texts: Extent property is not working with openlayers tile layer

texts:
I have an application where the images are load through the tiles, and I successfully made the tiles and was able to show them on the map.
But never was able to set the extent of the tile layer.
Every time I set the properties, the layer doesn't load for the map.

 var mapSource = new ol.source.OSM({
    url: layerUrl    /// Local Tile Source
});
var mapLayer = new ol.layer.Tile({
    source: mapSource,
    zIndex: 1,
    visible: true,
    //   extent: extent,    ///Comment Line 1
});

//  mapLayer.setExtent(extent);   ///Comment Line 2
map.addLayer(mapLayer);

If I comment the Comment Line 1 and 2, tile layers load, but if I uncomment any of one line, tile layer doesn't load.

Do anyone know the exact reason and the solution for it??
P.S : I am using openlayers v4.6.4


texts: Duplicated layer not projected to canvas

texts:
I'm working with QGIS and have a layer that displays all addresses within a certain area as points on a map. I use the following code to duplicate the layer

layer = iface.activeLayer()
layer_type = {'0':'Point', '1':'LineString', '2':'Polygon'}
mem_layer = QgsVectorLayer(layer_type[str(address_layer.geometryType())] + '?crs=epsg:3011', 'duplicated_layer', 'memory')
feats = [feat for feat in layer.getFeatures()]
mem_layer_data = mem_layer.dataProvider()
attr = layer.dataProvider().fields().toList()
mem_layer_data.addAttributes(attr)
mem_layer.updateFields()
mem_layer_data.addFeatures(feats)
QgsProject.instance().addMapLayer(mem_layer)

The new duplicated shows up in the left hand side layer menu, but is not projected to the canvas. Why and how can I project this to the canvas? It has the same CRS as the layer I'm duplicating (EPSG:3011).

Also, the original layer contains all address points in this area. One field in the attribute table is called "Name" and contains the name of the building located at that address, but some addressess have no building in which case Name = NULL. The attribute table of the duplicated layer contains only those observations for which name is not equal to NULL. This is what I want, but I do not fully understand why the whole layer is not duplicated.

If there is a better way to obtain a new layer from the original layer, containing only the addresses where a building is located (i.e. Name!=NULL), suggestions on this is also welcome.


texts: How to get nodes in a particular city? [Open Street Maps - Overpass API / Nominatim]

texts: I wish to get nodes that belong to a particular city. I tried doing a radius search around the latitude and longitude of the city but that is just an approximation. Moreover the radius varies from one city to another. Is there a good way to do this using Open Street Maps?


texts: Rasterizing shapefiles with GDAL and Python?

texts:
I am trying to rasterize a shapefile, and write values from a specific column of the shapefile into the resulting GTiff.

Here is what I've done so far, but that only creates a GTiff of zeros.

from osgeo import gdal
from osgeo import ogr
from osgeo import gdalconst

ndsm = 'base.tif'
shp = 'polygon.shp'
data = gdal.Open(ndsm, gdalconst.GA_ReadOnly)
geo_transform = data.GetGeoTransform()
source_layer = data.GetLayer()
x_min = geo_transform[0]
y_max = geo_transform[3]
x_max = x_min + geo_transform[1] * data.RasterXSize
y_min = y_max + geo_transform[5] * data.RasterYSize
x_res = data.RasterXSize
y_res = data.RasterYSize
mb_v = ogr.Open(shp)
mb_l = mb_v.GetLayer()
pixel_width = geo_transform[1]
target_ds = gdal.GetDriverByName('GTiff').Create('my.tiff', x_res, y_res, 1, gdal.GDT_Byte)
target_ds.SetGeoTransform((x_min, pixel_width, 0, y_min, 0, pixel_width))
band = target_ds.GetRasterBand(1)
NoData_value = -999999
band.SetNoDataValue(NoData_value)
band.FlushCache()
gdal.RasterizeLayer(target_ds, [1], mb_l, options=["ATTRIBUTE=hedgerow"])

How do I get the values of column 'hedgerow' into the GTiff?
In addition, I have to use the option 'ALL_TOUCHED=TRUE' with RasterizeLayer. How does the gdal.RasterizeLayer call has to look with both options in it?

Edit: using gdal.RasterizeLayer(target_ds, [1], mb_l, options=["ATTRIBUTE=hedgerow", "ALL_TOUCHED=TRUE"]) runs without any problem, yet I only get zeros.


texts: subscript and superscript labeling in QGIS (v.2.18.2)

texts:
Could anybody help me to find out the solution:
how is possible to create labels with subscript and superscript, based on the attribute table (polygon shape)?
The example that I need to create is

This type of labeling is common in any kind of geological maps.
I'm using QGIS v.2.18.2

I will be extremaly glad to get answer, I hope it's possible.


texts: Generate maps from different columns of shapefile with QGIS

texts:
I have a shapefile with N columns describing different attributes of some features. I would like to generate a grid of maps, where each map is a different column. Visually, I'm thinking of something like this:

I can easily generate a single map manually with QGIS, but I would like to automate the process to be able to generate hundreds of such maps very quickly.

I started to code a PyQGIS script following this recipe, but I keep getting segmentation faults (I'm on MacOS X, QGIS Wien).

What would you recommend? I thought of using R, but the output tends to be visually less appealing than QGIS.


texts: Does related localization give more accuracy?

texts: Let's suppose that we use another device as an RTK base. Both base and rover are moving and communicate constantly (via 5G for instance). Besides they get common GPS error from the satellite on the same area. Will this set give an ability to localize them more precisely one from another (than traditional GPS gives) or not?


texts: How to save a plot to disc with tmap in R

texts:
I have made a plot with these lines

mainland
print(Bornhold, vp = viewport(x = 0.7, y = 0.5, width = 0.3, height = 0.2))

One is mainland and the other an island. How can I save it to one one png file. I have found this link with the documentation but it only takes one object but the plot has two objects?


texts: Zoom to selected feature extent using Carto and Leaflet

texts:
I am trying to use the getBounds and setBounds functions to zoom to the extent of a selected polyline feature in Carto. The feature has been selected using an SQL query. I want to zoom to the extent of the selected feature but it is not working! See code below:

// Add dropdown selection function
const selector = $(".js-dropdown-selector");
// Change SQL query with dropdown selection
selector.on('change',function(e){
  let value = $(".js-dropdown-selector option:selected").val();
  console.log("You have selected Route " + value + ".");
  if(value == 'all'){
    source.setQuery('SELECT * FROM aggregate');
  } else {
    source.setQuery("SELECT * FROM aggregate WHERE routenumbe = '" + value + "'")
  };
});
map.getBounds(source);
map.setBounds(getBounds);


texts: Generating a graphic for publication: How to change color and border weight of shapefiles in ArcGIS Pro 2.4.0?

texts:
I am trying to generating a graphic for publication. I am using ArcGIS Pro 2.4.0, and I am trying to draw a border around experiment plots using a rectangular shape file. As can be seen in the below image, I have drawn a black rectangle (arbitrarily) as an example.

I like this symbol format, but I'm trying to change the border to white, as well as change the border weight to a smaller size. How do I do this? I have tried clicking on "symbology" and "properties," but I don't see a way to change the border color/weight. I also looked on the "Appearance", "Labeling", and "Data" tabs at the top, but still didn't get anything.

Edit: Would it be a better idea to add a shape, instead of a shape file for this purpose?


texts:
Is there a tool / toolbox in ArcGIS to create quadrats on a population? I have a point feature classes with 1 billion points (divided to 10 almost equal feature classes) that I want to take samples from and I want to use quadrats to describe the data.

There is no optimal size for each quadrat that I want to create, I would rather go with the default value the software suggests.


texts: How to show/hide markers that are inside a function using js?

texts:
I have a map with a lot of markers that are pulled from this function:

function showResourcesByName(name) {
    for (var i = 0; i < markers.resources.length; i++) {
        var resName = markers.resources[i].name;

        if (resName == name) {
            var resIcon = icons.resources[i].icon;
            var resSize = icons.resources[i].size;
            var resPname = icons.resources[i].pname;

            var customIcon = L.icon({
                iconUrl: resIcon,
                iconSize: resSize, // size of the icon
                iconAnchor:   [resSize[0]/2, resSize[1]/2], // point of the icon which will correspond to marker's location
                popupAnchor:  [2, -resSize[1]/2] // point from which the popup should open relative to the iconAnchor
            });

            for (var j = 0; j < markers.resources[i].coords.length; j++) {
                var x = markers.resources[i].coords[j].x;
                var y = markers.resources[i].coords[j].y;

                L.marker([y, x], {icon: customIcon}).addTo(map).bindPopup(resPname);
            }
        }
    }
}

Then I use the code showResourcesByName("AITokarServer"); to show all markers for that selector (AITokarServer) for example.

I have a sidebar with all categories, and want to show/hide markers if I click on that category. For example, if I click animals, I want to show only the markers from the "animals" group. Also I want to put a show/hide selector on each marker group too, if I click on "Shigi" link I want to show only the Shigi markers, that are pulled from this function: showResourcesByName("AIShigiServer");

I trid this example here: http://plnkr.co/edit/LVzmRcsVZ79wZ78E5yBd?p=preview
But I don't know how to work with the function that I use and those selectors to show/hide.

And here is my full code with all the files. Each group is commented in the code where are the function  that pulls the icons.

http://plnkr.co/edit/dVgHt4VK0DnA30M3a8vq?p=preview


texts: Interactive Web Mapping for a Non Programmer?

texts:
I'm looking to map something similar to this:

http://tipstrategies.com/geography-of-jobs/

Does anyone know, first off, how this was put together?
From what I've researched so far, it seems this type of interactive, mouse-over web mapping involves SVG (?), HTML (?), or JavaScript (?) (or a combination of all three)? It doesn't seem wise to try to master all three of those before embarking on an interactive web mapping project. What I'd like to do is hone in on exactly what I need to know and do to make something like the above Geography of Jobs.

Anyone have a recommendation for precisely what type of code to learn, resources to help one write that code, etc., for interactive web mapping?

PS, I use ArcMap 10.3 to create my vectors.

PSS, I know very little about coding, but am very very open to learning.


texts: Listing project layers in standalone PyQGIS script

texts:
I'm trying to load an existing .qgs project and get a list of the layers inside. I seem to be able to open the project, but I can't get the list of layers. I'm a little confused as to the basic PyQGIS syntax, and the cookbook doesn't cover this specific example.

from qgis.core import *
from PyQt4.QtCore import QFileInfo

QgsApplication.setPrefixPath(r"C:\OSGeo4W\apps\qgis-ltr", True)
qgs = QgsApplication([], False)
qgs.initQgis()
# Get the project instance
project = QgsProject.instance()
# Open the project
project.read(QFileInfo(
        r'C:\path\to\project\project.qgs'))
print project.fileName()
# Get the layers in the project
layers = QgsMapLayerRegistry.instance().mapLayers()

print layers
qgs.exitQgis()

Currently, this just layers returns an empty dict, despite the fact that the project exists and has many layers in it.


texts: Hand drawn sketchy symbology styles for GIS software

texts:
Often times in planning projects, a hand drawn, sketchy look is desirable in order to convey the preliminary nature of a project.

Is anyone aware of any utilities/plugins for desktop GIS software (ArcGIS, QGIS etc.) that enable the user to apply a hand drawn, sketchy look to feature symbology without modifying the geometry?

Here is a product called M-Color for AutoCAD that does the sort of thing that I am looking for but it is of course CAD centric:

http://www.m-color.com/m-color/flash/hand_drawn.html

This sort of thing can also be achieved in SketchUp using styles. The best solution would be one that would eliminate intermediate steps, allowing the user to stay in a single software environment and avoid any intermediate export/import steps.


texts: Retaining integer values in raster when reclassifying values in QGIS?

texts:
I'm trying to build an attribute table for a raster in ArcMap.

The raster was created in QGIS because I needed to reclassify nodata pixels to have a zero value. ArcGIS Desktop is not letting me build the attribute table because the raster is not single band integer. It only has one band but somehow in the reclassifying process, the values got changed from integer to whole numbers or double, I'm not sure.

Is there a setting in QGIS to retain the integer value type when you reclassify so that you can later create an attribute table for it?


texts:
Given that today is GIS Day I was wondering what people had run/been to/ had ideas for as function for GIS day.

I have seen a few I have liked but any other stories would be awesome.


texts: Is it possible to install qgis plugin in a specific non default directory?

texts:
Is it possible to install a plugin to a specific directory e.g. D:\folder instead of the default one .qgis\python\plugin?

Furthermore, can QGIS access plugins from different directories and folders?


texts: Labels not rendered at all scales of map composer, QGIS 3.10

texts:
Like the title states, my labels aren't rendered at all scales of the map composer. This makes it very difficult to move and position them since I can't always see where they are.
Exporting the map after bringing it into the print layout has all the labels rendered, so they're there, they just aren't showing up for me to preview.
Render options has scale dependent and pixel-based visibility off, show all labels on, discourage labels from covering features off.
This issue only occurs at a non-zero rotations. At zero rotation, I can see and move labels fine at all scales.
E.g of issue.

First image at 1:5838303, second at 1:2919152.
So is there a way to enable label visibility in the composer at all scales?


texts: ArcGIS Spatial Analyst in arcpy - FATAL ERROR (INFDEF) DIRECTORY FULL

texts:
I have been running into this error in several geoprocessing scripts I've written lately. When I call a spatial analyst function I return this error:

FATAL ERROR (INFDEF)
DIRECTORY FULL

The exact function call doesn't seem to matter (but limited to Spatial Analyst functions). In this case the function is arcpy.sa.ExtractByMask, but arcpy.sa.TabulateArea has also caused this error.

What really confuses me is that about 10% of the time the script will succeed without error. I ran across this documentation on the Esri website, that discusses a limit to the number of GRID files that can be stored in a single workspace. This might help explain the problem I'm running into, but it still doesn't explain the intermittent nature of the error, or that there is no issue running these same functions as tools within the desktop software.

Potentially the error is related to an internal conversion of a vector feature to raster format. Is there a temporary work space that can be cleared, do these temporary conversions get written to disk space?

Has anybody else run into this issue?


texts: Creating Pie Chart with radius based on another field?

texts:
I have to symbolize my ares polygon feature class and create pie Chart based on the following values in ArcGIS 10.2 for Desktop:

Area    Tds_Calc    Free_Chlorine   Ph    Fluoride  Turbidity   Failures
========================================================================

Area A  39.87           23.47       5.14     0          2.57     5

Area B  28.54           54.88       10.24   3.41        1.95    19

Area C  72.05            5.12        0.39   0.79        1.57    12

Area D  1.61             61.29       8.06   14.52       1.61    25

Area E  15               66.67       3.33      5        6.67    30

Area F  55.56            27.78       16.67     0         0       9

Pie Chart will be created based on the 5 fields and the last field, i.e. "Failures" should be used as radius of the pie chart. Thus, we will have size of the Pie based on the "Failures" and rest of the fields will be depicting the share of parameters.

How can I achieve this task?


texts: Using a bounding-box filter on a Overpass union

texts:
I'm trying to filter the result of an Overpass union using a bounding box.

This works:

(
  rel["natural"="wood"]({{bbox}});
  rel["landuse"="forest"]({{bbox}});
);
(._;>;);
out;

But it requires me to repeat the bounding box twice (or even more often when there are additional queries in the union). Therefore, I'd like to apply the filter after the union, which doesn't seem to work:

(
  rel["natural"="wood"];
  rel["landuse"="forest"];
)({{bbox}});
(._;>;);
out;

The error message I get is

Error: line 4: parse error: ';' expected - '(' found.


texts: How can I improve image quality when using GDAL to generate Google Earth superoverlays?

texts:
I'm using the free version of Google Earth, so in order to create superoverlays of my large TIF images I have to use additional software.  Google suggests GDAL.

Using the instructions Google provides I generate my superoverlay in two steps.  Here's an example:

Step 1:

gdal_translate -of VRT -a_srs EPSG:3632 -gcp 0 0 1130000 770000 -gcp 10000 0 1135000 770000 -gcp 10000 10000 1135000 765000 MyImage.tif MyImage.vrt

Step 2:

gdal2tiles.py -p geodetic -k MyImage.vrt

Those commands don't specify PNG format, but apparently that's the default because that's what I get.  GDAL documentation has image quality options for some of its output formats (e.g., PNG, JPG) but I'm not sure how to apply them here because my gdal_translate command output format is VRT.

I understand that in generating superoverlays, there is resampling of the original image, and some quality loss might be expected.  But this is too much.  The original is so much better!

Is there some simple way to specify quality of the PNG images?  Or do I need to switch to JPG or other format?  If so, how?


texts: I am mapping utilities for a small town in Iowa. I have shape files of my water, gas and sewer lines, fire hydrants, ect. I also have a aerial view of the town that was taken in state plane. When I bring that aerial file into the project I cannot see any of my utilities that I have already set up. the shape files are set to NAD83/UTM Zone 15N EPSG:26915.I am just learning the software so any help would be appreciated.


texts: Add value in Attributestable without reducing the attributetable

texts:
I am working with the modelbuilder to create a model which can be used by people who do not have a lot of experience with ArcMap.

I have a Shapefile with a huge attributetable. I created a new column for a calculation.
What I want to do is set the value in the newly created column, depending on a value in another column and field to a special value.

This is how it works (simplyfied). The column a is the column I have already. Depending on the value of a field in a, I want to populate a field in column b with a specific value.

a    b
1
2    OHBN
3    OFX
4
5    HGF
5    HGF
2    OHBN
2    OHBN
1

I tried already the select tool and the the field calculator, but that recudes my attributes table to the selected columns. I dont want that to happen.

Any suggestions?


texts: Nested modelbuilder: parameters from submodel not showing up as inputs in main model

texts: I have a submodel that takes 3 numeric parameters and one raster as inputs. I want to nest this in a second model that iterates through a folder of rasters. However, when I drag the submodel into the main model, only the raster input shows up as an input parameter (even though I've also marked the numeric inputs as parameters). How do I get the three numeric parameters to show up as inputs to the submodel in the main model? See screenshopts of the submodel (first) and main model (second) below.


texts: What is lost when converting 12 bit imagery to 8 bit?

texts:
SPOT 6/7 satellite imagery is captured with a dynamic range of 12 bits per pixel per channel (ref). However almost all of the SPOT imagery I have seen in use has been 8 bits per channel, and split into RGB natural colour (Bands-321) and Near-infrared-RG false colour (Bands-432). What information is lost in this 12 to 8 bits conversion?
I'm wondering if we should be altering our request for purchase specifications to deliver the full bit depth.
Although I'm referencing SPOT imagery specifically the question is general and really applies to any satellite or sensor system.
Update: Cross posted to Gdal-Dev mailing list, http://osgeo-org.1560.x6.nabble.com/gdal-dev-What-is-lost-when-converting-12-bit-imagery-to-8-bit-tt5482829.html. Feel free to crib the good bits from that conversation and add to your answers.


texts:
I am working on a ESRI Flex based application that will display data from a Dynamic Map Service. It need to be Dynamic, since the end user should have the option to turn on & off layers. This is possible only with Dynamic Map services & not Tiled map services.

What are some of the steps that can be taken to increase the speed with which tiles are sent to the client by the server?

I am looking at ESRI's Dynamic Maps available on ArcGIS online, and they are quite fast. Any idea on how they get such good performance?


texts: Create MultiPolygon from Dataframe column


texts: MMQGIS Geocode Error: new-line character seen in unquoted field

texts:
I am running QGIS 2.10, and I'm trying to geocode a list of addresses using a .csv file in the MMQGIS geocoder. I just installed the plugin. When inputting my file, I immediately get a Python Error:

An error has occured while executing Python code:
Traceback (most recent call last):
  File "/Users/derekkaden/.qgis2/python/plugins/mmqgis/mmqgis_dialogs.py", line 1143, in browse_infile_dialog
    header = mmqgis_read_csv_header(self.iface, newname)
  File "/Users/derekkaden/.qgis2/python/plugins/mmqgis/mmqgis_dialogs.py", line 2605, in mmqgis_read_csv_header
    header = reader.next()
Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?

Does anyone know how I can fix this issue?


texts: How does a Spatial Reference System like WGS84 have an elipsoid and a geoid?

texts:
I found out that WGS84 is an ellipsoid with a "geoid component", but I'm unsure exactly how that can be.  This is from PostGIS in Action, Second Edition (pg. 64), but it seemed a bit vague.

  Fortunately, today the world is settling on the World Geodetic System
  (WGS 84) and Geodetic Reference System (GRS 80) ellipsoids, with WGS 84 becoming the standard of choice. WGS 84 is what all GPS systems are based on. [...] To call WGS 84 simply an ellipsoid isn’t quite accurate. The WGS 84 GPS systems we use have a geoid component as well. The present WGS 84 system uses the 1996 Earth Gravitational Model (EGM96) geoid and is the ellipsoid that best fits the geoid model for the selected survey points in the set.

How does an elipsoid coordinate system also have a "geoid component"?


texts:
I'm having trouble with one SQL query I'm using on a shapefile in my VRT layer. My goal is to import several shapefiles to a PDF using OGR, GDAL and Python.

My shapefile has follwing structure: shapefile1.shp: {FID: integer, Type: string, Name: string, Show: integer ...}. Nothing out of the usual, no spaces, no underscores, no points.

If I call ogrinfo on a OSGeo Shell, the shapefile behaves nominally and all attributes are shown, i.e:

> ogrinfo -sql "SELECT Type AS foo FROM shapefile1" shapefile1.shp

 Layer name: shapefile1
 Geometry: Point
 Feature Count: 19
 [...]
 foo: String (150.0)
 OGRFeature(shapefile1):1
 foo (String) = correctString
 POINT (coordinates)
 [...]

But if I use the same SQL query on my VRT file, I get following error:

ERROR 1: Unrecognized field name Type.
ERROR 1: SQL statement failed, or returned no layer result:
SELECT Type AS foo FROM shapefile1
ERROR 1: Invalid geometry field index : 0

This is my VRT file:

<OGRVRTDataSource>
    <OGRVRTLayer name="points">
        <SrcDataSource relativeToVRT="1">shapefile1.shp</SrcDataSource>
        <SrcSQL>SELECT Type AS foo FROM shapefile1</SrcSQL>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryType>wkbPoint</GeometryType>
    </OGRVRTLayer>
</OGRVRTDataSource>

First I thought that OGR doens't like attribute names as "FID", "Type", "Name" and so on. But even if i change the SQL query to SELECT Show AS foo FROM shapefile1 the error keeps appearing. Even on an attribute called Azimuth, which should definetly not be a problem.

Any ideas on what I might be doing wrong?


texts: Adding points to point vector layer using QGIS?

texts: I have a point layer with multiple data points in QGIS, but I want to add some extra data points to it and adjust some info that we missed because the ground was wet and we needed to go around it.  I can't figure it out.  I would think you would go in edit mode and have an option to add points, but can't find it.


texts: Adding script with math functions to ModelBuilder?

texts:
I am very new to ModelBuilder + python.

I am trying to make a model. Don't know if it matters to upload it. If you want i can.

I want to calculate variance from a points-shapefile with elevation data and want to add this script to my model:

### x = (column: GRID_CODE, from a shapefile from model builder)

average = sum(x) / len(x)
variance = sum((average - value) ** 2 for value in x) / (len(x)-1)

### output to a new shapefile

How could i make this script working? Searched a lot here and at arcgis help but couldn't find something.

Can't understand how to "grab" data from shapefile, process them through script and then print the output.


texts: Why can't PHP insert new geometry on PostGIS?

texts:
(Copied this question from stackoverflow, since it may have more answers here.)

I'm using ogr2ogr to upload a GPX file to PostGIS.

When I do it on command line (Ubuntu 14.04), it works fine.

ogr2ogr -append -f PostgreSQL PG:"host=... dbname=... user=... password=..." 2016-04-26_15-32-01.xml

When I do it on PHP (5.5.9),

exec("ogr2ogr -append -f PostgreSQL PG:\"host=".HOST." dbname=".DATABASE." user=".USER." password=".PASSWORD."\" /var/www/html/plantas/gps/2016-04-26_15-32-01.xml 2>&1",$output,$retval);

it gives the following error:

ERROR 1: INSERT command for new feature failed.
ERROR: Geometry SRID (0) does not match column SRID (4326)

Command: INSERT INTO "waypoints" ("wkb_geometry" , "ele", "time", "name", "cmt", "desc", "sym", "type", "gpxx_waypointextension", "wptx1_waypointextension", "ctx_creationtimeextension") VALUES ('010100000000008C76C2DF4EC00100C0A13A450E40'::GEOMETRY, 594, '2015/11/16 17:22:09+00', 'ROP_2904', '08-NOV-15 9:56:51
PONTO 60', '08-NOV-15 9:56:51
PONTO 60', 'Flag, Blue', 'user', ' SymbolAndName ', ' SymbolAndName ', ' 2015-11-16T17:22:09Z ') RETURNING "ogc_fid"
ERROR 1: Terminating translation prematurely after failed
translation of layer waypoints (use -skipfailures to skip errors)

What am I missing here?

EDIT

I tried Mike T suggestion:

$linha = "ogr2ogr -append -f PostgreSQL PG:\"host=".HOST." dbname=".DATABASE." user=".USER." password=".PASSWORD."\" -s_srs EPSG:4326 /var/www/html/plantas/gps/2016-04-26_15-32-01.xml 2>&1";
// or $linha = "ogr2ogr -s_srs EPSG:4326 -append -f PostgreSQL PG:\"host=".HOST." dbname=".DATABASE." user=".USER." password=".PASSWORD."\" /var/www/html/plantas/gps/2016-04-26_15-32-01.xml 2>&1";
exec($linha,$output,$retval);

to no avail:

ERROR 1: INSERT command for new feature failed.
ERROR: Geometry SRID (0) does not match column SRID (4326)

What's really strange is that exactly the same command works on terminal. So I think PHP might have some issue, perhaps a missing library or permission?


texts:
I am following the procedure on this help page:

http://resources.arcgis.com/en/help/main/10.1/index.html#//00390000002z000000

However when at step 3, I can't seem to find the Define Line Portion tool.

Can someone please help locate that tool?

I've also posted the picture of how my interface looks like.


texts: ArcGIS giving measured distances and the scalebar incorrectly

texts: I am currently using ArcGIS 10.1 and am struggling to be able to measure distance or set a scale bar correctly. Its currently giving me absurd results orders of magnitudes to small (0.5m etc). All my layers are in OSGB36 Transverse Mercator (BNG) (at least thats what Arc is telling me). I am struggling to figure our what is causing the issue although I'm thinking it must be something to do with the layers and their coordinate reference systems. Any ideas?


texts: Difference between raster() and readGDAL()?

texts:
I am new in working with rasters and after having trouble working with them i'd like to know the difference between those two import functions.

for example i did this

  library(raster)
  s<-raster("random.TIF")

when trying to plot it, returns the correct image,
but  trying this:

s<-readGDAL("random.TIF")

returns a black image.


texts:
I have a Polygon (shapely) and the centroid of this Polygon (with longitude and latitude).
Is there any way to count radius of the Polygon?


texts: Filtering polyline features by direction using ArcGIS 10.2 (or ArcPy)

texts:
I have a polyline shapefile depicting a real road network. In many parts it has two 100 % overlapping segments in opposite directions, representing the two driving directions (In picture: red segments). The perpendicular lines are the start and end points of the segments.

How could I easily select the red segments that share the direction of the black line? (In picture: those red segments that are directed towards North East). So far I can only automatically find the overlapping (with black line) red segments of both directions.

I have a route as a 1-part line (In picture: black line).
This is derived from the same road network so the geometry is actually overlapping with the red segments.

I was thinking about this kind of a process, after finding the red segments that overlap with the black polyline:
1) For each red segment
          calculate the azimuth (angular direction)
2) Determine the end points of the red segments
 3) Split the black line at both end points of the red segments
4) For each split black segment
              calculate the azimuth
              determine the overlapping 2 red segments
                  copy the red segment that has the same azimuth (or withing a marginal)

BUT, is there an easier way or a tool?
I would like to do this using ArcMap 10.2 Standard or ArcPy.

The route might be twisty so I can't use a global azimuth.
I need to filter a complete road network (red lines) with n routes (black lines).

Picture:


texts: Working around MeasureOnLine function not being in ArcPy at earlier version?

texts:
I have created the following tool to use in version 10.1:

def getParameterInfo(self):
        """Define parameter definitions"""

        param0 = arcpy.Parameter(
        displayName="Input Table",
        name="Input_Toolbox",
        datatype="GPLayer",
        parameterType="Required",
        direction="Input",
     multiValue=False)

        return [param0]

def execute(self, parameters, messages):
        """The source code of the tool."""

     fc = parameters[0].value
     oidField = arcpy.Describe(fc).oidFieldName

     with arcpy.da.SearchCursor(fc,["SHAPE@","OID@"]) as search:
             for line in search:
                  geometry = line[0]
                  with arcpy.da.UpdateCursor(fc,["SHAPE@","SHAPE@M","OID@"],explode_to_points=True,where_clause = '{0}={1}'.format(arcpy.AddFieldDelimiters(fc,oidField),line[1])) as update:
                            for point in update:
                                point[1] = geometry.measureOnLine(point[0])
                                 update.updateRow(point)

But everytime I use it, I get this error:

  AttributeError: 'Polyline' object has no attribute 'measureOnLine'

Does anyone know what is the problem? fc is a feature class with polylines.

The problem is MeasureOnLine is a 10.2.1 feature and I have to use 10.1.

Does anyone know what to do?


texts: Importing full ready map with carto.js v4?

texts:
How do I import a whole map that is on my carto to edit it with carto.js v4?

It's pretty sad having to SQL to build the map from scratch.


texts: Exporting the data in pbf format, which is imported using osm2pgsql tool

texts:
I have imported the pbf data to postgres using osm2pgsql.
osm2pgsql -U postgres -W -d osmdbv4 --output-pgsql-schema=db_snapshot --latlong -H localhost -C 20480 --middle-schema=db_snapshot -S default.style  --prefix=aut --hstore-all --number-processes=24 --slim "country-latest.osm.pbf"

Now I want to create pbf file from this database. I see the option of osmosis, but the database schema of osm2psql and osmosis are different.
How I can export the data in pbf format, which is imported using osm2pgsql tool?


texts: How to rotate sphere when using Vertical Near Side Perspective projection?

texts:
Situation

Data is currently displayed on a globe using the Vertical Near Side Perspective projection with a blue circle as a backdrop.

Problem

I would like to 'rotate' the globe by altering the projection parameters without causing the shape files to shift away from the backdrop. The parameter that was changed was the Longitude_Of_Center


texts: How to load data in a record set from a table?

texts:
I'm developing a python tool in ArcGIS 10.3 .I want to show selected record that are result of the select by attribute.
Is it possible to show the selected records in the record set ?

import arcpy
class ToolValidator(object):
  """Class for validating a tool's parameter values and controlling
  the behavior of the tool's dialog."""

  def __init__(self):
    """Setup arcpy and the list of tool parameters."""
    self.params = arcpy.GetParameterInfo()

  def initializeParameters(self):
    """Refine the properties of a tool's parameters.  This method is
    called when the tool is opened."""
    return

  def updateParameters(self):
    fc = self.params[0].value
    lineCode = self.params[1].value
    recordset = self.params[2].value

    whereClause = 'Number =%s ' % int(lineCode)
    arcpy.SelectLayerByAttribute_management(fc, "NEW_SELECTION", whereClause)

    #  Here i want to load the selected records in a record set ........ !??

    return

  def updateMessages(self):
    """Modify the messages created by internal validation for each tool
    parameter.  This method is called after internal validation."""
    return


texts: Keep getting a black tiff when rasterizing a shapefile with GDAL

texts:
I have a shapefile that looks like the follows:

And here's how the attribute table looks like:

I'm trying to rasterize it with a reference raster and my code is as follows:
input_vector = city_mobile_dir
output_raster = f'../../../data/world_statistics/output_data/city_mobile_gdf_{net}_{iso}.TIF'
ref_raster = f'{source}/world_pop/jpn_ppp_2019_UNadj.tif'
raster_df = gdal.Open(ref_raster, gdal.GA_ReadOnly)
vector_driver = ogr.GetDriverByName('ESRI Shapefile')
vector_df = vector_driver.Open(input_vector, 0)
vector_layer = vector_df.GetLayer()
# fetch number of rows and columns
ncol = raster_df.RasterXSize
nrow = raster_df.RasterYSize

# fetch projection and extent
proj = raster_df.GetProjectionRef()
ext = raster_df.GetGeoTransform()

# create the raster dataset
memory_driver = gdal.GetDriverByName('GTiff')
out_raster_df = memory_driver.Create(output_raster, ncol, nrow, 1, gdal.GDT_Byte)

# set the ROI image's projection and extent to our input raster's projection and extent
out_raster_df.SetProjection(proj)
out_raster_df.SetGeoTransform(ext)

# fill our output band with the 0 blank, no class label, value
band = out_raster_df.GetRasterBand(1)
band.SetNoDataValue(-9999)
band.FlushCache()

# rasterize the shapefile layer to our new dataset
status = gdal.RasterizeLayer(out_raster_df,
                             [1],
                             vector_layer,
                             None, None,
                             [0],  # burn value 0
                             ['ATTRIBUTE = FID'])

if status != 0:
    print("Failed")
else:
    print("Success")

But no matter what I tried, I kept getting an entire black tiff. I looked through other similar problems on the website but their solutions don't work on mine either. Unfortunately I'm new to GDAL so I might not have been able to identify the mistake I made in my code. Thanks a lot for helping me!


texts: Trying to produce a map of Household behavior with identified explanatory variables held constant/equal

texts:
I have a map of the dependent variable, median household vehicle travel, and independent household characteristic variables, median income, mean household size and median age, aggregated to census areas. I'm looking to find a way of controlling for these demographic variables and produce a map of the vehicle travel assuming equal household properties across a city. The goal is to estimate how much travel a hypothetical household would carry out if they moved to different areas of a city.

Using spatial statistics and the geographically weighted regression tool I have produced a regression equation relating these variables to travel with an R2 value of ~0.5. The resulting residuals are spatially autocorrelated which is what I want as it shows some missing explanatory variable is influencing travel. It is the influence of this unexplained variable that I need to map, however, simply mapping the residual doesn't really tell me how much travel an average household would carry out, only that certain areas travel more than or less than what is expected from the regression off household characteristics.

I don't have much stats knowledge, but I'm guessing there is a way to do this. Could I use the resulting regression equation, R2 value or predicted and observed travel values to estimate the travel of an area assuming average household characteristics? Would something along the lines of the following work:

LocalR2*(Intercept+Coefficent1*AverageHHSize+Coefficent2*AverageIncome)+(1-LocalR2)*ObservedTravel

Or will I need to delve deeper into the statistical methods.


texts: Setting parameters in Script Tool using Python?

texts:
I hate to bug you all with the same problem over and over again but I run into a new problem everytime I make a slight change to the code. All I did to the code below was to replace field names to match the original feature class. Now it doesn't work. It gave me

<type 'exceptions.RuntimeError'>: ERROR 999999: Error executing function.
Failed to execute (Script).

I tried adding Try/Except to the code which didn't give me any error messages but didn't give me any results either.

I'm not sure what's going on? Any help to figure this out will be very much appreciated.

import arcpy, os
Try:
roadpath = arcpy.GetParameterAsText(0)
tablepath = arcpy.GetParameterAsText(1)

datapath = os.path.split(tablepath)[0]
tablename = os.path.split(tablepath)[1]
rows = arcpy.SearchCursor(roadpath,"FROMLEFT <> 0 AND TOLEFT <> 0","","STREET_NAME_ID;FROMLEFT;TOLEFT","STREET_NAME_ID A;FROMLEFT A;TOLEFT A")
arcpy.env.workspace = datapath

if arcpy.Exists(tablename):
    arcpy.DeleteRows_management(tablename)
else:
    arcpy.CreateTable_management(datapath,tablename,roadpath)
    arcpy.DeleteField_management(tablename,"SHAPE_Length")

irows = arcpy.InsertCursor(tablename)
first = True
for row in rows:
    if first:
        first = False
    else:
        GISID = row.GIS_ID
        stid = row.STREET_NAME_ID
        fl = row.FROMLEFT
        tl = row.TOLEFT
        if stid == prev_stid and fl <= prev_tl:
            irow = irows.newRow()
            irow.GIS_ID = prev_GISID
            irow.STREET_NAME_ID = prev_stid
            irow.FROMLEFT = prev_fl
            irow.TOLEFT = prev_tl
            irows.insertRow(irow)
            del irow
            irow = irows.newRow()
            irow.GIS_ID = GISID
            irow.STREET_NAME_ID = stid
            irow.FROMLEFT = fl
            irow.TOLEFT = tl
            irows.insertRow(irow)
            del irow
    prev_GISID = row.GIS_ID
    prev_stid = row.STREET_NAME_ID
    prev_fl = row.FROMLEFT
    prev_tl = row.TOLEFT
del rows, irows
except:
print arcpy.GetMessages()


texts:
I am working in a Django and have done a query to get a list of geometries from a table. I want to iterate through that list and insert them into my new query. My notional polygon is:

0103000020E6100000010000000A000000C3691AE97DAB434010D59670EBAB4C40A2D701742DE041403B9994F129824C401768318F8BEE41408A0A316D2EDF4B401F6D5C4CDF0E424032402134D5854B406264439762A4424073E3BF7E573F4B40CA3E65381A4E4340391B287128384B4098C3C80CD2234440585FB4D32E374C4098C3C80CD2234440585FB4D32E374C40FE49A2AD88F143406775822944974C40C3691AE97DAB434010D59670EBAB4C40

My latest attempt for a query is:

SELECT author, photo_id, user_id FROM point_database WHERE ST_Intersects(point_database.point_geom, ST_GeomFROMWKB('POLYGON(0103000020E6100000010000000A000000C3691AE97DAB434010D59670EBAB4C40A2D701742DE041403B9994F129824C401768318F8BEE41408A0A316D2EDF4B401F6D5C4CDF0E424032402134D5854B406264439762A4424073E3BF7E573F4B40CA3E65381A4E4340391B287128384B4098C3C80CD2234440585FB4D32E374C4098C3C80CD2234440585FB4D32E374C40FE49A2AD88F143406775822944974C40C3691AE97DAB434010D59670EBAB4C40)'))

This resulted in the less than helpful

 ERROR: Invalid endian flag value encountered.

SQL state: XX000

I know I could typically do something along the lines of ST_Intersects(point_database.geom, polygon_database.geom) but not sure how to structure a query with the ewkb hex especially when passing it through a secondary loop in a greater django framework.


texts: List all Feature datasets & feature classes from a single geodatabase into CSV

texts:
I have prepared a python code and I got the following errors:

  "Parsing error IndentationError: expected an indented block (line 11)"

and

  "Runtime error Traceback (most recent call last):   File "",
  line 10, in  TypeError: 'NoneType' object is not iterable"

The purpose of the code is to list all feature datasets & feature classes from a single geodatabase into CSV.

import csv, arcpy, os
from arcpy import env

env.workspace = "I:\J_Prashant's External HD\High Speed Rail\Task from Greg Campbell\Layers\HST_BP_GIS_Data.gdb"

datasetList = arcpy.ListDatasets('*','Feature')

for dataset in datasetList:
    arcpy.env.workspace = dataset
    fcList = arcpy.ListFeatureClasses()
    for fc in fcList:
        print arcpy.env.workspace,fc

csv_out = open('I:\\python\\List-Feature-Class\\test2.csv', 'wb')
mywriter = csv.writer(csv_out)
rows = zip(arcpy.env.workspace,fc)
mywriter.writerows(rows)
csv_out.close()


texts: Qgis raster calculator not giving output

texts:
I want to calculate some result using QgisRasterCalculator and using the code mentioned below.Problem is i am not getting any output raster also if i use this formula in raster calculator it gives nan.Please help.My code is

from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry
bohLayer = iface.activeLayer()
entries = []
# Define band1
boh1 = QgsRasterCalculatorEntry()
boh1.ref = 'boh@1'
boh1.raster = bohLayer
boh1.bandNumber = 1
entries.append( boh1 )

## Define band2
#boh2 = QgsRasterCalculatorEntry()
#boh2.ref = 'boh@2'
#boh2.raster = bohLayer
#boh2.bandNumber = 2
#entries.append( boh2 )

# Process calculation with input extent and resolution
calc = QgsRasterCalculator( 'Float("%LE71970282002228EDC00_B6_clip.TIF (2)%" * 0.03705882) + 3.2', 'D:\UHI Plugin work\test\output\outputfile.tif', 'GTiff', bohLayer.extent(), bohLayer.width(), bohLayer.height(), entries )
calc.processCalculation()


texts: Rotating symbols by Data Frame coordinate system in ArcGIS Pro?

texts:
Is it possible to ensure that symbols rotated by attribute (compass azimuth) retain their proper orientation when the Data Frame coordinate system changes?

Answers have been provided for this issue for ArcMap and for labels in ArcGIS Pro, but not for symbols in ArcGIS Pro.

As an example, I have a map with linear ESRI Cartography character symbols that are set to rotate in a "Geographic" rotation style so that the line points the compass direction specified by a field in the attribute table. This works completely fine in a geographic coordinate system where N is always up (WGS84). Unfortunately, when I change to a projected coordinate system (Lambert Conformal Conic North America), the lines no longer point in the correct compass directions on the map. For example, a line that should point N will point up on the screen even though in Alaska N is oriented to the top-right on the map in Lambert. In a projected coordinate system the symbols point the "wrong" way relative to all of the other features.

It is supposedly possible to correct this problem in ArcMap 10 (using the ArcMap Advanced Settings program) but I have not been able to do it in ArcGIS Pro.


texts: MapServer: UV_ANGLE not calculated correctly?

texts:
I'm following this example given on the MapServer website.

But the angle of the raster is incorrect:

The data is my grib files is correct, and should not yield these perfect opposite directions. I have confirmed this with a GRIB viewer.

My layer definition:

LAYER
      NAME "grib_direction_sample"
      TYPE POINT
      STATUS DEFAULT
      CONNECTIONTYPE uvraster
      DATA "/var/www/mapserver/data/grib/routeguard/4nwwin99_2013110412.grb2"    #u-component of wind @ Ground or water surface
      PROCESSING "BANDS=1.3,1.4"
      PROCESSING "UV_SPACING=40"
      #PROCESSING "UV_SIZE_SCALE=0.8"

      CLASS
        STYLE
          SYMBOL "arrow"
          ANGLE [uv_angle]
          SIZE [uv_length]
          COLOR 255 0 0
          #POLAROFFSET [uv_length_2] [uv_angle]
        END # style
      END # class

      PROJECTION
          #"init=epsg:4326"
          "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +pm=-360"
      END
END # layer

What am I missing here?


texts: How to get the elevation of the areas in a raster file from SRTM?

texts: I have an SRTM elevation map. How do I get the elevation of each point in the map? I am using GRASS. Is there a GRASS script to do such?


texts: How to create buffers having regard to topography with QGIS

texts:
I want to create buffers of 25 kilometers around points in a point-shapefile with QGIS.

My problem is that I don't need an air-line distance of 25 km around the points, but a "real distance" having regard to the DEM of the area.

In other words, it should be visible, how far (in air-line distance) I could walk in each direction of a point, always walking exact 25 km.

I loaded the DEM raster in my project and buffered my point-shapefile, but I have no idea how to combine both, so that QGIS fits the buffers into the elevation model.

Does anyone know a solution?


texts: Define location and name of cell statistics output

texts:
I have a list containing 3 rasters. Running the cell statistics operation on this results in a raster in the default database. My work involves getting the numbers in the count column. I don't want to generate the raster. I just want to extract values from the output in memory if possible.

outrast=CellStatistics(rlist,"SUM")

output raster name is "sumco_ras" which seems to be a default name. "outrast" is only layer name I think.

Using SearchCursor I can extract the values but it is getting complicated when the output raster is in another database with a different name.

Ideal solution would be an output in the memory workspace

Version:10.2.2


texts: Rasterize a shapefile to match an existing raster

texts:
I want to work with ecoregions (described in the shapefile from https://ecoregions2017.appspot.com/) in combination with a digital elevation model, to generate a least-cost path. For that purpose, it seems very useful to convert the ecoregions shapefile into raster tiles that match my DEM.
It looks like I can get the srs info from the DEM by running
gdalsrsinfo -o wkt /vsizip/elevation/GMTED2010/GMTED2010S30W060_150.zip/30s060w_20101117_gmted_med150.tif > GMTED2010S30W060_150.wkt

and then rasterize the shapefile around there by
gdal_rasterize -l Ecoregions2017 -te -30 -60 -10 -30 -ts 7200 4800 -a OBJECTID -a_nodata 999 -a_srs GMTED2010S30W060_150.wkt -ot UInt16 -of GTiff /vsizip/ecoregions/Ecoregions2017.zip /tmp/ECOREGIONSS30W060_150.tif

However, extracting the -te -30 -60 -10 -30 from somewhere in a batch process sounds like a pain (and the -ts should also be available from the TIFF). How can I use the metadata contained in 30s060w_20101117_gmted_med150.tif to automatically set the extent for this batch process?


texts:
I've just opened a feature request, but maybe someone knows a temporary solution.

In QGIS 2.2 one can change the default font of the Print Composer (through the Menu Option -> Setttings). But I think it is not possible to do the same with labels.

This is a little bit boring when one has to export a project from a Linux to a Windows machine. In Linux (debian in my case) the default font in Cantarell, font that is not recognized by Windows. This cause a boring error message. No big deal, just annoying.

Thanks


texts: Adding new ROLES and USERS through REST in GeoServer

texts:
I use GeoServer stable version 2.14.1 and get error messages when trying to add new roles and users via REST.
I suspect that the GeoServer REST documentation is buggy. When I call the REST interface of my GeoServer instance, I can see that the roles are accessible through the URI http://localhost:8080/geoserver/rest/security/roles. Users are under the URI http://localhost:8080/geoserver/rest/security/usergroup/users.
I can query both resources via GET request, but adding new resources via POST or PUT will not work. A POST request to create new roles ends up with status code 405 (Method not allowed). After trying to create new users comes the status code 500 (Internal Server Error).
For this, the GeoServer-REST documentation has been referencing the paths

/roles/roles/{role}

for new roles (API-Doc) or

/usergroup/users/

for new users (API-Doc) since several GeoServer versions. But when I use them, this always ends with Status code 404 (Not Found).
How can I add new roles and users through REST in GeoServer?
The workarround from @implssv in Creating new GeoServer user through rest api? does not work for me.


texts:
I am running a Geoserver2.12 with tomcat7 in a container. I am trying to enable CORS inside the web.xml file of my geoserver installation but whenever I add these lines in the file:

<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

and restart my tomcat then I am not able to access the geoserver (getting a 404) error. Any ideas what is causing this error?


texts: Getting duplicate values when joining .csv spreadsheet to .shp map layer using QGIS?

texts:
I need to join .csv/spreadsheet data to the .shp map layer. The join itself isn't a problem with same join & target values (building) but some data goes missing because of duplicate values.

For example, if the map data is buildings and spreadsheet contains information about workers: info from workers from the same building gets missed because the join is done by the value of the building to combine spreadsheet to the building map layer.

How do I present all the information about workers in the map even if the info is from the same building?

The join isn't possible with any other value.

For example


texts: Unable to insert geometry point using TypeScript and MassiveJS

texts:
I am trying to simply trying to validate a point before I actually insert it into the db.
I am using the following:

TypeScript: 3.5.2
MassiveJS: 6.4.0
PostgreSQL: 11
PostGIS: 2.5

        const validGeom = await db.st_isvalidreason(await db.st_point(commonWeather.reqLon.toFixed(4),commonWeather.reqLat.toFixed(4)))
        console.log(validGeom)

I am consistently getting the following error:
error: parse error - invalid geometry
    at Connection.parseE (/app/node_modules/pg/lib/connection.js:581:48)
    at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:380:19)
    at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:116:22)
    at Socket.emit (events.js:223:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:181:23) {
  name: 'error',
  length: 151,
  severity: 'ERROR',
  code: 'XX000',
  detail: undefined,
  hint: '"{"" <-- parse error at position 2 within geometry',
  position: '43',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'lwgeom_pg.c',
  line: '177',
  routine: 'pg_parser_errhint'
}


texts: Failed to install Potree on Ubuntu 20.04.1 LTS

texts:
I am trying to install Potree on my computer and I am stuck. I am following these instructions:
$ sudo apt-get install python-software-properties git
$ sudo apt-get install build-essential cmake g++
$ sudo apt-get install libboost-all-dev
$ sudo apt-get install cmake-curses-gui
$ sudo apt-get install gcc

LAStools:
$ git clone https://github.com/m-schuetz/LAStools.git
$ cd LAStools/LASzip
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make

Potree Converter:
$ git clone https://github.com/potree/PotreeConverter.git
$ cd PotreeConverter
$ mkdir build && cd build
**$ sudo cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=/home/ubuntu/LAStools/LASzip/dll -DLASZIP_LIBRARY=/home/ubuntu/LAStools/LASzip/build/src/liblaszip.so ..**
$ sudo make
$ sudo make install
$ sudo ln -s ~/LAStools/LASzip/build/src/liblaszip.so /usr/lib
$ PotreeConverter -h

Anyway, I installed LAStools and I have problem with Potree. When I run command:
sudo cmake -DCMAKE_BUILD_TYPE=Release -DLASZIP_INCLUDE_DIRS=/home/ubuntu/LAStools/LASzip/dll -DLASZIP_LIBRARY=/home/ubuntu/LAStools/LASzip/build/src/liblaszip.so ..
I get:
-- Build type is 'Release'
-- Compiler is not EMSCRIPTEN
CMake Warning at Converter/libs/brotli/CMakeLists.txt:319 (message):
  Test file tests/testdata/alice29.txt does not exist.

CMake Warning at Converter/libs/brotli/CMakeLists.txt:319 (message):
  Test file tests/testdata/asyoulik.txt does not exist.

CMake Warning at Converter/libs/brotli/CMakeLists.txt:319 (message):
  Test file tests/testdata/lcet10.txt does not exist.

CMake Warning at Converter/libs/brotli/CMakeLists.txt:319 (message):
  Test file tests/testdata/plrabn12.txt does not exist.

CMake Error at CMakeLists.txt:58 (find_package):
  By not providing "FindTBB.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "TBB", but
  CMake did not find one.

  Could not find a package configuration file provided by "TBB" with any of
  the following names:

    TBBConfig.cmake
    tbb-config.cmake

  Add the installation prefix of "TBB" to CMAKE_PREFIX_PATH or set "TBB_DIR"
  to a directory containing one of the above files.  If "TBB" provides a
  separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/PotreeConverter/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/PotreeConverter/build/CMakeFiles/CMakeError.log".


texts: Accessing python module for QGIS 3.0 topology checker from Python script?

texts:
There is a similar question Access QGIS Topology Checker from Python, however this user was wanting to run the topology tool while I want to import certain rules. For example in arcgis

  arcpy.AddRuleToTopology_management(for_validation, "Must Not Self-Overlap (Line)", nfc)

I saw this question about accessing qgis plugins from python. So I know I need to import the module, but I'm unsure the name of the module, or if it is written in C++ so importing into python directly is not possible.


texts: Timezone map including territorial waters

texts:
I have a project that requires timezone lookup for given coordinates. http://efele.net/maps/tz/world/ is an awesome resource however the polygons only cover land. Sydney Harbour is considered seas in the shapefile, even though parts of it are 5km from the coast.

I'm currently solving it in PostGIS with;

SELECT *
FROM timezones
WHERE ST_DWithin(geom,ST_SetSRID(ST_Point(151.268421, -33.840613), 4326)::geography, 22224)
ORDER BY ST_Distance(geom, ST_SetSRID(ST_Point(151.268421, -33.840613)::geography, 4326))
LIMIT 1;

This approach is costly and overly complex. Does anyone have a shapefile which includes territorial waters (12 nautical miles from the coast) or know how I could bloat/swell the shapefile from http://efele.net/maps/tz/world/ to include territorial waters but not overlap?

It doesn't have to be perfect, picking the closest land mass in area's like this would be suitable.


texts:
I am trying to develop a model in ModelBuilder that will allow for a number of polygon shapefiles to be paired with each other.  Say a group of 3 shapefiles (1,2,3) located in the same folder would be processed producing individual shapefiles 1-2, 1-3, 2-3.

Is there a way to do this in ModelBuilder?


texts: Labels not displaying when rendering to image with pyQGIS

texts:
I'm using the simple example in the pyQGIS cookbook
http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/composer.html

I'm able to manipulate the features in my layer using Python, but the already configured labels are not rendered to the exported image.

from PyQt4.QtGui import *
from PyQt4.QtCore import *
import time
l = iface.activeLayer()

for a in l.getFeatures():
    attrs = {16: 1}
    l.dataProvider().changeAttributeValues({a.id(): attrs})
    img = QImage(QSize(1280, 1024), QImage.Format_ARGB32_Premultiplied)
    # set image's background color
    color = QColor(255, 255, 255)
    img.fill(color.rgb())
    # create painter
    p = QPainter()
    p.begin(img)
    p.setRenderHint(QPainter.Antialiasing)
    render = QgsMapRenderer()

    palyr = QgsPalLayerSettings()
    palyr.readFromLayer(l)
    lst = [l.id()]
    render.setLayerSet(lst)
    render.setLabelingEngine(QgsPalLabeling())
    # set extent
    rect = QgsRectangle(render.fullExtent())
    rect.scale(1.1)
    render.setExtent(rect)
    render.setScale(1)

    render.setOutputSize(img.size(), img.logicalDpiX())
    render.render(p)
    p.end()
    # save image
    img.save("~/GIS/O/%s.jpg" % a['NAME_1'],"jpg")
    attrs = {16: 0}
    l.dataProvider().changeAttributeValues({a.id(): attrs})
    time.sleep(1)


texts: What are Definition, Algorithms and Practical Solutions for Concave Hull?

texts:
Convex Hull
A convex hull of a shape is defined as:

In mathematics, the convex hull or convex envelope for a set of points X in a real vector space V is the minimal convex set containing X (Wikipedia)

Wikipedia visualizes it nicely using a rubber band analogy, and there are some good algorithms to compute it.
Concave Hull
A concave hull is visualized using the red line in the image below (the blue line visualizes the convex hull). Intuitively, it is a polygon which embraces all the points, but has less (minimal?) area compared to the convex hull. As a result, the polygon's boundary length is longer.
A concave hull may be the solution for some real-world problems (e.g. finding the reasonable boundary of a city).

I have failed to find a proper definition, algorithm and practical solution for the notion of a Concave Hull. The Grass Wiki has some descriptions and images, and there is a commercial solution in concavehull.com.
Any ideas, algorithms and links?


texts: What Story Maps support replacing the map with a 3D scene?

texts: I am currently creating story maps to be able to display a 3D scene to users and I am trying to decide which layout works best. Right now I have run into an issue where only certain story maps will allow the main map to be replaced with a URL of a 3D web scene. This is becoming quite difficult to get all of the UI and properties that I want the users to have, while maintaining the 3D component. Is there a list somewhere that can tell me which styles of story maps will support my 3D needs so I can narrow my search down, rather than creating all of these different story maps to find out that it is only supported in 2D format? Right now I know that Journals and Story Map Series are both supported in 3D. Are there any others?


texts: Finding geodesically flat regions in DEM data

texts:
I'm interested to find regions in some DEM data for Earth that are what I call geodesically flat, i.e. flat in the way that the path light travels is flat in the absence of strong gravitational fields. This is in contrast to a geographically flat region of the Earth which follows the curvature of the Earth. Thus, a geodesically flat region on Earth would look like a plane section of a sphere (like a chord on a circle but in 3D):

(Wikipedia)
I believe DEM data is typically specified as the distance from the surface of a sphere concentric with the centre of the Earth with radius equal to global average sea level (or some similar definition). This means that "flat" regions on DEM data are not geodesically flat. I think I first need to transform the DEM to add an offset based on the curvature of the Earth away from some reference point. I have made a diagram below showing what I think I must do, but in 1D. Each point on the DEM along the x-axis would need to have Δh(x₀) - Δh(x) height added. Then I can compute the local slope of the DEM and find the minimum, as outlined for instance in this question. Unfortunately because this approach computes the offsets for each reference point x₀, it will require a lot of computation.

Before I get started, I wanted to ask whether anyone knows of existing GIS tools that can find such geodesically flat regions in DEM data, following this or another approach. I am also interested whether it's possible to perform the required DEM transform using gdal or similar - applying the offsets to each point based on the height at a particular reference point.


texts: MapServer offset spacing with point pattern

texts:
I'm trying to add some point pattern like this :

On MapServer. The best I achieved yet is this:

Using

STYLE
  SYMBOL 'circle'
  SIZE 7
  COLOR 9 13 248
END

I did not find any indication on how set an offset between my circles.


texts: Attempting to install pip package produces gdalversion is not defined error

texts:
I'm very new to using packages in python.
I'm on Windows 7 64 bit. I've installed OSGEO4w, and I've checked numpy and scipy are installed. I assume GDAL is installed when I installed OSGEO4W, and I put the bin directory where I see most gdal items (C:\OSGEO4W_2.14\bin) into my windows environment path.

I'm trying to install this much needed centerline package:
github.com/fitodic/centerline
I installed pip at the OSGEO4W shell using:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

And then:

python get-pip.py

This installs pip, setuptools and wheel.
I then try to install the package using:

pip install centerline

and it starts installing, but errors out with:

Collecting Fiona (from centerline) Using cached Fiona-1.7.0.post2.tar.gz  .  Complete output from command python setup.py egg_info: Traceback (most recent call last):  File "(string), line 1, in (module) File "c:\users...appdata\local\temp\pip-build-oakjl0\Fiona\setup.py", line 193, in (module) if gdalversion.startswith("1"): NameError name 'gdalversion' is not defined.   Command "python setup.py egg_info" failed with error code 1 in "c:\users...appdata\local\temp\pip_build-oakj10\Fiona\

It appears the setup.py script can't find the gdal version. I see there are some issues in the Fiona package, but I'm not sure what to do with those comments. How do I resolve this error so that the centerline package will install?


texts:
I reinstalled QGIS3 on a new mac but cannot get ECW support to work anymore.

I previously used QGIS3 on another Mac, where I installed ECW support using the "old" method (see this question).

This method is not described in the new installer by William Kyngesburye.

How do we get ECW to be supported now?


texts: PostGIS: Select Certain Columns returns Blanks

texts:
So I have a pretty stupid question. Suppose I have a table of the US called us_states. I created two new tables called wy_test which is created using

CREATE TABLE wy_test AS SELECT * from us_states where state = 'Wyoming';

AND  wy_test2 using the query

CREATE TABLE wy_test2 AS SELECT gid, geom from us_states where state = 'Wyoming';

However when I export the two tables using pgsql2shp and open it in QGIS, the table from wy_test will show me the state of Wyoming while wy_test2 will return blank.

Why does this occur? And how can I query the table so that I can pick specific columns without getting a blank in return?


texts: Drawing a marker on a shapefile with the given latitude and longitude?

texts:
I am using shapefiles to draw a custom map. They were created successfully with the help of ArcGIS Desktop.

Now I need to draw a marker on shapefile based on an existing tuple of lat, lng.

How can I do that?

I am not using any map service for this.

I need to place a marker on given lat, lng.


texts: Using Apply Symbology From Layer feature when source layer's symbology is based on field built using custom expression

texts:
I cannot find how to set the "Source field" in the "Apply Symbology From Layer" tool when the layer I'm trying to copy from has its symbology based on a custom field. Here are some images for context:
This is how my "source" layer's symbology looks like (i.e. the layer I want to copy from). Note the custom formula used to populate the values on-the-fly for the symbology:

Then, when I open the "Apply Symbology From Layer" tool from the Geoprocessing toolbox, the Source Field does not show "custom field" in the drop-down menu.

Is it simply not possible to use the "Apply Symbology From Layer" tool when the source field is based on values obtained by calculating a custom expression or am I missing something here?
Background info: I am currently using ArcGIS Pro 2.6.3 with an "Advanced" license on Windows 10.


texts: How to select training samples by number in Google Earth Engine?

texts: I now have 100 training data, and I want to randomly select 50 training data. How can I use Google Earth Engine to achieve this?


texts: Selecting, sorting, and grouping spatial data (lines) by length and proximity

texts:
I'm working on a project where I have a bunch of lines inside of polygonal land parcels. Here's a rough sketch of what I'm talking about:

I need to further subdivide these parcels into sections that contain ~80km of line each while trying to maintain line connectivity as much as possible. So as an example, I'd want the finished subsections to look like this (very rough) sketch here, where the blue line represents the boundary of each subdivided polygon that contains ~80km of line:

I've tried a couple of FME solutions, but I wasn't able to get anything to take. My issue is I need to sort and group based on two values: connectivity AND length, and I'm struggling to think of an automated solution to do so.


texts: Copy legend from ArcMap A to ArcMap B with different scales and/or paper size?

texts:
I have a question for you  and what is the best practice for me to copy the legend from another ArcMap A to ArcMap B. They are in the Layout View. it has different scale like in 1: 77,000 to 1:55,000 without having to adjust the legend ?

So here is the example of what I am talking about here:

ArcMap  A Layout View ..............................                                                        ArcMap B  Layout View

Scale : 1: 77,000                ----------------->      Scale : 1:55, 000

So the legend from the 77,000 seem to be bigger than the 55,000 and when I resize it to meet the same as the 55,000 it seems that the symbol gets smaller and the symbol changes. I had to fix it and try to resize but the symbols were not desired what I wanted.

What is the method or a way around to fix this ?


texts: Pixel-wize trend analysis of an irregular time series stack of NDVI rasters in R

texts:
I'm interested in doing a pixel-wize trend analysis of a series of NDVI images from Landsat in R.

The problem is that my images are not exactly happening at regular intervals. But decent imagery of my study area is sporadic and not regular at all (July-21-1992, May-20-1996, ...). Therefore, I can't directly use any of the timeseries packages (ts, greenbrown) to do this. The default assumption of these packages/functions is that your raster stack has a regular time interval (daily, monthly, ...). Here is an example:

Find and stack all the layers:

Library(greenbrown)
all <- list.files("C:/Users/R_test", full.names = TRUE, pattern = "*.tif")
st <- stack(all)

Perform  the pixel-wize analysis:

trends <- TrendRaster(st, start = c(1992, 1), freq=1, method=c("ATT"), breaks = 1)

Therefore, my question is how can I implement these gaps into the timeseries before doing any analysis?

I have tried the zoo package and managed to create a vector that has NA for the dates that I dont have imagery, but I'm not sure how to insert the zoo object back into the trend analysis function (here the greenbrown package).

Regards


texts: Concatenate fields value excluding empty values

texts:
I need to concatenate the value of two fields excluding empty values, using Field calculator. The fields are: AREA_HI and AREA_LO

I have tried using a Python script but ArcGIS returns an error "000539 : Error message from Python."

def concat_fields(!AREA_HI!, !AREA_LO!):
    if !AREA_HI!.strip() == "" or !AREA_LO!.strip() == "":
        return ""
    else:
        return !AREA_HI! + !AREA_LO!

On the base of suggestions and comments i've tried to modify the code. The result is ever negative.

The last code used, it seems formally correct but show an "indentation error (n. 000539) unexpected indent ( line 1)"...

  def concat_fields(AREA_HI, AREA_LO):
if AREA_HI.strip() == " " or AREA_LO.strip() == " ":
    return ""
else:
    return AREA_HI + AREA_LO


texts: Getting unexpected DEM spatial resolution using ArcMap

texts:
I have downloaded SRTM DEM 30 m. However, when I displayed on ArcMap, I got a DEM raster with 0.0002777 cell size.
How can I solve this problem?


texts:
I am attempting to add two rasters in Raster Calculator, but I am getting a blurred image that is not anywhere close to the original two rasters placed into the calculator.

Dimensions of the input rasters are identical and are the following:
X Size: 0.0083
Y Size: 0.0083
Columns: 7322 x 4142

The initial result from the calculation is at a lower resolution from an image that was calculated earlier in ArcMap. I've attached each input raster and the output raster:

Input Raster 1  Input Raster 2  Computed Raster  Calculation


texts:
The data was imported using the following command:

osmosis --read-pbf file="/usr/local/lib/geoserver-2.1.3/data_dir/argentina.osm.pbf" --write-pgsql database="argosm" password="1234.5" user="argosm"

And previously these commands were issued:

sudo su postgres

createdb argosm
createlang plpgsql argosm

psql -d argosm -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
psql -d argosm -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql

psql -d argosm -f /usr/share/postlbs/routing_core.sql
psql -d argosm -f /usr/share/postlbs/routing_core_wrappers.sql
psql -d argosm -f /usr/share/postlbs/routing_topology.sql

The following tables have been created:

nodes
relations
relation_members
schema_info
spatial_ref_sys
users
way_nodes
ways

Then I added a store in Geoserver, but the only layer I can see with Openlayers, QGIS and so on is "nodes".

No rivers, streets, and no street names. I don't know what can I do with this data, or did I miss some step?

All processes ended normally, no errors during import.

Thank you


texts:
I have a grib2 file from GFS.  I tried to load it as a raster like so...

gdalwarp -t_srs EPSG:4326 example.grib2 warp_example.grib2
raster2pgsql -I -C -M -d warp_example.grib2 table | psql $database

This appears to load correctly.
I try to query it but I get a SRID mismatch error.  This same procedure worked for many other grib files, so I don't understand what is broken in this case.

postgres=#  SELECT rid, ST_Value(rast,1, foo.pt_geom) As b1pval FROM surface CROSS JOIN (SELECT ST_SetSRID(ST_Point(84.1, 39.1), 4326) As pt_geom) As foo WHERE rid=1;
ERROR:  Raster and geometry do not have the same SRID
CONTEXT:  PL/pgSQL function st_value(raster,integer,geometry,boolean) line 13 at RAISE

How do I correct this error?


texts:
I have a point layer (bus stops), and I want to select the ones that are going to be changed (they have a common attribute to select them). I copy the selection (either ctrl+c or with the menu button) and choose the option "Edit > Paste Features as > Memory vector layer"

I choose the correct CRS (i've tried other CRS) and i create a memory vector layer (i've also tried to save it as a vector layer).

And the result is that the layer I get doesn't have any attribute:

I've done this a lot of times, and I've never had this issue.
But this time, it doesn't work.

Just to clarify, the layer only has 300 points more or less, so it is not a limit problem. I've also tried to create a layer from selection on other layers, but still the same problem. It seems something has broken (yesterday everything worked fine).

Any idea why this is happening?

(QGIS 2.8.3 on Windows 7)


texts:
I am trying to clean topology of a TAB file in QGIS 2.14.4 and it returns an error message as below

The weird thing is, I am able to execute this okay on my machine but not my colleague's. The other intriguing aspect is that the v.clean tool seems to work perfectly okay for SHP files on my colleague's computer. What is going on? We tried to fix the path for grass plugin installations and everything but we continue to receive the error message whenever we are trying to perform topology cleaning on TAB files.

I have also noticed that when my colleague fires up their QGIS 2.14.4 they get two messages which I don't:

There is a new QGIS version available 2.16
You can add more algorithms to the toolbox. Enable additional providers

Does this have anything to do with the tool not working? I do not get these messages.

Any advice?


texts: How to synchronize map context (bounding box and zoom level) only with ol-cesium?

texts:
I posted this question on StackOverflow, but since there is no answer yet and as recommended in a comment, I'll ask it here too:

I'm programming a page where a 2D and a 3D map are side-by-side as in this ol-cesium example. It should be possible to change the basemap in 2D and 3D (independently of each other) and it should also be possible to turn other layers on and off in both 2D and 3D (independently of each other too).

As described on the ol-cesium page, ol-cesium synchronizes:

Map context (bounding box and zoom level);
Raster data sources;
Vector data sources in 2D and 3D;
Map selection (selected items);
Animated transitions between map and globe view.

I want to create my own synchronizer which just sync the moves (the map context) and no raster or vector layers. So I want to create my own synchronizer but don't know what to do, when I want to sync nothing but the map context. This is what I'm doing:

var ol3d = new olcs.OLCesium({
    map: map,
    target: 'map3d',
    createSynchronizers: function(map, scene) {
        return [
            // what to return here?
            new olcs.VectorSynchronizer(map, scene)
        ];
    }
});
ol3d.setEnabled(true);

So at the moment I'm returning the VectorSynchronizer. I don't know what to return to just sync the map context and nothing else. There is no MapContextSynchronizer or somthing like that. So which synchronizer should I return though? Can I just return an empty array?


texts: geotiff conversion to coordinate system with gdal

texts:
I would like to get the coordinates X Y Z from a geotiff file.

I am using the gdal translate for the conversion.

Which output format is the more adequate for containing a 3 numpay array X Y Z ?


texts:
I have installed Mapnik and have a functioning PostGIS database (I can access data through QGIS with no problems). When I try to run render_list to generate tiles it fails with

socket connect failed for: /tmp/osm-renderd

I have updated datasource-settings.xml.inc to include proper connection settings for my database but still no luck.

Here is my datasource-settings.xml.inc:

<!--
Settings for your postgres setup.

Note: feel free to leave password, host, port, or use blank
-->

<Parameter name="type">postgis</Parameter>
<Parameter name="password">gis</Parameter>
<Parameter name="host">localhost</Parameter -->
<Parameter name="port">5432</Parameter -->
<Parameter name="user">www-data</Parameter>
<Parameter name="dbname">gis_data</Parameter>
<!-- this should be 'false' if you are manually providing the 'extent' -->
<Parameter name="estimate_extent">true</Parameter>
<!-- manually provided extent in epsg 900913 for whole globe -->
<!-- providing this speeds up Mapnik database queries -->
<!-- Parameter name="extent">%(extent)s</Parameter -->

I'm running Ubuntu 12.04. My database is on localhost at port 5432. OSM data is located in a database called gis_data under a schema called osm_data. The tables all have public permissions so I don't see that being the issue. Googling around didn't yield much help other than double- and triple-checking the permissions on my database. Any suggestions? Is there another settings file somewhere that I need to be looking at?


texts:
I have a confusing problem with a project generated in QGIS 1.8 when trying to open this on a new windows pc with Darfour (same OS, Win7) The hard drive including the project has been moved from old machine to new and as such no paths etc should have changed.

http://picpaste.com/qgisBadLayers.jpg http://picpaste.com/extpics/qgisBadLayers.jpg

http://picpaste.com/qgisBadLayers.jpg

I'd obviously rather not have to manually correct all 40, and want to understand exactly what has changed / what the issue is. The layers are UK OS data.

Many thanks

Many thanks for your reply. The data in this case are in shapefiles from the OS Digimap service

The issue was that Darfour expects the following

<datasource>./OS VectorMap District (Vector)SU/data/SU/SU_AdministrativeBoundary.shp</datasource>

and the original project are formatted thusly:

<datasource>./OS VectorMap District (Vector) SU/data/SU|layername=SU_Airport</datasource>

a couple of quick find and replace to take the layername out and add .shp did the trick


texts: PyQgis: How can I preserve order or index when adding features to a Vector Layer from a file?

texts:
As I read data from a text file and add points to a QgsVectorLayer (as well as related attributes), each new record gets 'stacked' on top of the previous one in the Attribute Table (and within the Vector Layer as well) and I end up with the first record read having the highest index and the last record having index 0 (LIFO-style) and this is not what I want (I would like to preserve the index from my input file).
Short of a solution, I am currently inserting an 'AutoID' field that is incrementing as I read my text file but I find this rather clumsy :
geom = QgsGeometry()
feat = QgsFeature()
layer = QgsVectorLayer("Point?field=AutoID:integer&
                       field=Line:string&
                       field=Point:string&
                       field=Easting:double&
                       field=Northing:double&
                       field=Elevation:double", file_name, "memory")
layer.startEditing()
i = 0
with open(data_file, 'rU') as filein:
    ##read the text file, get data and attributes in corresponding variables
    feat.setGeometry(geom.fromPoint(QgsPoint(x, y)))
    feat.setAttributes([i, line, point, x, y, z])
    layer.addFeature(feat,)
    i += 1

This is the end result: the last record read (AutoID 5326) gets index 0 in the table, so compared to my data file, the Attribute Table is just 'reversed' which is no big deal, but annoying. I need the index of my Vector Layer to be the same than that of my data file.


texts:
I have set up QGIS-server for a WMS. I use Ubuntu 14.04 and QGIS 2.10. When loading the WMS in QGIS or Mapbender3 the symbology in the layertree is missing for points and lines. It works with polygons. Under Ubuntu 15.04 I did not face this problem.

Any ideas?


texts: MMQGIS Python Error Message: "Null geometry cannot be converted to a point"

texts:
Sorry in advance: I'm a newb...

I have a shapefile layer that I created from a CSV; I want to create a buffer for each point with MMQGIS. I did so successfully with a similar dataset using the same process, but it will not work with this particular one. I checked the data and they look just like the data that worked.

Whenever I try to make the buffer in MMQGIS, it returns the error "Null geometry cannot be converted to a point."

I'm running QGIS 3.6, and python 3.6.8 on macOS 10.14.4.

I have looked all over for answers and I cannot figure out what to do. What am I missing?


texts:
I have a point feature class which contains features scattered around the city, with some of the points intersecting other points.

These intersecting features are correctly different features (they don't represent the same record), however I'd like to get a count of intersecting features so that I can do additional processing based on whether there are multiple points at a location.

My points have Location IDs, which should match all points at that location, but I can't guarantee this.  It is also possible that some of the Location IDs are in more than one location.  This is because the locations originally came from polygons, so the points in the same polygon ended up with the same ID.

I've used the Summary Statistics tool to get me close to what I'm wanting, however because of the above mis-matches with location-IDs, I'd prefer to have this run on the XY of the points rather than the Location ID.

When I use the Summary Statistics tool and set the Case field to be SHAPE it doesn't give me a count of the features.  If I set the Case field to be LOCATIONID it does give me a count of the features.  I use OBJECTID as the Statistics field (using COUNT).

Summary Statistics using SHAPE:

Summary Statistics using Location ID:

So my question is how can I get a count of intersecting point features?  I don't mind a bit of scripting to get it there, I'm just stuck as to what tool(s) to use.  I've tried Find Identical, Near, Generate Near table, Summary Statistics, and only Summary Statistics seems to get me close to what I need.


texts: Define point locations in relation to slope

texts: I have a dataset of settlements that I would like to put in relation with slope and aspect layers that I have made to see if there is a preferred altitude or direction (facing north or south, etc.) that might have influenced the location of the settlements. How can I do this?


texts: gUnaryUnion from rgeos packge fails randomly

texts:
I am using gUnaryUnion() function from the rgeos package to "melt" administrative regions into bigger units.

At times I do get the expected result, and other times (seemingly randomly, so I suspect a memory issue) it fails - the most common error message is :

Error in SpatialPolygons(pl, proj4string = CRS(proj4string(dots[[1]]))):
    cannot get a slot ("coords") from an object of type "NULL"

The intriguing thing is that at other times it runs perfectly. I am positively certain that the object I run the Union on has CRS set. It is a sp object with size in the tens of megabytes, so not huge but sizeable.

Is there a way to work around this? Assign more memory to Geos for example? Tune some parameters?

An example of my problem is

library(RCzechia) # set of shapefiles for the Czech Republic - devtools::install_github("jlacko/RCzechia")
library(rgeos)
set_RGEOS_polyThreshold(1/1000)
set_RGEOS_dropSlivers(TRUE)
okresy <- RCzechia::okresy
nuts <- okresy@data$KOD_CZNUTS3
kraje <- gUnaryUnion(okresy, nuts) # this fails!!

My session info is

R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

rgeos version: 0.3-26, (SVN revision 560)
 GEOS runtime version: 3.5.1-CAPI-1.9.1 r4246
 Linking to sp version: 1.2-5
 Polygon checking: TRUE


texts: How can I know image resolution of an image in ERDAS?


texts: Why qgis2web project is not displaying one WMS(OSM) in some machines?

texts:
I have an HTML page generated by the plugin qgis2web. It has three WMS services in it. In my computer, all of them work fine. But there are some computers in which the WMS of the OpenStreetMap is not working (the others, for example Google, work).

Is there anything to do with a specific configuration of the browser in these machines? Or is there a setting of the HTML to which I should pay attention?


texts: Problem with setting style for a specific layer

texts:
I'm trying to publish a layer using a geoserver rest library (geoserver manager), but nothing works.

First I tried this piece of code:

String srs = "EPSG:29193";
GSFeatureTypeEncoder feature = new GSFeatureTypeEncoder();
feature.setName(nomeCamada);
feature.setTitle(nomeCamada);
feature.setNativeCRS(srs);
feature.setEnabled(true);
GSLayerEncoder layerEncoder = new GSLayerEncoder();
layerEncoder.setEnabled(true);
layerEncoder.setQueryable(true);
layerEncoder.setDefaultStyle(estilo);
publisher.publishDBLayer(workspace, store, feature, layerEncoder);

I've previously created three styles (style1, style2, style3 - all of them are in the same workspace of the layers that I'm trying to publish) to test them with the layers. If I try to set estilo = "style1";, it's ignored and the default style is set. For some layers, it's set to polygon, for others it's set line and so on.

It only works if estilo has a value of one default style that comes with geoserver, that is: polygon, point, line, green etc.

I think it worths to mention that if I do all the actions manually (choose the layer, choose the default style) it works perfectly.

After some researches, I found this solution: https://stackoverflow.com/questions/15573984/geoserver-manager-adding-a-new-layer

But in my geoserver-manager version, there isn't this configureLayer(GSLayerEncoder layerEncoder, String layerName) method with this number of parameters. The configureLayer() method has three parameters (as stated here: http://demo.geo-solutions.it/share/github/gsman/apidocs/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.html): String workspace, String resourceName, GSLayerEncoder layer.

With resourceName, I understand the layer's name, right? I tried to configure before publishing (using the layer's name in the place of resourceName), but it returns false indicating it wasn't set and the problem's still up. (I've also tried to use the store name for resourceName, but there's still the problem)

Has someone already got into this problem? What can I do?

I'm using geoserver-manager-1.7, geoserver 2.4.4, jdk7 and tomcat 6.0.30.

EDIT 1:

I found something:

I must publish the layer before configuring layer, that is, I must publisher.publishDBLayer(workspace, store, feature, layerEncoder); first.
After that, I must configure the layer: publisher.configureLayer(workspace, nomeCamada, layerEncoder);
The second parameter of configureLayer() method, i.e., resourceName is the layer's name.

But, even after successful publishing and configuring, the selected style isn't being selected. Instead the default is chosen. I'm still stuck.

EDIT 2:

I removed the workspace from the styles. Now I can set them to the layer, but that was a workaround. I'm still looking for the solution. If I found it, I'll post here.


texts:
I have the centre of some buildings (polygons) and the road network of the area. The road network will be used as a pipe network as well. So I want to connect each building to the main transmission line, namely the road line. I am looking for a tool that connects the centre of the buildings which I already have as points with the polyline in the shortest distance possible.

I am using QGIS 2.4.0. I dont have GRASS GIS on my PC.


texts: How to import and transform metadata in shapefile in QGIS?

texts:
I know nothing about metadata so my question will seem a bit dumb.

I found metadata on the net that I want to use in a shapefile in QGIS, but I have no idea on how to do it. I tried the metatools plugin in QGIS, but I need shapefiles to incorporate the metadata. So I create a new shapefile and I was able to import/create metadata for this new shapefile. But now I don't know what to do to see the data, as a shapefile.

Here the metadata that I search to see: https://phd.dream.upd.edu.ph/layers/geonode%3Apanay_streamnetworks_final and I downloaded the ISO form because it can be used with metatools.


texts: Preventing invalid values in PostGIS geography

texts:
If I use pgAdmin to insert a point with an invalid latitude, say 91°, I receive the following notice before the query completes successfully:

  NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY

If I use a PDO statement in PHP there doesn't seem to be a way to get at that notice. Even if there were, I don't want to find out that the coercion happened after the fact—I want to prevent the record from being inserted in the first place.

Is there any way to have the insertion of invalid geography points fail?

My first thought was to use a check constraint, but the coercion of invalid values happens before the constraint conditions are evaluated. This means that ST_Y always returns the coerced value in the range [-90, 90], and the constraint is never violated.


texts: What is difference between LineString and MultiLineString?

texts: What is the difference between Linestring and multiline string, and things like compound curve, curve polygon, multicurve, and multisurface?


texts: How can I get the vertical profile of my trail?

texts:
I am creating some online maps for trails and I'm trying to figure out how to turn my lat/long data into vertical profiles roughly like the following.  I'm not so concerned about the markers/labels, though the x/y axes would be nice to have.

So far I have just been building out a prototype using Leaflet.js - soon I expect to do a full overhaul, possibly using Drupal as a framework/CMS.  So the door is wide open as far as implementation goes - it would just need to be something I can do programatically from a web server.


texts: How to load point on map on change of input value

texts:
I am new in OpenLayers. I am trying to map my address location on map by pointing. So I have one input field on change of input field I will get latitude and longitude value and then I will store that value in two global variables that are globalvar(longitude), globalvar1(latitude) and access it in my OpenLayers JS file to point location on map.

I am getting value and it also changing on change my input field(suggestion box where I select address and selected address give me lat and log values).

But it is not reflecting on map. not sure but when I enter value in it works

geometry: new ol.geom.Point(ol.proj.fromLonLat([4.637777, 50.68728])),

When I enter variables it won't

geometry: new ol.geom.Point(ol.proj.fromLonLat([globalvar, globalvar1])),

This is my JavaScript code:

window.abc.prototype.geolocateMap = function(e) {
    ar map = new ol.Map({
        layers: [rasterLayer, vectorLayer],
        target: document.getElementById('map'),
        view: new ol.View({
          center: ol.proj.fromLonLat([2.896372, 44.60240]),
          zoom: 3
        })
      });
    var view = new ol.View({
        center: ol.proj.fromLonLat([0, 0]),
        maxZoom: 16,
        minZoom: 7,
        zoom: 7
    })

    var geolocation = new ol.Geolocation({
        projection: view.getProjection()
    });
    console.log(globalvar1,globalvar)

    var city= new ol.Feature({
        geometry: new ol.geom.Point(ol.proj.fromLonLat([4.637777, 50.68728])),
        name: 'city'
    });
    city.setStyle(new ol.style.Style({
        image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
            crossOrigin: 'anonymous',
            src: '../../img/abc.png'
        }))
    }));

    var element = document.getElementById('popup');

    var popup = new ol.Overlay({
        element: element,
        positioning: 'bottom-center',
        stopEvent: false,
        offset: [0, 0]
    });
    map.addOverlay(popup);

    // display popup on click
    map.on('click', function(evt) {
        var feature = map.forEachFeatureAtPixel(evt.pixel,
            function(feature) {
            return feature;
        });
        if (feature) {
            var coordinates = feature.getGeometry().getCoordinates();
            popup.setPosition(coordinates);
            $(element).popover({
                'placement': 'top',
                'html': true,
                'content': feature.get('name')
            });
            $(element).popover('show');
        } else {
            $(element).popover('destroy');
        }
    });

    new ol.layer.Vector({
        map: map,
        source: new ol.source.Vector({
            features: [city]
        })
    })

What I found id values are coming but when input get changed the map geom.point method is not loading again.

I am loading my map in idex file like this:

<script>new abc('map',{})</script>


texts: Google Earth Engine add pixel values to shapefile points and create table as output

texts:
I am very new to GEE and coding, I've searched the web thoroughly for an answer to my question, but I don't understand the answers on the same type of questions.. So therefore I am asking (again) this question.
I am using the Copernicus Global Land Cover dataset together with a shapefile containing point coordinates of small reservoirs (obtained in QGIS). I want to add the pixel values (consisting of the fractions of landcover) of the Land Cover dataset to the shapefile (or a new table with all the information of the reservoir location). However, so far I did create the columns with the possible cover fractions together with the reservoir info, but the cover fraction columns are empty and the reservoir info columns are filled with the corresponding reservoir info.
I thought it might be the issue of using a shapefile, so I created 3 random points in GEE with the geometry function to check. But if I run those 3 points through my model, it only creates 1 row (besides the header row) where the separate values of the specific landcover fraction are all 3 together in 1 cell. So both cases are not going really well and are not the output I want..
Here's my code:
var reservoirs = ee.FeatureCollection("users/jentejanssen/New_Loc_Ghatanji");

var Ghatanji = ee.FeatureCollection("users/jentejanssen/Ghatanji_block");

var multiplepoints = /* color: #d63000 */ee.Geometry.MultiPoint(
        [[78.18223643888375, 20.06380771697672],
         [78.28334597834835, 20.073480721802248],
         [78.26137332209835, 19.99219800350948]]);

var clipToCol = function(image){
  return image.clip(Ghatanji);
}

//import Copernicus land cover
var dataset = ee.ImageCollection("COPERNICUS/Landcover/100m/Proba-V/Global").map(clipToCol);

//Chose visualization bands
var visualization = {
  bands: ['discrete_classification'],
  min: 0.0,
  max: 200.0,
  palette: [
    "032f7e","02740b","02740b","8cf502","8cf502","a4da01",
    "ffbd05","ffbd05","7a5a02","f0ff0f","869b36","6091b4",
    "999999","ff4e4e","ff4e4e","ffffff","feffc0","020202",
    "020202",
  ]
};

//Zoom to area and name "Land Cover" layer, this is the layer I want to collect data from
Map.centerObject(Ghatanji,10);
Map.addLayer(dataset, visualization, "Land Cover");

//Display new reservoirs in Ghatanji
Map.addLayer(reservoirs, {color : 'black'}, "reservoirs");

Map.addLayer(multiplepoints, {color : 'red'}, "points");

//Reduce to reservoir regions and retreive land cover data for reservoirs
var reduced = dataset.map(function(image){
  return image.reduceRegions({
    collection: reservoirs,
    reducer:ee.Reducer.toList(),
    scale: 30
  });
});

//create table
var landuse_table = reduced.flatten();

print('reservoir collection land cover', landuse_table);

//Reduce to reservoir regions and retreive land cover data for reservoirs
var reduced_points = dataset.map(function(image){
  return image.reduceRegions({
    collection: multiplepoints,
    reducer:ee.Reducer.toList(),
    scale: 30
  });
});

//create table
var landuse_table_points = reduced_points.flatten();

print('random points collection land cover',landuse_table_points);

// //Export table to drive
// Export.table.toDrive({
//     collection: landuse_table,
//     description: 'landuse_table',
//     fileFormat: 'CSV',
// });

And here's the link to my GEE environment.


texts: I can't find the processing toolbox anywhere in QGIS3.10. I thought I just had to activate it but I can't find it under all plugins or installed plugins. Does anyone know where I can find it or how I can fix this problem? I've attached a picture of the plugin window and the main window.


texts: Setting names for attributes in properties in json returned by postgresql

texts:
I am trying to make a webmapping app that uses on the server side node.js and postgresql(PostGIS). what I am doing is retrieving data from the Postgresql database using node.js and sending the result in JSON (geoJSON) format to Openlayers 3, using this query :

SELECT row_to_json(fc)
FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
    FROM (
    SELECT 'Feature' As type
    , ST_AsGeoJSON(lg.geometry)::json As geometry
    , row_to_json((attribute1, attribute2, attributeN)) As properties
    FROM myTable As lg   ) As f )  As fc;

my problem is that in the JSON data retrieved the "properties" are defined as "f1", "f2", "fN" instead of the actual names of the attributes, I saw this answer here in dba.stackexchange but it doesn't consider the fact that the attributes are within the "properties"

How to set the actual names of my attributes in the JSON returned instead of "f1", "f2", "fN" ?

I could get used to calling my properties in OL3 with "f1", "f2", "fN" since I am working alone on this app but that would be an obedient and kind of lazy solution.