texts: Enable and disable layer modifying in OpenLayers

texts:
I have this project where I have to allow the user to edit his feature. At this point I can show the feature. But I want to also allow the user to modify the feature. The feature can't me able to be modified from it's creation. The user has button which enables and disables the modifying of the feature. I have found this documentation on how to modify features: Documentation.
My project is created in React and the code that I have tried to derive from the documentation looks as follows:
setEditInteractionForPlotUserBoundriesLayer(state) {
    this.map.getLayers().forEach((layer) => {
      if (layer.get("name") === "plotUserBoundriesLayer") {
        if (state) {
          var select = new Select({
            wrapX: false,
            layers: [layer],
          });
          this.modify = new Modify({
            features: select.getFeatures(),
          });
          this.map.addInteraction(this.modify);
        } else {
          if (this.modify) {
            this.map.removeInteraction(this.modify);
            this.modify = null;
          }
        }
      }
    });
  }

The code doesn't work at this point. I can't seem to get it to work in my example. The documentation only has an example where the modification is enabled on creating the layer and not how to add it after it has been created.


texts: Does ArcGIS or ESRI's Story Maps provide interactive functions such as highlight or creating point data when a point is selected?

texts:
I'm trying to do some spatial analysis for crime trends. I'd like to, ideally, be able to select an point (an offense) and have it then create/show specific attached points. Such as selecting a violent crime offense and then showing the offender's last known home address.

Is this possible with ESRI's story maps? I can't figure it out in just ArcGIS alone.

Alternatively, if that is not possible would it be possible to select a point and then have specific related points highlighted?

I haven't played around with interactivity before with GIS and am hoping some of this is doable.


texts: Carto builder, opacity is set at 0 but publishing at 1

texts:
I'm working on a Carto map for a client, so I set up a new Carto account for them today.  I'm building it in Carto Builder, using the GUI.  (For this job, I need to just use the GUI, not get into carto.js or writing a whole page.)

I've put in some polygons, set opacity to 0.
But it publishes at opacity 1.  Any idea what I need to do?:

Here's the map

Here's what I see in Carto Builder:

But here's how it publishes:

Edit: I'm NOT having the same problem in my old personal Carto account that I've had for years


texts:
I have an Excel spreadsheet with the columns longitude, latitude and TR. I add them as XY data to ArcMap with long as the x data, lat as the y data and TR as the value.  This gives me a 12 x 12 series of points, representing a grid of data values in the Arctic.

I want to the convert this to a raster. I've tried using both Point To Raster and Feature To Raster.  Point to Raster gives me an unknown 9999 error and Features to Raster gives me an 000861 error - 'Sheet1 is not valid'.

In both cases I enter TR in the 'field' section and leave the cell size to default


texts: How to HTTP GET a full dataset from ArcGIS WFS server?

texts:
I would like to download this data set in a common format such as Shapefiles, GML, GeoJSON or another format which contains all information. An ArcGIS server is used to provide the data. I found the GetCapabilities URL for the WFS but it does not expose the desired layer.
Single items from the layer set can be requested via an HTML form. I could not find out how to request the full data set, though.

Example for item #26197


texts:
I am trying to install the GDAL plugin for Geoserver on machines which have windows 7 and 10.
both machines had a previously installed version of OSGeo4W.

I followed all the instructions in the official Geoserver guide,
 but it seems to be outdated as it recommends using gdal versions that work with Microsoft Visual C++ Redistributables which my machines don't have (i have the minimal 2015 while the most recent version in the downloads page is 2010).

After unziping the *.jar files to the WEB-INF/lib folder, making sure that the GDAL_DATA variable is defined properly and making sure that the new GDAL version i installed is first on the PATH
  variable and added the GDAL_DRIVER_PATH variable to link to the ECW and MrSID *.dll's i still can't see the ECW format when i try to open a new data store in Geoserver (Yes, after restarting), I also copied the GDAL *.dll files to wrapper/lib folder as suggested here.

Is there some step I am missing?
Is there a way for Geoserver to recognize OSGEO4W's GDAL version and extensions?
I want to keep using the OSGeo4W version of QGIS since it contains the filegdb write option which i can't get to work in the other installment of QGIS.

UPDATE
Tested other plugins which seem to be working well, also tested that gdalinfo is using the 1.9.2 version that Geoserver needs to use and that it has ECW format support.
Still not working.


texts: Cannot remove last Point from Cloned Geometry in OpenLayers (in DynamicMeasure.js Control)

texts:
I am working with OpenLayers-2 and currently can't figure out why I cannot remove the last Point from a cloned LineString-geometry.

This is my original geometry, a LineString with three points and the last point:

geometry: LINESTRING(594281.087 5892671.049,594320.061 5892645.758, 594324.266 5892644.357)
point: POINT(594324.266 5892644.357)  //the last point in the LineString

Now I want to remove the last point in this linestring to measure the length of the reduced linestring. But when I clone this geometry and remove the latest point, then the cloned Geometry is still the same. But removeComponent works when I use it on the original Geometry.

var oGeom2 = geometry.clone();
var bCheckA = oGeom2.removeComponent( point );

The result is:

bCheckA:true
oGeom2: LINESTRING(594281.087 5892671.049,594320.061 5892645.758, 594324.266 5892644.357)

But when I remove the latest point from the "geometry" Object, then it works:

var bCheckB = geometry.removeComponent( point );
bCheckB: true
geometry:LINESTRING(594281.087 5892671.049,594320.061 5892645.758)

What is the error here? Do I need a Timeout after .clone() or something like that?

Background: I am using the OpenLayers DynamicMeasure.js library in combination with Snapping-Control. When a Vertex or point was found, this Point is added to the line onClick but also another point which may be only centimeters away from the Snap-Point. Therefore I need to remove this last point to get correct measurements.


texts:
I'm using QGIS to produce a vector tile dataset for use with OpenLayers (as shown here).
However, although the dataset produced can be opened in QGIS and it renders normally, when using it in OpenLayers it does not show at all.
Other vector tile sources seem to work normally on the same Openlayers webpage (eg this ArcGIS vector tiles dataset). I used 3.14 and 3.16 QGIS versions for producing vector tiles. Can someone point to me what I'm doing wrong?
This is my sample webpage. This is the Map definition:
var map = new ol.Map({
  layers: [
    new ol.layer.VectorTile({
      source: new ol.source.VectorTile({
        format: new ol.format.MVT(),
        maxZoom: 20,
        url: 'http://bytemill.duckdns.org:81/VTiles_D/{z}/{x}/{y}.pbf'
//'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf'
      })

    }) ],
  target: 'map',
  view: new ol.View({
    center: ol.proj.fromLonLat([23,39]),
    maxZoom: 20,
    zoom: 10,
  }),
});

The commented source url is the one that works.
Tiles used are those produced by QGIS using the 'Write Vector Tiles (XYZ)'. So, I'm asking if there is something in vector tiles production using QGIS that causes Openlayers  not to show any data. Has anyone come across something similar?
(About the two GIS SE accounts issue, I've already followed the 'merge accounts' procedure, I believe I'm waiting for a review)


texts:
I try to use the georeferencer to geofreference certain building plans, but the referencer really distorts colours:

As you can see in the picture. it hollows out what used to be solid red, black and blue letters and dashed lines.

How can this be fixed?

It occurs with pdf as well as images.

Original:

Also occurs with use 0 for transparency disabled, helmert transformation, cubic resampling and no image enhancing.


texts: How to handle large raster datasets in GeoServer?

texts:
A 16gb large tiff should be processed with the Geoserver. What are the possibilities?

What has already been done:

1) The following tutorial was used:How to serve very large raster datasets The creation of an ImageMosaic failed.The error message is: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:///var/lib/geoserver/Test-TIFF and hints null

The folder has both write and read rights.The following files are located in this folder: .tiff, .aux, .rrd, and .tfw. Does a file fail to make the plugin work? Or has the Geoserver problems with the file size?

2) In the same tutorial, QGIS is used to create an ImageMosaic. Since there is only one TIFF file, QGIS creates a single tile. That does not take me any further.

3) I tried to build with pyramids (overviews) QGIS. Either an external .ovr file or internal. Here QGIS either crashed or the calculation ran through but no .ovr file was created.

What are the possibilities to display a 16gb tiff with the help of the geoserver?


texts: Using JSONP with Leaflet and GetFeatureInfo request

texts:
Is it possible to use JSONP with the GetFeatureInfo request?

I'm using a GetFeatureInfo function in Leaflet that works fine with JSON data but I'm really struggling to replicate this with JSONP and get a CORS error. The server does have JSONP enabled.

I've have a function that fills a popup but below I'm just logging the data.

var wmsURL = 'http://maps.dartmoor.gov.uk/geoserver/wms?version=1.1.1&REQUEST=GetFeatureInfo&layers=general:tpo_points&BBOX='+BBOX+'&FEATURE_COUNT=5&outputFormat=text/javascript&HEIGHT='+HEIGHT+'&WIDTH='+WIDTH+'&query_layers=general:tpo_points&SRS=EPSG:4326&X='+X+'&Y='+Y+'&format_options=callback:getJson';

    $.ajax({
            url:wmsURL,
            type: "GET",
            datatype: "jsonp",
            jsonpCallback: 'getJson',
            contentType: 'application/json',
            success: function (data) {console.log(data)}
            });


texts: I have a button created using Python Add-Ins which pops up a dialog box which is built using wxpython. I am wondering if I can place a tool (Select Layer by Location) within that dialog box to get location coordinates of layer (basically select that layer). Once a layer is selected, it will fire back some values to the already open dialog box. Any word of advice on whether it is possible and how to create a class for tool would be very helpful here.


texts: Possible to remove geoserver raster legend watermark?

texts:
If you get a legend from a geoserver raster with a opacity="0" watermask , you'll see a big red x... Like in this:

from the geoserver GetLegendGraphic docs.
Anyone know if it's possible to hack this out with geoserver? Current workflow is to create these legend graphics and then use an image editor to create static legends, but that's no fun to maintain.


texts: Get results for each topology errors for Polyline or Points?

texts:
When you set up a topology to build topology rules for each polyline, or points, is there a way to get the results or summary for each Line Errors?

For example, when you set "Must Not Overlap", "Must not Intersect", "Must Not self-overlap", etc for the line?

The same way for the Point Errors, too.

We know we can symbolized them by set each color in the Symbology tab. The Problem is that it does not show you the numbers of errors for each rule and they only show you the colors. The Generate Summary only shows numbers of errors for each rule.

Does anyone have a way around how to add them to the TOC to display them for each rule ? Is there a script or add-in to be able to do that ? Is this something I should send to ArcGIS Ideas ?


texts: ArcPy Python Addin Combobox How to leave a if-loop, when selection is found

texts:
ArcPy Combobox How to leave a if-loop, when selection is found

I developed a Combox which:

combines values from different featurelayers
the User can select an ID or activitycode (acode)
the active view zooms to the object (biotop or Protected Area)

The Combobox works very slow. Populating the Combobox with the values goes quite quick. But the zoom to the selected features is very slow. The problem is, that
the if-loop, iterates through all featureclasses. I don't know how to leave the if-loop, when the selected feature is found. Currently it loops throgh the end of all tables of the listed featureclasses no matter if the selection already is found.

import sys, os, arcpy, zipfile, traceback, pythonaddins
from arcpy import mapping, env

class SiteComboBoxClass43(object):
    """Implementation for Site_Python_Addins_addin.combobox (ComboBox)"""
    def __init__(self):
    self.items = []
    self.editable = True
    self.enabled = True
    self.dropdownWidth = 'WWWWWWWWW'
    self.width = 'WWWWWWWWW'
    def onFocus(self, focused):
         if focused:
                self.mxd = arcpy.mapping.MapDocument('current')
                global items, site, akode, fc_biotop_pol, fc_biotop_poi, fc_biotop_li, fc_pro1_pol, fc_pro1_poi, fc_pro1_li
                items = []
                fields_site = "SITE_ID"
                akode = "AKODE"
                fc_biotop_pol = "Biotop (Polygon)"
                fc_biotop_poi = "Biotop (Point)"
                fc_biotop_li = "Biotop (Line)"
                fc_pro1_pol = "Protection Area 1 (Polygon)"
                fc_pro1_poi = "Protection Area 1 (Point)"
                fc_pro1_li = "Protection Area 1 (Line)"
                # build lists and populate the Combobox with sorted values
                fcsites1 = [fc_biotop_pol, fc_biotop_poi, fc_biotop_li, fc_pro1_pol, fc_pro1_poi, fc_pro1_li]
                fcakode1 = [fc_pro1_pol, fc_pro1_poi, fc_pro1_li]
                for x in fcsites1:
                    for row in arcpy.da.SearchCursor(x,fields_site): items.append(row[0])
                for x in fcakode1:
                    for row in arcpy.da.SearchCursor(x,akode): items.append(row[0])
                self.items = sorted(items)
    pass
    def onSelChange(self, selection):
            combobox.enabled = True
            self.value = selection
            self.mxd = arcpy.mapping.MapDocument('current')
            self.df = arcpy.mapping.ListDataFrames(self.mxd)[0]
            # looking for the selected ID or code in the attributetable
            if len(selection) > 8:
                fcsites2 = [fc_biotop_pol, fc_biotop_poi, fc_biotop_li, fc_pro1_pol, fc_pro1_poi, fc_pro1_li]
                for x in fcsites2:
                    arcpy.SelectLayerByAttribute_management(x, "NEW_SELECTION", fields_site + "='" + selection + "'")
            else:
                fcakode2 = [fc_pro1_pol, fc_pro1_poi, fc_pro1_li]
                for x in fcakode2:
                    arcpy.SelectLayerByAttribute_management(x, "NEW_SELECTION", akode + "='" + selection + "'")
            # zoom to Selection
            self.df.zoomToSelectedFeatures()
            self.df.scale = 15000
     pass


texts: WFS query against SQL Server - Returned results not restricted by query

texts:
I have an SQL Server 2012 table, which contains a DbGeometry column with a spatial index.  Then a Geoserver 2.7 using it.  The problem is that when I do a WFS query it doesn't restrict the results to the coordinates I pass in by BBOX, it always returns all records.

I create the database entry using:

DbGeometry geo = DbGeometry.PointFromText(string.Format("POINT({0} {1})", hp.Lng, hp.Lat), 4326);

The point inserts fine, using 4326 & Long/Lat.  Geoserver sees it and picks up Native & Declared SRS of EPSG:4326.  I have tried 'Force declared' and 'Keep native'.

Ultimately I'm using Leaflet map with the WFS query as an Ajax call, but for now I'm just trying to get this working using a browser call.

The call/query looks like this:
http://ourserver:port/geoserver/ncc/ows?service=WFS&request=GetFeature&version=2.0.0&typename=ncc:OurLayer&srsName=EPSG:4326&bbox=-0.843632,53.035893,-0.755842,53.077641,EPSG:4326

Is there anything else I can try to fix this problem or even any other way of doing the same thing?

I have seen some posts about SQL Server sometimes passing back inaccurate results, but this isn't restricting them at all.

Edit to include this, the returned data.

<ncc:Location>
    <gml:Point srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
        <gml:pos>-1.11036761969209 53.3084063531532</gml:pos>
    </gml:Point>
</ncc:Location>

UPDATE: Interestingly, if we try clearing and repopulating the data and recreate a layer using EPSG:27700, the bounding box query works using easting/northing. On the same column.

Temporary workaround solution: Disabling the Spatial Index within SQL Server seems to rectify the issue.  Presumably it is then forced to use the property rather than the index.  However this is obviously not ideal.


texts: Trouble connecting to microsoft sql server 2008 from geoserver

texts:
I am having trouble connecting to ms sql server 2008 from geoserver. my ports seem to be fine.

error message:

  Error creating data store, check the parameters. Error message:
  Unable to obtain connection: Cannot create PoolableConnectionFactory
  (The driver could not establish a secure connection to SQL Server by
  using Secure Sockets Layer (SSL) encryption.


texts: .tiff image is black. I've opened it in QGIS without any problem but in ArcScene the image is black. The weight of image is 121gb(it is country .tiff image)


texts: PyQGIS: Editable Combobox for Value Map widget isses

texts:
I am having issues with an editable combo box in QGIS 2.4. The edit widget is set to Value Map with an uploaded CSV. However, if a new values (not included in the key value pair list) is added, the attribute value is not saved, thus defeating the purpose of the editable combo box.

Currently, I have it set editable like this in my python form (set under python init in layer properties).

Attributefield.setEditable(True)

I saw a checkbox "Editable" option for value map as well, but nothing happens when it is checked (combo box is not editable).

My original goals are mentioned in this post, using setLineEdit PyQt method. But I decided to try this editable combo box option, which still does not work.


texts: Qfield comes with a demonstration Beekeeping package installed. This package allows users to add new points and data that are updated online. Does anyone know of a tutorial that shows how this is done? I have a multi-user project for field data collection but I can only update the data offline using Qsync. In a multi-user environment this is time consuming and difficult and it would be much easier if I knew how to update data online.


texts: not able to add delimited text file layers

texts: Whenever I try to add a layer from a csv file, I run into a weird problem. The layer is not showing up on the map and the icon that shows up next to the legend entry is different than what normally shows up- see the image attached (sublap map test vehicle 7 - 10)


texts:
Is there a way to move tiger, tiger_data to another database on another host?

Without having to use the loader scripts?

If I use pg_dump I get no data.


texts: Using Iterate Feature Selection export features to new feature class with unique names

texts:
I'm trying to use ModelBuilder in ArcMap 10.2 to select features from a large data set (>30,000 features) based on a value in the field "Route" and have those selected features export to a file location with the the output containing the string "Route_" concatenated with the current selection criteria.

So for example, I want the tool to look at the filed route and select the first group of values, say Route = 101, export those features to a gdb dataset with the output name Route_101. Then the tool would select the next group of features, say "Route" = 102 and then export the selection to the same output location with the output name Route_102...and so on.


texts: Extract longitude - latitude from GIS generated map embedded in website

texts:
Is anyone clever enough to extract longs and lats for the points shown at:

https://www.northernpowergrid.com/generation-availability-map

What would be even better is finding out if those points hold the attributes which can be viewed if you download the excel heat map data from the same webpage. I've called Northern Power Grid and they don't have location data for this dataset which must be complete rubbish.

I'm not asking you to do it for me..(although that would be extremely kind) but hopefully you could give me a nudge in the right direction.


texts: Insert data in a PostgreSQL database using shp2pgsql in peer mode (without password for user postgres)?

texts:
Context

I wish to add some data that are for the moment in ESRI shapefiles into a PostgreSQL database.

To do so, I am using the shp2pgsql (RELEASE: 2.4.3 (r16312)) tool from an Ubuntu server (18.04 bionic).

The command I usually use is:

sudo -u postgres shp2pgsql -s 4326 my_shapefile.shp \
| psql -h <hostname> -d <databasename> -U <username>

as described here for example: How to import using shp2pgsql?
here: How to specify a password with shp2pgsql using CentOS?
or here: https://docs.qgis.org/3.4/en/docs/training_manual/spatial_databases/import_export.html?highlight=shp2pgsql
(but none of them answer the current question)

and where <username> is the default postgres, which is "derived" from the operating system postgres user created when installing PostgreSQL. So the connection mode in the pg_hba.conf is set to peer and I'd like to keep it so for the moment. That's also why, I don't want to define a password for the user postgres in PostgreSQL.

But by using the previous shp2pgsql command, I am always asked for the postgres password, which naturally doesn't exist.

Question:

How to avoid using a password prompt for the default user postgres while using shp2pgsql, hence keeping the advantage of the peer connection?

Updates

2020.02.03:

@Ian Turton's answer:

My first try is to switch directly to the user postgres as suggested:

$ sudo su postgres

and then, from the postgres@hostmachine terminal:

$ shp2pgsql -s 4326 my_shapefile.shp \
  | sudo -u postgres psql -h <hostname> -d <databasename> -U <username>

which in return gave me:

postgres is not in the sudoers file.  This incident will be reported.

2nd try; I thought the sudo -u flag was doing the job of running the following command for the given user, and was, let's way somehow better than switching to that user explicitely or less naughty.
So I also tried to add (... ) | sudo -u postgres psql (...) after the pipe but the prompt keeps asking me for a password. And when I give one, whatever it is, it ends on; sql: FATAL:  password authentication failed for user "postgres". I wonder why the difference with the first try?

3rd try, same as previous, but while having logged me as root -> I am still asked for a password for the postgres PostgreSQL user.


texts: List index out of range when put in startup.py on QGIS

texts:
I have the code :

from qgis.core import QgsMapLayerRegistry
vl = QgsMapLayerRegistry.instance().mapLayersByName('pl')[0]
iface.setActiveLayer(vl)

When I type in console after loading QGIS, no error. But, when I put the code in startup.py, so automatically QGIS will execute the code in startup.py, I get error. The error : "list index out of range"

What is wrong for the code?


texts: How to convert arcpy.InsertCursor to arcpy.da.InsertCursor in Python code?

texts:
I have some working code using arcpy.InsertCursor which I want to convert to arcpy.da.InsertCursor. This I want to do primarily as ESRI claims that da methods are more optimized. The code I have is follows:

array = arcpy.Array()
point = arcpy.Point()
tie_shp_file = arcpy.env.workspace + "/" + out_name
insert_cursor = arcpy.InsertCursor(tie_shp_file)
feat = insert_cursor.newRow()

for line in all_lines:   #all_lines is of the form array([[0, 3],[0, 7],[1, 3]) indicating line [from, to]
    #from
    point.X=coords_pts[str(pt[line[0]])][0]
    point.Y=coords_pts[str(pt[line[0]])][1]
    array.add(point)
    #to
    point.X=coords_pts[str(pt[line[1]])][0]
    point.Y=coords_pts[str(pt[line[1]])][1]
    array.add(point)
    polyline=arcpy.Polyline(array)# Create a Polyline object based on the array of points
    array.removeAll() #Clear the array
    feat.shape = polyline
    insert_cursor.insertRow(feat)

The code inserts lines to a line shapefile. The lines are created by specifying its end points.

How do I convert this? I am specifically stuck on how to pass the to and from points in the new version.


texts:
How do I change a symbol to a letter?

I have points on a map denoting 'male' and 'female', and I want the points for the 'male' to be an 'M' and for 'female' to be an 'F'


texts: Password Authentication failed when using shp2psgsql

texts:
I want to load shp data in my postgis enabled database.
I am typing the command:

shp2pgsql -s 4326 -G -I "shapefile_name" public.table_name |
psql -h localhost -p 5432 -d gis -U postgres

and I am prompted to enter my password. After entering the right password I get the following message:

psql: FATAL: password authentication failed for user "postgres"

Is there a configuration that has to be made in the pg_hba.conf file?


texts: Python MemoryError when running ArcGIS Python Toolbox tool

texts:
I have a Python Toolbox (.pyt) containing a single tool. Part of that tool is the following function, which creates a dictionary from an attribute table, where the keys are the rows' OBJECTIDs and the values are pulled from a field specified when calling the function. The attributes are accessed with a generator based on an arcpy.da.SearchCursor.

def make_oid_dict(fc, value_field):
    describe = arcpy.Describe(fc)
    key_field = describe.OIDFieldName
    key_value_pairs = (row for row in arcpy.da.SearchCursor(fc, (key_field, value_field)))
    oid_dict = dict(key_value_pairs)
    return oid_dict

I want to use the dictionary to access attribute values of the feature IDs in a Near Table. I've been trying to run the tool, but every time it calls this function -- for a point feature class with about 1.25 million rows and a value_field that is formatted as a Long integer -- it fails with a Python MemoryError.

I have successfully called the function on the same feature class from the Python window in ArcCatalog, so I have no idea why it wouldn't be working from within the Python toolbox. The resultant dictionary isn't even that large: just 24 MB, according to sys.getsizeof().

Any ideas what the problem might be?

Edit 1: I've updated the function to use a dictionary comprehension as follows, per Jason Scheirer's suggestion, but that unfortunately has not solved the MemoryError issue.

def make_oid_dict(fc, value_field):
    describe = arcpy.Describe(fc)
    key_field = describe.OIDFieldName
    oid_dict = {row[0]: row[1] for row in arcpy.da.SearchCursor(fc, (key_field, value_field))}
    return oid_dict

Edit 2: This is an update to clarify the solution(s).

My make_oid_dict() function works for me without throwing a MemoryError if and only if the tool is run using background processing (i.e. by setting self.canRunInBackground = True in the tool's __init__ method). Thanks to Aaron for pointing me in this direction.

In the case that the tool needs to run in foreground processing mode, however, Jason Scheirer's make_oid_array() function will run successfully -- or at least it did for me.


texts:
I am confused as to which one is technically the inset figure in the below map. I know an inset map is one which has more detail.

But in this case which one is referred to as an inset map conceptually?


texts: Download/Use a layer from Google Maps or Google Earth Pro

texts:
Is there a way to download trails that are shown on Google Maps, or export a KMZ from Google Earth? I'd like to import these into ArcGIS Desktop.
Roads, boundaries, water bodies, etc. all have check boxes in the "Layers" pane of Google Earth but I can't find an associated layer for regular trails in Google Earth Pro.
Here are example screenshots of the trail layer I'd like to access, if that matters.


texts: OpenLayers WMS to Leaflet with EPSG:2170 projection

texts:
This is the original code for OpenLayers 2

        var res = [
            1000.0 / 4.0,
            1000.0 / 8.0,
            1000.0 / 16.0,
            1000.0 / 32.0,
            1000.0 / 64.0,
            1000.0 / 128.0,
            1000.0 / 256.0,
            1000.0 / 512.0,
            1000.0 / 1024.0,
            1000.0 / 2048.0
        ];

        var extent = new OpenLayers.Bounds(256000, 0, 640000, 256000);
        var mapOptions = {
            controls: [
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.ScaleLine(),
                new OpenLayers.Control.MousePosition(),
                new OpenLayers.Control.KeyboardDefaults()
            ],
            resolutions: res,
            units: "m",
            projection: "EPSG:2170",
            maxExtent: extent
        };
        map = new OpenLayers.Map('map', mapOptions);
        map.setOptions({
            restrictedExtent: extent
        });

        layer_dof = new OpenLayers.Layer.WMS("Slovene Ortophoto Images",
            "http://gis3d.urszr.si/pds/wms", {
                layers: "slo-gkr",
                format: "image/jpeg",
                srs: "EPSG:2170"
            }, {
                tileSize: new OpenLayers.Size(512, 512),
                resolutions: res
            });

Now, converting that straight to Leaflet doesn't work:

    var res = [
        1000.0 / 4.0,
        1000.0 / 8.0,
        1000.0 / 16.0,
        1000.0 / 32.0,
        1000.0 / 64.0,
        1000.0 / 128.0,
        1000.0 / 256.0,
        1000.0 / 512.0,
        1000.0 / 1024.0,
        1000.0 / 2048.0
    ];

    var EPSG_2170 = new L.Proj.CRS(
        'EPSG:2170',
        '+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs', {
            resolutions: res,
            //origin: [-640000, -256000]
        }

    urszr = L.tileLayer.wms("http://gis3d.urszr.si/pds/wms", {
        layers: 'dtk-gkr',
        format: 'image/jpeg',
        attribution: "URSZR",
        crs: EPSG_2170,
        tileSize: 512,
        transparent: false,
    });

The projected coordinates are way off, and as far as I managed to figure this out is that the offset is defined in OpenLayers map extent:

        var extent = new OpenLayers.Bounds(256000, 0, 640000, 256000);

The coordinates in this projection start with zero, but the bounding box on Spatial Reference for this projection is

372543.8943, 5034152.5582, 631496.6208, 5197602.9212

I'm stumped. What's wrong? How do I correctly configure this projection in Leaflet?

The original site done in OpenLayers is here:
http://spin.sos112.si/SPIN2/Javno/

Source: view-source:http://spin.sos112.si/SPIN2/Javno/GIS/GraficniPrikaz.aspx


texts: Why are there both square and rectangle world maps?

texts:
When i search for images of earth divides to longitude ans latitudes seems that the are 2 major types:

is a perfect square and the latitudes in it are grow a different rate from the equator to up (and down) [mean, seems that the length from 0 to 66 is shorter than the way from 60 to the pole (90)] and the

is rectangle (oblong) and it's latitudes are grow in the same rate all the way up  (and down).


texts: Can lidR output date/time of outputs from readLAScatalog into an index polygon shapefile?

texts:
I would like to create a tiled index for extents of processed (e.g. normalized) LAS files that include date and time of processing. This is because we sometimes receive replacement tiles, and I need to have an easy way to show on a map where areas have been updated. The header of a LAS file holds a date (d/y) - the year stays the same after normalization (although day is set to 0 which maybe is a bug?), so I assume the file creation date refers to original creation and shouldn't change. I could extract the date/time afterwards and join it back to lidR output of the catalog via the name, but I was wondering if the file date/time could be read into the catalog itself?
library(lidR)

LASfile <- system.file("extdata", "Topography.laz", package="lidR")
ctg <- readLAScatalog(LASfile)
opt_chunk_size(ctg) <- 300
opt_chunk_alignment(ctg) <- c(200, 50)
opt_output_files(ctg) = "{tempdir()}/{ID}_normalized"

nctg = normalize_height(ctg, tin())

# Year of file creation is not updated
ctg$File.Creation.Year
#> [1] 2018
nctg$File.Creation.Year
#> [1] 2018 2018


texts: Error 404 when setting up web app builder (developer edition) on computer

texts:
I'm installing Web AppBuilder (Developer Edition) on my PC and running into an error.

I successfully connected to my local host and got to the page where I specify my Portal for ArcGIS URL. I have also set up my App ID in portal, registered, and provided that App ID in the browser server connection. I followed the steps laid out here: https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm#ESRI_SECTION1_F2CE6567CB854E4AB43F08EB64B3D7AE .

However, I am getting an error in an Apache Tomcat tab in my IE browser window that reads:

Page Not Found
Type: Status Report
Message: /webappbuilder/
Description: http.404/webappbuilder/
Portal for ArcGIS

Some additional details:

Not sure what this is all about--can anyone offer any guidance?

Node.js is installed and running. It appears to me that everything from the setup batch file initialized and works properly. My impression is that this is some kind of server connection/ portal account issue.

What I have tried:

Updated my existing App ID.

Setting the proxy for Web AppBuilder from node command node server.js [-proxy=value]


texts: Add vertices costs to postgresql routable network

texts:
In osm2po it's possible to create custom routers as the sample router TrafficSignalsRouter, but the costs seem to be added on vertices after the routing.

Is it possible to add these costs on the edges so that I can export them into my postgresql database (1 minute for each traffic signal in this sample)?

(by the way the vertices costs seem to be taken into account because it changes the generated path, but the final cost remains the same in the logs)


texts:
I'm studding AI course and I need to create a routing or navigation program.

I live in Barcelona and first at all I need Barcelona's street network data. I have found it here https://mapzen.com/metro-extracts/ (but I don't know it this data is good enough to use it in a navigation system).

Here, http://wiki.openstreetmap.org/wiki/Routing, I have found more information about routing but I'm terrible lost.

Where do you recommend me to start with this?

I have to implement my own version of A* algorithm. I only need data, but reading the previous page I see that Openstreet data has information about speed, highway type, etc.

I'm sorry, but I'm lost and I don't know where to start with.

Any advice?


texts: Google Maps OpenLayers plugin not zooming in or panning

texts:
So recently I've noticed that the OpenLayers plugin for Google Maps (Google satellite, physical etc) is not allowing me to zoom into the specific area I require. Every time I try and zoom it pans back to the global view.

I have upgraded the plugin to its latest version and on QGIS 2.6 Brighton. It only seems to happen on the Google Maps, but not on the others (e.g. Bing). Has anyone else had this problem?


texts: Inserting field-based hyperlinks in non-spatial tables

texts:
I am trying to insert field-based hyperlinks into a non-spatial table in arc 10.3.  The idea is simple, open the table and click on the link.  I am able to add hyperlinks to spatial fields, and click on a polygon to open it, but my map is very complicated and it does not make sense for users to have to click all over the map to get the correct one.  Also, the user will not know where they are supposed to click because it is a world map where states have ownership of polygons, lines, and points, in various locations around the globe.

When I right click the table, the display tab does not have the option to enable hyperlinks the way it does with a feature class.

There must be some very simple way to do this that I am missing, but for the life of me I cannot figure it out.


texts: How to identify and eliminate overlaying polygons in Quantum GIS?

texts: I have a shapefile with polygons and now, not sure why, most of the polygons became duplicated and overlaid, i.e. when i click to selected one, i get two selected... How do i identify those polygons and remove them?


texts: Stuck updating one field based on the condition of another using Acrpy or Field Calculator

texts:
I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with a population > 1,800,000 and < 1,600,000 = 2 and so on and so on. I know there are a lot of different ways to accomplish this and I think I have really confused myself reading to much. I want to write this as a arcpy script so I can change out the variables and use it on different fields but I'm unsure of the best way to go about this. I wrote this but it just places "1" in each row of pop_class.

city_points = "C:\\Desktop\\citypoints.shp"

cursor = arcpy.SearchCursor(city_points,"", "", "population")

for row in cursor:
    if row.getValue(cursor) > 2000000:
        arcpy.CalculateField_management(city_points, "cls_pop", '"{0}"'.format(1), "PYTHON")

    if row.getValue(cursor) > 1800000 and row.getValue(field) < 2000000:
        arcpy.CalculateField_management(city_points, "cls_pop", '"{0}"'.format(2), "PYTHON")

    ect……………….

Am I on the correct track or is there a better way for me to do this?


texts: Is there a time limit on post-processing GPS data with Pathfinder Office?

texts: Do I need to post process my GPS data within a certain amount of time after collection?  Do the services that provide the correction data to Pathfinder Office only make that data available for a certain amount of time?


texts: Creating selection in stand-alone ArcPy script?

texts:
I am using ArcGIS Desktop 10.5.

I have had this work for me before, so I am confused as to what problem I am -running into now. When making a selection to copy to a new dataset in Arcpy, -here is the important part of the code:

sortoutput = 'c:/Users/srcha/Desktop/Cluster_Analysis/output/Ld_Playas_extracted1_sorted.shp'
sortedftr = 'C:/Users/srcha/Desktop/Cluster_Analysis/output/Ld_Play_extra_sort_ftr.shp'
arcpy.MakeFeatureLayer_management(sortoutput,sortedftr)
arcpy.SelectLayerByAttribute_management(sortedftr, selection_type="NEW_SELECTION", where_clause='"AREA_ADJ" >=0.07957')

This yields the following error:

  ExecuteError: Failed to execute. Parameters are not valid. Error
  000732: Layer Name of Table View: data set
  C:/Users/srcha/Desktop/Cluster_Analysis/output/Ld_Play_extra_sort_ftr.shp
  does not exist or is not supported

  Failed to execute (SelectLayerByAttribute)


texts: Spatialite: Convert polygon to multi-polygons based on common field

texts:
I have a list of polygons which should be multipolygons:

PK_UID | PolygonID | Geometry
------------------------------
1      | 1         | polygon
2      | 2         | polygon
3      | 1         | polygon

How do I convert them to multipolygons in Spatialite based on the common field (PolygonID)? (e.g So they look like this):

PK_UID | PolygonID | Geometry
-----------------------------------
1      | 1         | multi-polygon
2      | 2         | polygon


texts: Problem converting Alaska to svg because of longitude wraparound

texts:
I'm trying to render an svg of Alaska, but because the left side of Alaska's longitude is 179 and the right side of Alaska is -152, the left of side Alaska is separated and shows up in the very far right of the svg.

SELECT ST_AsSVG(geom,1,1)
FROM states
WHERE state = 'AK'

Ideally, I would like to just have a 1000x1000 svg and have alaska scaled inside it.

Is there a solution to both these problems?


texts: I am trying to open a Landsat 8 Collection 1 image from the current year in SNAP by the xlm file and I get an error: "No appropriate Product Reader found" . I see that others has problems very similar to mine but with sentinel 2 images. I would be grateful for your answers.I used SNAP 8 version.


texts: I want to make a 32-days composite from 8-days LST data by taking its average value, but I am facing a problem in checking QC-day, the other thing is, due to data gaps (missing DN values) we cannot take its average simply (DN1+DN2+DN3)/3 etc because due to data gaps some value are missing.My problem is when I add all the four images and then divide them by 4 it doesn't give the average values because of missing values. for exp. (2+8+6+0)/4, fourth pixel is missing, how can i exclude the missing values and specify the average of existing values? if someone knows any code/proper method, please share and help me


texts: QGIS Print composer: Point symbols not correctly displayed in legend

texts: My problem: I have a point layer with a symbol size of 15958 meters. On the map they are all correctly displayed. When designing the map in the print composer and adding a legend, the symbols in the legend of this layer are not anymore displayed correctly. The outline seems to be cut on the right and the bottom side (see graph). The problem still exists when removing the outline. Unfortunately I wasn't able to find any solution on this issue.


texts: Automating estimation of invert elevations using ArcGIS for Desktop?

texts:
I’m working on a project where I need to estimate about 1400 pipe inverts using the adjoining pipes and manholes. The problem is a lot of the adjoining pipes are missing elevation data as well, so there are long segments of pipes missing data. I was wondering if anyone knew of an automated way to estimate the invert elevations.  I haven’t had to estimate the inverts for this many pipes before, and I realize doing so one by one would take a lot of time.  I have extracted upstream and downstream rim elevations using the USGS DEM, and using minimum slope would work for this analysis as well.  Please let me know if you have any suggestions.

I'm using ArcGIS Advanced with spatial and 3d analysis.  My dataset isn't in a geometric network.


texts: Tilemill reversing land and water at high zoom levels

texts:
I tried asking this over at MapBox's support forum and got no help.
I am trying to generate a map of Northern france using Tilemill and this set of land polygon data from openstreetmapdata.com (the first download link).
However, at zoom levels 17 the water and land invert colors and styling (see attached output from Tilemill). Any idea of what's going on? Is the data bad? Can someone help me find an alternative? Thanks!!

Zoom level 16

Zoom level 17


texts: Batch generating *.mbtiles using Qtile in qGIS

texts:
I've been able to use the Qtiles plug in to generate an *.mbtiles raster for a shapefile, which is great.
Now I want to make *.mbtiles for a whole directory of shapefiles (1000+).
My thinking was to write a script in the qGIS tools area, but I don't know how to call a plug-in via a script in qGIS.

Does any one know how I can call a plug in a script, or how to set up a batch process for making *.mbtiles from a TMS service?


texts: When Versioning with ArcSDE can posted edits be cancelled or rejected?

texts:
I am using ArcGIS 9.3.1 and attempting to work with an SDE geodatabase (with one polygon feature class) that has already been registered as versioned.  I'm new to versioning and am still trying to figure out some of it's basic functions.  So far, I haven't been able to discover if it is possible to "cancel" or "reject" certain edits once they've been posted to a parent version.

For example, let's say we have three versions: the original SDE.DEFAULT that was created when it was registered as versioned, a child version of the default called SDE.QA (for Quality Assurance), and a child version of the QA called SDE.Edit1 (where the edits first take place).  If certain features of SDE.Edit1 were edited (e.g., to keep it simple, let's say one polygon was added and one was removed) and then SDE.Edit1 was reconciled with the SDE.QA and subsequently posted to SDE.QA, would there be any way to later undo this change?  Following up on this question, would it possible to reject only some changes?  For example, accepting adding the first poly, but rejecting removing the second poly?

As far as I can tell, once edits have been posted to the parent version, all these changes are now a "permanent" (for lack of a better word) part of the parent version.  I am aware of the fact that these changes are all recorded within two tables, the "ADD" and "DELETE" tables (often referred to as the "delta" tables), and don't actually change the original FC itself.  I considered looking into manually altering these delta tables, but I found enough people warning against that to know that it's likely not the right solution.

Perhaps it is my understanding of versioning that needs some work, but I couldn't seem to find a way to reject a change or undo a change once it's been posted.  This seems strange to me, as this would mean that there is no way to undo a post which contained an error.  I also can't seem to find a way to trace the lineage of these versions (i.e., which version is the child of which parent).  While I'm on the topic, if anyone might know of any particularly useful ArcSDE references (links, articles, books, etc) that might help with my understanding of ArcSDE (and perhaps answer some of these questions), it would be much appreciated!

Although answers so far have been helpful (thank you for the links), I still cannot find an answer to the core of my question.  Again, perhaps it is my own misunderstanding of the situation.  Here is what I want to know:

Can you reverse (by reverse, I mean undo) a post once it has been made from a child version to a parent version?  In this scenario, the parent can be, but doesn't have to be, the SDE.DEFAULT version. Even better, I would like to know if you can reverse a part of a post (say, a single edit to a polygon), after it has been posted?  I would also like to know if this can be done without the need to have had any conflicts detected.

The fact that I can't find a clear answer to this question (i.e., "yes" or "no") documented anywhere makes me think I am missing something important about versioning in the ArcSDE.  I would also prefer to avoid manipulating the A and D tables manually.


texts: Plot GeoTIFF using tm_rgb from R tmap package

texts:
I've exported a raster object from QGIS into GeoTIFF format and imported it into R as a raster brick using the brick() function from the raster package. The file is too large to share but it imports OK and appears to have four layers, which I interpret to be R, G, B and alpha

class      : RasterBrick
dimensions : 4895, 4333, 21210035, 4  (nrow, ncol, ncell, nlayers)
resolution : 100, 100  (x, y)
extent     : 357310.5, 790610.5, 6299190, 6788690  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=51 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
source     : C:/_Work/_Research/xxxx/QGIS/190617.Fr.Grv.tif
names      : X190617.Fr.Grv.1, X190617.Fr.Grv.2, X190617.Fr.Grv.3, X190617.Fr.Grv.4
min values :                0,                0,                0,                0
max values :              255,              255,              255,              255

The image plots OK and quickly using the plotRGB() function from raster but the automatic grid is pretty rubbish so I was looking for a nicer plotting package.  I've installed the tmap R package and used the following in an attempt to plot my 'Brick'

tmap_options(max.raster = c(plot = 21210035, view = 21210035))
tm_shape(Brick) + tm_raster()

This command works OK (takes several minutes) to process and produces a 4x4 layout of the four bands in the brick in a nominal scale (0-300), with band 4 being all 255 (I expect the value should be 1 for alpha?)

Next, I try

tm_shape(Brick) + tm_rgb()

But this results in an error as follows.

Error in x[, 4] : subscript out of bounds

Which is probably related to the band four being all 255.  Is there an option or workaround to solve this problem as I quite like the look for tmap() for plotting image data.


texts: Finding context menu of Elevation Surfaces in Contents pane of ArcGIS Pro?

texts:
I have recently installed ArcGIS Pro and can't find the Elevation Surface tab (which should be in properties of 3D Map in the Contents as it is shown in the tutorials).

Could anyone tell me the reason for this?


texts: How to create a new empty vector layer programmatically?

texts:
I am new to python and QGIS. I have looked at a few tutorials of python scripts for QGIS. All of them create new vector and raster layers with some existing data source. eg. shapefile or geotiff or postgis database table.

Is it possible to create a QGIS layer through a python script, where i can create/add/modify new features through the python script, as the need arises.
It will be typically a vector layer with point data and custom symbols.

Will this be possible?
Is there a example i can look at?


texts: Set editor widget type for a given layer/field with PyQGIS

texts:
I would like to set the editor widget type for a a given field of a layer with PyQGIS. The actual widget type can be retrieved for example like

>>> iface.activeLayer().editFormConfig().widgetType('text_x')
u'TextEdit'

How can I set this to editor widget type Hidden, for example?

I tried:

>>> iface.activeLayer().editFormConfig().setWidgetType('text_x', u'Hidden')
Traceback (most recent call last):
 File "<input>", line 1, in <module>
TypeError: QgsEditFormConfig.setWidgetType(int, QString): argument 1 has unexpected type 'str'

And also:

from qgis.gui import *
iface.activeLayer().editFormConfig().setWidgetType('text_x', QgsHiddenWidgetWrapper)
Traceback (most recent call last):
 File "<input>", line 1, in <module>
NameError: name 'QgsHiddenWidgetWrapper' is not defined

From the doku https://qgis.org/api/2.18/classQgsEditFormConfig.html#afc55a3ae3b331225dd69b561d0d437bd the correct 'spelling' of setting up the widget type is not so clear to me.


texts: How to get X,Y coordinates of all vertices from polygon in shapefile as Excel spreadsheet using ArcGIS for Desktop?

texts:
I need to extract data from a shapefile using ArcGIS for Desktop 10.2.

The data needed is all the vertices (x,y coordinates in geographic WGS 1984) that construct the polygon below.

I need to get all these vertices as an Excel spreadsheet.


texts:
I recently installed QGIS version 2.18.28 on my workstation, but it keeps crashing/freezing. There isn't much data in it at all. Sometimes it even crashes when there isn't any data at all, and just one OSM layer for example. There is not a specific command that causes the problem.
I tried version 3.4 but that's just as bad. My workstation is a MSI WT72, it was pretty expensive and it should be powerfull enough to handle QGIS I hope. Autodesk Recap, infraworks and Civil3D isn't a problem at all.
I already tried to reinstall my graphic card drivers, and changed the settings from Auto selection to NVIDIA quadro 3000M without any results.
What else can I try?


texts: bicycle / bike map road grade markers - semi-automated?

texts:
So I'm making a bike commuting map for our area, and one of the features to show (common on a lot of bike maps) is some type of road grade marker.

We're planning to show three categories: 'kinda steep, pretty steep, and crazy steep' - we're not planning to use those names - but you get the drift.  (Actually, four categories - anything less than the first category just doesn't get a marker.)  The markers are one, two, or three arrows - here's a clip:

The problem: since we live in the foothills - not much flat stuff around here - the task of getting all the grade markers right is pretty daunting and tedious.  So - it would be nice to automate it.

So I've got the DEM for the area from the NED, and got a nice slope raster from it (thanks to folks that helped figure that out).  Overlaying that on the bike map (the roads are a vector layer of course), you can see a way to conceptually automate this task.  Basically, making a vector layer that is the boolean AND of the roads layer and the slope layer of certain values (whether by categorizing the slope layer, or by making separate slope layers per grade range ahead of time) should get it done.  I'd want the output to be a vector layer.  But, I'm not quite clear on how to do all that.  Suggestions on workflow?

I realize this concept doesn't account for direction (which way is uphill) so I'll plan on doing that by hand (flipping the vector selections as needed, or, doing so with an attribute that is used by the style to decide which way to draw the arrows)

UPDATE: this will be done in QGIS 2.  A thought: make a vector layer (of shapes) out of raster categories, i.e. a vector shape of areas with slope between 5 and 10 degrees (this would cover one of the categories of steepness), then do a boolean AND of that layer with the roads layer; so now you have a bunch of disjoint lines; that's exactly what is needed; just style these lines with the double-arrow (or as appropriate for that category), and flip direction of each segment as needed (which is easy to do from memory or from a map if needed).


texts: WFS layer Grid does not cover the entire area of my basemap

texts:
I was just able to get a GeoServer WFS layer, which is a Grid shapefile (polygon) designed to overlay a basemap, inserted into my javascript code for a web mapping app. Both the Grid and the basemap for my app are set to WG84/EPSG:4326 The Grid shows up, but it doesn't cover the entire area of my basemap. Would this be something I need to configure in the GeoServer Admin console (I was thinking it might be related to the bounding box or zoom)? Would I need to change it in QGIS perhaps and reload it to GeoServer (if so what could I change). I have tested it in QGIS, GeoExplorer, and the Layer Preview (in openlayers) with the same basemap as my app. But the basemap in my app is coming from the esri-leaflet-geocoder.js/css plugin and arcgisOnline (REST service) for the geocoder and it can almost endlessly scroll right or left. Could that be the issue (I noticed that the GRID does in fact cover the entire work but only within the bounds of my initial view)? In addition, there are some styling issues with my grid. I need to make the lines thinner and more opaque. What's the best way to do that? Below is the code portion for my basemap:

  <select name="basemaps" id="basemaps" onChange="changeBasemap(basemaps)">
    <option value="Topographic">Topographic<options>
    <option value="Streets">Streets</option>
    <option value="NationalGeographic">National Geographic<options>
    <option value="Oceans">Oceans<options>
    <option value="Gray">Gray<options>
    <option value="DarkGray">Dark Gray<options>
    <option value="Imagery">Imagery<options>
    <option value="ShadedRelief">Shaded Relief<options>
  </select>


texts: GRASS GIS 7.8 Delete mapset from command line

texts: Within GRASS GIS 7.8, a new mapset can be created using g.mapset -c mapset=mapset location=location, but is it possible to delete a mapset from the command line? I know that a mapset can be removed from the user's path using g.mapsets, but I want to delete the files and directory that compose the mapset.


texts:
What are the optimal settings for setting up a SQL Server 2008 Spatial database with full UK OS MasterMap data in?

Seperate tables for the different feature types, or a single table with everything in it?
What spatial index settings have you found work best?

Any "best practice" or experience gained would be appreciated.

For reference, I'm using Cadcorp to display the data.


texts:
I was recently trying to perform some band math calculations in multiband images. I have a big chunk of images witch contains more than 300 bands (dates) each. So I first choosed ENVI to do this process. When trying to calculate anything with those rasters, I realised that ENVI was not ignoring NoData values (-9999), and the result was obviously bad. When trying to redefine the ENVI header file to set the value to ignore, the software performs this only for the visualization, and any processing was still considering NoData. The same happened when I defined -9999 as NoData using QGIS "translate" tool.

So, resuming: Now the whole dataset have the NoData value successfully set for -9999, but ENVI is still not considering it for calculations. In QGIS or ArcGIS, it is possible to ignore this values for calculations, but I cannot perform multiband operations (more than 300 bands in each image) in tools like raster calculator, image analysis or even the model builder. Masking the NoData values from raster or separate bands in individual files seems not to be efficient methods given the size of the dataset (more than 5 gb per file).

Considering this, I am looking for a method to perform multiband calculations (eg. vegetation indexes) while the software ignores NoData values with just a few processing operations, given the size of the dataset.


texts: 360 degrees heading calculation between two points

texts:
I'm using Leaflet + Leaflet's rotate-branch to rotate my map application.

map.setBearing(angle_deg);

is the function to do so. angle_deg has to be between 0 and 359 to simulate any desired angle. I want the map to follow and rotate in relation to the users current position and walking direction.

In order to avoid math, I wanted to use Leaflet.GeometryUtil to do the calculations for me, but only was able to find the functions bearing() and computeAngle(), which yield the same result: horizontal heading between two coordinates (0 up to 180 clockwise and back to 0 again in axial symmetry with a minus sign).

How can I transform this into a full 360 degree value?

To further illustrate:

      0                   360/0
  -90   90       to     270   90
    +/-180                 180

Could I just add 360 to all negative values and be fine?


texts: QGIS: Creating Circles Around Points Imported from a Excel File (Lat, Long)

texts:
I am new to the QGIS platform and have been experimenting with the tool. I currently have a Basemap layer and a Shapefile layer on top of it. Now,

I want to import a .csv file containing (lat, long) coordinates for a set of points (say 20) as a layer.
I want to create a layer( or superimpose in the above layer), circles of a specified radius around each of these points.

How do I do these?


texts:
I need to create a thematic map for time intervals  (ex. 1/1/1920-31/12/1929). To every polygon corresponds a date (from a date field) and I need them to be coloured depending in which interval they are situated. I can't find anywhere in the symbology tab a place to type the time ranges.
In the quantities section I can't even select any field.

I would like to use Field calculator to convert my date into a number, which would represent the first year of a decade. For example 20/9/1954 ->> 1950. I think that would help me a lot. But I don't know how to do it in python or VB.

I have access to the Excel table that has been attached to the shapefile and I could easily do this transformation in Excel. And then add the data again to ArcMap. But I prefer doing it all this in ArcMap.

Another problem is that I have dates prior 1900, and if I sort them ascending, the ones before 1900 would appear even before the null values. So I guess ArcMap doesn't recognize them because of Excel. I've already read another topics about this problem, but I still couldn't find a solution.

I also read this answer to a similar question:

  If you are looking for Quantities -> Graduated Colors/Symbols, they
  won't directly work with Date fields. You could however convert the
  date fields to numbers and use that instead. I'd convert each date to
  an Epoch timestamp (number of seconds since a particular date,
  01/01/1970 being used most frequently), then use the Epoch timestamp
  to symbolize your features.

That would be very helpful too, but again, my lack of programming skills blocks me.

I solved this by extracting  the year from the date field into a new field (integer) using field calculator and the formula: DatePart ("yyyy", [field.name]  ). And then I created the map by quantities and used the intervals I wanted.


texts: why is there a difference between using EPSG and using basic code

texts:
I have the OSgeo4w installed on my PC and I am trying to upload ITM(israel transverse mercator) landmarks to google earth.
To do this I am using the  cs2cs command.I noticed that i get a deviation using the next code:   cs2cs +proj=longlat +ellps=WGS84 +datum=WGS84 +to +proj=tmerc +lat_0=31.73439361111111 +lon_0=35.20451694444445 +k=1.000007 +x_0=219529.584 +y_0=626907.39 +ellps=GRS80 +units=m
I tried the next code:cs2cs +init=epsg:4326 +to +init=EPSG:2039
this time my deviation decreased significantly.
why does this happen?
Another thing is, when i use the EPSG code I get a third number (that is always zero using the first code).
The third number, after the lon and lat is around 20, it cannot be the elevation so what does it represent?


texts: Can I select items in one table by matching items from a duplicate column in another table in QGIS?


texts: I am working about task for custom GIS application (about 70 users). It must show a map of region with custom objects from database (they will be triangles, lines, and icons with coordinates) . Users can add objects to the map by clicking the mouse. I am reading now about OSM, tiles servers and other information. But I don't know how to start creating the architecture of an application. Could you give some advices or examples of such applications (I think somebody has done such projects). Will I need ArcGIS and what plan? Or can I use only OSM with Leaflet?


texts: Pass sql expression with GetParameterAsText to SelectLayerbyAttribute in .py script

texts:
With Arctoolbox and python scripting I'm creating long tool, but one of the steps is to select by attributes with SQL expression.
Let's imagine that:

featureCar = arcpy.GetParameterAsText(0) is Data Type/Feature Set: attributes weight, length, height

filter = arcpy.GetParameterAsText(1) is Data Type/SQL Expression.

output = arcpy.GetParameterAsText(2)

In addition, when I run a tool from arctoolbox and previously specify in sql expression:

"weight" > 2000 AND "length" > 2 AND "height" > 1 from featureCar with assistance of Query Builder

I'm expecting that this query as it is will be passed to arcpy.SelectbyAttribute_management, but it seems not. How to pass this expression correctly to arcpy.SelectbyAttribute_management in  python script?
I've tried:

arcpy.SelectbyAttribute_management(featureCar, "NEW_SELECTION", "(filter)"), and similar solutions with quoting filter, but I always get ERROR 000358: Invalid expression.
I've noticed that is something with '\'{}\''.format(filter), but don't know how.


texts: Using the Function Editor to replace special characters

texts:
I am attempting to use the new Function Editor within QGIS 2.8.2. I have a field called LAND_NAME with hundreds of rows. What I'm trying to do is find and replace all "special characters". In ArcGIS, I would use this function:

codeblock:

def findreplace(s):
s = s.replace('(',   '').replace(')','').replace('&','and').replace('\'','~').replace('.','').replace(' ','_').replace('@','at').replace(',','').replace('/','_').replace('[','').replace(']','').replace(':','_')
return s

In the function editor, I have gotten this far and am now stuck:

@qgsfunction(args='auto', group='Custom')
def findreplace(s):
s = replace("field",'(','')
return s

Any insights into how to replace all the special characters in the first codeblock and make a function in QGIS?


texts: How to download MOD16 (Modis Evapotranspiration) image?

texts:
I use a 'R' script for downloading MODIS imageries. However, it doesn't give MOD16 product. I could neither find the MOD16 product in earthexplorer website. Though the desired product is available at http://www.ntsg.umt.edu/project/mod16#data-product but I could not find any script to download.

Is there any script available for it? or I need to click each image for download.

For example, if I want to download "h02v08" image from each and every month of the year, how to do it?


texts: gdal_rasterize error: "attempt to create 0x0 dataset is illegal.."

texts:
I'm trying to use gdal_rasterize to convert a polygon shapefile into a raster, where the value comes from the 'COVTYPE' attribute. I try calling gdal rasterize like so (I'm calling from within a python script so I have to call os.system):

os.system("gdal_rasterize -a COVTYPE -l %s -a_nodata 999 -a_srs EPSG:102001 -t 30 30 %s %s" % (bname, inshp, outrast))

Where bname is the basename of the shapefile (aka the layer name), inshp is 'inpath/bname.shp' and outrast is 'outpath/bname.tif'.

And get the error : "ERROR 1: Attempt to create 0x0 dataset is illegal, sizes must be larger than zero. Cannot create outpath/bname.tif"

It was my understanding that with gdal>1.8 (I'm running gdal 1.9.2), gdal_rasterize could create a new raster file as long as -tr (target resolution) or -ts (target size) is set (see http://www.gdal.org/gdal_rasterize.html). I'm setting the target resolution, so I don't see why it thinks I'm trying to create a 0x0 raster. Additionally, documentation says that if the target extent isn't set, it'll take the extent of the vector layer, which is want I want.

I've tried calling gdal_rasterize outside of python and get the same error. I also tried rearranging some of the keywords and taking away the a_srs keyword thinking it may be causing problems (a_srs overrides the default projection for the output file), but still to no avail.

Does anyone have an inkling as to what's going on?


texts: Some rasters appear only white/black in PDF exported from QGIS and viewed in CorelDraw X7

texts:
I'm having a recurring problem with exporting raster imagery in QGIS's print composer for use in CorelDraw X7 (for map styling).  The problem has persisted for some time, through many releases of QGIS (now on 2.18.16; Windows 10).

Maps will appear as expected in print composer, and the exported image appears as expected in Adobe Acrobat Reader DC.  In CorelDraw X7, however, some raster images in the PDF will appear as either black or white, though any vector items appear normally. Examples of rasters with this problem include both high resolution orthoimagery, as well as scanned and geo-referenced maps.

This problem is sometimes fixed by generating a new PDF from print composer.  Where this solution works, differences between PDF's that load as expected in CorelDraw X7 and those that do not typically consist of small (a few hundred kilobyte) differences in file size.

"Export as Image" results work as expected.

Looking for some help to figure out what is causing this problem in order to allow for map production workflow where layers are preserved in CorelDraw.


texts: Refreshing MapCanvas while PyQGIS-script is running

texts:
I try to write a PyQGIS script similar to this:
Use of python console to prepare offline map from WMS (tile downloader).

Basically there are two loops to pan the mapCanvas, refresh the mapCanvas and export the mapCanvas to *.png.

iface.mapCanvas().setExtent(QgsRectangle(xmin, ymin, xmax, ymax))
time.sleep(5)
iface.mapCanvas().refresh()
time.sleep(5)
iface.mapCanvas().saveAsImage("D:/GE"+str(i)+"to"+str(j)+"img.png" )

If I execute this code line by line in the Python Console it is working fine. If I use it in a loop georeferenced png will be exported but they are either blank or contain all the same content. As you see above I tried to use time.sleep() to have a timeslot for the map to update. But was not successful.
As Joseph suggested I also tried:

for layer in qgis.utils.iface.mapCanvas().layers():
    layer.triggerRepaint()

Same problem here: works line by line in the Python Console but not in a loop.

How to refresh mapCanvas while PyQGIS-script is running?

(QGIS Version 2.14.3)


texts:
I'm finding a hard time storing a point coordinate as the location to a PostgreSQL using PostGIS:

I found this query, but I'm unable to understand what the SRID and CRS values specified in this answer refers to.

UPDATE table_name SET geom = ST_Transform(ST_SetSRID(ST_MakePoint(longitude, latitude), 4326),26913);


texts: Is it possible to to export a shape polygon to a file? I want to export the polygons from a country to use them on a different map system,


texts: Running FFT (Fast Fourier Transfomation) in ArcMap?

texts:
How can I run FFT(Fast Fourier Transformation) on a raster image in ArcMap?

I can run FFT in Erdas, but for that I need to convert from tif to img, get Erdas FFT internal format and transform it into  img and apply the filter, then reverse the whole process ... it is to much redundancy...

I don't know if/how I can run FFT through a script etc in ArcMap.


texts: Installing QGIS Server - qgis_mapserv.fcgi returns error

texts:
I am installing QGIS Server on Ubuntu 20.04 (focal)
Docs indicate one should run usr/lib/cgi-bin/qgis_mapserv.fcgi and expect:
QFSFileEngine::open: No file name specified
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Content-Length: 206
Content-Type: text/xml; charset=utf-8

<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">
 <ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>
</ServiceExceptionReport>

But I get:
Application path not initialized
Application path not initialized
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
"Loading native module /usr/lib/qgis/server/libdummy.so"
"Loading native module /usr/lib/qgis/server/liblandingpage.so"
"Loading native module /usr/lib/qgis/server/libwcs.so"
"Loading native module /usr/lib/qgis/server/libwfs.so"
"Loading native module /usr/lib/qgis/server/libwfs3.so"
"Loading native module /usr/lib/qgis/server/libwms.so"
"Loading native module /usr/lib/qgis/server/libwmts.so"
QFSFileEngine::open: No file name specified
Content-Length: 102
Content-Type: application/json
Server:  QGIS FCGI server - QGIS version 3.16.1-Hannover
Status:  400

[{"code":"Bad request error","description":"Requested URI does not match any registered API handler"}]

The commands I have entered into a fresh Ubuntu 20.04 image are:
sudo dpkg --remove-architecture i386
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F7E06F06199EF2F2
gpg --export --armor  F7E06F06199EF2F2  | sudo apt-key add -
sudo add-apt-repository "deb https://qgis.org/debian focal main"
sudo apt update
sudo apt-get install python-qgis qgis-server libapache2-mod-fcgid
sudo apt autoremove


texts: Offset points to show multiple points in one location, while simultaneously showing two categories of points

texts:
Problem:
I'm using ArcMap 10.7.1. I have a dataset that has two categories (A and B) of points and has multiple points in one location. I want to "jitter" or offset these points from each other, so every point can be seen on the map, but also show two different categories. I have over 100 points.

Example of data:

Lat, Lon, Category
55.18, 14.80, A
55.18, 14.80, A
55.18, 14.80, B
56.53, 16.55, A
56.53, 16.55, A
54.42, 11.24, A
54.42, 11.24, B
56.96, 18.26, A

What I've tried:

I tried to symbolize by categories (A and B) and graduated symbols.
    I couldn't figure out how to use both at once, however, since some
    of my points only differ by 0.01, this method wouldn't work anyway,
    as some points would still overlap depending on scale.
I also tried manually jittering them, but with so many data points,
    this would take an unreasonable amount of time.

Is there an easier way to jitter or offset points?


texts: WFS altimetric curves that intersect geometry?

texts:
I have a WFS with altimetric curves and I would like to perform a spatial query. I would like to load from the WFS only curves that intersect or overlap a geometry from a shapefile, so only curves of a specific region.
I've tried with something like this:

intersection( $geometry , geometry( getFeature( "nameoflayer", "nameofattribute", 'valueinword' )))

But it doesn't work, I obtain a layer with curves attributes from the WFS ($geometry) but it is empty.

I've tried also with other operator like intersect but it doesn't work

How could I do it?


texts:
I have been using ArcGIS for some time and am playing around with arcscene for the first time. I am having trouble getting started. When I add a DEM to a blank project it renders as a uniform grey, blank obliqued square. If I use the info tool the values are in the range of valid elevations (ex: ranging from 80 - 2400). Strangely, once I use the info tool on the raster it displays as a uniform red. The same raster works as expected for a DEM in ArcMap. I have only the raster loaded in a blank project. The original Dem is an img format in a gcs coordinate system (downloaded from national map). I have tried reprojecting it and saving it in other formats with no success.

Any suggestions?


texts: How to extract xy coordinates to featuretable using ArcGIS web map/app to create points?

texts: I have an ArcGIS online web app to collect points using the services served on our server. The featurelayer exists in our SDE server.  How can I extract and update the xy (lat/long) coordinates without having a task scheduled to run?


texts: How to create a shapely polygon with a hole?

texts:
Sounds like a simple question, and the Shapely doc says all I need to do to create a simple polygon with a hole is to pass two lists of coordinate tuples:

exterior = [(2, 8), (7, 8), (7, 3), (2, 3), (2, 8)]
interior = [(4, 7), (4, 5), (6, 5), (6, 7), (4, 7)]
pgn = Polygon(exterior, holes=interior)

However, I get the following error:

AttributeError: 'tuple' object has no attribute '_ndim'

I also tried passing a Polygon as the interior ring.

interior=Polygon([(4, 7), (4, 5), (6, 5), (6, 7), (4, 7)])
pgn = Polygon(exterior, holes=interior)

>>> TypeError: object of type 'Polygon' has no len()

What is the correct way to use this constructor? Looks like the holes parameter should not be a tuple or a Polygon, so what should it be?


texts: Go to the URL when clicked on Leaflet marker

texts:
I want to implement marker click event so when user click on marker it goes to url. Url is written inside an array (a[3]). However, this is my code which doesn't work, it always goes to the link of the last marker only. Can you help me? I need a function which will open a new window with url in an array of that specific marker.

 for (var i = 0; i < markers.length; i++) {
            var a = markers[i];
            var title = a[2];
            var link = a[3];
            var image = a[4];

         var list =
            "
"
                + "
" + title + "
"
                + image

                +
           "
";

            var marker = new L.Marker(new L.LatLng(a[0], a[1]), { riseOnHover: true }).bindLabel(list).addTo(map);

            marker.on("click", function() {

                window.open(link, "_blank");

                }
            );

        }


texts: Select polygons contained inside a polygon and assign ID

texts:
I have a polygon feature class Base_FC, where each poly has a unique alphanumeric ID. My second polygon feature class Type_FC has the details for the various polygons which would fall inside Base_FC when intersected. These polys have unique alphanumeric IDs as well.

For display purposes, I would like to assign each Type_FC poly that falls within a Base_FC poly a number, along with its neighbouring polys. For example:

Base_FC polygon B1 contains three Type_FC polys T5, T8 and T11.
Base_FC polygon B2 contains four Type_FC polys T20, T21, T25 and T30.

The numbers should ideally be assigned spatially from left to right, so if B1 has the polys going from left to right as T8, T5 and T11, they would be labelled 1, 2 and 3 respectively. I realise that there are a number of ways to do this - the method I was thinking of was to create a model which iterates through each Base_FC feature, selects by location all the Type_FC features it contains, then use the Python field calculator to number them - but I'd like to know of other methods, or if there is a tool out there which can do this.

I'm also not sure how to handle the issue of numbering them so that visually it looks good. Maybe using the coordinates of the centroids to ensure numbering goes from left to right?


texts: How to build osm tileserver (Ubuntu 14.04 LTS)?

texts:
I'm trying to follow the tutorial:
https://switch2osm.org/serving-tiles/manually-building-a-tile-server-14-04/

And the first part works greatly, but because i'm new at using Linux (Ubuntu 14.04 LTS 64bit) i'm stuck at my first ERROR:

**Installing osm2pgsql**

osm2pgsql is under active development and is best compiled from source.

    mkdir ~/src
    cd ~/src
    git clone git://github.com/openstreetmap/osm2pgsql.git
    cd osm2pgsql
    ./autogen.sh

*bash: ./autogen.sh: No such file or directory*

so the next lines won't work at all:

./configure
make
sudo make install

I also tried the tutorial on github:
git://github.com/openstreetmap/osm2pgsql.git

I'm a complete novice according to Linux, so if someone can explain me, or if there is someone with a other (working) tutorial, please let me know.


texts: Looped query rendered feature function for a set of intersect points upon a GeoJSON building layer in Mapbox GL JS

texts:
I'm currently using mapbox gl to visualise and analyse a GeoJSON layer of buildings. My current aim is to develop a function that will use the mapbox draw functionality to draw a line (using the lineString tool), then intersect this line with the building layer, output an array of coordinates for the intersect points and finally query rendered features of the building layer with the intersect point array.

function getIntersect() {
    var drawnLine = draw.getAll();
    var layerFeatures = turf.featureCollection(SELECTED_LAYER_JSON.features);
    var intersectingFeatures = turf.lineIntersect(drawnLine, layerFeatures);
    interArray = [];
    for (var i = 0; i < intersectingFeatures.features.length; i++) {
        interArray.push(intersectingFeatures.features[i].geometry.coordinates)
    }

    mapB.on('render', interHeights);
    mapB.resize();
}

This function above conducts the intersect using turf js functions to get the line and current building layer into the appropriate format.

function interHeights() {
    mapB.off('render', interHeights)
    var selectFeatures = [];
    interArray.forEach(coords => {
        pixelCoords = mapB.project(coords);
        var bbox = [[pixelCoords.x - 10, pixelCoords.y - 10], [pixelCoords.x + 10, pixelCoords.y + 10]];
        selectFeatures.push(mapB.queryRenderedFeatures(pixelCoords, {layers: [SELECTED_LAYER_ID]}));
    });
}

The function above iterates through the intersect coordinate array and creates an array of features using queryRenderedFeatures.

Here is a bl.ock where you can see an example of the code.

Sadly the later function is not working correctly it currently is intermittently returning features in the query rendered feature array (selectFeatures). While the intersect works well and gives out an array of all intersected points, the query rendered feature function only returns query results for some intersect points and not others. This often depends on map zoom level or movement and changes depending on amount of buildings intersected with the drawnline. All results should be visible in the console.

I have subsequently read a post about the asynchronous nature of addLayer but I'm not sure if this is the problem I'm experiencing, but I was wondering if anyone has any suggestions or had experienced similar issues with the query rendered feature function in mapbox before.


texts: Getting merged color satellite image from red,green, blue, pan, and nir tifs

texts:
I am using Tiff images from Digital Globe and trying to get a color satellite image. I have merged the red, green, blue, pan and nir tiff files into one file. I then changed the band properties to a max of 500 and contrasted enhancement to stretch and clip to the min and max values. Doing all this produced a merged satellite image but the image has no color and is being rendered as single band gray.

How can I create a colored image?

I'm assuming I need to somehow create a tif such that each red, blue, green, nir band is a band for the tiff.


texts: How to change the raster color range in GRASS NVIZ?

texts:
I'm trying to create a 3d map in GRASS NVIZ from a GDEM (raster) and the range of colors that show the height of the terrain are very ugly, how I can change them? For example, I would like the low levels in green and yellow high altitudes, simulating aridity with increasing altitude.

Thanks.


texts: VBA/Python If/then statements in Field Calculator for one column based on another not working

texts:
I know this question has been asked a hundred times on here, for example:

Basic If/Then in Python Parser of ArcGIS Field Calculator?
Using if/elif/else statements in ArcGIS Field Calculator?
Checking for values in one column and do something in another using ArcGIS Field Calculator?
https://community.esri.com/thread/21689

but I just can't get my code to work.  I am trying to do a simple if/then statement in field calculator.  I have a column (risk_value) I want to populate based on the values in the other (risk_color). There are only four values in Risk_color: Green, yellow, red, null.

I tried writing code in VBA:

Pre-logic script Code:

Dim val
If [RISK_COLOR] = "Green" Then
     val = "Low"
elseif [RISK_COLOR] = "Yellow" Then
     val = "Medium"
elseif [RISK_COLOR] = "Red" Then
     val = "High"
elseif [RISK_COLOR] = "<Null>" Then
     val = "<Null>"
end if

RISK_VALUE=

val

Error executing function.

Then I tried python string:

def Value(color):
    if (color == 'Green'):
        return "Low"
    elif (color == 'Yellow'):
        return "Medium"
    elif (color == 'Red'):
        return "High"
    else:
        return "<Null>"

RISK_VALUE=Value(!RISK_COLOR!)

Error executing function.

What am I doing wrong?


texts: arcobjects modify vertices coordinate in both interior ring and exterior ring

texts:
I have a multiple parts polygon and I want to move all vertices of this polygon. I use exteriorRingPointCollection and interiorRingPointCollection to get all vertices. But I cannot get the result I want, after run the following code, neither exterior vertices nor interior vertices changed.

Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer

Dim polygon As IPolygon4 = TryCast(pFeature.Shape, IPolygon4)
Dim exteriorRingGeometryBag As IGeometryBag = polygon.ExteriorRingBag
Dim exteriorRingGeometryCollection As IGeometryCollection = TryCast(exteriorRingGeometryBag, IGeometryCollection)
Dim updCollExt As IPointCollection = New PolygonClass()
Dim updCollInt As IPointCollection = New PolygonClass()
For i = 0 To exteriorRingGeometryCollection.GeometryCount - 1
    Dim exteriorRingGeometry As IGeometry = xteriorRingGeometryCollection.Geometry(i)
    Dim exteriorRingPointCollection As IPointCollection = TryCast(exteriorRingGeometry, IPointCollection)

    Dim interiorRingGeometryBag As IGeometryBag = polygon.InteriorRingBag(TryCast(exteriorRingGeometry, IRing))
    Dim interiorRingGeometryCollection As IGeometryCollection = TryCast(interiorRingGeometryBag, IGeometryCollection)

    Dim InteriorRingGeometry As IGeometry = interiorRingGeometryCollection.Geometry(k)
    Dim InteriorRingPointCollection As IPointCollection = TryCast(InteriorRingGeometry, IPointCollection)
    For j = 0 To exteriorRingPointCollection.PointCount - 1
        Dim pp As IPoint = exteriorRingPointCollection.Point(j)
        Dim xvalue1 As Double = pp.X
        Dim yvalue1 As Double = pp.Y

        xValue = pp.X
        yValue = pp.Y

        pp.X = Fix(pp.X * 100) / 100
        pp.Y = Fix(pp.Y * 100) / 100
        updCollExt.AddPoint(pp)
    Next

    For k = 0 To interiorRingGeometryCollection.GeometryCount - 1
        For m = 0 To InteriorRingPointCollection.PointCount - 1
            Dim pp As IPoint = InteriorRingPointCollection.Point(m)
            Dim xvalue1 As Double = pp.X
            Dim yvalue1 As Double = pp.Y
            xValue = pp.X
            yValue = pp.Y

            pp.X = Fix(pp.X * 100) / 100
            pp.Y = Fix(pp.Y * 100) / 100

            updCollInt.AddPoint(pp)

        Next
    Next

    InteriorRingPointCollection = DirectCast(updCollInt, IGeometry)
Next
exteriorRingPointCollection = DirectCast(updCollExt, IGeometry)
pFeature.store()


texts:
I have several records from a survey and would like to show flow map from places mentioned in the survey. I have all places mentioned georeferenced and some records mentioned no places and others mentioned up to 16 places.
I made a graphic so I can make myself clearer.


texts: Using multiband images in ArcGIS Raster Calculator?

texts:
I have 5-band composite orthomosaics that I wish to apply multiple vegetation indices towards. In the raster calculator, it only displays the raster, but not the individual bands. Can someone give me an example of how I would write out a calculation for something like NDVI? (NIR-Red)/(NIR+Red)

I imagine it is something like (Rastername Layer4 - Rastername Layer3) and so on. Just cannot seem to find anything online after much searching.

Naturally, I am aware that I could subset the bands of the images, but that seems counter-productive!


texts: Creating SQL query in ArcGIS Explorer SDK?

texts:
I am using the ArcGIS Explorer SDK and have run into an issue surrounding a query I would like to perform with SQL. I believe my query is built wrong or perhaps I am looking at the wrong fields. Would anyone have any input on my code below and/or possible solutions?

I would like the code to query a column for specific values then return them into a combo box. My query simply returns a blank value at the moment. Below is the code for that block.

Try
    Dim md As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
        Dim map As Map = md.Map
        Dim cblayernameselect As MapItem = cblayername.SelectedItem
        Dim cbfieldnameselect As String = cbfieldname.SelectedItem
        Dim selitem As SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems

        cbattribute.Items.Clear()

        selitem.Select(cblayernameselect)

        Dim child As PackageChildLayer = TryCast(ESRI.ArcGISExplorer.Application.Application.SelectedItems(0), PackageChildLayer)
        Dim layertable As Table = child.Table

        Dim cbcolumn As Column = layertable.Columns.Item(cbfieldnameselect)

        Dim whereclause As String = "SELECT " & cbcolumn.Name & " FROM " & layertable.Name

        Dim rows As RowCollection = layertable.Search(New Filter(whereclause))

        For Each row In rows
            cbattribute.Items.Add(row)
        Next row

    Catch ex As Exception
        MsgBox(ex.Message)
    End Try


texts:
I have a problem with mysql vector; when I connect to the MySQL table (containing a geometry column), the attribute table is loaded correctly, the map is centered properly but the geometries are not displayed;
if I save the vector as a shapefile classic or other type, the new layer is loaded and displayed correctly.
I'm using Windows7 + qgis 2.8 lts

I tested the same procedure in ubuntu 14.04 + qgis 2.8lts and everything works properly.

I believe it depends on GDAL/OGR, someone can help me?

I get the same result (geometry not displayed) even if I load the table console py:

from qgis.core import *
uri = "MySQL:xxx,host=localhost,port=3306,user=root,password=xxx|\
layername=xxx"
vlayer = QgsVectorLayer( uri, "xxx", "ogr" )
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

if I select all records of the attribute table, and I use the tool to move the elements (with the edit mode on) when I click on the map all the elements appear in the map and remain visible until I deactivate the edit mode....


texts: Atlas export using Python: AttributeError: 'NoneType' object has no attribute 'atlas'

texts:
I'm trying to export my atlas layout named "Atlas_png", but are getting the error:

AttributeError: 'NoneType' object has no attribute 'atlas' (line 27).

I have tried to use this examples:
Exporting QGIS Atlas using PyQGIS (qgis.core) ---- Error line 27:

# Open prepared layout that as atlas enabled and set
layout = project.layoutManager().layoutByName(layout_name)

# Export atlas
exporter = QgsLayoutExporter(layout)
settings = QgsLayoutExporter.ImageExportSettings()
exporter.exportToImage(layout.atlas(),output_folder, 'png', settings)

https://github.com/carey136/Standalone-Export-Atlas-QGIS3 ---- Error line 85:

QgsProject.instance().read(myProject)
myLayout = QgsProject.instance().layoutManager().layoutByName(layoutName)
myAtlas = myLayout.atlas()
myAtlasMap = myAtlas.layout()

I am  sure that there is a layout called "Atlas_png" in the qgs project. I can get the name when running printLayouts in the Python console directly in QGIS.

Every examples seems to work, except when I am running them.

Any leads?

Running Python 3.7.0 and QGIS 3.10.2


texts: Collect last word from varied length string for filtering, auto labeling and column population?

texts:
I have been looking and reading for a few days about how to collect the last word from a varied length string. I have found lots of postings about how to collect/split the last word, but none of the content I have read addresses varied length stings.

I would like to use this function for column population, automated labeling and content filtering from inside either the field calculator or label expression interfaces.

String examples: Morgan County, Johnson Parrish, John Brown County, Rick de la Rosa City, Big Wild life Area.

Output example : County, Parish, City, Area

Nothing I have tried has worked 100%. The following code just about works, and would work if all my strings were two words long:  s.split( " " )[1:][0]

I am using arcmap 10.2 / python


texts:
I have a geotiff raster image.
I have estracted the WritableRaster, the envelope, and the gridsampleDimension I need to create a new geotiff using Geotools.

GridCoverageFactory gcf = new GridCoverageFactory();
GridCoverage2D image2 = gcf.create(UUID.randomUUID().toString(), raster2, envelope, gridSampleDimensions);
String url = "D:\\ImmaginiRaster\\2015\\" + UUID.randomUUID().toString() + "--.tif";
File file = new File(url);
GeoTiffWriter writer = new GeoTiffWriter(file);
writer.write(image2, null);

And this works perfectly well.
Also if I set a random valure for the pixel using

 raster2.setPixel(i, j, [RANDOM]);

But this image is in b/w.
I want to create a new image in RGB.

I've tried using and IndexColorModel

int nColors = 8;
Random rn = new Random();
byte b000 = (byte) 0;
byte b255 = (byte) 255;
byte[] reds = new byte[]{b255, b255, b000, b000, b255, b255, b000, b000};
byte[] greens = new byte[]{b255, b255, b255, b255, b000, b000, b000, b000};
byte[] blues = new byte[]{b255, b000, b255, b000, b255, b000, b255, b000};;

IndexColorModel colorModel = new IndexColorModel(3, nColors, reds, greens, blues);
raster2 = colorModel.createCompatibleWritableRaster(w, h);
for (int i = 0; i < w; i++) {//width...

        for (int j = 0; j < h; j++) {
                raster2.setSample(i, j, 0, rn.nextInt(200));
                raster2.setSample(i, j, 1, rn.nextInt(200));
                raster2.setSample(i, j, 2, rn.nextInt(200));
        }
}

I've also tried with

BufferedImage imagex = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
TiledImage tiledImage = new TiledImage(0, 0, w, h, 0, 0, imagex.getSampleModel(), imagex.getColorModel() );
raster2 = tiledImage.getWritableTile(0, 0);

But I receive always a message like this

  width = 1304 height = 567 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0 is incompatible with ColorModel ColorModel: #pixelBits = 32 numComponents = 1 color space = ScaledColorSpace[32767.0, 32767.0] transparency = 1 has alpha = false isAlphaPre = false

Where am i wrong ?


texts: Importing / copying data from PostGIS to ArcGIS / ArcMAP

texts:
So, I'm working on a project using Postgresql and Postgis. We have a client using ArcGIS (10.0) and ArcFM. We are trying to export some data from postgres to ESRI, but we have our hands tied quite a bit as we don't have esri experience or access to esri!

The client is a utility and using the connectivity features of esri. They have a pretty extensive network mapped already and we are looking to add assets to it. For example, a service line to an existing water main - and have it connected appropriately.

We have looked at a few ways so far, I thought the most promising was to use gdal / ogr to export from postgres to a file geodatabase. Then the 'Geometric Network Incremental Loader' could be used to import and connect the data. It may still work but it seems that the likely SRID projection needed isn't supported by the ogr / FileGDB format.

Doing more research, I found that arcgis has capabilities to read postgis - it seems at both the server and desktop level. Is it possible then for ArcGIS to load postgis data and import / copy either all or selected data from the postgis 'layer' in to the existing geometric network? Copying all the attributes, geometries and connecting appropriately? I saw reference to the 'Copy Features' command - will this do all of that?


texts:
Is there any way to install and run Google Earth Pro totally offline? Actually if there is not internet access on specific computer and I want to run Google Earth Pro on that computer. What is the useful technique to copy cache from one computer (which is connected to the internet) to another computer. I have tried to copy Cache files to the offline computer. But it didn't work.
Is there any solution?
I have Windows 10
Google Earth Pro version 7.3.2.5776


texts: How to convert a shapefile to WKT with GeoTools snapshot 9?

texts:
Possible Duplicate:
  Write out a WKT file from a loaded shapefile

I need to convert a shapefile to WKT to be read in OpenLayers. The shapefile is one that has been created by Geotools. Basically, I draw on the map, save it as a shapefile, and stash it in a directory. Then, I read all the files, put them out, and when clicked on they open in OL. I had GeoScript outputting the shapefiles but it causes Grails to take a dump when used with Maven (which I have to use) so I can't use Geoscript for it, anymore. All of the tutorials I found for GeoTools were version 2 which is incredibly old and virtually none of the Library calls are correct in them. Does anyone know how to do this with Snapshot 9? Or even Geotools 8? It was literally about 8 lines of code with Geoscript. Any help will be appreciated.


texts: Is it possible to download the code of a web app you've created in Esri's Web AppBuilder?

texts:
I've created an app in Esri's Web AppBuilder, but now I'd like to download the code and host it myself.  I have both ArcGIS Online and ArcGIS Server.  In the past, there was a "Publish" option where you could download your code, but it seems to have disappeared in the new version.

EDIT: I can manually pull some HTML and JavaScript off the page using Chrome and the "Inspect Element" tool (via the "Sources" tab).  However, even when structured the same and hosted, the app doesn't fully load (the progress bar stops at about 75%).  I'm familiar with web concepts and I would think this should work, but I must be missing something.


texts: pgr_createTopology uses too much memory and "connection to the server has been lost"

texts:
I have the large roads network (urban walking paths).
I'm trying create topology in my database but when query reaches 175
thousands of edges, begins to increase memory usage. In the same time CPU usage is decreasing.
After some time, I get an error:

"Connection to the server has been lost."

I read these topics:

pgr_createTopology() 'Connection to the server has been lost'
pgr_createTopology with large datasets

But the first has not been explained and in the second - I do not know Python.

I tried to upgrade and downgrade PgAdmin Version. Nothing works.

I also tried to simplify the geometry. Unfortunately, it didn't help either.

I use this query:

select pgr_createTopology ('roads', 0.0001, 'geom','id');

PgAdmin Version 4.13 with PostGIS 2.5.2 and pgRouting 2.6.2.

I have 8GB RAM.


texts: Converting NLCD raster to vector using QGIS?

texts:
This is a followup question to:
Determining percent land coverage around points of interest using NLCD and QGIS

I am looking to determine the percent of various landcover types (wetlands, forest, etc) in areas of various radii surrounding a breeding location using the NLCD database. Using help I received with my previous question, I was able to generate shapefiles representing all of my desired radii. The response to my question also linked me to a video showing how to determine the various percentages of landcover in my buffer zones.  However, the video showed the use of a Shapefile for the land coverage instead of the raster file. When I downloaded the NLCD database, I got files with the following extensions: .rrd, .rde, .img, .ige, .xml and a folder called spatial metadata with files named spatial_metadata with extensions of .shx, .shp, .sbx, .prj, .dbf, .cpg, .txt.  When I open the .shp metadata file, it just shows the US as a solid color. When I open the .img file, I see the landcover usage that I would like.

How can I go about getting a file (or files if I need to have one for each land cover category) that I can use with the buffer zones to calculate percentage?

I have done the raster to vector (polygonize) command, but when it finishes running, it says there is an additional layer called “vectorized” however that layer is completely empty when I try to view it.