texts: QGIS graticule coordinates in print composer starting from 0?

texts:
I am not sure how to explain the problem correctly as my English isn't as great as it should be - but let me try anyway.

I just tried to create an extremely simple map made of one layer loaded as WMS layer for Croatia's geoportal. I successfully loaded the necessary layer and created everything in print composer, but the problem is that graticule coordinates system is starting from 0 not from its real values? What am I doing wrong?


texts: I have some bathymetry data in TIN format; I am able to open this in arcmap and view the terrain. However I need to use this data within a simulation framework called Delft3D, which needs the bathymetry data in ascii format (.dep). I am very new to both of these software technologies, I wanted to know how I can convert the TIN format data to a .xyz file or even a .dep file using arcgis or even something external.


texts:
I have a significant background in statistics, and I'd like to learn more about spatial statistics (and statistics associated with geospatial data).

Are there any especially good resources for someone looking for an overview of the field?

I am not looking to solve a specific problem at this point.  Just want to understand the field and how it differs with statistical applications on non-spatial data.


texts:
QGIS 2.18.5

I'm using Qgis2threejs to put this COLLADA model ontop of a point (open in IE, not chrome). You see how the web-preview animates perfectly and the blades are centred on the hub. When loading the model through Qgis2threejs, the 3D visualisation adds the model with the blades off-set from the hub. Is there a way to get the animation going as well?


texts: I would like to select all lines within a polygon. I tried to do that with the clip-function, but it didn't work out (the resulting layer was empty). Do I have to select a particular setting before using that function or why isn't it working?


texts: How to build, store and index a road network from a digital city map

texts:
I'm totally new to this domain so my question may sound like a little bit silly……

I'm eager to know how to extract, store and index the coordinates of the road segments(edges) and intersections or endpoints(nodes) according to a digital city map.

First, the map contains a lot of layers yet I'm only concerned about the roads layer. It seems like I'm not allowed to choose a certain layer map (road layer) to be exported in OpenStreetMap. Is there any solution or alternative map to recommend?

Second, I have no idea what software or programming language is appropriate to extract the road network. I downloaded and installed arcGIS which seems like a very complicated software and I just want to learn the skills that I need to solve my problem. So I hope someone could recommend some software or tutorial or just give a clue to me.

Third, if there is a flyover or overpass in the map, how to distinguish it from other roads? After extracting the road segments from map, how to store them and index them like using a database?

Many thanks!


texts: Converting area of a polygon from steradians to square kilometers using D3.js?

texts:
How can I find the area of a polygon in square km using D3.js? I'm not even really sure whether to use d3.geo.path.area or d3.geo.area.

Here is my code (JSFiddle):

var d = {
    "type":"Feature",
    "id":"7525",
    "properties":{"name":"Paris, 11e arrondissement","id":"117525"},
    "geometry": {
        "type":"Polygon",
        "coordinates":[[[2.377,48.8719],[2.3991,48.8481],[2.369,48.8532],
                       [2.3684,48.8557],[2.3639,48.8674],[2.377,48.8719]]]
    }
  };
var w=720, h=640;
var projection = d3.geo.orthographic().scale(3660).rotate([-3,-46.35])
                    .clipExtent([[0,0], [w,h]]).translate([w/2,h/2]);
var path = d3.geo.path().projection(projection);

console.log('path area', path.area(d));
console.log('geo area', d3.geo.area(d));

For path area I get 1.0841410092907608 and for geo area I get 8.101249039703731e-8.

The docs suggest that the first is the result in pixels, and the second is the result in steradians. Is it possible to convert steradians to square km?


texts:
I'm quite new to ogc webservices and I need some guidance.
I have a shapefile in geoserver lmes.shp (WMS,  WCS and WFS are activated), with attribute LME_ID for each polygon of lmes.shp.
I need to write a function that will query the layer lmes for a given LME_ID and get back the polygon bounding box. Please note I'm not looking for an event-handler (I don't want to select the polygon by clicking on it, I just need to pass LME_ID to my function).

Which web service should I use (WFS I suppose) and what openlayers function is the most appropriate? An example would help!


texts: Error: GRASS 7.0 and QGIS 2.8.1 in Linux Mint from the ubuntugis-unstable

texts:
I have installed GRASS 7 and QGIS 2.8.1 from the https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable (Trusty 14.04) in Linux Mint 17.1 64bit(sudo apt-get install postgis libgdal1h grass-dev grass-gui monteverdi2) and QGIS doesn't recognize GRASS 7.0.0 Actually, I can see GRASS 7 on the QGIS toolbox but it doesn't work.

Is QGis prepared to support GRASS 7 through the QGIS/GRASS plugin?

When I run the GRASS 7 from QGIS toolbox I have the following Error:

GRASS_INFO_MESSAGE(14387,3): r.composite complete. Raster map created.
GRASS_INFO_END(14387,3)
GRASS_INFO_ERROR(14389,1): Raster map or group not found
GRASS_INFO_END(14389,1)
Execution of '/home/thayse/.qgis2//processing/grass7_batch_job.sh' finished.
Cleaning up temporary files...

Starting GRASS GIS...
Executing '/home/thayse/.qgis2//processing/grass7_batch_job.sh' ...
GRASS_INFO_ERROR(14401,1): Raster map or group not found
GRASS_INFO_END(14401,1)
Execution of '/home/thayse/.qgis2//processing/grass7_batch_job.sh' finished.
Cleaning up temporary files...
Converting outputs

Loading resulting layers

Is it possible to have GRASS 6.4 installed in parallel to GRASS 7? What would be the best way to have both GRASS 6.4 and GRASS 7.0 installed on Linux Mint 17.1 from repositories?


texts: Sending file of custom python script with all parameters for popup interface already defined?

texts:
I have a python script in ArcGIS 10 that when clicked, has a popup for a user to choose parameters. I would like to send this file to someone else. While I could send them the python code and have them setup the parameters - this method repeats work I have already done.

I would like to send someone one file that contains all of this information so they can just recieve my file, add it to a toolbox, and then have it all work. I am wondering where the file resides that has both the python code and parameters / what is the export process/ file type I should be looking at? (All the searches I do for "export script" seem to refer to exporting a model to python code...)


texts: How to fit a polygon to a "best buffer" about a reference geometry in it?

texts:
If I have a polygonal geometry gbase, like a street (a rectangular strip), and a reference geometry gref, like a central line of gbase. The question is what is the function (here named BestBuffer) that returns a geometry gbest,
gbest = BestBuffer(gbase, gref [,p])

that is the "best fit" for gbase and can be generated from gref by a ST_Buffer (optionally with a shape parametrized by p)?
Remarks
Formally this is a  mathematical optimization problem:
Given: inputs gref and gbase (optional p) and,
gbest = ST_Buffer(gref,w,p)

Sought: parameter w that supply
ST_Area(gbest) = ST_Area(gbase)

NOTE: I think BestBuffer can be a "standard library" function (where is it? please show sources/references), not a external plugin, because the estimation checks are all standard OGC build-in functions.

ILLUSTRATIONS
BestBuffer when gref is a POINT
Illustrating by the trivial case, the buffer of point, that have exact solution:

is the same as "fit a polygon to a square of equal area" (or a circle).
Inputs: gbase a (blue) island, gref is only a point, gref=ST_Centroid(gbase), or another position, and the parameter N, that can be 1 for square and 8 for circle.
Results (pink):
  gbest_square = bestBuffer(gbase,ST_Centroid(gbase),1);
  gbest_circle = bestBuffer(gbase,anotherpoint,8);

You can approximate gbase to gbest without change original area.

BestBuffer when gref is a LINE
Illustrating with the  Massachusetts avenue,

Inputs: gbase, a polygon of a street, gref a (blue) center line in it, and the choice of shape (no endcaps)
Result of   gbest=bestBuffer(gbase,gref,'endcap=flat')

is a rectangle (gbest). It is the "best buffer about gref" for Massachusetts avenue, filling the same area as gbase.
Another cases where you may need to draw BestBuffer of polygons and its central lines: when need to show  streets, sidewalks, rivers, etc. with uniform  width, instead real/irregular ones.

BestBuffer when gref is a POLYGON

In the above illustration, the blue polygon represents a island with your beach, as gbase, and gref the same island without the beach. gbest0 is the "best buffer" for gbase.
Inputs: gbase (blue), gref a (gray). Can be rendered as ST_Difference(gbase,gref), that represent beachs.
Result:   gbest0=bestBuffer(gbase,gref), but we want to render as (gbest),
  gbest =  ST_Difference(gbest0,gref)

The goal of the buffer of gref is to generate the "beach geometry", even if gbest not generates an exact gbase-gref geometry: it is a good approximation and have uniform width w, the average width of gbase-gref (w is mean beach width).

NOTES
Fit the "best curve" about a set of points in an XY chart is a classical statiscal problem,
have classical solutions, and have a lot of tools for it.
Similarly the "best curve about another curve" is usual when the "best" is a simple one,
like a straight line, a parabola, etc.  To fit irregular/complex lines
Cubic spline lines are frequently used.
Where are the standard functions tools for "fit the best polygon in a GIS context"?  Are there standard libraries?  For generic statistical problems we have external packages
that can be integrated with postgreSQL and PostGIS...
But for built-in functions: ST_Buffer is a standard function, why not a function  BestBuffer in a complementary library?


texts:
I want to use QGIS to convert millions of lines (It's a Streetlayer.shp) to Points.
I know, that there is a way to do that but what I haven't figured out yet is following problem:

The conversion-tool uses a Reference-node left (unique id) and reference-node right (unique id) from the line and puts a point in center of these. As long as the line is straight it does what it's meant to do. When the lines has more than 2 nodes and makes a curve the conversion-tool still puts the point in the center of reference-node left and reference-node right which isn't on the line anymore (see picture attached).

Is there a way to make sure that the point is on the line?


texts:
I have a raster that I've been trying to export from ArcGIS Pro as a .tif so I can load it into object based image analysis software. The raster loaded from the .gdb displays fine in Arc and is stretched from 33.2413 to -20.05811. I am exporting the raster as 'Right click > Data > Export Raster' and am saving it to a file folder with the tif extension and specifying 32-bit float (as per the original). When pulled into Arc after exporting it stretches from 0 to 0. I then tried 8-bit signed and the resultant raster was stretched from 33 to -128 but the pixel values are not the same as the original raster. I tried changing the stats but nothing seems to display the original raster values when in the tif format.

Does anyone know of another method or how I could go about getting the values to display correctly in the tif?


texts: Single tiled Mapserver WMS to avoid Labels and features cut along tile borders and repeated labels

texts:
I am using Mapserver-wms-openlayers for publishing maps. But there are some issues came across related to duplicate labeling for same feature in adjacent tiles, unwanted breaks in line features along tile borders, labels cut along tile boarders.
Not much documentations to clear this anywhere.
Can I create single tile using mapserver wms? Just increasing the tile-size to container (map-div) size is enough?

My code is:

map = new OpenLayers.Map('map',
  {zoomDuration: 1,projection: 'EPSG:3857'}
);

var mymap_all = new OpenLayers.Layer.WMS("EOL",
"http://192.168.0.233/cgi-bin/mapserv?map=/var/www/mstest/test_plant.map",
  {'layers':"map_outline",
   'transparent':true,
   'format':'image/png'},
  {isBaseLayer: false,opacity: 100},
  {singleTile: true, ratio: 1}
);

var gmap = new OpenLayers.Layer.Google("Google Streets", // the default
  {numZoomLevels: 25,visibility: false},
  {isBaseLayer: true}
);

map.addLayers([mymap_all,gmap]);


texts: How to view coordinates instead of geometry object in geometry column in Oracle SQL Developer?

texts:
I've once found a setting in Oracle SQL Developer, allowing to display the geometry column as coordinates, instead of the generic geometry object name (e.g. MDSYS.SDO_GEOMETRY).

I cannot find it anymore, where is this setting located?

Note: I've also posted this question on dba.stackexchange.com


texts:
I have spatial MS SQL 2012 and i need to store hindi characters in a column.
I tried using nvarchar datatype but I'm getting only "Question marks(????)".

Is it possible to store non-english characters?


texts: Sorting layer created by Create Layer from Selected Features using ArcMap

texts:
I am using ArcGIS Desktop 10.5.1 Standard / Windows 10 Pro.

I am selecting features with a common attribute and then using the Create Layer from Selected Features method to create a new layer to work on. As soon as I sort my new selection layer, its feature count jumps back to the original feature count of the source layer. In effect, I now have a new layer that is an exact duplicate of the source layer.

Are there certain conditions with the source data that might cause this behavior?


texts: QGIS new version on UBUNTU 14.04 Nvidia Jetson TX1

texts:
I had tried to install the latest QGIS following the commands listed on QGIS Documentation ; But they seem not to work for the arm architecture of Nvidia Jetson TX1 & i get a clash of the version number.  Then i had reflashed my board Nvidia Jetson TX1 and installed QGIS old version.  As anyone tried to install QGIS on arm64 Nvidia Jetson TX1 ?

Here is the result of uname -a

Linux tegra-ubuntu 3.10.96-tegra #1 SMP PREEMPT Tue May 17 16:29:05 PDT 2016 aarch64 aarch64 aarch64 GNU/Linux

My terminal output:

ubuntu@tegra-ubuntu:~$ sudo apt-get install qgis
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qgis : Depends: qgis-providers (= 2.0.1-2build2) but it is not going to be installed
        Depends: qgis-common (= 2.0.1-2build2) but 2.8.3-0~trusty1 is to be installed
        Recommends: qgis-plugin-grass but it is not going to be installed
        Recommends: qgis-plugin-globe but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried to compile Grass according to Grass wiki
But, i am not understand how to specify for grass build, the system type

ubuntu@tegra-ubuntu:/usr/local/src/proj$ ./configure  &&  make  &&  sudo make install
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... ./config.guess: unable to guess system type

This script, last modified 2007-03-06, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2007-03-06

uname -m = aarch64
uname -r = 3.10.96-tegra
uname -s = Linux
uname -v = #1 SMP PREEMPT Tue May 17 16:29:05 PDT 2016

/usr/bin/uname -p =
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              =
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = aarch64
UNAME_RELEASE = 3.10.96-tegra
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP PREEMPT Tue May 17 16:29:05 PDT 2016
configure: error: cannot guess build type; you must specify one


texts: Reclassifying multiple rasters using ModelBuilder of ArcMap

texts:
I am using ArcMap 10.1 or 10.2.
I have a folder with more than 500 raster (DEM) and i want to reclassify (equal interval method) each of them but number of classes in each case is determined by the number of 100m elevation bands. i.e number of classes =(max elevation- minimum elevation)/100. I have obtained max and minimum elevation of each raster from GetRasterProerties tool.
How do I put this custom number of classes for each raster using ModelBuilder?


texts: Openlayers 3 - if else, check if layer is visible condition

texts:
I am building an interactive map where my layers are displayed by zoomlevels using the min/maxResolution property. Here's the simple JS:

function getmap(){

//BaseLayer
    function baseMap(){
        var baseMap= new ol.layer.Tile({
            source: new ol.source.XYZ({
            url:'http://{1-
            4}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png',
            })
        })
        return baseMap
    };
//MainLayer
    var layerSource = new ol.source.Vector({
      loader: function(extent, resolution, projection) {
        var urlSecteur = 'JsonUrl&'
        +'bbox='+ extent.join(',');
        $.ajax({
          url: urlSecteur,
          success: function(data) {
            var features = geoJSONFormat.readFeatures(data);
            layerSource .addFeatures(features);
          }
        });
      },
      strategy: ol.loadingstrategy.bbox
    });

   function createLayer(){
            var Layer = new ol.layer.Vector({
                title: 'Layer',
                source: LayerSource,
                minResolution: 0,
                maxResolution: 1
            })
     return Layer
  };

//Assembly of layers
    var layerBaseMap= baseMap();
    var layerLayer = createLayer();

    var map = new ol.Map({
        target: 'map',
        layers: [
        layerBaseMap,
        layerLayer
        ],
        view: new ol.View({
            center: ol.proj.fromLonLat([2.52639, 46.48361]),
            zoom: 6,
            minZoom: 6,
            minZoom: 6
        })
};

And the HTML:

             <link rel="stylesheet" href="/JsLib/openlayer/ol.css" />

What I want to do is to display a legend when the layer gets visible (when the user reach the appropriate zoomlevel). The legend is already set in HTML so I just need to change the display property in CSS from "none" to "block".
In theory this should goes like this at the end of the Js:

   if(layerLayer.isVisible == true){
            legend.style.display="block"
       }else{
        legend.style.display="none"
       };

I have already tried some solutions, noone of these has worked:

if(layerLayer.getVisible() == true){
        legend.style.display="block"
    }else{
        legend.style.display="none"
    };

And

if(layerSource.getState() == 'ready'){
        legend.style.display="block"
    }else{
        legend.style.display="none"
    };

Both display the legend when the map gets loaded.

Any suggestions?


texts: Getting Python console in QGIS to do tab completion of file system?

texts:
I am trying to have the Python 3 console tab of QGIS 3 complete my file system.

I've tried import sys but this does not allow me to do it.


texts: french accents changed to junk characters when saving the SLD in geoserver 2.11.2

texts:
I have a shapefile with french accent and needs to be published in geoserver 2.11.2. I have my geoserver in tomcat 8.5 and am using Ubuntu 14.04. The french accents are showing fine in get feature info but the issue is only when saving those characters in SLD, the french accents gets changed to junk characters.I have set my encoding as UTF-8 in SLD

But when i see the encoding of the file after saving by command file --mime-encoding it is in us-ascii instead of UTF-8.


texts:
Regarding to Jay suggestion i open a new topic.

Do you know how i can set in arcgis 9.3 coordinates only with one locus after comma, i mean like that format: xx xx xx,x not like i have now xx xx xx,xxx (screen below)


texts: Trying to save the map in pdf but it's stuck on rendering

texts:
I'm trying to save a map in pdf but it's stuck on ,,rendering map", and it's not doing something...What can I do in order to solve it? I've downloaded the A3 template map from here https://layout-hub.github.io/ Is it something that I'm doing wrong?
My map:

The stuck process:

Layout manager:


texts: Python GDAL API: .Transform(osr.CoordinateTransformation(…), …)

texts:
A have input .tif files and geojson with different EPGS. I'm trying to use osr.CoordinateTransformation(source, target) method which takes 2 arguments of EPGS like on this cookbook. So how can I get this values from input files? Method AutoIdentifeEPSG ()  doesn't work.

Here is my code:

Register Imagine driver and open file. Getting projection of input file.

driver = gdal.GetDriverByName('GTiff')
dataset = gdal.Open('{}/{}.tif'.format(image_dir, file_name))
projection = dataset.GetProjection()

And I created geometry to set it directly to the feature

geometry = ogr.CreateGeometryFromJson(""" some json string """)
lyr = memds.CreateLayer('', geom_type=ogr.wkbMultiPolygon)
feat = ogr.Feature(lyr.GetLayerDefn())
feat.SetGeometryDirectly( ogr.Geometry(wkt = geometry.ExportToWkt()) )
lyr.CreateFeature(feat)

Then I need to transform geomerty projection to the projection of the input .tif file.

geometry.Transform(osr.CoordinateTransformation(…), …)

but when I tried to use .Transform () method on my geometry I got error like: `NoneType object have not attribute or method Transform.


texts: v.rectify don't work properly from processing toolbox in QGIS 3.2

texts:
I would like to use the tool "v.rectify" from GRASS in my plugin, but when I call it, it continues to say that "ERROR: Required parameter 'output' not set", although this parameter is set. I think this is a bug. I run the tool with the following parameters:

{ '-3' : False, '-b' : False, '-o' : False, 'GRASS_MIN_AREA_PARAMETER' : 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER' : 1, 'GRASS_REGION_PARAMETER' : None,
'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '','GRASS_VECTOR_LCO' : '',
'inline_points' : '', 'input' : 'F:/Study/6_semester/manufacturing_practice/Results/
ClipProject.shp', 'order' : 2, 'output' : 'rectified_test', 'points' : 'F:/Study/6_semester/
manufacturing_practice/Work/LinkTable_fixed.txt', 'rmsfile' : 'F:/Users/Ram1L/AppData/Local/
Temp/processing_13eee64d26b245df93f2fdc2e933ecd0/b7cd4c655ce04008af2d038b81108a60/rmsfile.txt',
'separator' : 'pipe' }

I tried to use the tool in the GRASS itself with the same parameters and it works. Also tried many times to change the input parameters. QGIS version - 3.2.0-Bonn, GRASS version - 7.4.1, OS - Windows 8.1. Link to the log of tool - https://pastebin.com/tFfLcrNF. Other tool from GRASS section in processing toolbox v.buffer works fine. Sorry for bad english


texts: Union very large layer in FGDB and only keep one polygon that is overlapping?

texts:
I'm trying to union an exceptionally large layer (45k features) of footprints with many of them largely overlapping. I'd like to union this layer but I'm having trouble due to the size of it. The end result I would like to have is a layer with individual polygons.

I preformed a small union test with 63 footprints. The result was almost 9k features in the output which many of them the same polygon ontop of each other. If I did this with the entire layer I would end up with >6 million features.

You can see here that identifying 1 polygon shows many polygons stacked ontop of each other after the union

So obviously I can't run a union on 45k overlapping features even on my VM with the cmd line (still recieve missing table/topology error).

The goal I want to achieve is to have a flat plane of individual polygons from the union(not multiple polygons that are the same stacked ontop of eachother). Using this layer I want to eventually derive points from the mean centers then spatial join with the original layer to get the overlapping counts for each individual area so I can determine the footprint coverage. The above is the method that I thought of but if there is an easier way/less resource intensive way I'm all ears.


texts: I need to convert approximately 3500 jpeg2000 4-band NAIP images to GeoTiff format without mosaicing.  I have access to ENVI, ERDAS and Arc 10--is there an efficient way to batch convert these files to GeoTIFF while maintaining quality and band integrity?


texts: Crowdsourcing points by on-click to web map with moderation?

texts:
I want to build a really lightweight web map interface where a user can click anywhere on a map, create a point, type in a comment -- ideally all via Facebook, but I don't want to get ahead of myself -- and have that comment pop up next to the point on mouse-over. Eventually, a large "crowdsourced" smattering of points with comments will be formed ... kind of like this New York Times map.

I have access to everything I need to build something with the ArcGIS API for JavaScript, and some basic knowledge of JavaScript / that API, but am stymied by the need for the following features, in order of importance (1 & 2 are about equal):

A moderator of some sort (me) can go in & remove any inappropriate points/comments.
User X cannot edit any other users' points.
User X who makes a point on the map can go back and edit any of their own points.

It seems the ArcGIS API can help you make a web map that allows a point-editing free-for-all, but nothing like the above features, as far as I know. And I don't know much about the server/database side of web technologies. What kind of technology would even be necessary to:

Recognize User X as User X & not User Y?
Recognize points a, b, and c as belonging to user X?
Letting user X edit those points and no other points?

I imagine there would need to be some kind of account creation / logging-in situation, tied to map editing capability? Where would one even begin crafting something like that?

For functionality, Crowdmap (like this example here) does exactly what I'm looking for in terms of the key requirements 1 & 2, but I want something a lot more simple ... just one click on the map, type in a box to put your comment, and you're done, no clicking through to "report submission" forms with tons of fields and sending it off somewhere to get processed.

For aesthetics & some functionality, I really like the look & simplicity of this cool map, which also fulfills 1 & 2, but I have no idea how user-submitted polygons are being read and presumably appended to a geo-enabled table/database, and in fact that very part seems crucially incomplete, because the things you draw on the map don't seem to actually get saved.

Would love to get pointed in the right direction, as I would be thrilled to know how to do this! Or even what I need to learn more broadly.


texts: Converting contours to DEM raster (using TIN interpolation)

texts:
I have a contour file for the Brazilian state of Rio de Janeiro (available here https://www.arcgis.com/home/item.html?id=c575d42b3f114d7da4784a337b42dcd9) and need to convert it into a DEM raster file.
I have found many tutorials on how to do that but for some reason, I am unable to produce a DEM.
Following this tutorial (https://www.youtube.com/watch?v=-euJdFYPzdM&ab_channel=Q-tips), this is what I have done:
On Qgis:
1st step: Layor > Add Layor > Add Vector Layor (select my contour)
2nd step: TIN interpolation > Select Variable with info about elevation (in my case, "cota") > Select Extent (I used the "draw on canvas" function to select the city of Rio de Janeiro only).
Once the process is done, my result looks nothing like the one in the video. It seems that nothing really was produced. If I either select or not the "Interpolated" layer, nothing changes on the plot. The values also look weird (see print screen).
I am very new to GIS so I am guessing this is very trivial. After googling a lot, I am still lost though.


texts: I have files in Map Info format(TAB,DATA,etc) and I want to convert them to WKT(well-known text) format, so that I can store in a DB. do any of you know how to convert Map Info to WKT?


texts: What Is The Ideal Workflow To Map (British) Postcode Territories

texts:
I'm looking for the best workflow for mapping postcodes and calculated territories, but being relatively new to mapping I'm struggling on a few details and also the best practices for displaying these maps via a browser.

I have access to the Code-Point Open postcode data from Ordnance Survey and my intention is to generate layers based on this data based on a series of dissolving aggregations (Postcode Sector into Group1 into Group2 into Group3) etc.

I think I need to aggregate this data in each level using Voronoi regions - what I don't understand is whether I need to generate polygons or can draw these polygons in a live manner?

I have access to Windows (WAMP) and Red Hat 6 (LAMP+PostGres+PostGis) - where can I find out more about generating voronoi and the advantages/disadvantages of pre-rendered polygons?

On a side note, our regions change quarterly and so for all but the lowest level this data will need recalibrating 4 times a year - we would probably regroup postcode sectors at the same time (as Code-Point is also updated quarterly and well, we might as well update everything).


texts: Is there a way to convert 3D polylines to 3D points in ArcGIS?

texts:
I need to convert a huge number of very dense (densified to 1m) 3D polylines to 3D points.
I need each vertex along the line and no duplicates (two of the same XYZ coordinates) if possible. Is there a tool for that? Each feature class to be converted yields about 1 to 2 million points.
I did write my own add-on for this and although I am using the insert cursor (as oppose to iFeature:Store) it's quite slow so I am hoping there is a better way.


texts: XML Schema into Pathfinder Office to create a Data Dictionary?

texts:
I have an exported XML Schema from a client database that I need to convert to a ASCII File in order to import the schema into the data dictionary editor in Pathfinder Office.

Does anyone know how to do this?


texts: Arcobjects: DisplayTransformation.FromMapPoint() transforms wrong

texts:
I want to transform map coords into page coords in ArcObjects in Python. So I do, say:

>>> pApp = NewObj(esriFrame.AppROT, esriFrame.IAppROT).Item(0)
>>> pDoc = pApp.Document
>>> pMxDoc = CType(pDoc, esriMapUI.IMxDocument)

>>> pDisplay = pMxDoc.ActiveView.ScreenDisplay # something wrong here?
>>> pDisTrans = pDisplay.DisplayTransformation

>>> pageX, pageY = pDisTrans.FromMapPoint(ptInRealCoords) # coords are ~389700,~316671m
>>> pageX
6523059 # which should be ~4.73 in cm

Any clues whats wrong?


texts: Can ArcGIS Server be called ArcSDE? I'm confused about terminology

texts:
I'm confused about some ESRI terminology.

If I have ArcGIS 10.1 Server installed and we use Enterprise geodatabases with versioning capabilities but we use direction connections does this have anything to do with ArcSDE or SDE?

I know that ArcSDE isn't even installed on our server, but I see ArcSDE experience being requested quite a bit but I never know if they truly are using ArcSDE or that's just what they are used to calling it.

Can someone clear this up for me?


texts: Tile request limits at {a-c}.tile.openstreetmap.org

texts:
My in-house application is using the OpenStreetMap tile servers {a-c}.tile.openstreetmap.org for a 'free' base layer. I've read the tile usage policy and although it prohibits "heavy use" it only provides a vague reference to what this might be.

Users within the company office periodically see a slow down in tile performance (e.g. suddenly each tile takes 10 - 15 seconds to download). This happens for map areas they use on a regular basis (it's unlikely the tiles are being generated on-the-fly) and it doesn't happen for remote users (who access the tile servers from a different origin IP). This suggests that the tile servers are throttling performance based on origin IP.

I found some source code in the OpenStreetMap Github mod_tile repo that supports throttling based on IP but 1) I'm not sure if this is what is used at {a-c}.tile.openstreetmap.org and 2) I still have no idea what the usage limits are.

Are there defined and published limits on how many tiles per (day|week|month) a single IP may request?


texts:
Has anybody done performance benchmarks between C++, C#, and Java  ArcGIS Server Object Extensions?

I'm wondering writing lower-level code translates to better performance.


texts: How to create a square polygon or buffer with quadrants in ArcGIS?

texts:
I have 32 points than I need to create a 2 mile square polygon around, and break each polygon into 4 quadrants. I've tried a few things, including creating an MBR(Minimum Bounding Rectangle) around a standard buffer, but those don't output perfect squares for some reason, which doesn't necessarily totally matter, but I hit a wall when I try to break the square polygons into quadrants.

I'm using the NAD 1983 UTM Zone 12N coordinate system for the map. The Geodatabase for my data is GCS_North_American_1983. I'm using ArcGIS 10.3.1

Here's an example of what I generally need.


texts: How to visualize grd files in the software QGIS?


texts: Getting error while creating createMapSDDraft using Python

texts:
I am getting error while creating the MapSDDraft using Python.

import arcpy
import os
import xml.dom.minidom as DOM
workspace = r'C:\\Users\\xyz\\Documents\\ArcGIS\\'
mxd = 'TEST.mxd'
con = r'C:\\Users\\xyz\\AppData\\Roaming\\ESRI\\Desktop10.6\\ArcCatalog\\arcgis on domain(xyz.in)(admin)'
service = 'FirstService'
summary = 'testing purpose'
tags = 'test'
mapDoc = arcpy.mapping.MapDocument(workspace + mxd)
sddraft = workspace + service + '.sddraft'
sd = workspace + service + '.sd'
analysis = arcpy.mapping.CreateMapSDDraft(mapDoc,sddraft,service,"ARCGIS_SERVER",con,True,None,summary,tags)

Runtime error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\utils.py", line 182, in fn_
    return fn(*args, **kw)
  File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\mapping.py", line 398, in CreateMapSDDraft
    return convertArcObjectToPythonObject(arcgisscripting._createMapSDDraft(*gp_fixargs([map_document, out_sddraft, service_name, server_type, connection_file_path, copy_data_to_server, folder_name, summary, tags], True, False)))
ValueError: C:\\Users\\xyz\\AppData\\Roaming\\ESRI\\Desktop10.6\\ArcCatalog\\arcgis on domain(xyz.in)(admin)

Actually, I have the ArcGIS Server on another machine and the ArcMap on another machine. I am writing script where ArcMap is installed. I am totally new to ArcPy.


texts:
I'm installing QGIS Web Client following these instructions on windows 7.

Problem
When trying to access 'http://localhost/web/site/qgiswebclient.html?map=C:/OSGeo4W/apache/htdocs/web/projects/helloworld.qgs' the web client loads but hangs at 'Loading Map'. In the browser developer console I'm getting the error:

XMLHttpRequest cannot load file:///C:/OSGeo4W/app/qgis/bin/qgis_mapserv.fcgi?map=C:/OSGeo4W/apache/htdocs/web/projects/helloworld.qgs&&_dc=1475068443365&SERVICE=WMS&VERSION=1.3&REQUEST=GetProjectSettings

But GetCapabilities returns the un-styled xml without issue...

What I've tried

All the references to /home/web/qgis-web-client/ in GlobalOptions.js and index.html etc have been changed to C:\OSGeo4W\apache\htdocs\web\projects.

.exe has been removed from qgis_mapserv.fcgi.exe to create qgis_mapserv.fcgi.

Project CRS set to EPSG:3857in GlobalOptions.js

In httpd.conf I've changed:

ScriptAlias /cgi-bin/ "C:\OSGeo4W/bin/" to ScriptAlias /cgi-bin/ "C:\OSGeo4W/apps/qgis/bin/"

I've tried all the QGIS Web Client questions including these:

How to setup QGIS Web Client?

qgis-web-client stuck on Loading Map

QGIS Web Client in Windows does not load map


texts: Qgis - taudem plugin - python script not found

texts:
I installed the sextante toolbox on qgis.
my os is fedora.

grass works fine but i've got problems with taudem. it seems like some python files are missing.
for instance when i try to run the pitremove algorithm the sextante info log yields:
"HYDU_create_process (./utils/launch/launch.c:69): execvp error on file /home/me/.qgis/python/plugins/sextante/taudem/pitremove (No such file or directory)"

indeed, there's no pitremove.py in the plugins/sextante/taudem directory.

so did I missed one step in the plugin installation ?

thanks for your help


texts:
I am attempting to change the name of the layer. The following code changes the name of the layer but then removes the layer from the map, and I am not sure why.

Note: I don't have any remove layer statements.

for lyrs in arcpy.mapping.ListLayers(mxd, "*", df):
    if lyrs.name == "project_ws":
        lyrs.name = "project_prow"

arcpy.RefreshTOC()
arcpy.RefreshActiveView()


texts:
I used both Python and QGIS to perform polygonization of a raster but the waiting times with Python are very long, while with QGIS the operation is done in a few seconds.
Could you tell me the reason of such difference?
This is my code:
import rasterio
from rasterio.features import shapes
import geopandas as gpd

mask = None

with rasterio.open('...\\.tif') as src:
    image = src.read(1)
    results = (
    {'properties': {'DN': v}, 'geometry': s}
    for i, (s, v)
    in enumerate(
        shapes(image, mask=mask, transform=src.transform)))

geoms = list(results)
gpd_polygonized_raster = gpd.GeoDataFrame.from_features(geoms,crs=src.crs.to_dict())
ss = gpd_polygonized_raster[gpd_polygonized_raster['DN']]
ss.to_file(...)

I also tried using GDAL, but it still takes much longer than QGIS.


texts: QGIS: processing-modeler to add multiple layer name to attribute field

texts: I'm trying to add layer name using the field-calculator in QGIS (3.4.1). If I do this manualy it works fine, but if I do this using the processing-modeler I get NULL for every field. I just type @layer_name in the Formula field. Field-type is string and length is 50.


texts: Loop through a marker cluster using Leafletjs

texts:
I have a variable like this

var cubbon = new L.MarkerClusterGroup()

then i added many markers to this variable.
now i like to create a function() and loop through the variable and find out a marker having latitude value of 12.962.

once i find the marker, i like to use openPopup() method to open popup window on the marker.

i want this loop to run when i click a button.

Here is my code process..

Objective: click an 'html' button, so that a marker(having latitude=12.962 & Longitude=77.168) which is within 'marker cluster group'should open its popup automatically.

//create a marker cluster variable with the name 'parks'
var allParks = new L.MarkerClusterGroup({    maxClusterRadius: 20,spiderfyOnMaxZoom: true, showCoverageOnHover: false, zoomToBoundsOnClick: true});
//now i create individual markers and finally add them to 'allParks' variable.
var parkA = L.marker(new L.LatLng(13.234, 76.321);
parkA.bindPopup("Here the parkA");
var parkB = L.marker(new L.LatLng(13.325, 76.675);
parkB.bindPopup("Here the parkB");
var parkC = L.marker(new L.LatLng(12.962, 77.168);
parkC.bindPopup("Here the parkD");

//Now i add all these markers to 'allParks' variable.
allParks.addLayer(parkA);
allParks.addLayer(parkB);
allParks.addLayer(parkC);
// like this i created many park's and finally added to the varaible 'allParks'
//Now, as stated earlier, on a click of a button the following function should fire, which loop through the marker-cluster variable (allParks) and find out the park (having lat=12.962,long=77.168) and open its popup on the map.
//this is where i am trying and failing.i am using the 'eachlayer'method to loop

allParks.eachLayer(function (layer) {
if(((layer.getLatLng().lat)=12.962) && ((layer.getLatLng().lng)=77.168)){
layer.openPopup();
}

});

Can you help me how to loop through that variable and find out only that park satisfying the condition and open its popup on the map?


texts:
A client asked us for a group of files of DTM in Grid Format.

And my question is, what is this DTM in Grid format? O maybe its same of DEM?
Is it possible to convert from DEM gray scale format to DTM Grid?

I have ArcGIS and Erdas Imagine, perhaps this may help me.

At work, we produce Orthophotos and DEMs (Digital Elevation Model) in TIFF or JPEG format, the classic Gray scale image but I don't know what is a DTM in Grid format. Could you help me with this?


texts:
I would like to install Qgis to my Raspberry and I would like to load some plugins in it.
I have some problems.
First on my pc I have installed the version 2.14.11 Essen of Qgis, instead on the raspberry the newest version of the Qgis that I have found is the 2.4 Chugiak.
Why I cannot load in my raspberry the Essen Version?

Secondly I tried to load some plugin in my Raspberry. For Example I would like to load the QAD plugin but I have an error when I load it:
“’QsgBubberBand’ object has no attribute ‘setBorderColor’”.

Probably I missed something during the installation on my raspberry?

I tried also to install FirstAid Plugin and the error was:
"name “QgsPointLocator” is not defined"


texts: Zoom from one feature to another in edit mode?

texts:
I have to manually edit a shapefile of a couple of hundred points.

I would like a quick way to jump from one point to the next in both the attribute sense and the visual/spatial sense i.e I would like to while in edit mode jump from object ID 1 to Object ID 2 without having to open the attribute table, select the next point, zoom to selection, etc.

A sort of "Next" button that would expedite the manual process.


texts: QGIS Spatialite select by expression performance

texts:
I've created a spatialite database with 1,600,000 rows with an index on one of the fields, when I query the indexed text field using the spatialite GUI the response is almost instant. If I load the database into QGIS (2.8.3) and query the same field using select by expression the query takes 20 seconds to complete so it appears QGIS isn't using the index.

Does anyone have any ideas as to how I can improve performance of the query in QGIS?


texts: Converting a WMS GetFeatureInfo's specific feature as hyperlink through GeoExt

texts:
I'm tying to develop a WMS GetFeatureInfo query using GeoExt, OpenLayers and GeoServer and I want a hyperlink to be displayed on the popup window in a specific column. I have created the service but the link is returned as plain text.

I want to modify the content of the GeoExt window's content in order to convert that field to hyperlink.
I read several answers in similar questions like:
OpenLayers - URL hyperlink in GetFeatureInfo table?

I succeed to convert the WMS GetFeatureInfo response to a hyperlink in GeoServer 'layer preview' template but when I use the same layer in my GeoExt app the content is plain text.
Also I read a way to convert GeoExt popup content in the following thread:
http://www.geoext.org/pipermail/users/2011-July/002412.html

But I feel that the solution in my case is much simpler.
My code:

 var gfiControl = new OpenLayers.Control.WMSGetFeatureInfo({
            // autoActivate: true,
             drillDown: true,
             infoFormat: "application/vnd.ogc.gml",
             maxFeatures: 3,
             eventListeners: {
                "getfeatureinfo": function(e) {
                 var items = [];
                 Ext.each(e.features, function(feature) {
                    items.push({
                       xtype: "propertygrid",
                       title: feature.fid,
                       source: feature.attributes
                  });
             });
             if (items.length > 0) {
                Ext.create('GeoExt.window.Popup', {
                   title: "Feature Info",
                   width: 350,
                   height: 320,
                   layout: "accordion",
                   map: mapPanel,
                   location: e.xy,
                   items: items
                  }).show();
                 }
               }
             }
          });

Any suggestions?

UPDATE

I created a content.ftl template in my GeoServer and the direct response from GeoServer works fine.
After the @nmtoken's helpful comments and more searching, I realized that the main issue is that my GeoExt code cannot parse the html response from GeoServer. My GeoExt code now looks like that:

var gfiControl = new OpenLayers.Control.WMSGetFeatureInfo({
            // autoActivate: true,
             drillDown: true,
             infoFormat: "text/html",
             maxFeatures: 3,
             eventListeners: {
                "getfeatureinfo": function(e) {
                 var items = [];
                 Ext.each(e.features, function(feature) {
                    items.push({
                       xtype: "propertygrid",
                       title: feature.fid,
                       source: feature.attributes
                  });
             });
             if (items.length > 0) {
                Ext.create('GeoExt.window.Popup', {
                  title: "Feature Info",
                   width: 350,
                   height: 320,
                   layout: "accordion",
                   map: mapPanel,
                   location: e.xy,
                   items: items
                  }).show();
                 }
               }
             }
          });

But while the ajax response has a status = 200, the popup window doesn't open.
When I copy and paste the query that is sent to the server to my browser, the response is successful just like in GeoServer's 'layer preview' page.
It seems like GeoExt cannot parse the response as infoFormat = text/html but only in infoFormat= "application/vnd.ogc.gml".
How can I fix this ?


texts: Cropping geo pdf in GDAL for use in OruxMaps?

texts:
I am attempting to crop geo pdf mapsheet files to the map area, so that they will switch automatically between maps in a program like Oruxmaps. The starting geo pdfs open fine in OM. So far I can use the published python script (cutline.py):

from osgeo import gdal
import os
import sys

ds = gdal.Open(sys.argv[1])
neatline_wkt = ds.GetMetadataItem("NEATLINE")
ds = None

f = open('cutline.csv', 'wt')
f.write('id,WKT\n')
f.write('1,"%s"\n' % neatline_wkt)
f.close()

os.system('gdalwarp %s temp.tif ' % sys.argv[1] +
      '-crop_to_cutline -cutline cutline.csv -overwrite')

run: python cutline.py whatever.pdf

But gdalwrap gives an error on attempted raster geo pdf output, so the above script uses the default geo tif output. Therefore, to get the cropped pdf, I have to run: gdal_translate -of pdf temp.tif temp.pdf

Unfortunately after all that, OruxMaps to v. 7.0.17 does not seem to support geo pdfs from GDAL. After refresh maps, OM gives the error “> Can not find GEO info!” (even though the GEO info shows using gdalinfo, and the files open with correct geo referencing in qgis, for example).

So, my question is:

Is there a direct way to get gdal to crop a geo pdf and save the geo pdf format?


texts: Convert ESRI Shapefile to Raster using R - biggest polygon area to raster cell value?

texts:
I want to create a raster from an ESRI shapefile. Multiple polygons may exist in one raster cell.

If so, I want to assign the attribute variable which occupies the biggest area of the raster cell. If, for example, Polygon1 occupies 10%, Polygon14 25% and Polygon5 65% of the raster cell, the cell should contain the attribute variable of Polygon5.

Using the R-pacakge rasterize{raster}, values are transferred if the polygon covers the center of a raster cell. Of course, functions like min, max, mean, or character values like 'first', 'last', 'sum', 'count' are available. Default is 'last'.

You can download the sample shapefile here.

Up to now my code is this:

setwd("your_wd")

require(sp)
require(raster)
require(rgdal)

sp_df <- readOGR(getwd(), "stok_subs") # reads the shapefile into a large polygon
                                       # data frame

extent(sp_df) # shows the extent of sp_df

summary(sp_df) # simple summary

# Object of class SpatialPolygonsDataFrame
# Coordinates:
#        min      max
# x 32539350 32544695
# y  5732607  5735439
# Is projected: TRUE
# proj4string :
# [+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=32500000 +y_0=0 +ellps=GRS80+units=m+no_defs]
# Data attributes:
# X_CENTR           Y_CENTR            ATTRIBUTE
# Min.   :3539714   Min.   :5734725   9.4-.2.3 :21
# 1st Qu.:3540436   1st Qu.:5735323   23.4-.2.3:19
# Median :3541226   Median :5735830   9.4.2.3  :19
# Mean   :3541263   Mean   :5735824   23.4.3.5 :18
# 3rd Qu.:3542031   3rd Qu.:5736358   23.4.2.3 :16
# Max.   :3543461   Max.   :5737024   19.4.3.5 :12
#                                     (Other)  :89

r <- raster(extent(sp_df)) # creates a raster with the extent of sp_df
projection(r) <- proj4string(sp_df) # uses the projection of the shapefile
                                    # for the raster
res(r)=10.0 # sets the resolution of the raster to 10 m

r10 <- rasterize(sp_df, field="ATTRIBUTE", r) # converts sp_df to a raster
                                              # assigning the last attribute
                                              # variable in a cell (default)

writeRaster(r10, filename="stok_subs.tif", format="GTiff") # writes the raster
                                                           # to a file

plot(r10) # plots raster

None of the provided functions seem to cover my needs. However, I'd rather operate with R, as operations with very large raster data (e.g. whole Lower Saxony @ a resolution of 10 m) may be easier to handle than with GIS solutions.

Anyone out there who has a (or any) solution for my problem?


texts: Adding an XYZ tile using PyQGIS in PyCharm

texts:
I am trying to add a XYZ Open Street Map tile into my QGIS project, using PyQGIS. I am currently trying to use PyCharm to start with, to see if my script is running correctly. I have looked through various other questions but none have worked successfully so far. I have also tried to add the link with %7Bz%7D/%7Bx%7D/%7By%7D instead of {z}/{x}/{y} but still no luck. The code works perfectly inside the QGIS Python Console but does not seem to run in PyCharm. My code is:
# Add Base Map
urlWithParams = 'type=xyz&url=https://tile.openstreetmap.org/{z}/{x}/{y}.png&zmax=19&zmin=0&crs=EPSG3857'
rlayer2 = QgsRasterLayer(urlWithParams, 'OpenStreetMap', 'wms')

rlayer2.isValid()
QgsProject.instance().addMapLayer(rlayer2)
print(QgsProject.instance().mapLayers())

But when I run the script, an error occurs as my other raster and vector layer is added, but the OpenStreetMap layer becomes invalid and is not added to my exported map, even though it tells me in the script that rlayer2.isValid (as can be seen below).
{'OpenStreetMap_9b914e8c_7637_411a_beea_397b7f36f2c8': <QgsRasterLayer: 'OpenStreetMap' (Invalid)>}

Wetransfer link - [1]: https://we.tl/t-RiNdhUOHrc


texts: How to configure osm2po to use maxspeed:seasonal:winter if available?

texts: In Finland, the speed limits on some roads are different in the winter. These roads are usually tagged with maxspeed:seasonal:winter in OpenStreetMap. Is there a way of configuring osm2po to use the value of maxspeed:seasonal:winter instead of maxspeed when overriding the default speeds?


texts:
I'm new to R and GIS so please forgive me if this is a simple request.

I was looking for a way to find out if a Lat/Long point is on land or ocean. I found this previous post from a couple of years ago which provides an array of true/false results.

Given a Lat and Lon, identify if the point is over land or ocean?

I was able to get it to display the simple world map with the points, but I had two questions:

How do I use the rworldmap with the more detailed and up to date country polygons?
How do I return only the Lat/Long points that are on land?

Basically I am looking to get the Lat/Long points that are on land only and don't know where to start.


texts:
I'm trying to load a shapefile into a GeoServer that has a style defined which makes use of the FID attribute:

      <PolygonSymbolizer>
       <Fill>
         <CssParameter name="fill">
           <ogc:Function name="Interpolate">
             <!-- Property to transform -->
             <ogc:PropertyName>FID</ogc:PropertyName>

The shapefile I'm currently working with doesn't have an explicit 'FID' attribute:

$ ogrinfo -al -geom=NO precincts.dbf
...
OBJECTID: Integer (10.0)
Name: String (100.0)
Label: String (100.0)
Type: String (50.0)
CurrencyDa: Date (10.0)
SrcFormat: String (150.0)
Shape_area: Real (19.17)
Shape_len: Real (19.17)

But requesting the 'FID' attribute seems to somehow procure one:

$ ogrinfo -geom=NO -al precincts.shp -sql 'select FID from precincts'

FID: Integer (0.0)
OGRFeature(precincts):0
  FID (Integer) = 0

OGRFeature(precincts):1
  FID (Integer) = 1

OGRFeature(precincts):2
  FID (Integer) = 2

Uploading it to GeoServer however lists no FID attribute:

While other shapefiles previously uploaded (and whose provenance is unknown to me) do have one:

I have managed to generate one shapefile with a FID attribute by exporting it from PostGIS. However, this particular 'precincts' shapefile doesn't come from PostGIS. (Maybe I could import it to PostGIS just for this purpose, but that seems a bit dumb...)

Basically, I'm wondering:

What is the deal with the FID attribute? Is it a real attribute, or something that ogrinfo fakes?
Is there a way to turn it from a fake attribute into a real one so that GeoServer can see it?
Or is there some other way to get GeoServer to recognise it for the purposes of this style?


texts:
Every time I think I've started to get a very basic handle on QGIS, I get thrown for a loop.

I tried to run r.flow today, and got the following error:

ERROR: Elevation raster map resolution differs from current region resolution

So, upon investigating this, I realize that I'd never set a GRASS region, which is apparently an important thing to do, for reasons i'm still not very clear on, even after reading the man page.

I name my location "grasslocation_test" and my mapset "test_mapset".

So now I have QGIS open, with all my various rasters and vectors still visible, but now I have a Region window open as well.  It seems like I need to match my region to my rasters, so I run g.region.multiple.raster, thinking this is the correct tool for the job.  Yet I can't select the raster I want to use to bound my region.  I tried moving the DEM into the map directory created when I created this new region, thinking maybe that was the problem, and still nothing.

I've googled this to no avail, which makes me feel even sillier since nobody else seems to have been quite as confused by this process as me, but here we are.


texts:
Does any one know how to stylish a map using QGIS? Im working on some maps but when I project them in Stat Planet Plus the lines look very pointy, not curvy at all and it looks really unprofessional. I attach an image. Any tipps?

Thanks in advance.

PD if it works, the only files that I have are .shp, .prj, .qpj, .shp, .shx and .dbf.
PD 2 to project them in Stat Planet Plus I only use the .shp and .dbf files.


texts: Which Open Source GIS application support Linear Referencing and Dynamic Segmentation?

texts: I'm looking for an Open Source GIS application that supports Linear Referencing and Dynamic Segmentation for the development of a road inventory system. I already know about GRASS but I'd like to know if there are any other options.


texts: Updating shapefile from ArcMap to ArcGIS Online - Automatically

texts:
I wish to update a Cities shapefile* in desktop ArcMap (10.5.1), and I would want this layer to be automatically updated (synced?) to a Cities layer in my US Severe Weather Alerts map on ArcGIS Online.

Is there a way to complete this process in the fewest steps? I'm already aware of the manual append upload method, but there has to be a more automatic way. How can I do this?

I know there are plenty of cities GIS layers, but the one I'm updating includes small unincorporated communities in addition to the cities that are typically available.


texts: Is it possible to get the the layer returned by a GRASS tool without saving it to disk in QGIS?

texts:
I use some GRASS tools in QGIS Python Console. All tools I use return a dictionary with a key and a value which contains string path, like this: {"output": "file/path"}. There is an answer here. It suggests to use that string in QgsVectorLayer. But writing/reading a file to/from disk is time consuming.
I tried processing.runAndLoadResults and processing.run. Both add a layer. But before adding the layer, they save the layer to disk, then add it.
processing.run("grass7:v.buffer", {..., 'output':'TEMPORARY_OUTPUT', ...})
# returns {'output': '/tmp/.../output.gpkg'} -> file path

processing.runAndLoadResults("grass7:v.buffer", , {..., 'output':'TEMPORARY_OUTPUT', ...})
# returns {'output': '/tmp/.../output.gpkg'} -> file path

I wonder, is there a way to get the returned/added layer by the GRASS tool without saving to disk (to use in the next processing tool in a Python script)?


texts: Generate polygons based on point origins and pre-determined polygon dimensions and orientations

texts:
I have a shapefile with 300 origin points for polygons I want to generate. I also have a table with a record for each origin point with attributes for the desired polygon's dimensions and angle of orientation.

Can anyone help me use a script or model builder to run through the points and generate polygon shapefiles based on the existing input?

I can work in ArcGIS 10, ArcGIS Pro, or QGIS.


texts: How to convert from one ellipsoid to another?

texts:
Introduction

I have the following problem: I want to convert from WGS84 to "Anguilla 1957 / British West Indies Grid" (EPSG 2000). This seems to be straight-forward, as the transformation is a simple Transverse Mercator and the projection uses the Clarke 1880 Ellipsoid without any datum shift. My result differs significantly (some 400m) from the one i.e. epsg.io is returning.

Problem

The reason seems to be the datum transformation chain. Since the code is implemented such that it can convert from any cs to any cs, it also in this case does

WGS84 geographic -> WGS84 Geocentric (using the WGS ellipsoid)
WGS84 Geocentric -> Clarke 1880 Geocentric (nothing to do here)
Clarke 1880 Geocentric -> Clarke 1880 Geographic (now using the Clarke Ellipsoid)

The last step is giving me a headache now, because the output of step 3 is not equal to the input at step 1, while the same conversion returns the exact input on reference pages I've checked.

Question

Should and can a "Geographic Ellipsoid 1->Geocentric->Geographic Ellipsoid 2" Conversion change latitude and/or longitude?

Update

Here's the steps I take: I basically want to convert from WGS84 to Anguilla, British West Indies Grid (EPSG 2000). According to http://epsg.io/2000 this uses Datum 4600. This datum consists of the Clarke 1880 RGS ellipsoid 7012 and no datum transformation.

I'm only considering the conversion from WGS84 to Datum 4600 here, because the rest is not relevant here.

I'm getting -63.000000000000014, 18.001851635270203, -78.860902368091047, which is the exact same result as mkennedy below using a 0 0 0 transformation. However, If I input the same coordinates at http://epsg.io/4600/map, The output is precisely -63, 18. That's where the confusion comes from. May I assume that the web site is wrong and whatever coordinate system library they're using is incorrectly assuming that a conversion whose datum parameters are 0 can be skipped altogether?


texts: Adding FeatureLayer on a thread crashes ArcMap

texts:
I asked this question on the ESRI forums but got nothing so I thought I would try it here (hope that is consider ok). I am creating an extension for ArcMap 10.2 using Visual Studio 2012 C# WPF. Consider this code snippet:

//Open the CSV file
IWorkspaceFactory WorkspaceFactory = new TextFileWorkspaceFactoryClass();
IFeatureWorkspace FeatureWorkspace = (IFeatureWorkspace)WorkspaceFactory.OpenFromFile(FilePath, 0);
ITable Table = FeatureWorkspace.OpenTable(FileName);

IStandaloneTable StandaloneTable = new StandaloneTableClass();
StandaloneTable.Table = Table;

IMap Map = MxDocument.FocusMap;
IStandaloneTableCollection StandaloneTableCollection = (IStandaloneTableCollection)Map;
StandaloneTableCollection.AddStandaloneTable(StandaloneTable);

//Create the Event Layer of the data source
IDataset Dataset = (IDataset)StandaloneTable;
IName TableName = Dataset.FullName;

IXYEvent2FieldsProperties XYEvent2FieldsProperties = new XYEvent2FieldsPropertiesClass();
XYEvent2FieldsProperties.XFieldName = ColumnX;
XYEvent2FieldsProperties.YFieldName = ColumnY;
XYEvent2FieldsProperties.ZFieldName = String.Empty;

IXYEventSourceName XYEventSourceName = new XYEventSourceNameClass();
XYEventSourceName.EventProperties = XYEvent2FieldsProperties;
XYEventSourceName.EventTableName = TableName;
XYEventSourceName.SpatialReference = SpatialReference;

IName XYEventName = (IName)XYEventSourceName;
IXYEventSource XYEventSource = (IXYEventSource)XYEventName.Open();

//Map the Event Layer
IFeatureLayer FeatureLayer = new FeatureLayerClass();
FeatureLayer.FeatureClass = (IFeatureClass)XYEventSource;
FeatureLayer.Name = FileName;

//Add the layer extension
ILayerExtensions LayerExtensions = (ILayerExtensions)FeatureLayer;
LayerExtensions.AddExtension(new XYDataSourcePageExtensionClass());

//Add it to the MXD
Map.AddLayer(FeatureLayer);
FeatureLayer.Selectable = true;
MxDocument.UpdateContents();
MxDocument.ActiveView.Refresh();

This is from a function in a class that is called from the UI Form. What I am doing is creating a CSV file from a .Net DataTable (not in the above code), adding the CSV as a Table in Sources of the TOC, and then mapping the Table as Layer (the last 4 lines above).

This all works fine if I do it on the main UI thread of the Form when the user clicks a button. But what I would like to do is it put it on a TPL thread since it can be a time consuming process and here is when I run into problems. The above code will CRASH arcmap completely. It cannot even be trapped.

I noticed two things. One, the crash happens on the line "Map.AddLayer(FeatureLayer);" so when it tries to add to the layer collection. So I removed that line just to see what the Table in sources looks like. Second, looking at that Table I notice that if I right click it the options to Open and Display are lit-up for a second and then grey out. Again, this only happens when on a Thread.

Another thing to note is that when I break on any of the lines of code above in the Thread and inspect the objects I get an error "The function evaluation requires all threads to run". I would think this is more an issue with Visual Studio and the implicit evaluation settings so it should not affect arcmap and it certainly should not cause it to crash. But I thought I would mention it.

Thanks for any help.


texts: Use current date in Overpass Turbo querries

texts:
For example one may wish to search for roads under construction, with known opening date that is in past (in other words - one of many possible indicators that OSM data is outdated).

[timeout:180];
(
way[highway=construction][opening_date](if:date(t[opening_date])<date("2018-2-6"))({{bbox}});
);
out body geom qt;

query is doing it (for query on overpass see http://overpass-turbo.eu/s/vUH ), but one needs to keep date updated.

How one may use current date directly?


texts: Geoserver ImageMosaic Creation through rest api with postgis granule indexing

texts:
When I create an image mosaic timeseries store through the geoserver web interface, a new table is created in my postgis database where the granule timeseries is indexed.

To accomplish this, the granules folder contains all the granules with names like:

nameYYYMMDD.tif

a database.properties file:

SPI=org.geotools.data.postgis.PostgisNGDataStoreFactory
host=localhost
port=5432
database=testing
schema=public
user=postgres
passwd=postgres
Loose\ bbox=true
Estimated\ extends=false
validate\ connections=true
Connection\ timeout=10
preparedStatements=true

an indexer.properties file:

TimeAttribute=ingestion
Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)

and a timeregex.properties file:

regex=[0-9]{8}

If I zip up an exact copy of the granule folder used above and try to create the image mosaic layer through the rest api instead, the store and layer are created, but the granule indexing table isn't created in the postgis database. This makes it so that I can't edit the time dimension.

How do I get the rest api to create the postgis indexing table? Maybe there is some parameter I need to pass? I'm actually trying to do this through this gsconfig-py3 python wrapper. The call looks like this:

cat = Catalog("http://localhost:8080/geoserver/rest/",
              username="admin", password="geoserver")

st = cat.create_imagemosaic('store_name', 'D:\gridded\six_average_leaf_ncep.zip', workspace='workspace_name')


texts: How to draw small circles within a big circle(greater radius) on the basis of marker size on google maps?

texts:
I have more than 1000 markers at different location in my Map. I read Lat and Long from a xml file and render it in Google maps and create circle over them on the basis of city name within given radius. And count the number of markers in those circle.

Now what i want to do is?

(1) When the size of markers within the given radius greater then a predefined value such as 10 then i want to draw 2 small inner circles with smaller radius within the existed big circle.the smaller circles contains their own markers.So whenever marker size is less then the predefined value, i.e., 10 then it should combine the 2 radius of these two small circles and should show only one big circle covering the markers of the two smaller circles (smaller 2 will now disappear resulting on marker size is less then 10).

My code is:

function codeAddress() {
        var address = ["islamabad", "lahore", "karachi", "multan", "peshawar", "faisalabad"];
        var radius = parseInt(document.getElementById('radius').value, 10)*1000;
var i=0;
for(i=0; i < address.length; i++ ){

        geocoder.geocode( { 'address': address[i]}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            side_bar_html = "";
            map.setCenter(results[0].geometry.location);
            var searchCenter = results[0].geometry.location;
            if (circle) circle.setMap(null);
            circle = new google.maps.Circle({center:searchCenter,
                                             radius: radius,
                                             fillOpacity: 0.35,
                                             fillColor: "#FF0000",
                                             map: map});
            var bounds = new google.maps.LatLngBounds();
            var foundMarkers = 0;
            for (var i=0; i<gmarkers.length;i++) {
              if (google.maps.geometry.spherical.computeDistanceBetween(gmarkers[i].getPosition(),searchCenter) < radius) {
                bounds.extend(gmarkers[i].getPosition())
                gmarkers[i].setMap(map);
                side_bar_html += '' + gmarkers[i].title + '<\/a>
';
        foundMarkers++;
              } else {
                gmarkers[i].setMap(null);
              }
            }
            document.getElementById("side_bar").innerHTML = side_bar_html;
            if (foundMarkers > 0) {
            map.fitBounds(bounds);
        } else {
              map.fitBounds(circle.getBounds());
            }

          } else {
            alert('Geocode was not successful for the following reason: ' + status);
          }
        });}
i++;
      }

var infowindow = new google.maps.InfoWindow(
  {
    size: new google.maps.Size(300,200)
  });

I don't want to use marker cluster, is there any other alternative solution.Could some one please help me in solving this problem? i just need to like this as shown in picture:


texts: Is there a QGIS alternative for ArcMap's Append (to Shapefile) Data management tool?

texts:
Is there something out there for QGIS that is similar to the Append Tool in ArcMap?
Reason I am looking:
I am currently working on a storm drainage project that involves GPSing Storm drain lids.
My issue is when I capture the points with the GPS unit, and then bring them into the office. The GPS unit produces a CSV file for me to import into QGIS. It gives the CSV file with generic header names ( field1, field2, field3..etc) This is fine, until I try to copy it into the working shapefile that has all the other storm drains.
The beautiful thing with ArcMap's append tool was that I could map each field from my CSV file to the destination shape file...ex... "field1" from CSV is equal to "Elevation" field in my shapefile. And thus update my shapefile with the newest points.


texts: How to export Point-shape coordinates to csv (X,Y)?

texts:
I am trying to export point coordinates from a shapefile to a CSV file. I managed to create this:

but I need the output to look like this:

I tried different options with save as... and with the MMQgis-plugin, None of them worked.

Does anyone know how to export the file to make it look like the example I gave?


texts: Merge two geodatabases with identical structure

texts:
I'm using an ArcGIS addon which stores all created data (shapes and tables) in a gdb. The addon is made for single user use but to safe time I want to split the work with someone else. After that I want to merge both geodatabases into one.

Is this possible? Line segments get IDs which are referenced in the tables. So by merging, identical IDs would have to be changed - in all tables in the same way. Maybe by adding to each ID in one of geodatabases the same number, like ID=ID+1000. But I don't know how to do that in ArcGIS either. Also it seems that the merge function in the toolbox only accepts one file add a time. So I would have to merge each table seperately because I don't want to change the structure. The number of tables has to stay the same, otherwise the addon probably won't work anymore.

Is there an easy way to do this. Is this possible at all?

Robert


texts:
I'm trying to add a script to GeoServer so I can create my own rendering transformation. However, I'm having trouble installing the scripting extension as outlined here.

The script uses the GeoScript Groovy API. I've added the groovy plugin files from the nightly build server to the WEB-INF/lib folder on my local machine, but I'm not getting the script directory appear in the GeoServer GUI after I restart. The docs only outline the process for installing the Python script extension, not the Groovy one.

I'm using GeoServer on my local machine which runs Windows 10. Is there something I'm missing to enable the scripting extension?


texts: Densify Shapely polygon using OGR Segmentize

texts:
I am trying to densify geometry of polygons loaded by GeoPandas using ogr.Geometry Segmentize. When I print new geometry, it is densified as intended, but it will never save into the shapefile. It should just overwrite the old one, but geometry remains the same as the original one. I have no idea what is wrong. It is not giving me an error.

The code looks like this:

import geopandas as gpd
from osgeo import ogr
from shapely.wkt import loads

path = "/Users/martin/Tess/b3.shp"
objects = gpd.read_file(path)  # load file into geopandas

for index, row in objects.iterrows():
    wkt = row['geometry'].wkt  # shapely Polygon to wkt
    geom = ogr.CreateGeometryFromWkt(wkt)  # create ogr geometry
    geom.Segmentize(2)  # densify geometry
    wkt2 = geom.ExportToWkt()  # ogr geometry to wkt
    new = loads(wkt2)  # wkt to shapely Polygon
    row['geometry'] = new  # overwrite old geomtry with densified one

objects.to_file("/Users/martin/Tess/b3s.shp")

Any idea what is wrong?


texts: Including conditional operation depending on number of images?

texts:
I want to do certain operations depending on the number of images in a filtered collection. I am working within a loop, so I need the condition to jump to the next step in the loop given a condition. Here is some code example:

var S2 = ee.ImageCollection("COPERNICUS/S2");
var point = ee.Geometry.Point([2.32,37.25]);

//This is within a function (loop)

// Filtering the image collection in a specific point for a time period
var S2TemporalFiltered = S2.filterDate('2017-04-12','2017-04-25');
var S2SpatialFiltered = S2TemporalFiltered.filterBounds(point);

// Calculating the number of images
var numberImages = S2SpatialFiltered.size()

// Now do something like:
// if (numberImages == 0):
//     Jump to the next iteration step
// else:
//     Stay in the loop function


texts: Debugging ERROR 000664 when changing field name with arcpy.AlterField_management()?

texts:
I am trying to change a field name in featureclasses (shapefiles) using AlterField_management, however I receive the following error message:

  Runtime error  Traceback (most recent call last):   File "",
  line 14, in    File "c:\program files
  (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 3332, in
  AlterField     raise e ExecuteError: ERROR 000664: Invalid input: The
  type of dataset is not supported.

The code:

import arcpy

from os import path

arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'C:\johnny\trial'

    for fc in arcpy.ListFeatureClasses():

    fieldList = arcpy.ListFields(fc)

    for field in fieldList:

        #if field.baseName != "NEAR_DIST":

        arcpy.AlterField_management(fc, 'NEAR_DIST', 'distance', "distance", "DOUBLE")


texts: "Downsample" a dense grouping of points onto a sparse grid

texts:
I have a SpatialPointsDataFrame with thousands of datapoints in a relatively small geographic area. The points are grouped around regions of physical measurements and are hence irregularly spaced:

plot(old)

I'd like to resample these data onto a coarser grid that is sparsely populated so as not to overextrapolate observations. Each point in the grid grid should take on the value of the closest point in old --- unless there are no data within (say) a 500m radius, in which case the grid point in new should take on the value of NA.

ggg <-raster(crs = old@proj4string,
               ext = extent(old@bbox),
               resolution = 1000)
gg <- as(pppp, 'SpatialGrid')
plot(gg)

I have played around with creating an empty SpatialGrid object as shown above and using over(), but I get a vector of NAs. I assume that's because the points in the grid do not precisely align with my data.

I am currently trying to see if there's a way to do it with aggregate but no dice so far. Note that I don't want to average all values in each grid cell---instead, I want to use the nearest single observation to each grid cell center / point.

Can anyone point me in the right direction?


texts: Importing coordinate data from Excel into QGIS

texts:
I have an Excel file containing data collected over many years as latitude and longitude coordinates for archaeological sites.
How can I import it into QGIS as a new layer?


texts: Limiting sharp drop off of coastal DEM raster where there is no data using QGIS?

texts:
I'm stitching numerous tiled DEM's using Build Virtual Raster and then 'Align raster' function within QGIS 3.6

Original DEM has no data for sea area as expected:

I get sharp drop off on coastal/harbour locations

Original single tile header detail in asc:

Following 'Align' task within QGIS:

Is there anything I can do to smooth this transition?


texts: Georeference a LAS file with txt2las using a Geomedia coordinate system file (.csf)

texts:
I need to transform a file in a .csv file into a LAS file. I have a LiDAR data folder, in this folder I have these files:

A .csv file that contains the the point data
Some metadata files (schema, HTML, MTD, SGML)
A .csf file that is "An Intergraph Geomedia coordinate system file".

I am using txt2las to change the format but when I do this the LAS file does not have any reference, when I upload the new las file to ArcMap it says that is georeference system is unknown.

txt2las file.cvs -o file.las

I assume that the information about the geographic information is in the .csf but I don't know how to link it to the txt2las function.

Is there any way command txt2las to set a CRS from a .csf input? Or any other way to assign a CRS to the LAS file?


texts: Building Large Network Datasets from OpenStreetMap in ArcGIS?

texts:
I'm trying to build a "large" network dataset from OSM data in ArcGIS.  Doing it all at once is taking a "long time" and seems like there is a big opportunity for it to fail at some point which would cause me to have to start over.  I would like to be able to ingest smaller dataset so that the processing would not take so long.

Is it possible to merge multiple smaller network datasets to a single dataset (that doesn't require rebuilding the entire network) that I can make routing calls to?  Or maybe to do routing calls across multiple network datasets?

For reference the dataset I used was an OSM extract for all of California. It is 11GB of xml. It took me 4.5 days to turn that into feature classes. It took another 5.5 days to create the network dataset.  The gdb is now 19.6GB. This was running on a m3.medium.  I would eventually like to be able to route anywhere in the US.


texts: In QGis, why do parts of the OpenLayers layer export in a different scale and position?

texts:
I have a problem printing with google satellite maps in QGIS. In the composer it's all right, but in the pdf file some portions of the image are in a different scale and in a different position.

An image can talk more then 1000 words…

EDIT: My problem isn't misalignment, and the problem occurs independently from size or position. It's something like the bug of which talk about in this page. How can you watch in the image that I inserted before, the correct image is the portion at the center, while the rest is in a scale smaller (the street above can't be bigger than the houses).


texts: Waiting on AJAX result in main JS function

texts:
So ....  my main init()Javascript function has these 3 lines:

sarea =  GetArea(Uname,UIDfield,Table, document.getElementById("Source").value);
darea =  GetArea(Uname,UIDfield,Table, document.getElementById("Destination").value);
alert(sarea);

The GetArea function work as expected, and I use the when/then jQuery technique to wait on the AJAX GET, if I monitor it (alert box) I can see that the value before the return statement is correct.
however, in the init code, an alert that comes after the function, and uses it's return is incorrect, I get undefined.
In addition if I have all three alert boxes I get the undefined one before the other two alert me with the correct result, so the order in the init() function is what's acting funny.

function GetArea(Uname,UIDfield,Table, sourceID){
    var ReqUrl = "http://" +Uname+".cartodb.com/api/v2/sql?q=select ST_Area(the_geom::geography)/1000000 as SA FROM "+Table+" where "+UIDfield+"="+sourceID;
    var area;

    $.when($.ajax({
        async: true,
        type: 'GET',
        url: ReqUrl,
        success: function(data) {
            area = data.rows[0].sa;
        },
        error: function() {
            area = null;
        }
    })).then(function(data) {
        return area;});
}

I  know that I could set async: false but that isn't in the spirit of AJAX, their has to be a neat way to do this.

Update

So I got my head around promises and decided to use the then functionality, however it is still not working. I am running out of ideas (read as patience) with my little webpage, this is my new code, It is still not working, I put comments inline to explain.
I really hope i'm missing something obvious here, I really don't think i'm reinventing the wheel

var promise = new Promise(function(resolve, reject) {
GetArea(Uname,UIDfield,Table, document.getElementById("Source").value,function(data) {
  console.log("before callback finishes and before temp is set " + data) //the data passed to the callback looks legit
  temp = data; //wait for the async function to finish and set  a global variable the data passed to the callback.
  console.log("before callback finishes, this is temp " + temp); //the updated temp value looks legit
 });
 if (temp > 0) {
    console.log("after temp is set and before resolve is set " + temp); //hmmm this never fires
  resolve(temp);
}
else {
    console.log("after temp is set and before REJECT is set " + temp); //this fires
  reject(Error("It broke"));
}
});

promise.then(function(result) {
  console.log(result); // "Stuff worked!"
}, function(err) {
  console.log(err); // Error: "It broke"
});

it uses a function stored in another .js file:

function GetArea(Uname,UIDfield,Table, sourceID, callback){
    $.when($.ajax({
        type: 'GET',
        url: "http://" +Uname+".cartodb.com/api/v2/sql?q=select ST_Area(the_geom::geography)/1000000 as SA FROM "+Table+" where "+UIDfield+"="+sourceID,
        success: function(data) {
            area = data.rows[0].sa;
        },
        error: function() {
            area = null;
        }
    })).done(function(data) {
        console.log("View data before callback: " + area);
        callback(area);
    });
}

This is the Chrome console feedback:

after temp is set and before REJECT is set undefined
Compare2.html:76 Error: It broke {stack: (...), message: "It broke"}
Compare2.js:36 View data before callback: 294.602577280986
Compare2.html:58 before callback finishes and before temp is set 294.602577280986
Compare2.html:60 before callback finishes, this is temp 294.602577280986


texts: Visualisation: probabilistic rainfall forecast from CSV

texts:
Note: I have a basic idea of how shapefiles work & how to save maps as images.

I'm a super noob on QGIS. I have this CSV which provides me details such as

State
Average rainfall (mm)
Probability % - Levels
(Normal,Above,Low)

Sample Data:

How can I visualise this on a map using QGIS? Please direct me to source on how to use the above dataset on QGIS & how to plot a legend alongside it. (I have the shapefiles of the states)


texts:
I installed node and yarn in Windows 10, but after adding mbtiles2gpkg I was getting error:

"mbtiles2gpkg" is not recognized.

Note: As this is environment variable Path issue I checked the path and yarn --version is displayed from cmd, power shell and nodejs cmd.


texts: What's the correct transformation for Lambert Conformal Conic for Mexico?

texts: I have a shp archive without the .prj file. I don´t know the proyection of this shp, but I think it is in lambert conformal conic. Can anybody helpme to proyect this shp? i´ve tried to proyect it in wgs84 utm 16N and geografic wgs84, but i have no success. this shp is from Quintana Roo, México. I´m working in qgis


texts: Merge polygon based on other line shapefile PostGIS

texts:
I have a polygon shapefile and a line shapefile. I would like to merge two polygons which shares the same border along with line shape. Finally the line should be removed in polygon shapefile.

In below sample, A&B polygons should be merged and C&D, E&F, G&H so on...

If any easy solution available other than PostGIS, then please provide your views.


texts: TypeError: g.join is not a function in queryTask.execute

texts:
I need to query data from a server, so I try to exploit "Query data without a map" sample. However, at queryTask.execute I get following error:

TypeError: g.join is not a function

My code is similar to that in the example:

var queryTask = new QueryTask(featureClassUrl);

var query = new Query();
query.f = "json";
query.outFields = "*";
query.returnGeometry = true;
query.where = "Foo = 'Bar'";

$(document).submit(function (e) {
    queryTask.execute(query, updateResults);
});

function updateResults(results) {
    //working with the results
}

The only significant difference from the example is in the event listener. Does JQuery or submit event really break it?

The closest to my question what I found is on StackOverflow, but I failed to apply the solution for on to queryTask.execute.

I use JavaScript API v. 3.14.


texts:
When running r.fil.dir with QGIS I get the following error message:
The following layers were not correctly generated.
 S:/user/School/Spring 2021/CIVL 461/QGIS/SRTM_DEM_Feather_River_Depressionless.tif
You can check the 'Log Messages Panel' in QGIS main window to find more
information about the execution of the algorithm.

When in the Log Message Panel the only error I see is:
2021-02-22T16:31:30     WARNING    Duplicate parameter coordinates registered for alg v.net.visibility
I have run the program as administrator, changed the save path and drive, and check with other students that are working on the same project to no avail.
QGIS version: QGIS Desktop 3.10.14 with GRASS 7.8.5


texts: How to calculate 'off track' error from GPS data?

texts:
I'd like to analyse navigational accuracy, comparing planned transects with the actual track flown from GPS data.

For example, the planned transects below (green) don't match perfectly with the actual flown (blue) - for the areas adjacent to the transects, what is the average error (distance), IGNORING the bits beyond the ends of each transect?

The planned transects are lines, typically only with start and end nodes. The tracks are from GPX files and may be made of many, many nodes - but may only have a few nodes recorded when the aircraft is flying particularly straight.

I'd like to use QGIS. One thought was to use the v.to.points tool from GRASS in the Processing toolbox to split each transect into points of, say, 50m spacing, and determine the nearest distance to the track for each point (then average them).

Is there, perhaps, a better way of calculating average distance than splitting the lines into individual points?


texts: EVI2 value calculated from MODIS MOD09Q1 not bounded by -1 to 1

texts:
I'm trying to derive from MODIS 8 day composite MOD09Q1.006 product

My formula follows the standard interpretation:

EVI2 = 2.5(NIR-Red)/(NIR + 2.4*Red+1)

I already know that MODIS bands for NIR and Red have a scaling factor applied, and when I say "-1 to 1"  I know I'm really expecting values to lie between -10000 and 10000.

My surface reflectance Band 1 and 2 (RED and NIR) values range from -100 to 16000 as they should.

When I perform my calculation for EVI using the previously mentioned formula, I have a wide range of values including roughly fitting between -25,000 to 25,000.

This leads to my question: How am I supposed to expect EVI2 values to fall between -1 and 1? Is there some kind of transformation I should be applying to my band values? With the multiplier of 2.5 in the formula, I see that the the function converges at 2.5 (thus those 25,000 values) as NIR approaches infinity.


texts: Problem with PostgreSQL View layer in QGIS

texts:
I have a PostgreSQL table and view:

     CREATE TABLE lines (
      geom geometry(MultiLineString,4326),
      type character varying(254),
      login text,
      gid serial NOT NULL,
      CONSTRAINT lines_pkey PRIMARY KEY (gid))

    CREATE OR REPLACE VIEW lines_view AS
     SELECT lines.geom,
        lines.type,
        lines.gid
       FROM lines;

    CREATE OR REPLACE RULE add AS
        ON INSERT TO lines_view DO INSTEAD  INSERT INTO lines (geom, type, login)
      VALUES (new.geom, new.type, "current_user"());

    CREATE OR REPLACE RULE del AS
        ON DELETE TO lines_view DO INSTEAD  DELETE FROM lines
        WHERE lines.login = "current_user"()::text AND lines.gid = old.gid;

     CREATE OR REPLACE RULE upd AS
      ON UPDATE TO lines_view DO INSTEAD  UPDATE lines SET geom = new.geom, type = new.type, login = "current_user"()
      WHERE lines.login = "current_user"()::text AND lines.gid = new.gid;

So, problem is when I load this lines_view in QGIS as layer and add lines, after saving I cannot use "node tool" to new lines ("Node tool: could not snap to a segment on the current layer"). But when I use move tool on them (just select "move feature(s)" button and click on new line) "node tool" start working as usual. Can some one help me with this?


texts: How to Clip raster using shapefile and store each shape as a numpy array

texts:
I have a raster file in numpy array of size 4x9000x10000.
The raster file has 4 bands - Red, Green, Blue, NIR and 6 different crop types.

I want to create small arrays of size, say 4x100x100 such that all pixels in the small array belong to the same crop type.

I tried to select a random point from the big array and read 100 pixels around the random point, but it doesnt guarantee that all pixels are going to be of same crop type.

Can you please help me how to do the split


texts: Whether to use ArcGIS Platform (from Esri) or Google Maps API for large number of polygons?

texts:
I am in the planning phases of building a web based application which will be served on IOS devices through a custom application with HTML container. The functionality will be to display a number of icon markers as well as polygons. The core functionality is fairly simple which is to render markers and polygons.

The issue I am having is with a feature which I have agreed to which is dynamically adding and removing polygons. I can certainly do this with client side on google maps. However performance of polygons on client side is very poor. There is also a limit of ~10 KML files at any one time to be added to a google map. The polygons need to be in separate KML files so that I can add and remove them.

My question is does ESRI GIS maps handle large amounts of polygons being added/removed better than google maps apiv3?


texts: Is it possible to auto-stretch text to width of rectangle?

texts:
I am using a rectangular text object to "fit" dynamic text in an area of my layout. (If it is too long for one line, it wraps to more.)  Is there a way to have the (changing) text fit the width of the rectangle it is in?  I know I can change the symbol properties and adjust the character spacing (for example), but there doesn't seem to be a way to tell it to automatically determine a spacing that fills the box.

What I'm looking for is like using Maplex labeling on a polygon and setting the spread characters value to zero.


texts: -9999 (no data value) becomes 0 when writing array to GDAL memory file

texts:
I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an array (shape 10834x15055). The data type is float32.

When I write the result to a geotiff file, everything is expected.No data value is set to -9999 and output array has -9999 cells.
However, when I write the result to a gdal memory file to save some time (25 seconds shorter processing time, down from 105 seconds to 80 seconds), this time all -9999s (no data value) become 0 (zero) in the output array of memory file. Both results are exactly same, but GeoTIFF file has -9999, memory file has 0. Even though memory file has no data value of -9999, but the output array is initialized to 0.0 instead of -9999.

I am using the same code to produce the results and the only difference is that I call memory driver when I want to write result to memory file
(driver=gdal.GetDriverByName("MEM")), and GeoTIFF driver when I want to write result to GeoTIFF file (driver=gdal.GetDriverByName("GTiff"))

My gdal version is '1100000' from gdal.VersionInfo(). My operating system us ubuntu 12.04 LTS "precise".

# Create a file
outFileRead=driver.Create(outFilePath,X,Y,1,dataType,options)
print inFileRead.GetRasterBand(1).GetNoDataValue()
print inFileRead.GetRasterBand(1).ReadAsArray()
print inFileRead.GetRasterBand(1).ReadAsArray().shape
# Reproject
gdal.ReprojectImage(inFileRead,outFileRead,inProjection,outProjection,reSamplingType)
print outFileRead.GetRasterBand(1).GetNoDataValue()
print outFileRead.GetRasterBand(1).ReadAsArray()
print outFileRead.GetRasterBand(1).ReadAsArray().shape

the result of prints

-9999.0

[[-9999. -9999. -9999. ..., -9999. -9999. -9999.]

[-9999. -9999. -9999. ..., -9999. -9999. -9999.]

[-9999. -9999. -9999. ..., -9999. -9999. -9999.]

...,

[-9999. -9999. -9999. ..., -9999. -9999. -9999.]

[-9999. -9999. -9999. ..., -9999. -9999. -9999.]

[-9999. -9999. -9999. ..., -9999. -9999. -9999.]]

(406, 238)

-9999.0

[[ 0.  0.  0. ...,  0.  0.  0.]

[ 0.  0.  0. ...,  0.  0.  0.]

[ 0.  0.  0. ...,  0.  0.  0.]

...,

[ 0.  0.  0. ...,  0.  0.  0.]

[ 0.  0.  0. ...,  0.  0.  0.]

[ 0.  0.  0. ...,  0.  0.  0.]]

(15055, 10834)

This shows even if no data value is set to -9999 in memory file, the array is initialized to 0.0 instead of no data value. Array in GeoTIFF is initialized to no data value, -9999, as expected. I think this is a bug in the memory file.


texts: Computing the Vertical Nearest/Shortest Distance in ArcGIS

texts:
I have a shapefile containing around a hundred points (lat/longs). And, I have a shapefile that contains a polyline representing a river. The river is somewhat horizontal (runs east to west) but meanders quite a bit. I am trying to compute how far a point lies to the north or south of the river in meters.

So far I have used the ArcGIS Near tool. My understanding of this tool is that it computes the shortest/perpendicular distance from the closest part of the near feature (in my case the river/polyline). Since the river is not perfectly horizontal, these distances will contain a horizontal component.

How should I compute how far a point lies north or south from the river (i.e. no horizontal component and only vertical distance from the nearest point on the river)?


texts: Replacing PyQt4 with PySide with standalone QGIS

texts:
I would like to develop an application using the QGIS libraries and PySide instead of PyQt4 due to more flexible licencing, I wonder if this is possible.

I downloaded PySide and replaced my references to PyQt4 in an existing program, and it throws this  error immediately:

Traceback (most recent call last):
  File "E:\me\myapp\myapp.py", line 8, in <module>
    from qgis import core
  File "C:\OSGeo4W64\apps\qgis\python\qgis\__init__.py", line 36, in <module>
    from qgis.core import QgsFeature, QgsGeometry
  File "C:\OSGeo4W64\apps\qgis\python\qgis\core\__init__.py", line 1, in <module>
    from qgis._core import *
ImportError: DLL load failed: The specified procedure could not be found.

This error does not appear when I use PyQt4 instead of PySide.

I'd like to know if I'm flogging a dead horse with this - I don't have the time or knowledge to contribute any changes to QGIS source code to accommodate PySide (if that's what it requires).

I found the only other reference to this here but with no answers.


texts:
I have different raster in the same folder and I want to sum all of them and generate a new raster. I'm trying todo a script on Python, but it doesn't work or run the process but it doesn't generate an output.

Which is the most easy way to write an expression to sum different raster?

I have different examples of the scripts, but I can't find the right way to write the expression just to sum them. Finally, my problem is how to write the expression to sum rasters in the same folder and generate a new one.

EX 1.
import qgis
from qgis.analysis import QgsRasterCalculatorEntry, QgsRasterCalculator

# Get layer object
layer = processing.getObject(lyr)
lddLrs = qgis.utils.iface.legendInterface().layers()
for lyr in lddLrs:
    entries = []
    ras = QgsRasterCalculatorEntry()
    ras.ref = 'lyr@1'
    ras.raster = lyr
    ras.bandNumber = 1
    entries.append( ras )
    calc = QgsRasterCalculator( '("lyr@1" / "lyr@1") * "lyr@1"', +lyr.name() + "_suffix.tif", 'GTiff', lyr.extent(), lyr.width(), lyr.height(), entries )
    calc.processCalculation()

EX 2.
import os
import fnmatch
import os
import shutil
#import lib.config as config
import processing
from osgeo import gdal
#from PyQt4.QtCore import QFileInfo
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry

inputFolder = "C:/++ELABORAZIONI_NUOVE/entrevistas/+++HEATMAP/hm_ben"
outputfilename = '/calculos_raster/hotspot_ben.tif'
outputFolder="C:/++ELABORAZIONI_NUOVE/entrevistas/+++HEATMAP/calculos_raster"

def findRasters(path, filter):
    for root, dirs, files in os.walk(path, filter):
        for file in fnmatch.filter(files, filter):
            yield os.path.join(root, file)

entries = []
layers = []

for l in findRasters(inputFolder, '*.tif'):
    print (l)
    fileInfo = QFileInfo(l)
    baseName = fileInfo.baseName()
    rlayer = QgsRasterLayer(l,baseName)
    #QgsMapLayerRegistry.instance().addMapLayer(rlayer)
    layer = QgsRasterCalculatorEntry()
    layer.ref = rlayer.name() + '@1'
    layer.raster = rlayer
    layers.append(rlayer)
    layer.bandNumber = 1
    print (layer)
    entries.append(layer)

    reflist = " + ".join([ent.ref for ent in entries])
    expression = '(' +  reflist + ')'
    outuput = outputFolder
    print (expression)

calc = QgsRasterCalculator(expression,outputfilename,
                           'GTiff',
                           layers[0].extent(),
                           layers[0].width(),
                           layers[0].height(),
                           entries)

calc.processCalculation()