texts: Label styling applied in Geoserver are not being applied to WMS layer in Openlayers

texts:
I am trying to label a layer of line vectors using SLD in Geoserver. It is simple enough, and it's pretty much copied from the SLD cookbook: http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/lines.html

The thing that's getting me is that when I view the Openlayers preview in Geoserver, everything seems to render correctly. Each road is only labeled once and it's not extremely busy looking. However, when I import the layer via WMS to my Openlayers map, it doesn't seem to recognize this line:

<VendorOption name="repeat">400</VendorOption>

Which is supposed to keep it from repeating within 400 pixels.

I've also tried:

<VendorOption name="group">yes</VendorOption>

Which should only display a single label on a map per unique text.

Any idea what is going on here? I need the labels to look like the Geoserver preview.

Map displayed in openlayers after importing layer via WMS:

Map displayed in Geoserver Openlayers preview:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
  xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>Roads</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Rule>
          <Title>Roads</Title>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">
                <ogc:Literal>#000000</ogc:Literal>
              </CssParameter>
              <CssParameter name="stroke-width">
                <ogc:Literal>1</ogc:Literal>
              </CssParameter>
            </Stroke>
          </LineSymbolizer>
          <TextSymbolizer>
           <Label>
             <ogc:PropertyName>name</ogc:PropertyName>
           </Label>
           <LabelPlacement>
             <LinePlacement>
               <PerpendicularOffset>
                 10
               </PerpendicularOffset>
             </LinePlacement>
           </LabelPlacement>
           <Fill>
             <CssParameter name="fill">#000000</CssParameter>
           </Fill>
         <VendorOption name="repeat">400</VendorOption>
        </TextSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>


texts: How to create or reclassify a land cover raster based on distance to roads in ArcGIS 10.4?

texts: I am using a raster of land cover (Globcover 2.2, 300 m resolution), which I managed to reclassify (in 2 land cover categories) and clip to my region of interest. I also have a shapefile of the roads within this region of interest. I am interest in areas within 1 km from each side of the road, so I created a buffer of the road layer. I would like a way to combine (or merge, not sure about the terminology) these two so I have a new raster that has the 2 land cover classes and a third class equivalent to the roads. How can I do this?


texts: I was wondering if it is possible to customize the interface of the Flex viewer with HTML using the index.html file that is located in the viewer?


texts:
When QGIS is starting, there is a banner announcing that a new version is available but it does not tell about new LTR versions. I'm working with QGIS 2.14.11-Essen LTR and I get that:

To get new releases informations, it is necessary to check QGIS official website. Is there a way to automatically get informations about releases, either within QGIS or not?


texts: Reclassifiying a continuous raster data inside each of 4000 polygons

texts:
I have a raster data with a continuous value (from a Low 0 to a High 1).
Across the whole area of the raster map, I have 4000 polygons of different shape and size.
Each of these polygons is assigned a value percentage (%). This % indicates the proportion of pixels (from the raster map) out of the total pixels each polygon covers that will be extracted or classified as one category. The selection of pixels should start from the highest raster value until the required number of pixels is met.

Is there a way to do this in ArcGIS Desktop?


texts: Quicker function than dissolve and difference

texts: I'm on QGIS (v. 3.6) trying to create a map of Florida's hydrography using the NHD "Water Areas" shapefile. Methodology is to fix any invalid geometries in the NHD data, dissolve the layer, and then execute the difference between water areas and the whole state of Florida. There quite a lot of these areas and it's obviously taking a significantly long time for the dissolve function to complete (I left it running for ~5 hours and the algorithm was still processing). This is running on a Thinkpad X1 Yoga. Is there a faster way to complete this project or is QGIS the wrong software for what I'm doing?


texts: How to load mdb geodatabases in QGIS for MAC?

texts:
I've been unsuccessfully looking for a way to add data from a .mdb geodatabase into QGIS for mac.
Using the add vector layer, .mdb is not available in the filetypes, and in the database connection I don't have a clue on how to connect to a database thats already in your hard drive.

Any help will be much appreciated.


texts: Exception handling in ArcGIS Modelbuilder

texts:
i'm using a ArcGIS 10.3 modelbuilder for comparing two subdatasets in a HDF file. model runs for multiple inputs i.e. it has an iterator. model runs fine for many inputs but sometimes it throws an exception and stops. I debugged the model and found out that when Con tool compare two subdatasets in the model and if it doesn't find data (i.e. null raster) it trows an exception and whole model stops. I searched a solution for it and came out is using a script tool.

My question is i want to write a script tool that checks if input raster is null and outputs two Booleans 'true' or 'false'. if False then model runs as usual and if True it comes to next input in iteration and keep running.


texts: Spatialite, GeoPackage & Metadata. Are there any python code available to upload metadata?

texts:
First of all I am working with spatialite-gui 1.6.0 and spatialite 4.0 and sqlite 3.7.14.1

I want to upload on spatialite and geopackage xml metadata authomatically using python scripts.

The problem is I haven't found any table with an ISO metadata schema in both cases.

Because of that is not clear how I have to proceed. I had to look for a solution, I think only two options are consistent with those formats:

1) create my own iso metadata table and upload one  xml metadata document for  each row of that table.

2) create one metadata table for each spatial layer.

Do you know if there are a better method available to upload and store XML metadata on spatialite either geopackage?


texts:
I am using osm2pgrouting to import data to my PostGIS database from OSM and I was wondering if there is some way to specify to pgRouting to calculate paths with only ways that can be walked by people?

I've been able to make paths with any kind of ways and the paths use the roads, something that I don't want to do.


texts: Combining DataFrameTime object with ExportReports function in ArcPy?

texts:
using python in ArcGIS, I'm trying to combine the ExportReports function with the DataFrameTime object. For every date interval, an image of the Layoutview is exported and all the visible layers are supposed to be saved in the report.I am able to get the images to match the dates, however the report doesn't change and just adds all the files to the report including those not visible in the current time frame.

 pageCount = 1
while df.time.currentTime <= endTime:
    activeDF = df.time.currentTime
    timeLyr = arcpy.MakeFeatureLayer_management(lyr,"RSII1")
    extentPolygon = arcpy.Polygon(arcpy.Array([df.extent.lowerLeft,df.extent.lowerRight, df.extent.upperRight, df.extent.upperLeft]),df.spatialReference)

    arcpy.SelectLayerByLocation_management(lyr, "WITHIN", extentPolygon, "", "NEW_SELECTION")
    arcpy.SelectLayerByAttribute_management(lyr, "SUBSET_SELECTION")
    arcpy.SelectLayerBYAttribute_management(lyr, "CLEAR_SELECTION")
    arcpy.Delete_management("RSII1")
    arcpy.mapping.ExportToPNG(mxd, path + "\Test1.png") #Creates a single file of the current time frame picture to be added to report

     # Generates report
    arcpy.mapping.ExportReport(report_source=lyr,report_layout_file=path + r"\Report.rlf",output_file=path + r"\temp" + str(pageCount) + ".pdf",dataset_option="SELECTED",starting_page_number=pageCount)

     # Appends pages into final report
    pdfDoc.appendPages(path + r"\temp" + str(pageCount) + ".pdf")
    os.remove(path + r"\temp" + str(pageCount) + ".pdf")
    pageCount = pageCount + 1

    df.time.currentTime = df.time.currentTime + interval


texts: Get tiles to appear after fitBounds call on one marker on mobile only

texts:
I am making a Leaflet 1.3.4 map. When I added fitBounds to the code, I experience a problem when viewing the map on my iPhone XS. Map displays fine on the desktop but regardless of browser (I have tried Safari, Firefox and Chrome) on my iPhone, when a single location is called for, the map displays the marker on a grey background. Only after the user "wiggles" the map to cause a redraw will the map appear. I made this simple example that illustrates my problem when you view it on iPhone (I don't have an Android to say if it works there or not). The complete map features a dynamic select to choose a "category" then the code puts markers and popups on the map for all the "members" in that "category." I am hoping someone will see what is causing this problem in the code:

<link rel="stylesheet" href="leaflet.css" />

<title>Chamber Member Map</title>

Here is the sampledata.geojson file referenced in the code:

{
"type": "FeatureCollection",
"features": [
{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      -94.715818,
      39.308195
    ]
  },
  "properties": {
    "Member_Name": "Kansas City Aviation Department",
    "Contact": "Patrick Klein",
    "Address": "601 Brasilia Ave.",
    "City": "Kansas City",
    "Phone": "(816) 243-3100",
    "Email": "Mark_VanLoh@kcmo.org",
    "Website": "www.flykci.com"
  }
}

]
}


texts: Are there any common field names for the FGDC street address standard fields?

texts:
I have been looking into implementing the FGDC street address data standards so that my address data is potentially consistent with other US data I obtain in the future. However, the FGDC documentation doesn't suggest actual names to name the fields.

I currently am using the following fields:

555 1 SW Main St, Ste B

 - ST_NUMBR:  555
 - ST_NSFX:   1
 - ST_PREFIX: SW
 - ST_PRETYPE:
 - ST_NAME:   Main
 - ST_TYPE:   ST
 - ST_POSTDIR:
 - ST_UNIT:   Ste B

To be consistent, I should probably change the ST_PREFIX field to ST_PREDIR, but if I'm making changes I might as well know if there are other conventions I should be following.

Are there any standard or common names for such address fields?


texts: Changing origin (top left corner) coordinates of raster using PyQGIS?

texts:
I am developing a python plugin for QGIS. The purpose of the plugin is to properly open an HDF5 dataset as a raster. Opening and displaying the raster can be done without the need for a plugin, however, QGIS does not recognize the origin (top left corner coordinates) of the dataset, or specific data file that I am importing. Top left corner coordinate information is embedded in the HDF5 metadata and I would like the plugin to recognize and feed it to QGIS.

When I run the code below through the plugin I get the raster loaded but not displayed, and the top left corner coordinate is (0, 0). How can I change that to whatever (x, y) values I want using PyQGIS syntax?

This is the code I am working with:

from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication, QFileInfo
from PyQt4.QtGui import QAction, QIcon, QFileDialog
import resources
from second_try_dialog import SecondTryDialog
import os.path
from osgeo import gdal, ogr, osr
from qgis.core import QgsRasterLayer, QgsMapLayerRegistry, QgsCoordinateReferenceSystem
from qgis.core import * #this is redundant with the line above
from qgis.gui import *

#### to open windows browser and search for HDF5 files only:
myfileNames = QFileDialog.getOpenFileNames(self.dlg,
                                            self.tr("HDF5 File Selector"),
                                            "",
                                            self.tr("HDF5 (*.hdf5 *.h5)"))
#### to loop through all selected HDF5 files, just handling one for now
for i in myfileNames:
    #### bind the HDF5 file
    myfile = QgsRasterLayer(i)

    #### to deal with multiple datasets within file
            if (len(myfile.subLayers()) > 1):
                #### to open dataset with desired data and name it Reflectance
                mydset = QgsRasterLayer(myfile.subLayers()[0], 'Reflectance')

                #### to set proper Coordinate Reference System (crs) info
                crs = mydset.crs()
                crs.createFromId(32611)
                mydset.setCrs(crs)

                #### to set raster bands to load as RGB
                mydset.renderer().setGreenBand(34)
                mydset.renderer().setRedBand(52)
                mydset.renderer().setBlueBand(18)

                #### trying to set top left coordinates
                #### This part isn't doing what I expected
                rect = QgsRectangle(326380.0,4103390.0-2853,326380.0+1332,4103390.0)
                mydset.setExtent(rect)

                #### to add selected dataset/raster to map canvas
                QgsMapLayerRegistry.instance().addMapLayer(mydset)

The result of calling this procedure is not what I expected. I want the raster be displayed in the map canvas and the top left corner to be located at (326380, 4103390). This is not what happens. The problem is that the raster doesn't load in the map canvas, even though the layer appears in the Layers Panel. The coordinates in the blank canvas seemed to have changed though. If I remove the two lines of code from the part that is not working, the raster does load, albeit with the top left corner at (0, 0).

Also, I keep getting an annoying message box that says: "CRS was undefined: defaulting to CRS EPSG...". I would like to resolve this problem as well.

How do I solve this?

Originally I thought the raster wasn't being displayed because the map canvas was blank but upon close inspection with the identify tool it became clear that the raster was there, but all the values for every band were overwritten with 'no data', making it appear blank.
Also, since querying my raster's extent returns bottom left and top right corner coordinates, I have updated the values inside QgsRectangle so they correspond to those positions.


texts: If/Else Create File Geodatabase statement ArcPy

texts:
I am trying to check to see if a scratch File Geodatabase exist. If it does not, then create one.

If it does exist I would like to delete all Feature Classes in the scratch File Geodatabase.

In the code below, it will create a scratch File Geodatabase if one does not exist. However, if one exist, it attempts to create a scratch File Geodatabase, rather than delete the existing contents.

Any thoughts?

import arcpy

arcpy.env.overwriteOutput = True
arcpy.env.scratchWorkspace = r'C:\Users\topmypath'
scratchWorkspace = arcpy.env.scratchWorkspace
scratchGDB = 'scratchGDB.gdb'

if not arcpy.Exists(scratchGDB):
    arcpy.CreateFileGDB_management(scratchWorkspace, scratchGDB)
    print "Scratch FileGDB created"
else:
    if arcpy.Exists(scratchGDB):
        for fc in arcpy.ListFeatureClasses(scratchGDB):
            arcpy.Delete_management(fc)
            print "Scratch GBD cleared..."


texts: Adjusting display size of Layer Manager so that full layer names are visible using Google Earth Engine

texts: I would like to adjust the size of the Layer Manager so that it enlarges enough to fit the entire layer name. With the default settings, the full ID of a Landsat image is not visible. I found that when I hover over the Layer Manager, I can right-click "Inspect Element" and explore and change its properties, but I am not sure exactly what to modify to make this change. I have tried unchecking the "maximum width" of the layers list, but the Layer Manager was still not wide enough.


texts: How to mask an area in ArcMap and run supervised classification on unmasked area?

texts: I would like to just run supervised classification on my area of interest (all along the coastlines) and would like to know how to do this in ArcMap. I have created a polygon to mask out the area out of interest, but I don't know how to replace the values of the pixels of the mask to 0 and to one outside the mask. Is there a way for me to do this and just do supervised classification of the land use along the coast?


texts: Opening KML with preserved raster symbology for icon

texts:
I have a KML file where the Icon is a png image of a generated coverage, and the idea is to overlay this in a layer over a basemap background, below is the KML file:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Folder>
    <name>Test Coverage</name>
    <GroundOverlay>
        <name>Coverage</name>
        <description>Test Coverage</description>
        <color>88ffffff</color>
        <Icon>
            <href>RM7FECF870F54_0.png</href>
            <viewBoundScale>0.75</viewBoundScale>
        </Icon>
        <LatLonBox>
            <north>-24.9667</north>
            <south>-26.76534</south>
            <east> 29.18931</east>
            <west> 27.19041</west>
        </LatLonBox>
    </GroundOverlay>
    <Placemark>
        <name>New Coverage</name>
        <Point>
            <coordinates> 28.18986204,-25.86602141,0</coordinates>
        </Point>
    </Placemark>
</Folder>
</kml>

When loading the KML as vector I get the following dialogue

When selecting all layers I get the following result

The picture the should have been overlayed looks like this

Is what I would like to do possible in QGIS 3.6?
I if so, what am I doing wrong?


texts:
I am facing a problem with GrassGis 7.0.1. I want to install r.viewshed.cva form Addons. I don't get an error during installation but when I try to open the plugin I get the error :

ScriptError
Unable to fetch interface description for command
'r.viewshed.cva'.
Details:

Can anyone help me? I am on windows


texts: Finding additions and updates between two vector layers using QGIS

texts:
I am using QGIS.
I have two exports of vector data created some 6 months apart.
How do I find any new objects added in the 6 months, and any attribute changes in the original objects?
An asset_id field exists in both tables as a unique identifier, and will carry through both tables. I can use the "Difference" tool to get geometry changes but can't get the attribute table changes too.


texts:
I need to rescale Sentinel2 data (both lvl 1C and 2A) to 8 bit, because of the requirements of a GRASS GIS module (i.histo.match) that only works with values from 0:255. All the documentation of Sentinel2 1C and 2A data products say that the data are encoded at 12bit, but that is not up to date (also this other post pointed this out https://gis.stackexchange.com/a/234044/172030). In fact, if I run gdalinfo on my L1C files, it says that it has 15 significant bits:

Image Structure Metadata:
COMPRESSION=JPEG2000
NBITS=15

while if I run it on my L2A files (created with Sen2Cor, not downloaded) it omits the "NBITS" field.

Image Structure Metadata:
COMPRESSION=JPEG2000

I don't know how to correctly perform the conversion: should I treat the data as formatted in 15 or 16 bits? I.e. DN / 2^15 * 2^8 or DN / 2^16 * 2^8? Is there any better way to perform this transformation?


texts: Polygons vs MultiPolygons in Google Earth Engine, labelling and reducing for each Feature

texts:
This question is a specific application of a previous question

I want to:

Generate different groups of polygons (each belonging to a zone)
Each polygon inside a zone would have a label that indicates which zone it belongs to.
Then download a time series of the average (or any reducer) for EACH polygon. This time series should have a label that tells me what zone the polygon belongs to.

The way I tried to do this is by constructing a MultiPolygon (a set of buffers around points in my example) and then adding a label to the FeatureCollection they belong to. However, when I download the time series, I get (naturally) the average across polygons and not the average for each polygon.

I believe what I need to do is to turn the MultiPolygon into a FeatureCollection of Polygons, each with the same label...

Please see the code which has the example:

https://code.earthengine.google.com/0ed71b7645f904ab1c2a61ec10e7b548


texts: AGS 10.1 geoprocessing service returning the wrong URL

texts:
I have an image export geoprocessing service that runs on ArcGIS server 10.1. It works by writing an image out to the scratch folder, and returning the location of that image.

Basically just this:

Output_File = os.path.join(arcpy.env.scratchFolder, output)
#Export the file ...
arcpy.SetParameterAsText(8, Output_File)

This works fine in most situations, and returns a url that looks like this:

http://www.oursite.com/arcgis/rest/directories/arcgisjobs/...

but on one client's network, when they connect to our hosted server, the service returns something that looks a lot more like this, despite the fact that the same instance of the service returns normally otherwise:

http://(local server name).(internal domain name).local:6080/arcgis/rest/directories/arcgisjobs/...

Is this the result of a misconfiguration on the server? And is there a reason why it would return the local network name of the server in some contexts?


texts:
Where would I set a proxy server for OSGeo4W Shell? In OSGeo4Winstaller I use the IE Setting and in QGIS the "system default".

I can't establish connection to a WMS service. In my opinion there should be a place for this somewhere in OSGeo4W\etc\ini but I can't find anything on this subject.


texts: I have a study area that is a polygon feature class, and am running the Cost Distance Tool on it in ModelBuilder. However, everytime I run the tool, it only calculates a cost distance and cost distance backlink for half of the polygon. The cost surface I produced with a weighted overlay covers the entirety of the study area, but not the cost distance. Any suggestions as to how to go about resolving this?


texts: how to choose stratified random sample on multispectral image

texts:
I'd like to choose random samples from multispectral image according to each Land Cover  image. The multiband image has 70 bands representing land surface temperature data from MODIS. Land cover image has 9 classes. I need 50 sample (pixel) values of each land cover type which extracted from each band of multispectral image. How can I choose these random samples in ARCGIS, ERDAS and EVI? ENVI can be used to choose random samples on multiband image as ROI. But statistic output of ROI gave me the descriptive statistics of mean of all sample. What I want is the mean value of each separate samples of each land cover types in each bands.

Thanks in advance


texts:
As i tried to install add-ons in GRASS GIS 7 using the command as:

Say,

g.extension extension=r.stream.order

The following error is displayed:

  ERROR: GRASS Addons (r.stream.order) not found. Reason: [Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond


texts:
I'm trying to get a token for ArcGIS Online using C# (well, more specifically SSIS). I've got a URL I can use which works well, and I can hit it and get what I need in Chrome, but it won't work through C# using a WebClient.

I can get other JSONs through it through SSIS/C# WebClient, but NOT ArcGIS Online for some reason. The URL works through Chrome, but won't yield an answer through SSIS/C# WebClient.

My code (with client id/secret/credentials) is:

string webResource = "https://mymaps.maps.arcgis.com/sharing/rest/oauth2/token?client_id=MYCLIENTID&client_secret=MYCLIENTSECRET&grant_type=client_credentials";
WebClient wc = new WebClient();
string json = wc.DownloadString(webResource);

I would then parse the JSON.

Currently I'm getting:

DTS Script Task has encountered an exception in user code:
project name: ST_0a306cf2e1634509bea49b75b7d93265
Exception has been thrown by the target of an invocation.
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

I have created an application, as described in https://developers.arcgis.com/labs/rest/get-an-access-token/

An example of the returned JSON (through Chrome) is:

{"access_token":"blahblahblahcrazywords..","expires_in":7200}


texts:
I followed a tutorial to make a very basic map with leaflet but the marker won't appear. How can I fix it so that it does?

<!DOCTYPE html>

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />

<title>Leaflet Web Map</title>


texts: Calculating the distance of each pixel in a raster from a point in PostGIS

texts:
I have a raster in PostGIS and a table of points. I want to calculate the distance of each pixel to each point.

How can I do that?

For example, if 9 pixels and 3 points, then I want to calculate 27 distances.

Your idea looks good. Actually I am trying to create a heatmap from a set of points that are trajectory of GPS.

I thought to first create a raster of the convex hull of the points, then calculate the distance of each pixel to each point. After that, I want to assign a degree to each pixel that represents its closeness to points. Now, I will use your idea for the middle part and at the end I create a  rater from it.

Do you have any faster idea for creating heatmaps because I have really big data?


texts: Advantages of using spatialite over shapefile?

texts:
I found spatialite more useful than shapefiles as it does not have the limitations of shapefile and it is also portable. Many people here use shapefiles to exchange data and even the experts do not know about this new format.

What are the advantages of using spatialite over shapefiles?

Can it be used instead of shapefile?

Please focus only on those formats which are portable, i.e. can be exchanged using USB sticks. GML, GeoJSON, KML, CSV are not an option and they are not directly editable in GIS.

UPDATE:
It has been more than 5 years and the new development is directed towards geopackage which is related to spatialite.

So now question is more like Advantages of using GEOPACKAGE over GEODATABASE?


texts: OpenGeo Explorer error publishing layers to geoserver

texts:
I want to use Opengeo Explorer to publish layers to geoserver but i am getting an error report.
I create workspaces with no problems and i publish styles with no problems.
Can you pls help?

  Error while storing uploaded file::Read timed out Traceback (most recent call last): File > "C:/Users/tomis/.qgis2/python/plugins\opengeo\gui\explorer.py", line
  118, in run command(*params) File
  "C:/Users/tomis/.qgis2/python/plugins\opengeo\gui\confirm.py", line
  18, in publishLayer catalog.publishLayer(layer, workspace, overwrite,
  name) File
  "C:/Users/tomis/.qgis2/python/plugins\opengeo\qgis\catalog.py", line
  379, in publishLayer self.upload(layer, workspace, overwrite, title)
  File "C:/Users/tomis/.qgis2/python/plugins\opengeo\qgis\catalog.py",
  line 247, in upload self._uploadRest(layer, workspace, overwrite,
  name) File
  "C:/Users/tomis/.qgis2/python/plugins\opengeo\qgis\catalog.py", line
  197, in _uploadRest overwrite=overwrite) File
  "C:\Users\tomis.qgis2\python\plugins\opengeo\ext-libs\gsconfig-0.6.6-py2.7.egg\geoserver\catalog.py",
  line 383, in create_featurestore raise UploadError(response)
  UploadError: Could not save the layer Naxos_Points, there was an
  upload error: Error while storing uploaded file::Read timed out


texts: OpenLayers MousePosition control listening to position, using generic change event

texts:
I want to add a MousePosition control, without using a HTML-control as target, but just put it in a variable.
    map.addControl(new ol.control.MousePosition({
        coordinateFormat: function(coordinate) {
            return ol.coordinate.format(coordinate, 'Lat: {y}, Long: {x}', 4);
        },
        className: 'coordinate_display',
        change: function(evt){
                 console.log(evt); //or anything to catch the event
                },
        projection: 'EPSG:4326',
    }));

Is it the right way to listen to the mousposition ? I dont get into to the change-handler.


texts: GRASS 6.4.3 installed with QGIS not working

texts:
I'm new to QGIS and GRASS. I'm trying to do an image classification and it seems that the method I need is not within the GRASS toolbox in the QGIS . So I decided to use the standalone GRASS version that got installed when I installed QGIS. I created a new project mapset and region and I was able to import the images and create an rgb composite using r.composite - However I'm not able to display them. I have the images activated (with the check box) click on the "display map" icon but nothing happens. When I move the cursor over the map display window, the coordinates showing are correct if I use the querying tool the command says d.raster fail. If I check the region parameters with g.region it gives me the correct region of my study area/ image.
I re-created the project several times, save it, open it again, and I still have this problem.
Even when I click on the Icon next to the image name to check the properties nothing happens...the histogram of the image is empty. If I extract the raster statistics it gives me an output- but with a d.raster fail error as well.
I can open the images and do operations with the GRASS tools within QGIS so it seems to be something with the standalone version.
Does anyone knows what is going on? Any recommendations?
Thanks!


texts:
I have a set of .las tiles. I needed to edit one of the tiles in Trimble's Inpho DTMaster to remove some noise. The coordinates are correct in the program, showing a my desired elevation. On export, however, the program shifts the entire file up in Z by 90 feet. It is not a spatial reference/coordinate problem, I've ruled that out already (unless the software is doing something unbelievably dumb). This is all done in a local spatial rectangular system.

Is there an easy way to subtract 90 from the elevation field of every point in the .las? I'd like to try to offset the Z. I've tried to convert it to an ascii file to do it semi-manually, but it is too large and fails after it grows to about 2.5 GB.

I have access to various software, including ArcGIS, QGIS, Inpho Photogrammetry, Global Mapper.


texts: Replacing Feature Class OR Deleting Feature Class within GDB using FME?

texts:
I'm looking to use FME to either replace/overwrite a Feature Class, or just a to delete a feature class so I can 'write' the new one into that gdb.

Essentially I have constant new data being updated every week, so every week I need to archive 'some' of the feature classes in a GDB and import the updated data to the same GDB.

I have a workbench which takes the old data and archives it (easy), and can write the new data in. But of course it doesn't move the feature class, only copies it. Meaning I can't write the updated data in.

I've heard this can be done in Python, however I'm not overly experienced in this. I am happy to learn if anyone can provide some steps?


texts: Extract attributes from a shapefile layer into polygons ArcMap

texts:
Apologies if I'm not going to explain myself too well, but I'm very new to this.

I have a layer with a series of separate polygons (squares) and another shapefile layer with different attributes and I want to clip that shapefile to my polygons so that the attributes are transferred to the polygons.

I have tried clipping, spatial joining and intersecting but none of them do what I need.

Is there a way to extract by shape using those polygons?

Here is what the attribute table for the road looks like. Initially it was split in much many more polygons, I have dissolved them by NoiseClass already, but had to give the option to have more than one polygon per NoiseClass as the shapefile is too large and it would otherwise crash.


texts: How to efficiently detect intersect between polygons?

texts:
So I'm trying to implement box selection in Leaflet.  Currently I'm using turf's intersects function to detect if the box intersects with any of my GeoJSON polygon features.

However, this is very slow; with 180 polygons (about 500KB for GeoJSON data), it would take 3 seconds to iterate over every polygons.

I see that OpenLayers 3 has a box-selection feature which uses ol.source.Vector.prototype.forEachFeatureIntersectingExtent which in turns uses ol.geom.flat.intersectsextent.linearRing and so on.

The example that OpenLayers 3 gives has a GeoJSON source of 250KB, and it takes no time to iterate and highlight selected polygons.

Does anyone what algorithm OpenLayers uses? or is there any fast algorithm out there?


texts: Calculating height above ground from ellipsoidal height and GDEMs

texts:
I'm very much a novice on GIS/geospatial related work.
Recently I've been trying to find the height of a 3D coordinate (latitude, longitude, altitude) above the surface of the earth.
I have measured a bunch of GPS tests from my android phone. From this, I can get the coordinates (lat & Lon) and altitude. From Googles API docs, the altitude is measured as the ellipsoidal height.
What I have done to try solve this is:

get access to a G/DEM for my area - I am using the ASTER project primarily - which from what I can see measures its elevation with respect to EGM96 / it's orthometric.
Convert my ellipsoidal height to orthometric height by subtracting the (nearest) GeoID for the coordinates from the ellipsoidal height.
Finally, I should be able to (based on my understanding of this) subtract the elevation (an orthometric measurement) in the ASTER DEM from my orthometric altitude measurements to get the approx. height above the ground.

The issue I am facing at the moment is that all of my 'heights above ground' are being flagged as below ground (i.e. they have a negative value when I'm expecting a positive value)
I've tried using a different geoids (egm2008) and the SRTM GDEM and I'm getting relatively similar results regardless of the combination of these.
Is my understanding/implementation correct and I'm just getting buggy data from the API or is it flawed and I'm missing something/doing something wrong etc?

I am just adding some more info as suggested by @JimT.
Steps:

get my test latitude, longitude and altitude from Googles android location API and create geopandas GDF.
Read in ASTER DEM tif for area (GDEMs I am interested in ASTGTMV003_N02E101_dem.tif & ASTGTMV003_N03E101_dem.tif) and create GDF with that too.
match up my test data to ASTER coordinates - I convert the x and y to latitude and longitude and from my understanding the z axis in meters regardless? - Note I had tried two different methods to match up, one is to match to the nearest coordinate in the TIF data, the other was to round both the test and elevation data to the nearest 0.0005 degree and average the elevations and do a normal join on lat and long to create the match (since it is faster to process than Nearest neighbours).
I pass my lat,lon and alt of my tests to a function that searches the egm96-5.pgm data for the geoId at my coordinates and calculate the orthometric height = altitude - GeoID.
I then subtract the orthometric height from my ASTER elevation - which I was hoping to get the height above ground. but is resulting in a pretty negative; incorrect, value.

Sample Data:
latitude = 3.0986359
longitude = 101.5527107
altitude = 6.636183
geoID@coordinate = -2.9963938625967255
orthometric height to coordinate = 9.632577
nearest elevation(From ASTER) to coordinate = 24
height above ground = -14.367423
I am not too sure what @JimT means by "level corrections" - The above is the verbatim of the process I am applying, and from my understanding, the only issue I can see is how I join the elevation to the point - rounding coordinates and averaging elevation VS matching based on nearest neighbour - or its a data quality issue from the API (or I'm pulling in the wrong data for EGM / ASTER, but I'm certain that's not the case!)

I have continued doing some digging and I think the issues are either arising from the Google altitude API, an error in the ASTER data, or some combination of the two of them.


texts: Can ArcGIS geoprocessing tools be used in ArcGIS Field calculator?

texts: Can you put ArcGIS geoprocessing tools such as arcpy.SelectLayerByLocation_management() or arcpy.MakeFeatureLayer_management() into the code block of the ArcGIS Field-calculator (ArcGIS Desktop 10.4)?


texts: Raster origin is incorrect so not properly overlay with vector in same CRS

texts:
Two layers, both allegedly WGS84, one vector layer of the Midwestern US, one raster layer with coverage of the entire US. The vector layer renders correctly (coordinates are correct), but the raster layer is way off. I looked at the metadata, and the origin is set to 200,75.5 (lon,lat). The prj.aux file of the raster layer claims it is wgs84, so having my raster layer inherit the CRS of the vector layer, which is also wgs84, doesn't do anything.

How can I get these layers to properly overlay?


texts: Revert back from RGBA raster to original 1 band raster cell value

texts: I have a number or single band raster grids that have been converted to RGBA (png). I no longer have access to the orignal single band raster data but have the png files. Is there a way to convert the png files back to the single band grid? Preferably using QGIS or other opensource GIS?


texts:
I am trying to use gdal_polygonize to create a polygon from a binary raster.

My code is:

os.system('gdal_polygonize.py ' + filename + ' -f ESRI Shapefile ' + shapefile)

where filename is a string file path with a '.tif' extension and 'shapefile' has a .shp

I am receiving the following error message:

Creating output Shapefile of format ESRI.
Traceback (most recent call last):
  File "/usr/bin/gdal_polygonize.py", line 164, in <module>
    dst_ds = drv.CreateDataSource( dst_filename )
AttributeError: 'NoneType' object has no attribute 'CreateDataSource'

I have browsed the internet for help but to no avail. I am running the programme from NXclient on a windows 7 machine.

Any help would be greatly appreciated.

Becky


texts: How to delete roads within blocks using ArcGIS?

texts:
I want to delete all the internal roads which exists in Block2. These roads don't have any attribute data. It is a single polygon. I need to extract only external roads. Block 2 should be made as Block 1. Block 1 is done by removing internal roads manually using "Cut polygon" tool.

I have so many block to work on. So, wanted to find an easier method


texts: Accessing Data Sources listed in the ArcMap TOC

texts:
I recently identified a bug with a fairly mature application I've developed which is hosted through ArcMap.  The bug happens when I've loaded a 'project' into ArcMap, which includes assorted feature layers and standalone geodatabase tables.  When a user chooses to close out of the active project and load a new project, I've noticed that while the previous project layers and tables appear removed from the 'Contents' view of the Table-of-Contents (TOC), the previous project geodatabase 'data source' is retained in the 'Source' view of the TOC.

The reason this is happening seems to me to be related to the fact the original call to create a new document hasn't quite finished by the time I begin loading my new data.  I suppose I could track that down eventually.

But my question surrounds the TOC itself.  A possible workaround might be to test the TOC during this 'load' sequence and ensure it's been properly cleared.  Unfortunately, for the life of me I can't seem to identify the proper interface to acquire the collection of data sources attached to a TOC and remove the one(s) I don't want.

The closest I've come is this link which describes how to acquire the Source Contents view object/interface.  Unfortunately, that particular interface (IContentsView) isn't very helpful in exposing the current collection of data sources...

I'd appreciate any thoughts, speculation and/or advice anyone might have.


texts: Split Line at Point not working in ArcGIS Desktop?

texts:
While i was using the "Split Line at Point" function with two features, both with 80000 point features and 90000 line features each, the finished result wouldnt split on the points. It would split a bit further away from the desired point.
Given the line feature has multiple lines overlapping indicating the multiple "routes", is there any way i could split the line features by point regardless of how many line feature it has beneath?
The picture shows what happens after i split using points. The points are on top/intersecting the line feature.


texts:
I have several DEMs obtained from NASA-SRTM (https://www2.jpl.nasa.gov/srtm/).

I try reduce the noise infor these applying the function noise.filter ofwvtool package and receive the next message:

> library(raster)
> DEM <- raster("S04W075.hgt")
> DEMnoise <- noise.filter(DEM, n= 5, method = "gaussian")
Warning message:
In noise.filter(DEM, n = 5, method = "gaussian") :
  data must be grayscale image
> DEMnoise
[1] "data must be grayscale image"

I have to process several rasters, so I need the solution in R.


texts: How to map geoJSON polygon from a url request in python

texts:
Using Python I have loaded json data from the url http://environment.data.gov.uk/flood-monitoring/id/floods and have found that the flood areas encoded as geoJSON polygons are displayed as url links.

What code do I use to map these polygons in python?

Here is additional information on the API and layers:
http://environment.data.gov.uk/flood-monitoring/doc/reference#api-structure


texts: Polygon topology validation in ArcGIS - whole study area artefact problem

texts:
I have no experience with topology validation in ArcGIS. I have polygon feature class.
When I create topology for this feature class, I specify two topology rules :

Must Not Overlap
Must Not have Gaps

After correcting all understandable artefacts, one problem remained visible on the map.
I would like to ask you if I should to Mark as Exception?


texts: Resampling WGS84 to ETRS89 causes change in pixel dimension

texts:
I'm a first time QGis user and got some resolution troubles. I need to create a DEM for whole Europe using SRTM 1-arc second (30m) from USGS. As I need the slope algorithm in a later step, I have to use a cartesian coordinate system. I'd like to use one single system, so I guess I go with ETRS89 (instead of UTM zones). When I reproject to the new CRS, the pixel sizes change from 30x30m to 26x26m (according to the measuring tool).

Can somebody explain me why this happens and if it matters?


texts: Is there a quick way to display a proposed route (that's a vector, line type) in QGIS but only display the first 100km of a route

texts: I have a vector line that is a proposed route between two cities.  I want to make a quick map (i.e. real time in a meeting) that shows the proposed route covered on a given day, ideally I was looking for a style property or attribute where I say "only color the 100km to 200km on the line/route."


texts: When I try to use the processing grass tools like r.series I always get the following messege. I deinstalled QGis and reinstalled the program totally fresh without success.


texts: QGIS DB manager Import layer/file tool won't allow me to choose "Append data to table"

texts: I want to append some data to a layer in my PostGIS DB using a shapefile, but when I use the Import layer/file tool in QGIS, it doesn't allow me to choose the append option.  Why is this and how do I get it to allow me to append?


texts: Strange effects when exporting an Arcmap file to Adobe Illustrator

texts:
I am working on a map in ArcMap (10.2) and when I went to check how some of my markers looked in Illustrator I got some odd results. Here is a picture of the error:

If you look closely in the red circles, you will see gray lines of markers that belong to two different features, but not the actual markers themselves. Two of the markers that did not show in the image are the same as the black horse image that is drawn above. The rest of the map has the same problem. None of the rest of my file is rasterized, and everything shows up in the layers dialog as it should be. What could be causing this error when exporting?


texts: Determine the most frequent value for an attribute based on another attribute

texts:
I need to determine the most frequent value of one attribute based on another.

For example:

Field 1     Field 2
Cat         Tabby
Cat         White
Cat         White
Dog         Brown
Dog         Brown
Dog         Brown
Dog         White
Dog         White
Bird        Yellow

would return:

Field 1     Field 2
Cat         White
Dog         Brown
Bird        Yellow

I know I can use the summary statistics to get a frequency count, but I need a way to return the value that occurs the most frequently, not the number of times it occurs.


texts: Changing Query Layer's SQL Expression with Python

texts:
I use query layers in ArcMap 10.4. The maps need to be done/repeated periodically. The easiest way is to copy the map, change the source's SQL expression (e.g. from select * from TABLE where Period = '2016-March' to select * from TABLE where Period = '2016-April') and that's it. But the expressions are long and hard to edit. Then I have many similar maps, where I have to make edits manually.

Is there a way to do this with Python?

Using the combination of query layer and definition query is not doable in my case.


texts: Removing "Invalid or Missing Projection" window when adding an image with DotSpatial

texts:
I want to add an image to my win form app using DotSpatial. I use the code below (it works):

private void Form1_Load(object sender, EventArgs e)
{
    map1.AddLayer(@"C:\image.png");
}

But I see "Invalid or Missing Projection" window to choose a projection. How can I set projection in code and remove the window above?


texts: vector clip based on chronological value

texts:
I would like to know if there is any algorithm in python that can clip  vector features according to the "date" value?
To be more specific the newest date is the dominant value and clipping will start from it


texts: Is there an API for NOAA GOES 15 satellite data?

texts: In August 2015, I was requesting GOES 15 GVAR_IMG satellite data because it had both visible and infrared light info (useful for studying cloud coverage and solar radiation).  I remember having to make email requests for the netCDF data and was wondering if something had changed.  Also, if I am just looking for visible light data this time around, is there an API that I could use to access NOAA satellite imagery?


texts:
I'm new to qgis and very sorry if this is a simple question to ask.
IS there a way to highlight the available paths (roads) between two selected points in a road map(in qgis) ?
I want to find the possible routes between two points in map, which less than or equal to a specified distance. For example, highlighting the roads(paths) between point A and point B which are less than 5km (if available).
And the two points are selected by the user on map, using mouse clicks.


texts: What is the minimum buffer zone to get a certain amount of points within the zone?

texts: I have one map with lines and another map with points. I want to find the distance of the buffer zone to be such so the amount of points that are in the buffer zone to reach a certain number. For example what is the buffer zone to get, 50% of all the points in the buffer zone?


texts: select polyline intersections from one shapefile using QGIS

texts:
I'd like to find out if there is a way to select all of the polyline intersections within one shapefile. The lines are a road network. I've looked through the posts, and the only tip I can find is the intersections tool. That requires two layers, though.

Thanks, Ward


texts: Using QuickOSM to select more values in key?

texts:
In using QGIS, I would like to select several values at once within the same key in QuickOSM.

I'm not at all familiar with coding!

Can someone suggest a simple point-by-point method to do this?

An example would be:

In Quick Queries, I select "amenities" under Key. Under Value, I'd like to select colleges, schools, hospitals.

Is there a way to do this, so that I don't have to do one at a time?


texts:
I did an unsteady flow analysis with HecRAS 5.0.7. and want to export my results as GIS - Data. But if I want to select my profile, I got always the same error message

  The plan must be executed for profiles to be available

How can I avoid this error?


texts: How does geoprocessing results window store tasks?

texts:
Yesterday I was working in a single mxd all day, performing dozens of calculations and other analysis using multiple tools. A lot of it was trial and error, so when I found the correct combination I would label it as such in the Results window before documenting it in OneNote.

I opened and closed that mxd multiple times, and was able to rerun those tools I had labelled, as expected. When I opened that mxd this morning at work, I found that the tools I had renamed had been reset to their default names - as a result, I've had to trawl through each result until I found the ones I wanted.

What I would like to know is, seeing as the processed tasks persist between sessions as it stored inside the mxd, so even if I open it on a different computer the results are still there, why does it "forget" that I renamed some of them?


texts: Unable to find the GRASS module i.ortho.rectify on QGIS

texts:
I am using QGIS 3.4.2-Madeira. It has GRASS 7 as a core plugin.

In QGIS, when I open Processing Toolbox, I can see the GRASS option but under the imagery sub-menu, I cannot find the i.ortho.rectify module.

I am also unable to add a new mapset since my GRASS toolbar doesn't show all the options as told in this QGIS tutorial. It only shows Open GRASS Tools option which upon clicking opens the GRASS Tools as seen in the lower half of both of the attached images.


texts: How to inlcude empty data GEE (R, reticualte)

texts:
I am using the r package reticulate and rgee to run some analyses in Google Earth Engine and get data loaded into r via numpy arrays for further analyses. I came across one issue that I could not solve. I tried to compile a simple example (see below). The issue is, that for some dates the vectors that I am extracting are not of the same length, although they are coming from the very same image. I assume that missing values get discarded and not transferred. Sometimes it is different for the different bands. In this case all three bands that I am extracting are different to the lon/lat vector. Any idea how to include missing values or whether the problem is actually something else.

#### Initialise GEE
library(rgee)
library(reticulate)

use_condaenv("gee-demo", conda = "auto",required = TRUE)

ee = import("ee")
ee$Initialize()

np = import("numpy")
pd = import("pandas")

# region of interest
roi = ee$Geometry$Rectangle(c(5, 50, 10, 55))

# load MODIS collection
Mod09       = ee$ImageCollection("MODIS/006/MOD09GA")$
                filterDate(ee$Date('2016-01-01'), ee$Date(paste0('2016-12-31')))$
                filterBounds(roi)

# get dates
date <- sapply(Mod09$getInfo()[[6]], function(x) x$properties$`system:index`)

Mod09sub = ee$Image(Mod09$toList(length(date))$get(3))$select(
    list("sur_refl_b01",
         "sur_refl_b03",
         "sur_refl_b04"))

latlng = ee$Image$pixelLonLat()$addBands(Mod09sub)
latlng = latlng$reduceRegion(reducer = ee$Reducer$toList(),
                               geometry = roi,
                               scale = 500)

# convert lat lon values to numpy array
lats = np$array((ee$Array(latlng$get("latitude"))$getInfo()))
lngs = np$array((ee$Array(latlng$get("longitude"))$getInfo()))
### length(lats): 1238793
### length(lngs): 1238793

# convert band values to numpy array
red   = np$array((ee$Array(latlng$get("sur_refl_b01"))$getInfo()))
blue  = np$array((ee$Array(latlng$get("sur_refl_b03"))$getInfo()))
green = np$array((ee$Array(latlng$get("sur_refl_b04"))$getInfo()))
## length(red): 1238792

df <- data.frame(x = lngs, y = lats, red, green, blue)

r <- raster:::rasterFromXYZ(df)
plotRGB(r, stretch = "lin")


texts: OpenLayers Plugin - Opencyclemap does not display correctly

texts:
It happened on version 2.6 and I was told it was my version that was the trouble, so I reverted to 2.2.  The odd thing is, that it will usually work fine the first time I open the map, but it seems like with each additional use more white squares pop up.  This is happening with the OpenStreet and OCM layers.  It does not seem to happen with other layers.

Any thoughts?


texts: How to add attributes to a Shapefile published in Geoserver?

texts:
I use Geoserver 2.4.4 with Shapefiles.
Now, I want to add attributes to features from a layer that already has some attributes. (Shown in Geoserver->Layers->Feature Type Details).

I add the attributes in QGIS (or Openjump) to the layer and store it in the shapefile. However, if I open it with Geoserver and click 'Reload feature type'. the added attributes do not show up. Strangely, when I view the features with WFS request=GetFeature, the attributes are displayed.

When I access the application with OpenLayers, finally, the attributes are missing.

Is there a way to detect within QGIS or OpenJump what might be the difference between the old attributes that are displayed and the new ones that are missing in OpenLayers and FeatureTypeDetails?


texts: How to extend Raster layer without pixel value data losing

texts: I got 2 different raster layers one of them black and white representing the river road. This river raster has pixel values stand for height. I want to extend the size of river in order to show, if the water increases which areas would be under the water But i don't know how to extent, Also the areas outside of the river raster(transparent in the picture) has no data values. Pixel values in extended areas should have pixel values same as nearest river pixel value. I guess i have to do it with raster calculator. But i can not find out how to code this.


texts:
I am trying to create a Multipatch Shapefile in the shape of a cube. I am using pyshp library and could create one face as a 3D Polygon as described in the wiki of pyshp (Creating 3D Polygons). However, I am not able to create a multipatch geometry, probably because I do not use the right order of coordinates or something like that. Here is my Code using the coordinate order described by esri (Link, doc Page 35):

w = shapefile.Writer(shapeType=shapefile.MULTIPATCH)
w.poly(parts=[[[0,0,0] , [0,0,1] , [0,1,1] , [0,0,0]] , [[0,0,0] , [1,0,0] , [1,1,0] , [0,0,0]],
        [[0,1,0] , [0,1,1] , [0,0,0] , [0,1,0]] , [[0,0,0] , [0,1,1] , [0,0,1] ,[0,0,0]],
        [[1,1,0] , [0,1,1] , [0,1,0] ,[1,1,0]], [[1,1,0] , [1,1,1] , [0,1,1]] ,
        [[1,0,0] , [1,1,1] , [1,1,0] ,[1,0,0]], [[1,0,0] , [1,0,1] , [1,1,1]] ,
        [[0,0,0] , [0,0,1] , [1,0,0] ,[0,0,0]], [[1,0,0] , [0,0,1] , [1,0,1]] ,
        [[0,0,1] , [0,1,1] , [1,1,1] ,[0,0,1]], [[0,0,1] , [1,1,1] , [1,0,1]]], shapeType=31)
w.field("NAME")
w.record("PolyZTest")
w.save("shapefiles/test/MyPolyS")

What am I doing wrong? Is the usage of poly() wrong?


texts: Transpose attribute table in QGIS Composer?

texts:
I have difficulty in how to rotating attribute table in QGIS Composer. The default is horizontal, it's because data I have too much around 50 tables. So I want to rotated it to horizontal.

Under the map, or maybe there is another way for me to include this all record and print it out?


texts: Adding QGIS-specific Python interpreter to PyCharm on Windows?

texts:
I am having trouble adding a QGIS-specific Python interpreter to PyCharm. Ideally, I would like to be able to switch between both Python2 and Python3 in PyCharm. I thought this might be possible by setting the .exe files from C:\OSGeo4W64\apps\Python27 and C:\OSGeo4W64\apps\Python36 as Python interpreters. However, none of this works, the error always looks like here below, where I tried to add C:\OSGeo4W64\bin\python.exe

After reading through some blogs and questions (links below), here is what I tried:

1) I created this pycharm-pyqgis.bat file below, that I am now using to start PyCharm.

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
SET QGISNAME=qgis
SET QGIS=%OSGEO4W_ROOT%apps%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
SET PYCHARM="C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.1\bin\pycharm.exe"

CALL qt5_env.bat
CALL py3_env.bat

CALL %OSGEO4W_ROOT%bin\o4w_env.bat

SET PATH=%PATH%;%QGIS%\bin
SET PATH=%PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
SET PYTHONPATH=%QGIS%\python
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Scripts
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\DLLs
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-dev\python

start "PyCharm aware of QGIS" /B %PYCHARM% %*

2) I modified the Windows environment variables to the folders indicated above (C:\OSGeo4W64\bin..). However, I am a little uncertain what should really go into PATH, PYTHONPATH, PYTHONHOME and PYTHON.

Related Links

Setting up PyCharm for PyQGIS and Qt
Adding QGIS-specific Python interpreter to Eclipse?
A Quick Guide to Getting Started with PyQGIS on Windows
Fixing "The SDK seems invalid" error when setting up PyCharm and PyQGIS?
Porting Processing scripts to QGIS3
https://gisforthought.com/updating-a-plugin-from-qgis-2-to-qgis-3/

This is not a working answer, just an extended reply to the comment above from Andreas Müller.

I now created two batch files as Andreas Müller suggested in the comment above.

Python27

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
SET QGISNAME=qgis
SET QGIS=%OSGEO4W_ROOT%apps%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
SET PYCHARM="C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.1\bin\pycharm.exe"

CALL %OSGEO4W_ROOT%bin\o4w_env.bat

SET PATH=%PATH%;%QGIS%\bin
SET PATH=%PATH%;%OSGEO4W_ROOT%\apps\qgis\bin

SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Scripts
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\DLLs

start "PyCharm aware of QGIS" /B %PYCHARM% %*

Python36

@echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
SET QGISNAME=qgis
SET QGIS=%OSGEO4W_ROOT%apps%QGISNAME%
SET QGIS_PREFIX_PATH=%QGIS%
SET PYCHARM="C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.1\bin\pycharm.exe"

CALL qt5_env.bat
CALL py3_env.bat

CALL %OSGEO4W_ROOT%bin\o4w_env.bat

SET PATH=%PATH%;%QGIS%\bin
SET PATH=%PATH%;%OSGEO4W_ROOT%\apps\qgis\bin

SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python36
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python36\Scripts
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python36\lib
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python36\Lib\site-packages
SET PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python36\DLLs

start "PyCharm aware of QGIS" /B %PYCHARM% %*

I am not sure if I did it correctly, but it doesn't solve the problem:


texts:
We have a large number of GeoJSON shapes that are stored in a datastore.
Currently, the GeoJSON coordinates are being stored with 15 decimals, which is accurate up to picometers.
We don't need that kind of precision, so we'd like to lower it to 7 digits in order to save some storage.
However, the data comes from external sources so we tried reducing the precision by simply omitting the last 8 digits. However, this cause some shapes to become invalid due to duplicate points. When we remove the duplicate points, the shapes can become invalid.
Is there a general process that should be followed when reducing the precision?


texts: Accessing global attribute of a NetCDF-based coverage in GeoServer as a service

texts:
Is there a way to access a global attribute of a NetCDF-based coverage through GeoServer?

Running GeoServer 2.12.0 with netcdf and netcdf-out plugin.

Have tried to look for the option to access it via the wcs:CoverageDescription document.


texts: restrict search to specific city - ArcGIS JS API 3.31

texts:
I'd like to use the Search widget to search for addresses and intersections in a custom web app (JS v3.31).  Is there any way to restrict this search to a particular city?

I see how to restrict it to a specified extent, but this is not good enough for us; our basemaps are made only for the city borders, and any extent will include some areas outside of our map.
(This question also post on Geonet , with no responses)


texts: WFS & Feature Access -> Database connection / Database support (ArcGIS 10.2)

texts:
Over the last two days I've tried to set up and to use a postgreSQL database to use WFS and Feature Access.
I've also started a thread in the esri forums, but I hope that I can reach a wider audience here.
Some basic information, what I've done

ArcGIS 10.2 installed on Windows Server 2012
PostgreSQL 9.2.2 64Bit is installed on the same server as well as PostGIS 2.0
I've edited the pg_hba.conf to have remote access.
I've copied the necessary 32Bit client files (libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Desktop 10.2 installation.
I've copied the necessary 64Bit client files (libeay32.dll, libintl.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Server 10.2 installation. I'm even not sure, if I need this....
I've copied the necessary st_geometry file (stored in the Installation folder of your ArcGIS installation (D:\Programs\ArcGIS 10.2\Desktop10.2\DatabaseSupport) into the \lib-Directory of my PostgreSQL 9.2.2
installation.
I've registered the database and the folder via the ArcGIS Server manager in the data store tab. I'm not sure if this right or necessary!?
The connection via pgAdmin works. I can connect to the database using pgAdmin. Here I have three tables: http://imgur.com/pkY0LmV
The connection via "ArcCatalog-> Add Database Connection" is finally working. I can connect to the database. As a database I can only select "postgis20" as a database?! Any idea, why it's like that?! http://imgur.com/rQYpjbc I think that it has to be postgres, hasn't it?

From now on I don't know how, what are the next steps.
Can anybody confirm that the above mentioned steps are right?

And it would be awesome if someone of you could give me some tips, how I have to work on or what are the next steps. Do I have to "Enable Geodatabase"? Do I have to create an Enterprise Geodatabase with the ArcToolbox Tool? I've spent too many hours without having success :(

My goal: Enabling WFS and Feature Access.

Thanks a lot

Edit Started from scratch regarding database. See each second comment of this post and answer. Btw:...first time for me using stackexchange.com.


texts: SQL Syntax to extract (convert) Strings with Degrees Minutes to Decimal Degrees

texts:
I have a PostgreSQL/PostGIS database with a two string fields containing Lat and Long coordinates in degrees and decimal minutes, like this 45° 24.5' N 3° 43.01' E.

How can I convert them into decimal degrees, for use in ST_GeographyFromText?


texts: How QGIS Python loop through all tables MS SQL Server?

texts:
I've got Python code on QGIS 3.12 that adds a MS SQL Server data layer to the map, but I need to add all of them.
uri = QgsDataSourceUri()

uri.setConnection(r"xx.xxx.xxx.xx\xxx", "xxxx", "xxx", "xxxx", "xxxx")

uri.setDataSource("000001","lcentro", "geom","")

uri.setSrid('31982')

vlayer = QgsVectorLayer(uri.uri(),"Roads","mssql")

QgsProject.instance().addMapLayer(vlayer)

So I can't figure out how to do it for all the geometry tables.


texts: How can I execute SpatiaLite commands directly from the command line?

texts:
I know I can open a SpatiaLite database and export a CSV from it as the following:
.headers on
.mode csv
.output csvFile.csv
select * from table
.output stdout

However, I'd like to automate the process of exporting CSV files from SpatiaLite with a bash script. Is there any way to execute this same sequence of commands from a shell? Just so I don't need to manually enter the database all the times I want to export data from it?
Alternatively, is there any way of exporting the result of a query inside my SpatiaLite database to a csv file directly? Without the need of using the commands that I used in my example?


texts: Fixing file geodatabase with deleted files?

texts:
As I was freeing up some space for my computer and I saw that my file geodatabase has about 150 GB inside the .gdb folder, I decided to delete some old files. So that is when my problem started. I accidentally deleted (shift+delete) some of the essential files and now ArcMap does not read Default.gdb as a database but rather as a folder

Is there a way to fix this?

If not, is there a way to recover the remaining feature classes in that folder so that I can use them again?


texts: ArcGIS Javascript API and connecting to a widget click event

texts:
I am using an ArcGIS App which was created in ArcGIS Web App Builder 2.2.  I am trying to connect to a map click event and/or a widget click event to run a custom made function.  I have made simple apps and have been able to connect to click events in the past.  With the apps created in Web App  Builder the .js files are spread out all over the place and I am not that advanced in JavaScript to figure this out.  I guess I am having trouble getting a handle on the map object which contains the lat, long, etc. of the click event.  How would I find the map object to tie these events. Before I had just had all my .js code in one file and tied a click event like this simple example:

map = new Map("map",{
    basemap:"Street",
    center: center,
    zoom: 3
    });

map.on("click",mapClickEvent);

function mapClickEvent(evt){
    console.log(evt);
}


texts:
I am trying to learn the Vector Tile Map, and got one pbf file for one tile. I can load it into QGIS, but how can I know the CRS?

http://PBFSERVER/13/2411/3080.pbf

Update:

I am trying to follow the tutorial here, code hereso can I say the CRS is 26918?


texts: osgeo available in QGIS, but not in mac command line interface

texts:
I am getting an error when I try to import osgeo from the python console on my mac (OS 10.13.6):

>>> import osgeo
ModuleNotFoundError: No module named 'osgeo'

As far as I know, GDAL is installed properly because I can get it's version from the bash command line:

$ gdalinfo --version
GDAL 2.2.4, released 2018/03/19

In case my python version is relevant:

$ python --version
Python 3.7.0

I installed it when I installed QGIS and interestingly import osgeo is working just fine from the QGIS python console. Any tips how to get it to work in the plain interactive console in Terminal?


texts: QGIS Temporary Scratch Layer attribute name become `:(0,0)`

texts:
I wrote a simple plugin to retrieve and synchronize points from remote MongoDb into a generated scratch layer with all the attributes every time the project open, edit and commit but the attribute naming bothering me for sometimes.

Scratch layer is in-memory layer that does not preserve the features upon exit. However I can save the project together with the layer.

Whenever I load the project, the attributes name of scratch layer gets appended with :(0,0). E.g. the attribute changed from city to city:(0,0) why?

Edit:

Apparently it will only happened if the attributes created using python.

How to produce:

layer = iface.activeLayer()
from PyQt4.QtCore import QVariant
field = QgsField("test", QVariant.String)
layer.dataProvider().addAttributes([field])
layer.updateFields()

Create Temporary Scratch Layer
Run the code above in Python Console
Save the layer edit and project into a .qgs file.
Exit and reopen QGIS
Reopen the saved project file
Open the layer Properties > Fields
The attribute name test will turns into test:(0,0)

I am using QGIS 2.18.2

Edit2:

I found that QGIS does not preserve the data type string into the project file when the field created using python. The project file .qgs xml content under qgs > projectlayers > maplayer > datasource is:

memory?geometry=None&amp;field=test:(0,0)

but it should be:

memory?geometry=None&amp;field=test:string(0,0)


texts: OpenLayers 3 - draw multiple lines/paths based on coordinates

texts:
I am trying to draw a line(s) based on give coordinates (starting and ending point).

Googled , found few examples but non of them seem to work probably because they are for OL2, so this is my last resort.

The coordinates are located in markers array

<!doctype html>

    <link rel="stylesheet" href="css/ol.css" type="text/css">

Fiddle link:

http://jsfiddle.net/tr8691ev/


texts: Can I achieve one-to-many relationship in QGIS custom forms?

texts:
My PostgreSQL database has ElectricLine geometry table which has one-to-many relationship with ElectricLineMaterial non-geometry (attribute only) table. This PostgreSQL table added as layer in QGIS 2.0.1. When the user add/edit an ElectricLine, he should have ability to add one or more ElectricLineMaterial records against to that geometry.

Can I achieve this requirement via Custom QGIS Forms? In other words, I want to have an "Add Electric Line Material" button in the form to add many materials against the current adding/editing electric-line.

Note: I am new to QGIS and learning QT Designer.


texts: Why the result of executing a geometric user function is different from the result of execution of the corresponding CTE query

texts:
So,

I wrote a recursive query that works well, maybe only for me :-),

[https://gis.stackexchange.com/a/333562/120129]

WITH
    tbla AS (SELECT (ST_DumpPoints(geom)).geom FROM adm_polygons),
    tblb AS (SELECT ((ST_Dump(ST_VoronoiPolygons(ST_Collect(geom)))).geom) geom FROM tbla),
    tblc AS (SELECT ST_Intersection(a.geom, b.geom) geom FROM tblb a JOIN poly_extent b ON ST_Intersects(a.geom, b.geom)),
    tbld AS (SELECT ST_Difference(a.geom, b.geom) geom FROM tblc a JOIN adm_polygons b ON ST_Intersects(a.geom, b.geom) AND ST_Overlaps(a.geom, b.geom))
    SELECT ST_Union(geom) geom FROM tbld;

See the result in figure,

Then I decided to wrap it in an SQL function:

CREATE OR REPLACE FUNCTION ST_CarvesPolygons(
    geom1 geometry,
    geom2 geometry)
RETURNS geometry
AS $BODY$
WITH
    tbla AS (SELECT (ST_DumpPoints(geom1)).geom),
    tblb AS (SELECT ((ST_Dump(ST_VoronoiPolygons(ST_Collect(geom)))).geom) geom FROM tbla),
    tblc AS (SELECT ST_Intersection(geom, geom2) geom FROM tblb WHERE ST_Intersects(geom, geom2)),
    tbld AS (SELECT ST_Difference(geom, geom1) geom FROM tblc WHERE ST_Intersects(geom, geom1) AND ST_Overlaps(geom, geom1))
    SELECT ST_Union(geom) geom FROM tbld
$BODY$
LANGUAGE SQL;

SELECT ST_CarvesPolygons(a.geom, b.geom) geom FROM adm_polygons a, poly_extent b

but the result also changed, see figure,

What's wrong with the function syntax?

Maybe it's a bug?

Tested by: PostgreSQL 11.1, PostGIS 2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1...

I have to deal with it, because there are other recursive queries waiting for me in the queue that ask me to wrap them in the SQL function :-)....

So why the results of work with WITH... and the results of the work of the corresponding SQL function in the body of which is added a query with WITH... gives different results!


texts: How to build a minimum convex hull crossing the 180 degrees line?

texts:
I've been building convex hulls for species that inhabit the Indo-Pacific (~ from 20 to -65 degrees of longitude). The problem I've encountered is that for the species that can be found on both sides of the 180 degrees longitude line the reconstructed hull expands across the whole layer rather than including the points in a much smaller polygon comprising both ends of the layer. The cause for this behaviour is that this line represents the edge of the layer, and QGIS doesn't wrap vector maps (see image below...my 'reputation' is now 'good enough to include it, thank you).

After some thinking and googling these are some of the possible approaches to the problem I have come across; however, I'm not too sure of their merit or implementation:

Change the central meridian from the 0 (i.e. Greenwich) to let’s say 150 degrees.
How can this be done? Would this merely change the map display (useful per se), or would it also contribute to the construction of the correct convex hull?

Change the coordinate system from a +/- 180 degrees format to a 0 to 360 degrees format.  Apparently, something along these lines can be achieved using the 'ST_Shift_Longitude' function in PostGIS, which adds 360 degrees to the negative longitudes. Is there a simpler way to do this? Also this function produces a 180 degrees centric map, which wouldn't be the end of the world but a 150 degrees centric map would be better (~ the centre of the Indo-Pacific).
Thank for your time and help, and sorry for the lengthy post.


texts: Is it possible to cluster markers based on city name in Google Maps API

texts:
I have a requirement to display all the customers in map. Since the customer list is too large it looks messy when I place markers.

I have tried the marker cluster functionality but it groups based on distance and that's not what I prefer.

Is there a way to cluster markers based on city names or custom logic??


texts: Making linear regression across multiple raster layers using ArcGIS Desktop?

texts:
I have a series of 5 rasters which represent a value for 5 consecutive years.

Is there a way to create a linear regression for each cell over the 5 layers and output the slope?

The result would be a raster with cell values equal to the slope of the linear regression line.

Essentially it is exactly what is done in How to represent trend over time?


texts: Asset point IDs, pipeline and flow direction

texts:
I have a data set of a sewage pipe network and point data (assets). I would like to:

first calculate the flow direction of pipes (polyline feature)
assign IDs to the pipelines using asset IDs (connecting). Eg, pipeline x starts from asset number 11 to asset number 10. I want to update the pipeline columns, one with downstream value of 10 (from asset) and another of upstream value of 11 (asset ID).

I have tried network analyst with ArcGIS but got stuck when trying to assign the IDs. Open to Python or any other code, or Modelbuilder.


texts: How to compare multiple spatial point patterns over a polygon

texts:
I have multiple point pattern distributions over the same region/polygon. Each point pattern distribution has different number of points.

Here is an example of two spatial point patterns for the region/polygon, the first one covers the polygon, while in the second not all of the polygon area is covered by the point pattern.

How can I compare the distributions within a polygon?

I prefer a solution for this problem in R.


texts:
I was wondering if it was possible to calculate the mean of Z in a ROI in a Surfer Contour map.

To be more precise, I have the map of a chemical element of an object that I converted into a XYZ files. Then I used Surfer to converted it into a Krigeage grid of 3266 X 200 which I transformed into a contour map. I re-scale the axes of my map to produce a more "realistic looking" map that i can stack with a picture of my object.

Ultimately, i would like to be able to explore my map and zoom on a area of interest and get the mean of the Z values in this area (by drawing a polygon on the map for example).

Is it possible to do that on Surfer or do I have to export my file in QGIS?


texts: Create Polygons that is the sum of other polygons

texts: I have a shapefile table of property parcels that are polygons.  I am looking to group these parcels by subdivision.  If I know which parcels belong in which subdivsion, is there a way to generate a polygon that is the sum of other polygons in shapefile format so that I do not have draw out each subdivision?


texts: "gdal:cliprasterbymasklayer" not clipping to polygons in QGIS3

texts:
I'm working on a plugin for QGIS3, and trying to clip a raster layer using a vector mask layer containing many polygons. I've been able to successfully do this using "Clip raster by mask layer" through the processing toolbox, but when I use the following code in the plugin, the output layer is simply clipped to the extent of the vector, not to the polygons within it:

processing.run("gdal:cliprasterbymasklayer",
        {'INPUT': rasterToClip,
        'MASK': vectorMask,
        'NODATA': -1,
        'ALPHA_BAND': True,
        'CROP_TO_CUTLINE': True,
        'KEEP_RESOLUTION': True,
        'OPTIONS': "",
        'DATA_TYPE': 5,
        'OUTPUT': outputFilename})

When I say "clipped to the extent of the vector", I mean the raster values outside the polygons have retained their original values - not None or NaN etc. I was expecting all of the polygons outside the polygons (but within the extent) to be nulls. There is an alpha band in the output, in which all pixels appear to be set at 255.


texts: In OpenLayers, how to set feature.style when using attribute-dependent symbolizers?

texts:
I am using dynamic (attribute-dependent) symbolizers on a vector layer. In this CodePen example, we have the colors of the states depeding on the PERSONS attribute, which given the number of inhabitants of that state.

I use the context property when initializing the Style, I use a StyleMap and everything works just fine.

/* Symbolizer */
symbolizer = {
    fillColor: '${getFillColor}',
    fillOpacity: 1,
    strokeWidth: 1,
    graphicName: 'circle'
};

/* Rule */
var rule = new OpenLayers.Rule({
    filter: filter,
    symbolizer: symbolizer
});

/* Context */
var context = {
    getFillColor: function(feature) {
        var persons = feature.attributes.PERSONS;
        return convertNumberToColor({
            value: persons,
            min: 453588,
            max: 29760021,
            colorRange: 'gr'
        });
    }
};

/* Style */
var style = new OpenLayers.Style({}, {
    context: context
});
style.addRules([rule]);

/* Style map */
var styleMap = new OpenLayers.StyleMap(style);
vector.styleMap = styleMap;

The problem comes when I try to highlight one of the features. By highlighting I mean this: maintain all the symbolizers of the feature and only change some. For example, in a red polygon, the highlighting would mantain its red color, but wuld change the strokeWidth.

var highlight = function(feature) {
    feature.style = $.extend({}, symbolizer, {
        strokeWidth: 5
    });
    vector.drawFeature(feature);
};

As you can see, I want to perform the highlighting in the feature.style property, because it does not interfere with the original styleMap and so I can easily remove the highlighting.

Please check out the CodePen above. When highlighting California, the fillColor should remain red, but it changes to green. The same happens with Texas.

Would you please help me to correctly implement highlighting in the feature.style propert when using attribute-dependent symbolizers?


texts: Executing bidirectional Dijkstra on TIFF image?

texts:
Can anyone indicate an example of how to do this? Link, tutorial etc...
I started a discussion here about how to load a TIFF image like a graph nicely answered by @sehe.
But, in this post the image is RGB. Then, after change for my needs(TIFF grayscale) the result is a image spatially displaced...

Real example of raster (was converted to PNG after upload) grayscale with float pixel values and current CRS (Coordinate Reference System) is SIRGAS2000:

From original code posted by @sehe I made some changes:

// I modified the type from rbg to grayscale
using Img = boost::gil::gray32f_image_t;
using Px  = Img::value_type;
Img img;

boost::gil::tiff_read_and_convert_image("raster.tif", img);
auto vw = view(img);

Next, I modified this code:

        auto calc_color = [&](size_t v) {
        std::ostringstream oss;
        oss << std::hex << std::noshowbase << std::setfill('0');

        //I removed the from[1] and from[2] because is a graycale image
        auto const& from = pixel_sample(vertex(v, graph));
        oss << "#" << std::setw(2) << static_cast<int>(from[0]);

        return oss.str();
    };

Now, I am trying to use the boost functions:

Eager Dijkstra shortest paths
Crauser et al. Dijkstra shortest paths
Delta-Stepping shortest paths
Bellman-Ford Shortest Paths
And if as possible...Bidirectional Dijkstra

But, I'm newbie in C++... I'm reading the Boost documentation and looking examples using TIFF to better understand it but I have not got it yet.
Then, how to execute this algorithms and how to hold the correct CRS of TIFF in this case?


texts: R sf aggregate polygons at various geographic levels

texts:
I'm trying to aggregate polygons at different geographic levels. As a hypothetical and reproducible example, let's suppose that I want to aggregate US county data set at the state level (of course, I can directly retrieve state-level polygons if this was my "actual" problem).

I've tried to do it by applying st_union for each group, where the group is each state. The code seems to work fine, but when I try to use it for plotting or other data manipulation, R throws an error message as below.

Error in CPL_geos_is_empty(st_geometry(x)) : Not a matrix.

In general, if we have multiple levels of geography within a data (e.g., state, county, city, zip code, etc) and if we want to aggregate it at different levels, what's the best approach?

counties <- USAboundaries::us_counties()

state_union <- counties %>%
  group_by(state_abbr) %>%
  summarise(geometry = sf::st_union(geometry)) %>%
  ungroup() %>% st_as_sf()

plot(st_geometry(state_union))


texts: Using Pix4d google_tiles KML outside of Google Earth

texts:
I am using Pix4d to generate orthomosaic tiles.   I would like to display these in something other than the HTML that is provided.   Possibly have 2 or three shown on the same window.   The full orthomosaic is huge (101 GB) and can only be opened in QGIS or ArcGIS or other software packages.  I tried to use Leaflet but it does not seem to be able to handle the KML with the file structure.   I may be doing something wrong.

https://support.pix4d.com/hc/en-us/articles/206860936-How-to-generate-the-Google-Maps-Tiles-and-KML
https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/javascript/examples/map-coordinates

Is there a clear direction on how to use these tiles other than open them with the supplied HTML file (which works well for this single file)?

[Image of the file structure of google_tiles


texts: Opening folder using QGIS action with Total Commander

texts:
Is it possible to open a folder, with QGIS' "run feature action", using Total Commander instead of explorer?
Something like:
explorer [%'C:\myfolder'%]
needs to be
C:\totalcmd\TOTALCMD.EXE [%'C:\myfolder'%]


texts: How to change the color ramp of a rule based styling in QGIS?

texts:
I use rule-based styling in QGIS, in order to do spatial quantile, computed in R.
If I want to change the color ramp, I need to either:
change every class color,
or set graduated then change the color ramp and go back to rule-based and re-enter my classes thresholds.

Is there a way to change the color ramp for a rule-based styling directly into the rule-based panel ?


texts: Retrieve speed and number of Lanes in Google Maps API, OSM data or any other stream?

texts: Is it possible to return the posted speed and number of lanes of a highway segment using Google Maps API, OSM data, or any other stream (paid for or free)?


texts: Performing health checks on ArcGIS Server?

texts:
ArcGIS Server setup in an enterprise environment:

i.e. Multiple SOCs, perhaps a fail-over setup, separate web server, SDE/DBMS on separate machine, etc.

Without going into the specifics on versions/software/operating systems/etc, I would like to know what people would recommend on performing "health checks" on this kind of scale setup.  Or perhaps diagnostics is a better word?

I was thinking it would be a good idea to run monthly checks (as opposed to consistent monitoring) to ensure everything is running smoothly and to perhaps identify bottlenecks or problem areas in the setup.  Ideally having a specific workflow that could be easily repeated, and then gather historical data to see if the setup has deteriorated over time.

I hope this is not too subjective a question, but I think there will be experts out there that will have "right" answers to this, and perhaps any discussion can be done via comments and deleted as need be?

To make the question more specific, please assume:

SDE has been setup optimally.
ArcGIS Server services have also been setup optimally (i.e. Cached where appropriate, scale ranges/definition queries, etc).

I was thinking of putting together a custom application that sits on the webserver and allows a user to hit a button which would do things like:

ping each endpoint (each IP, check XML from Server WSDL ok, various REST endpoints)

Fail/Pass to these tests
Perhaps repeat these pings, and show an average response time for each endpoint.

These tests could be performed in off-peak hours, and then generate a basic report on the outcomes.

I guess you could also swap out ArcGIS Server for any server technology (which got me thinking on perhaps this belongs in ServerFault).

I know ArcGIS Server has logging and statistics capabilities.
I should also point out that automatic alerts have already been put in place to notify when servers go down or are performing very badly.  I am really after some advice on what to test/identify in terms of diagnosing if the overall system is "healthy" (i.e. Is it running ok, is it worse than last month, can something be improved?)

I would be interested to know what people (who are experienced in multi-tier/high use setups) think of this.


texts: Does Leaflet.js uses WebGL for drawing on HTML5 canvas?

texts: If someone could explain how does the Leaflet.js library draws object (and map layers) on HTML5 canvas? Does it uses WebGL and its GPU accelerated usage of physics and image processing in any way?


texts: Using the field calculator to replace the character in QGIS

texts: How to use the field calculator to replace the character - in part of the values with the character "B" at the end of this value? I also want to replace the other values without symbol - replace with the symbol "F" at the end of these values. Like this -0345 to  0345B, 0341 to  0341F.


texts: Does the Load Data function in ArcCatalog automatically re-project the data?

texts:
If I have a feature class within a dataset in one coordinate system and using the Load Data function, load that data into a feature class of a different dataset that's in a different coordinate system ... does the data automatically re-project?

I'm thinking it must because it ends up in the correct location.

How does this work? I'm a little confused.


texts: Using Custom Functions in Python Toolbox?

texts:
I am trying to put together a python toolbox (Arc 10.1) and would like to use a defined function in my code.  The function is:

'sys' is imported at the top of the file
def listdirs(folder):
        return [d for d in os.listdir(folder) if os.path.isdir(os.path.join(folder, d))]

It's a handy little bit of code I picked up on stackexchange that returns a list of folders in a given path.

I can't seem to figure out how to integrate it into the toolbox, everywhere I put it seems to disagree with the toolbox.  Initially I had it in the def execute(self,parameters,messages) block.  That didn't work, so I moved it outside of that and into the class level.  I also tried putting it outside of the class.

The toolbox compiles without any errors (Using the 'Check Syntax' tool in the context menu in ArcCatalog) but when I run it my script fails the first time the function is called.  No specific error is thrown, but my script exits through the except statement and doesn't finish the try block

Should I put it into an external file and then import that like I do arcpy,sys,traceback etc?  Does anyone know if there are certain restrictions to using custom functions inside of a python toolbox and if so, what they are?

It seems that the real issue was that I was including sys and not os like I should have been.  Rookie mistake.  Anyhow, the script seems to be running nicely now, python toolboxes are great and are making my life much simpler.

Regarding the crux of my original question for any folks curious in the future - it doesn't seem to matter where you define a custom function in the python toolbox.  As long as it has the classes that ArcGIS needs to know what to do with it anything else is ephemera.


texts: How can I debug a geoprocessing service on the server?

texts:
I've a geoprocessing script that I'm trying to get working.  I've turned on Show Messages, so I can see how far in the script I've gotten before the submitted job fails, but it's not helping, as I'm getting errors that I don't understand exactly, because I don't know where they occurred.  Is there any way to debug server geoprocessing scripts on the server?

EDIT:
Error is occurring in this code, which worked fine locally.  I'm not getting either of the messages returned, so something seems to be going wrong with the layers.

for layer in mxdLayers:
    try:
        arcpy.AddMessage("Layer name is %s" % (layer.name))
        layer.visible = visibleLayers[layer.name]
    except:
        arcpy.AddMessage("Layer not set: " + layer.name)

Error message is Layer: Unexpected error

Edit 2:
The error is not in the code above.  The following code takes the parameter and stores the passed in features in a scratch gdb.  Currently this is passed as an empty string, as I haven't gotten to testing this part yet.

# Get the passed point graphics and save to scratch workspace
inPointFset = arcpy.GetParameterAsText(9)
if inPointFset == '#' or not inPointFset:
    inPointFset = None
else:
    arcpy.CopyFeatures_management(inPointFset, os.path.join(arcpy.env.scratchWorkspace, r"scratch.gdb\Points"))

This code then changes the data source of the first mxd layer (which is why it's blowing up; the first layer doesn't reference the points feature class in the scratch gdb), but since the parameter was an empty string, I'm not sure why this is evaluating to true.

mxdLayers = arcpy.mapping.ListLayers(mapDoc)
if inPointFset:
    arcpy.AddMessage("Points")
    mxdLayers[0].replaceDataSource(os.path.join(arcpy.env.scratchWorkspace, r"scratch.gdb"), "FILEGDB_WORKSPACE", "Points")


texts: Creating categorization by symbols using PyQGIS

texts:
I am trying to create a categorization by symbols
I have reviewed this address but I failed to adapt it
Apply symbol to each feature (Categorized symbol)

I need each point to be different according to the field. For example:

VALVULA
0..............circle
Aire...........triangle
0..............circle
Mariposa.......star
0..............circle
Alivio.........square
Aire...........triangle
0..............circle
Mariposa.......star
0..............circle
Alivio.........square

# Modifying simple symbol
layer6.renderer().symbol().setSize(2.5)
layer6.renderer().symbol().setColor(QColor("blue"))
layer6.renderer().symbol().symbolLayer(0).setShape(QgsSimpleMarkerSymbolLayerBase.Star)
layer6.triggerRepaint()
iface.layerTreeView().refreshLayerSymbology(layer6.id())

I only have this and it only works for me to change all the nodes of a layer.

Can you help me?


texts:
I am attempting to display Open Map Tiles (https://openmaptiles.org/downloads/#country) into my QGIS project but I am getting nowhere when attempting to load them into my project. Is there a specific way to load the vector tiles into the project after I have downloaded them?

The purpose of this project is to make an offline web application that utilizes GeoJSON data, as well as the Vector Tiles.


texts:
I am not sure if this forum is proper place for that kind of question but i hope to get some advice...

I looking for some scenario (examples, ideas) for urban game (location-based game) with usage of GPS devices. The thing is that the game should touch on spatial planning subject. It will be for teenager audience.


texts: writeOGR with a spatialpolygon simplified by gSimplify

texts:
I'm using gSimplify (rgeos package) to simplify the geometries of a shapefile. The funcion works good, but now I can't write the output in a new shapefile.
I tried some ways:

writeOGR(simplyshape, file, driver="ESRI Shapefile", layer='test')

I get

  obj must be a SpatialPointsDataFrame, SpatialLinesDataFrame or
      SpatialPolygonsDataFrame

and with:

writePolyShape(simplyshape, file)

I get:

  Error: is(x, "SpatialPolygonsDataFrame") is not TRUE


texts: Defining extent of SAGA proximity algorithm output

texts:
I try to calculate raster distance to restaurants using proximity in QGIS. I have the following data:

Binary Int Raster with restaurant location
Perimeter Shapefile

Using QGIS GDAL Proximity, I got this error message, which I don't understand:

Using SAGA GIS, I was able to create the Distance Raster, but only in a square defined by the uttermost 1-value pixels. I'd like to calculate in my whole perimeter.
In the following  image you see the cells (shown as point vectors for better visibility), distance raster and perimeter.

So, how can increase the area of the raster calculation?


texts: ogrinfo returns a negative coordinate for extent of mif data file

texts:
I'm trying to get the extent of a MIF file using ogrinfo. The MIF file is supposed to be in epsg:23030 projection. This is:

PROJCS["ED50 / UTM zone 30N",
    GEOGCS["ED50",
        DATUM["European_Datum_1950",
            SPHEROID["International 1924",6378388,297,
                AUTHORITY["EPSG","7022"]],
            AUTHORITY["EPSG","6230"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.01745329251994328,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4230"]],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    AUTHORITY["EPSG","23030"],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH]]

But with ogrinfo, I get this as SRS WKT

PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["European_Datum_1950",
            SPHEROID["International 1924",6378388,297],
            TOWGS84[-87,-98,-121,-0,-0,-0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

And this as extent

Extent: (-28050.000000, 3896708.000000) - (1139100.000000, 4874250.000000)

Outside the limits of epsg:23030 projection, and with negative coordinates.

I don't know if it's related, but the data file covers all Spain, and epsg:23030 doesn't cover all the country. There's a small part covered by epsg:23029. So, I guess the problem is related with the way the file was exported or georeferenced in the origin (MapInfo).

So, what could be the problem with my data?


texts:
I can't open my project, when I try to Open QGIS it was like "Python error"
and when QGIS is open there was "Authentication System: DISABLED. Resources authenticating via the system can not be accessed".

Then I try to open project it wrote that "There are still 4 unhandled layer(s), that will be lost if you closed now." I use Windows 10.


texts: Only last line of Oracle Spatial Multiline is drawn in QGIS

texts:
When I use QGIS to show Oracle spatial data, only the last line of an Multiline is shown. For instance, in this multiline geometry, only the segment from 20,10,0 to 30,10,0 is shown

insert into rr.DB_ORIGIN_PATHS( id, geom) select 3, SDO_GEOMETRY( 3002, NULL, NULL,
          SDO_ELEM_INFO_ARRAY( 1,4,2,  1,2,1,   4,2,1)
        , SDO_ORDINATE_ARRAY(          10,10,0, 20,10,0, 30,10,0 )) from dual;

What should I do to make QGIS show all the lines in my multiline geometry ?

This is a sample from the actual production data as a response to user30184:

select
        SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT( SDO_GEOMETRY( 3002, NULL, NULL,
        SDO_ELEM_INFO_ARRAY(1,4,3, 1,2,2, 7,2,1, 10,2,2),
        SDO_ORDINATE_ARRAY(193438.746000003, 326577.692999998, 0, 193437.195826577, 326578.284037557, 0, 193435.539999961, 326578.387000003, 0, 193433.818000015, 326577.163000011, 0, 193433.67635475, 326577.068722151, 0, 193433.522895758, 326576.995223623, 0 ))
        ,0.005) from dual;

Also gives the following:

54530 Point:0,Edge:1,

I see all kind of gaps when I use QGIS to look at this production data, but the software used to draw this data (Intergraph G/Technology) doesn't.