texts: Create custom Authentication filter in GeoServer 2.3.0

texts:
Context

In my current project, I've the requirement to validate that requests coming to GeoServer (2.3.0) are allowed.

The project holds those facts:

the GS client cannot provide the principal information (the password
for instance),  GS itself has no connection with a user/role repo

So we took the opportunity to use the auth filter mechanism in order to check that:

a valid request (to a specific WFS' layer) contains a special HTTP Header (let's say X-CUSTOM-VALID)
This header is a JSON encoded message holding enough information to validate the fact that the request was initiated by a client that was connected to a valid third system (a username, a secret, stuffs like that)

Status

The documentation is telling us that we should be able to do so...

However, the documentation is not clear how to create such components and how they should be configured.

Debugging GeoServer I managed to find that to configure such a filter, it requires a dedicated Authentication Provider. That, in order to have a panel in the web admin interface (under authentications, in the Authentication Filters list)

Panel

Thus my code is composed of those files:

ProducteurAuthFilterPanel.java
ProducteurAuthFilterPanelInfo.java
ProducteurAuthenticationFilterConfig.java
ProducteurAuthenticationFilterPanel.html

These are require to add a panel in the Web Admin Interface. ProducteurAuthFilterPanelInfo is glueing the two other along with the ProducteurAuthenticationFilter here-after (THE filter ^^).

The ProducteurAuthenticationFilterConfig declares that in its constructor:

setClassName(ProducteurAnonymousAuthenticationProvider.class.getName());
setName("producteur");

Filter (and Provider)

Now, the classes needed to create a filter to be included in a chain (I guess):

ProducteurAuthenticationFilter : the filter implementation extending GeoServerSecurityFilter and implementing GeoServerAuthenticationFilter
ProducteurAnonymousAuthenticationProvider: somehow required by the Panel (above) to define the new filter
ProducteurAuthenticationException: used in the AuthenticationEntryPoint (only Http403ForbiddenEntryPoint for now)

Finally, the beans are defined like so:

<bean id="yaanonymousFilterProvider" class="dgarne.java.geoserver.security.ProducteurAnonymousAuthenticationProvider"/>

<bean id="producteurAuthPanelInfo" class="dgarne.java.geoserver.security.ProducteurAuthFilterPanelInfo">
    <property name="id" value="security.producteurAuthFilter" />
    <property name="shortTitleKey" value="ProducteurAuthFilterPanel.short"/>
    <property name="titleKey" value="ProducteurAuthFilterPanel.title"/>
    <property name="descriptionKey" value="ProducteurAuthFilterPanel.description"/>
</bean>

At the end of the game, in the Web Admin Interface I've a new Item in the filter panel, and I used it in the default mapping (see image below for references):

Problem description

Here we are...

None of my WFS request issued by a client (OpenLayers) which are matching the default mapping (/**) is going through the defined Filter.
While debugging I found that the filter chains defined in the Spring Context are never including my definition, but rather are always including the classical one using either anonymous, digest or basic...

Question

So is there anyone able to point me out with a (much ^^) more complete documentation about how I have to do it?


texts: Getting list of only vector layers using PyQGIS?

texts:
I need a list containing all the vector layers in a QGIS session. I have this code to get all layers, how can I put a filter to get only vector layers?
layers = QgsProject.instance().mapLayers().values()


texts: ArcGIS Server 10.3.1, Web Adaptor and Windows Authentication

texts:
This is probably a long shot but here it is.

We have ArcGIS Server 10.3.1 installed and a simple map service deployed on it. We are accessing the map service via custom javascript/html applications (one of which is ESRI's Roadway Characteristics Editor or RCE).

Accessing the unsecured map service via http://mapserver:6080 presents no problems nor does accessing it via the ESRI Web Adapator url (http://mapserver/arcgis).

However, enabling security through the Windows Domain at the Web Tier causes the following errors to start appearing in our web application calls to the map service.

GET http://dev-gis/arcgis/rest/info?f=json
XMLHttpRequest cannot load http://dev-gis/arcgis/rest/info?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://dev-app' is therefore not allowed access. The response had HTTP status code 401.

Now, it appears that there is a CORS error, however the CORS policies were enabled with Web Adaptor (which should only apply for Silverlight and Flex anyways) and there are no CORS issues when the Windows Domain authentication is not enabled.

This is how the security is configured for the Web Adaptor in IIS

I have tried enabling CORS via the web.config for the Web Adaptor (although this shouldn't be necessary) by adding the following lines.

<httpProtocol>
   <customHeaders>
     <add name="Access-Control-Allow-Origin" value="*" />
   </customHeaders>
 </httpProtocol>

which gets me to here

GET http://dev-gis/arcgis/rest/info?f=json 401 (Unauthorized)

Obviously this is a problem for any of our applications if we are trying to access via domain authentication.

The question is, has anyone else run into this problem and if so, how did you solve it. I believe that I have tried everything in my bag of tricks at this point and am out of ideas.

Update 1

Per Mintx question, the GIS Server is configured with the Web Adaptor

and Web Tier authenction has been enabled for ArcGIS Server.


texts: How to convert large size hyperspectral from tif to lan

texts:
I tried to convert hyperspectral from .tif to .lan format. There are three file with size about 1.5GB , 750MB and 200MB respectively.
I use this code
from osgeo import gdal

src_fname = 'file.tif'
dst_fname = 'file.lan'
driver = gdal.GetDriverByName('LAN')

sds = gdal.Open(src_fname)
dst = driver.CreateCopy(dst_fname, sds)
dst = None  # close dataset; the file can now be used by other processes

It's works with hyperspectral file less than 200MB. But when file size more than that, it's failed. I didn't get output file with .lan format. What solution to handled this problem? Do i need other software to do file convert?


texts:
i am using arcgis 10.1

i want to calculate the shortest distance between a raster and another raster. i have a bathymetric raster and an underlying fault plane raster. for each bathy raster cell, i need to know the shortest distance to the underlying fault plane.

the bathymetry and the fault plane rasters are not planar nor horizontally level.

i am not trained in python and hope there is an existing tool that i could use (though i could learn python if i need to).


texts:
I have two spreadsheets that came from the same data export.  One 25k points, one 55k points.  Both have a time column including year, day, time down to the second.  The first worked perfectly (25k points) - the visualization looks great.  The second import works fine but when I change the field type from "string" to "date" it turns all of the times to 00:00:00 which makes the torque map just flash.  I've reviewed the information at the following http://www.postgresql.org/docs/9.2/static/datatype-datetime.html

Any thoughts?


texts:
Is there an openstreetmap based system that makes it possible to draw something like military symbols?
It should be possible to draw frontline, zones of control, battle events, troops, vehicles and so on. I think, there should be such project, because it would useful for analyzing modern conflicts or even planning historic reconstruction events.


texts: Making one-to-many polygon interactive map using ArcGIS Online

texts:
I have a polygon shapefile of all war zone. Each war zone has a list of allies and rivals. In which case it is a one-to-many relationship.
The goal is to make an interactive map that will allow you to click on a polygon and it will highlight the allies and rivals in two different colours.
Is there a possible way to do this in ArcGIS Online without coding?


texts: Any GIS program with GPX support and free hand selection tool?

texts:
I'm looking for GIS program that has good support for KML/KMZ or GPX route files and also has free hand selection tool. Right now I use 3dem and it would be perfect for my needs if only it had that free hand selection tool. All I need is to load a terrain (HGT file), and then select only the part of it that is close to my route plan (KML file). And finally save that selected part to DEM file or any other format that I could edit later in some 3D modeler.

I'd appreciate it very much if someone could point me to some GIS program that fully meets my requirements.


texts: QGIS Technical problem in 'Extract nodes' command

texts:
I am trying to create a layer of nodes from an existing layer of line. For this I am using
Vector> Geometry Tools > Extract nodes

I, first, select the 'Input polygon vector layer' and then select the output file. After I click on the 'OK' button the process starts and the 'OK' button is grayed out. Even after the process shows 100% completion, the 'OK' button remains grayed out. Hence, I am unable to finish the command and, hence, get the desired output.


texts: SQL Server: Physical Memory and Arc Cursors

texts:
I implemented a script recently that uses an update and search cursor on a large feature class database of over 20,000 records. This script runs nightly. This is an SQL Server database with an ArcSDE connection. However, the physical memory of the server (sqlserver.exe) has been running at over 86% and bogging down any edits that users want to make. Prior to this script, the server was running normally.

The script currently does not delete any cursors, and I'm wondering if this is causing a load up of information in the system. If so, how do I go about deleting the information?


texts: Find the intersecting points of 2 polygons in Python

texts:
I am trying to get the intersecting point coordinates of 2 polygons in Python.
For example intersecting points of the two polygons (polys2). For illustration purpose, I have marked the intersecting points in green.
from shapely.geometry import Polygon,Point
import geopandas
polys1 = geopandas.GeoSeries([Polygon([(0,0), (2,0), (2,2), (0,2)]),
                               Polygon([(1,1), (3,1), (3,3), (1,3)])])

polys2 = geopandas.GeoSeries([Point([(1,2)]),Point([(2,1)]) ])

df1 = geopandas.GeoDataFrame({'geometry': polys1, 'df1':[1,2]})
df2 = geopandas.GeoDataFrame({'geometry': polys2, 'df2':[1,2]})

ax = df1.plot(color='red', alpha = 0.5)
df2.plot(ax=ax, color='green', alpha=0.5);

What is the best way to find these intersecting points in Python?


texts:
I tried to use reclassify values function in QGIS. But there are always giving the following error. Does anyone know how to solve this problem?

Algorithm Reclassify values starting...
io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/625660db6b0d4460b378f09a2e01575e/2018NGRDI.sgrd" -FILES "/Users/lidong/Desktop/Drove data_crop height/2018/Remove_noise/2018_NGRDI.tif"
grid_tools "Reclassify Grid Values" -INPUT "/var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/625660db6b0d4460b378f09a2e01575e/2018NGRDI.sgrd" -METHOD 2 -OLD 0 -NEW 1 -SOPERATOR 0 -MIN 0 -MAX 1 -RNEW 2 -ROPERATOR 0 -RETAB "/var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/1561643514.522.txt" -TOPERATOR 1 -NODATAOPT true -NODATA 0 -OTHEROPT true -OTHERS 0 -RESULT "/var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/ae73a594010b463ba598c712a7548b96/RESULT.sdat"
/Users/lidong/.qgis2//processing/saga_batch_job.sh: line 3: 7087 Segmentation fault: 11 saga_cmd io_gdal 0 -TRANSFORM 1 -INTERPOL 0 -GRIDS "/var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/625660db6b0d4460b378f09a2e01575e/2018NGRDI.sgrd" -FILES "/Users/lidong/Desktop/Drove data_crop height/2018/Remove_noise/2018_NGRDI.tif"
____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
____________________________

SAGA Version: 2.2.3

____________________________
library path: /Applications/QGIS.app/Contents/MacOS/lib/saga/
library name: libgrid_tools
library : Tools
tool : Reclassify Grid Values
author : Copyrights (c) 2005 by Volker Wichmann
____________________________

Load table: /var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/1561643514.522.txt...

Load grid: /var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/625660db6b0d4460b378f09a2e01575e/2018NGRDI.sgrd...

Load table: /var/folders/zv/z59g5c7540x7nrqrk3y13tb80000gn/T/processing9c1101da7e444650846f43d22eb6877d/1561643514.522.txt...

Parameters

Grid system: 0.009902; 22555x 18742y; 109013.146251x 182362.678788y
Grid: 2018NGRDI
Reclassified Grid: Reclassified Grid
Method: simple table
Lookup Table: (columns: 3, rows: 2)
operator: min
no data values: yes
new value: 0.000000
other values: yes
new value: 0.000000
Assign ...: NoData value of input grid

Converting outputs
Loading resulting layers

The following layers were not correctly generated.
Reclassified Grid
You can check the log messages to find more information about the execution of the algorithm


texts: Which one is best for atmospheric correction?

texts: My aim is to determine surface temperature extraction by computing NDVI from Landsat 7 and Landsat 8. suggest me which method DOS (dark object subtraction) or FLAASH atmospheric correction in ENVI will be suitable to compute NDVI?


texts: How to Split attribute tables into new records (Data Management)

texts:
(Arcgis user)
I created a fgdb for inspections in the Esri Collector app.

How can i create a export table of the feature that splits the fieldnames into seperated records related to fieldname Code?

My Example:

Some ideas to create the table?


texts:
I have thousands raster maps (3652, named raster_name.1, raster_name.2,... raster_name.x,... raster_name.3652) and for each map I want to do the r.mapcalc-threshold operation below here:
binary_raster_name.x = if ( raster_name.x > 293 , 1 , 0 ).
My target is to create a binary threshold map for each raster I have in my project.
Here is the script I tried:
GRASS 7.8.3 (LocationMatteo):~ >x=3652
GRASS 7.8.3 (LocationMatteo):~ >seq $x | parallel r.mapcalc expression="tas.binary{}=if(tasmax_day_CMCC-CMS_rcp45_r1i1p1_20300101-20391231.{}<293.15,1,0)"
It seems that parallel works as I get 3652 lines, but I get this error for each line:
IT: errore di sintassi vicino al token non atteso "("
EN: syntax error near the token not expected "(".
How can I run correctly r.mapcalc in parallel (or parallelized) in GRASS?
Which is the correct formula?


texts: How to Load an Input of MultiValue Parameter Based on First Input Select

texts:
I am trying to create a Python Toolbox and I need to load some chekboxes to a parameter (param2) after selecting a value in previous parameter (param1).
As you can see I have name of states in param1 and need to load a code like this after changing on param1

inFeature = parameters[0].valueAsText
slectedCounty = parameters[1].valueAsText
counties = []
def unique_values(table , field):
    with arcpy.da.SearchCursor(table, [field], '"NAME_1" = \''+slectedCounty+'\'') as cursor:
         return sorted({row[0] for row in cursor})
uniques = unique_values(inFeature, 'NAME_2')
for unique in uniques:
    counties.append(unique)
# Now Load the checkboxes
param1.filter.list = counties

Here is the code

def getParameterInfo(self):
    """Define parameter definitions"""
    param0 = arcpy.Parameter(displayName="Feature Class",name="in_fc", datatype="Shapefile", parameterType="Required", direction="Input")
    param1 = arcpy.Parameter(displayName="States",name="st",datatype="String", multiValue="False", parameterType="Required", direction="Input")
    param1.filter.list = ['Alabama','Alaska','American Samoa','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','District of Columbia','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Marshall Islands','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York','North Carolina','North Dakota','Northern Mariana Islands','Ohio','Oklahoma','Oregon','Palau','Pennsylvania','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virgin Island','Virginia','Washington','West Virginia','Wisconsin','Wyoming']
    param2 = arcpy.Parameter(displayName="Counties",name="countyName",datatype="String", multiValue="true", parameterType="Required", direction="Input")

    params = [param0, param1, param2]
    return params

def isLicensed(self):
    """Set whether tool is licensed to execute."""
    return True

def updateParameters(self, parameters):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parameter
    has been changed."""
    return


texts:
This is a newb question and I hope you all will be patient. The answer should be simple (I hope.).

I obtain gif and shp files from flying a drone and processing the images with DroneDeploy. The 1ft contour map created in QGIS from these two layers is very accurate. I would like to create elevation profiles so downloaded the Terrain Profile plug-in. But I understand I have to use an interpolation tool first and so downloaded the Raster Interpolation plugin. That tool wants to save the interpolation to a "destination" layer. I have none to choose from; the drop-down box is blank. I have a raster (gif) and a shape layer (shp). How do I create a destination layer for the interpolation? And then, once I have the interpolation, will the Terrain Profile plug-in automatically use it?


texts: I need to Cache the google map on the client side through the openlayer.I havent tried the client side cache yet and have very little idea about it too.


texts: Does anyone know how to export a shapefile out of ArcGIS into an Access 2007 database?


texts: Adding text fields with more than 255 characters?

texts:
I'm working on a QGIS project where I have few shapefile layers with text fields. I would like to add whole paragraphs as descriptions to the text fields, however the fields are limited by their maximum allowed length which is 255 characters.

How should I accomplish adding longer texts? I'm sure there must be a way which I'm not considering.

I read somewhere that I should try PostGIS. The final goal of the project is to be  uploaded to a web server for online viewing. Therefore, I'm not sure how can the PostGIS relation to the much bigger text files be uploaded or saved on the web as well?


texts: Geoserver WFS features query inaccurate using SQL Server Backend with spatial index

texts:
I´m using Geoserver to query features through WFS in an Web Application with Openlayers as client. The queried layer is using SQL Server as backend storage.

When applying a spatial index to the queried layer in SQL Server, the response of an identify is very inaccurate and lots of features that are not even nearby the identify click are returned. When removing the spatial index in the backend, the identify in the client is accurate and only the clicked feature is returned.

The issue is that Geoserver uses the "Filter()" method of SQL Server when querying the bounds calculated by Openlayers for the area to identify. The "Filter()" method is using the spatial index to determine what features has to be returned. The documentation (http://msdn.microsoft.com/en-us/library/cc645883%28v=sql.105%29.aspx) states, that the "Filter" method is fast, but inaccurate when a spatial index is applied and potentially returns features outside the queried bounds.

Is there a possibilty to maintain a spatial index in the SQL Server table (is necessary for other functions operating on the table) and using STIntersects() instead of "Filter()" to filter the queried features when running an identify through WFS on Geoserver and get accurate results ?

Geoserver is version 2.5.1 and SQL Server is 2008 R2.


texts: Is there a way in PyQgis to perform a transaction upon several features at once for undo and redo operations?

texts:
I'm developing a standalone application in pyqgis (python 3.6, qgis 3.2) for editing roads and ran into a problem connected to performing transactions. When the user of the app insert, update or delete one feature s/he often wants to perform undo or redo operation in case some wrong actions have been done.
I found and tested the following

1) Creating undo stack for road layer

self.undo_stack: QUndoStack = self.trackLayer.undoStack()

2) Implementing the following functions

def perform_undo(self):
    self.undo_stack.undo()
    self.mapCanvas.refresh()
    self.adjust_undo_redo_buttons()

def perform_redo(self):
    self.undo_stack.redo()
    self.mapCanvas.refresh()
    self.adjust_undo_redo_buttons()

def adjust_undo_redo_buttons(self):
    self.action_undo_transaction.setEnabled(self.undo_stack.canUndo())
    self.action_redo_transaction.setEnabled(self.undo_stack.canRedo())

For single operations (insert one feature, change the location of one vertice) that works fine.
But when it comes to changing the location of the vertice that is common to (for example) three roads the user has to perform undo three times.

For example, I know how to do this in proprietary product GE Smallworld GIS

 # Change area value of the selected records
 sel_recs << a_view.collections[:plot].all_at(32,11)
_local ok? << a_view.start_lwt()
_protect
    for rec _over sel_recs
    _loop
           rec.area +<< 20.0
    _endloop
    # doing some changes upon some records
    ok? << _true
_protection
    a_view.end_lwt(ok?, _true, "Increasing areas by 20")
_endprotect

I'm sure that there is some way to undo several operations at once.
For example, it's easy to split some polygon into 6 parts and undo this transaction by one click in QGIS 3.2

So what should I do to merge several operations on the data into one transaction in pyqgis?


texts:
I am currently trying to use zonal_stats of the rasterstats package to get zonal statistics of processed satellite images.
The data is stored as .img-format and i have a shapefile containing 1 polygon to test things.

from rasterstats import zonal_stats
IMG = 'S1A_IW_GRDH_1SDV_20181104T054742_20181104T054807_024434_02AD7C_F5E1_pre.data\\Ratio.img'
SHP = 'Lake2.shp'
stats = zonal_stats(SHP,IMG,stats = "*")

When I run the code I get the following error message:

AttributeError: 'rasterio._io.RasterReader' object has no attribute 'mask_flag_enums'

Does anyone know how I could work around this? Previously I used ArcPy to get this done but I do not want to use it in further projects since not everyone has access to it.


texts: I am running QGIS version 3.4.4-Madeira and just installed the R plugin. in Processing->Providers->R I checked the activate box. In the processing toolbox all I see under R is 'test'. The setup tutorial I was following showed additional options in the R drop down in the Processing Toolbox. Are there other steps I need to take to set up R in QGIS?


texts: How to set cell size for vector to raster conversion in QGIS GRASS plugin?

texts:
I'm converting a vector (loaded in GRASS plugin in QGIS (1.7.0.-wroclaw) and would like to convert this to a raster with a defined cell size. At the same time I need a value from the attribute tabel to be used as raster value.

This tool: v.to.rast.attr

looks promising. however, I cannot define the output cell size, or a snap raster. In ArcGIS (esri) this is quite easy. Is there a way to do the same in QGIS?


texts: Change path to folder storing icons for Leaflet Layer

texts:
I have a Leaflet point layer that uses icons.  I have a different folder for individual time steps, and I would like to use a jquery ui slider to change between them.  Changing the slider should change the path used to define the markers on the layer.

This is my attempt thus far:

var map = L.map('map', {
    crs: crs
});

$( "#slider-bar" ).slider({
    value: 1999,
    min: 1999,
    max: 2014,
    step: 1,
    change: function(event, ui) {
        //console.log(ui);
    }
});

var markerPointLayer = L.geoJSON(britishColumbiaPoints, {

    pointToLayer: function (feature, latlng) {
        return L.marker(latlng, {
            icon: L.icon({
                iconUrl: 'svg/1999/' + feature.properties.name + '.svg'
            })
        })
    },

    onEachFeature: function (feature, layer) {
        $( "#slider-bar" ).on("change", function(feature) {
            layer.setIcon(L.icon({
                iconUrl: 'svg/' + $( "#slider-bar" ).slider("option", "value") + '/' + feature.properties.name + '.svg'
            }))
        })
    }

}).addTo(map);

But it seems that the onEachFeature function is not detecting that the slider bar has changed.

I've also tried doing this on the slider itself:

$( "#slider-bar" ).slider({
        value: 1999,
        min: 1999,
        max: 2014,
        step: 1,
        change: function(event, ui) {
            markerPointLayer.setIcon(
                L.icon({
                    iconUrl: 'svg/' + ui.value + '/' + markerPointLayer.feature.properties.name + '.svg'
                })
            )
        }
    });

But it doesn't recognize the layer object it seems.


texts:
I am building a flex web map app. I am using the Identify tool version 3, here. Below is the syntax I am using, based on the PDF help file. It, however, gives a 1085 error. Does anyone know if I am using the correct syntax?

<layers onlythese="true">
    <layer>
        <name>Australia offices</name>
        <fields>
            <field name="Address" />
                            <field name="City" />
                            <field name="State" />
                            <field name="Postcode" />
                    </fields>
        <links>
            <link includeinresults="false" field="" alias="" tooltip=""/>
                <linkprefix></linkprefix>
                <linksuffix></linksuffix>
                <iconfield></iconfield>
                <iconprefix></iconprefix>
                <iconsuffix></iconsuffix>
            </link>
        </links>
        <zoomscale>15000</zoomscale>
        <forcescale>true</forcescale>
             </layer>
             <layer>
                    <name>QLD rail</name>
        <fields>
            <field name="FNAME" alias="Name"/>
                            <field name="ELECTRIFIE" alias="Electrified"/>
                    </fields>
        <links>
            <link includeinresults="false" field="" alias="" tooltip=""/>
                <linkprefix></linkprefix>
                <linksuffix></linksuffix>
                <iconfield></iconfield>
                <iconprefix></iconprefix>
                <iconsuffix></iconsuffix>
            </link>
        </links>
        <zoomscale>15000</zoomscale>
        <forcescale>true</forcescale>
    </layer>
</layers>


texts: Add information from a cvs/text file to a raster shapefile based on latitude and longitude information

texts:
I have an empty raster shapefile that only contains the latitude and the longitude of the centroids of each grid.

I now want to add an extra variable to each grid cell coming from a cvs or txt file. In this text file, latitude and longitude of the centroid of each grid is also included. Even though the information is given per centroid, the information relates to the entire grid cell (so each grid cell should be colored for 100% with one color / value).

Afterwards, I save the joined result again in a shapefile.

My data (MyData.cvs) and grid shapefile (grid_025dd.shp) can be found through the following link:
https://drive.google.com/folderview?id=0By9u5m3kxn9yfjZtdFZLcW82SWpzT1VwZXE1a3FtRGtSdEl1c1NvY205TGpack9xSFc2T2s&usp=sharing

I would like to use R to do this merge because I need the shapefile, with the information of the variable, afterwards to continue my analysis in R. However, I do have ArcGis on my computer in case that R can't do the job. In that case, ArcGis could maybe make one shapefile with all the information so that I can use that in R.

I think the main reason why I don't manage solving this (basic?) issue is that I don't know how to handle the two column coordinates (one for longitude and one for latitude). Previously, I have always worked with one common ID in both the text file and the shapefile. Now I have two columns that form together the ID to merge both data.

Could someone help me with this? I have some experience with R but I am a beginner in ArcGis (yet, willing to learn!).


texts: What address database does Google Maps use for United Kingdom?

texts: When searching for a United Kingdom address in Google Maps, is the OS AddressBase or another address database being queried?


texts: Recommendations on universal projection API or algorithm for ArcObjects?

texts:
As asked on the esri forum here, we are trying to convert a geometry from any spatial reference to any other spatial reference. We have tried the default IGeometry.Project(target_spatial_reference) but with no success.
We then turned our attention to IGeometry.ProjectEx(...), but some of the sample data we have does not use a well-nknownn ID (FactoryCode) and we can't find a canned, out-of-the-box GeoTransformation to convert our geometry.

We did follow the recommendations in both responses in this other thread here, but with no succes.

Does anybody here know of an esri API that can project a geometry from any spatial reference to any other spatial reference?

Or, can anybody point us to a code sample or algorithm to properly and accurately project a geometry to/from any spatial reference?

Thanks in advance for your help,

Eric.


texts: GeoWebCache WMTS always replacing tiles in cache

texts:
I've spent the last two days trying my hand at GeoWebCache. I've had some issues and am now out the office so can't access any code to attach. I know if i don't post this it'll bug me all weekend.

I've been using GeoServer WMS on demand from my OpenLayers app but wanted to make use of the integrated GeoWebCache. (a) do I have to use WMTS to use the cache? My current thinking is yes and I have changed my code accordingly. my new WMTS url points to geoserver/gwc/service/wmts.

So i went and configured my geowebcache.xml to include the BNG 27700 gridset. I also included 14 resolutions that correspond to my app's map scales. Map and gridset both return 256x256 tiles. No problem. I edit my layer.xml for the desired layers to include my gridset. My Catalina.out shows this is all fine when i start tomcat5. I've read i need to have a different layer name in my geowebcache.xml to the actual layer in geoserver. (b2) is this true?

My app then makes some very slow WMTS requests which take upto a minute to comeback. Significantly slower than my previous WMS. (c) Why? . I've tried png, png8 and jpeg. (d) which is quickest? Currently favour png8. I'm using mastermap area data with an simple SLD. No labels or transparency so i'm not sure why it's so slow.

I see my pyramids begin to build in the gwc directory when i make these horribly slow requests. However, when i make exactly the same request again, the tiles are replaced in the cache rather than consumed. Obviously there is no performance benefit as a result. (e) Why are my tiles replaced? I am not setting any expiry details so presume the metastore should handle this.

When i went to revert back to my previously quickish WMS request they too were now very slow. (f) Is this related? Bouncing the server didn't help.

Details: GeoServer/GeoWebCache is on a RHEL 16GB RAM machine. The cache store limit is set to 5GB which I'm nowhere near. I have the latest versions of both apps.

Help with any of my 6 questions would be great!
Thanks.


texts: Getting building addresses from Google Maps API

texts:
I am trying to download all the building addresses on a specific street.
Is it possible to download all addresses using Google Maps API as building address are available online in maps but API is not showing all addresses.?

The attempt that I have made
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)

# import the library
import googlemaps
import json
import pprint
import xlsxwriter
import time
import pandas

# Define the API Key.
API_KEY = 'AIzaSy---------------------------------'

# Define the Client
gmaps = googlemaps.Client(key = API_KEY)

#places_result  = gmaps.places_nearby(location='-33.8670522,151.1957362', radius = 40000, open_now =False , type = 'Building')
places_result  = gmaps.places_nearby(location='-38.339655,143.58063649963287', radius = 50000, open_now =False , type = 'cafe')

time.sleep(3)

place_result  = gmaps.places_nearby(page_token = places_result['next_page_token'])

stored_results = []

# loop through each of the places in the results, and get the place details.
for place in places_result['results']:

    # define the place id, needed to get place details. Formatted as a string.
    my_place_id = place['place_id']

    # define the fields you would liked return. Formatted as a list.
    my_fields = ['name','place_id','geometry']

    # make a request for the details.
    places_details  = gmaps.place(place_id= my_place_id , fields= my_fields)

    # print the results of the details, returned as a dictionary.
    pprint.pprint(places_details['result'])

    # store the results in a list object.

    stored_results.append(places_details['result'])

# -------------- DUMPING VALUES IN EXCEL -----------------------

# define the headers, that is just the key of each result dictionary.
row_headers = stored_results[0].keys()

#%%
#%%
# create a new workbook and a new worksheet.
workbook = xlsxwriter.Workbook(r'C:\Users\Ali\OneDrive - UNSW\Zepben_coding\Line_2020\'Google_Coordinates.xlsx')
worksheet = workbook.add_worksheet()

Is there any other way to collect all the addresses of buildings from a specific location?
After address I want to geocode into Lat/Long information.


texts: Using LAStools in QGIS gives "global name 'os' is not defined"?

texts:
I have a problem with LAStools in QGIS 2.6.1. I have never used QGIS to process LiDAR data before.

I downloaded LAStools yesterday from the rapidlasso GmbH website. I unzipped the “lastools.zip” file into my osgeo folder (C:\OSGeo4W64\LAStools) and followed the instructions for activating LAStools and specifying the folder location. LAStools appears correctly in my Processing Toolbox in QGIS.

Then, I downloaded a LiDAR tile from the National Land Survey of Finland as a .laz file. I tried to use lasground to view this data, and followed the instructions on the rapidlasso GmbH website (see screengrab). However, I get this message in my log:

  Algorithm lasground starting...global name 'os' is not defined See log for more details

Am I missing some dependency from my library?


texts: Combining points into polygons with range of values using PostGIS

texts:
I have a PostgreSQL table with a few million rows of [id, height, point] where the points are located in a ~100x100 grid.
I want to extract polygons from this data by combining points into polygons where the polygons contain a similar height. I want to be able to specify the height range (sometimes I might to have very many polygons and a narrow height interval and sometimes I might want to have fewer polygons and a wider height range)
How do I do this?
I tried to look though the functions in PostGIS but I couldn't find a suitable function.


texts: I am trying to create a table in composer to be positioned at the base of the map and is essentially a title block to provide information in text, image and table form. The only success I have had is creating many small text boxes and strategically placing them to appear as a table. However this is extremely tedious and if I need to change the spacing of 1, I need to then change the spacing's of all other text boxes- surely there is an easier solution.


texts:
I am interested in openlayers 3, and I want to build a site.

Already I can load features from variable in Geojson environment and I can draw features. But I could not write a code for saving drawn features.

How can I save features - what was drawn by a user - to variable (separately coordinates from properties) in the easiest way? ( I was looking for getFeatures() function, but It did not work for me. was I right, or should I search an other option?)

If I know it I will do it with database.


texts: CSV with latitude and longitude to a spatial points with QGIS 1.8

texts: I have a CSV file with latitude and longitude of several addresses and a shapefile of a region. I want to plot the points of the CSV file into the shapefile. But I don't know how to transform these latitude and longitude columns into spatial points with QGIS 1.8


texts: How to append Extent object to existing dictionary key values?

texts:
I have a dictionary whose keys are map segment names, and whose value is a list of three field values.

Using an arcpy.da.SearchCursor on the map segments FeatureLayer, I have extracted the extent object and the names for the segments.

Using the similar map segment names, I want to append the extent values to the dictionary keys (so that I can reference them later). How would I do this, you can't index an Extent object.

for instance:

{'m32': [7, 10, 13], 'm33': [7, 10, 13]}...

turns into something like:

{'m32': [7, 10, 13,XMin,Ymin,XMax,YMax], 'm33': [7, 10, 13,XMin,Ymin,XMax,YMax]}...

so that when I index it, I can index the key, the original values, and index the extent values.


texts: Could not set a workspace style as layer's default style using REST API

texts:
I am posting this data to

DATA_ONE

{"layer": {
          "enabled": true,
          "defautStyle":{
                    "name": "My_Roads_Style",
                    "workspace": "My_Workspace"
                        }
          }
}

DATA_TWO

{"layer": {
          "enabled": true,
          "defautStyle":{
                    "name": "My_Roads_Style"
                        }
          }
}

REST_URL

http://localhost:8080/geoserver/rest/workspaces/My_Workspace/styles/?name=My_Roads_Style

I have POSTed REST_URL with DATA_ONE it is giving 403 error.
I have POSTed REST_URL with DATA_TWO it is giving 403 error.
In both the cases it is giving same error.
What is wrong with my approch ?

I am able to apply the same style which is there in workspace to layer from Geoserver web interface.

I have tried it with Geoserver v2.2 and v2.5.


texts: TileMill: How to mask layer without losing background

texts:
I have a large geotiff with elevation gradient which I want to use to colour my map. However, the coastal line of the geotiff doesn't exactly match my shapefile so I want to mask it. The problem is that by using comp-op options (the best result is by using dst-in) I lose my background. Does anyone have a clue how to mask my layer but keep the background?

Attached is a screenshot for more explanation.


texts: Plugin for automatic refreshing of vector layers in QGIS

texts:
I am trying to develop a plugin for QGIS which can automatically refresh all vector layers at a given interval of time. Prior to QGIS version 2.06 I was using self.iface.mapCanvas().refresh) along with timer which was working. The same does not seems to be working anymore with the current versions.

Can some please guide me how to go about it.


texts:
I'm trying to determine whether there is spatial autocorrelation in a set of data. I am using Moran's I statistic to test for spatial autocorrelation.
The data was point data (instances of an event at specific addresses) that has been aggregated into postal areas. For privacy reasons I cannot get access to the original address data, so have to use the aggregated data.
How do I test for spatial autocorrelation in the underlying data if the data is skewed?
I am asking either:

Are 'events' likely to be near other events or is their distribution random?
Or, are postal areas that have many 'events' likely to be nearby to other postal areas that have many 'events'?

The issue that I have is that the data is skewed toward zero (Right skewed? Sorry, I don't know what the correct name for this kind of distribution is). In other words, most postal areas have zero 'events' and with decreasing numbers of postal areas the further you get away from zero, with some extreme outliers having hundreds of events. Every example I have read about that uses Moran's has normally distributed data. For example, mean income of census tracts, which is never zero but is normally distributed around some value.
Does this matter in my dataset?
So, will it bias the result?
And if so, how can I correct for it, or is there an alternative test for spatial autocorrelation in this kind of dataset?
What I have done so far:

plotted the data on a Choropleth map. This seems to indicate clustering, with most postal areas that have a non-zero value being clustering an a few regions. Additionally, the fact that there are extreme outliers in the hundreds implies that there is some level of clustering in the underlying data.
I have tried to run a Moran's I test using both R and ArcGIS (using both inverse distance and contiguity edges spatial conceptualization). Results give a low p-value, but also a low index value (around 0.1).


texts: Reordering vertices on a polyline (route)

texts:
I have a route in which the second vertex is in the middle of the line. Route is about 130 miles long. This is preventing me from recalibrating.

Is there any tool that will re order or sort all the vertices in the line? Or maybe even reapply order in which they are drawn?


texts: Creating feature class representation using ArcPy?

texts:
I have written a script which allows me to select multiple feature classes and apply both a representation (based on a template layer) and set a transparency value before adding to the map. Unfortunately only the first layer receives the representation. What am I doing wrong?

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
addlayers = arcpy.GetParameterAsText(0) # featureclasses (multivalue entry)
theFolder = arcpy.GetParameterAsText(1) # workspace - geodatabase
theRep = arcpy.GetParameterAsText(2) # featureclass with representation
theValue = arcpy.GetParameterAsText(3) # Transparency value

# Set reference layer and create representations for selection
rep_layer = "{0}\{1}".format(theFolder,theRep)

# Add layers and transparency
theLayers = addlayers.split(";")
for layer in theLayers:
    lay = arcpy.mapping.Layer(layer.strip("'"))
    desc = arcpy.Describe(lay)
    for child in desc.representations:
        if child.dataType =="RepresentationClass":
            pass
        else:
            rep_name = "{0}_rep".format(desc.baseName)
            arcpy.AddRepresentation_cartography(lay,rep_name,"RuleID","Override","STORE_CHANGE_AS_OVERRIDE",rep_layer,"Assign")
    arcpy.mapping.AddLayer(df,lay)
    arcpy.RefreshActiveView()
    lay.transparency = int(theValue)


texts:
I have created some QGIS plugin using PyQGIS those plugins have different input layer methods, some work to get layer by name from layer panel some plugin have compo_box to define the user where layer want from layer panel of QGIS.

Those plugins have a some error, if the input layer is wrong or missing from layer panel then it crashes, but if I replace with correct layer without closing QGIS then again don't work with the some way keep the wrong layer again.

If I use reload plugin and run the script with correct layer then plugin work correct.

But how to avoid to run all time reload plugin?

Can I have in my plugin some code to do re-reload every time the plugin running?


texts: R leaflet set zoom level of tiled basemap (ESRI World Imagery)

texts:
I need to define the maximum zoom level of a tiled map in R leaflet. The problem is that I have points that are placed very close to each other and I would like to be able to distinguish each of them on a map by further zooming in. My problem is that I cannot define the zoom level accurately as it is greyed out. How can I define the zoom level, so that it is possible to zoom in further?

I tried adding a providerTileOptions() using the maxZoom setting but this just gives me an empty map.

library(leaflet)
names = c("point1", "point2", "point3")
lat = c(46.67933, 46.67940, 46.67941)
long <- c(7.310553, 7.310570, 7.310565)

data <- as.data.frame(cbind(names, as.numeric(lat), as.numeric(long)))

m <- leaflet() %>%
  addProviderTiles('Esri.WorldImagery', options = providerTileOptions()) %>%
  addMarkers(data = data, lat = ~lat, ~long, popup = data$names, label = data$names)

m


texts: Is it possible to make a stackable label with the Esri LabelLayer

texts:
I'd like to add a line break, but the textstring is always taken literally. For example:

labels.addFeatureLayer(states, statesLabelRenderer, "Line 1 \r\n Line 2");

is displayed on the map as:

  Line 1 \r\n Line 2

I also tried HTML break tag with no luck either.


texts: Setting longtitude altitude latitude in postgres

texts:
what datatype should I use for a geometry field that uses longtitude altitutde latitutde ?

I'm using a point but that's not sufficient.


texts: Converting shapefile To GeoJSON using ArcPy?

texts:
I would like to convert a shapefile to geojson using python window in arcmap. I did not find any python code to do so. any idea?

I want to import my shape in a leaflet map but since there are too many shapefiles I want to automate the process.


texts: ArcGIS Rest performing query on feature service layers using within and intercepts

texts:
I am creating an application that needs to query a bunch of layers over REST to see which layers a point or line is within.

At the moment I have a local ArcGIS server set up with some feature services published.  I can successfully connect to the services and retrieve results - I'm actually doing this from a C# application using a URL to query to feature service, then deserialising the JSON result.

Here is an example of how I am querying one of my services now:
    http://LocalArcGisServer.local.com:6080/arcgis/rest/services/SW/SW_2/FeatureServer/0/query?f=json&where=PROJECT='EP'

Now the bit I am struggling with.  I have points and lines defined that I want to test against some layers in various feature services.  For example, I want to see if my point is within a particular polygon, or if my line crosses a polygon.

How can I formulate a query to a REST service, passing in my point or line, and asking if that point is within the layer or not?

I think I need to pass in info to describe my input point or line, and ask the feature service to do a 'Within' or 'Intercepts' query.  What are the parameters I need to set, or how would I reformulate that query?


texts:
I am new in qgis.

Do you know how hide selected layers from identify feature?

I select all the features because I need them to showed in the map. But when I used identify feature, I just want the one of them when identify feature pop up. (In this case, I don’t want ‘jateng’ show up in identify feature window).

Do you know how to hide it from identify features?


texts:
The Transectizer plugin does not work for the new QGIS version.
Any idea how to make it work?

or please suggest me is there any other alternative for it?


texts:
I am trying to install PostGIS on Ubuntu 12.04 and I think everything is installed correctly except for postgresql. I followed this post. I get the following error and nothing I do seems to satisfy the unmet dependency.

dpkg: error processing /var/cache/apt/archives/postgresql-9.1-postgis_2.0.1-2~precise3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/postgresql/9.1/lib/rtpostgis-2.0.so', which is also in package postgresql-9.1-postgis2 2.0.0-1ubuntu1~ppa18~precise1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/postgresql-9.1-postgis_2.0.1-2~precise3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

A little  help for this ubuntu/gis novice.


texts: Adding labeling expression to Custom Overlay Grid in ArcGIS Desktop?

texts:
I have a custom overlay grid whose labels are driven by an ugly attribute field which contains unnecessary leading zeroes and other labeling no-nos.

How can I introduce a labeling expression to this grid?

I am using ArcGIS 10 SP1 for Desktop.


texts: Rotating North in Custom CRS using proj4?

texts:
I'm trying to create a CRS for a local mine grid that involves the translation and rotation of GDA94 / MGA zone 55. The origin is translated 2195129.073 in the +x direction and by 5489615.789 in the +y direction, then the x-y plane is rotated about the origin by 68303 arc seconds.
This is the proj4 for GDA94 / MGA zone 55:

+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

This is the proj4 I have used to try and make the local mine CRS:

+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=2195129.073,5489615.789,0,68303,68303,0,0,0 +units=m +no_defs

The custom CRS currently doesn't work.

Why is it not working?

Test points; Custom Grid (15360, 6840), GDA94/MGA55 (303370.3,5916524)


texts: Drawing rectangle with geo coordinates (north/south, east/west) using QGIS

texts:
I need a layer with a rectangle that maps it's top left and bottom right corners to north/south and east/west coordinates. This is an Area of Interest which I need to overlay another image layer to see if the things I'm looking for are in the AOI.

How do I do this in QGIS?

It seems hard to find a decent tutorial.


texts: Return all results from join of non-spatial CSV to spatial data using ogr2ogr and SQLite dialect

texts:
I am attempting to carry out a simple join of a non-spatial CSV to a GeoJSON data source using ogr2ogr an its built-in SQL capabilities. I would like to use the SQLite dialect to carry out the join. When I try to use the SQLite dialect (-dialect sqlite) I expect all joined rows to be returned, however the actual result is only the first joined row. I demonstrate this and some variants below.

Example

Data

Spatial Data Source: map.geojson

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {"id": 1},
      "geometry": {
        "type": "Point",
        "coordinates": [-78.653, 35.7874]
      }
    },
    {
      "type": "Feature",
      "properties": {"id": 2},
      "geometry": {
        "type": "Point",
        "coordinates": [-78.6298, 35.7873]
      }
    },
    {
      "type": "Feature",
      "properties": {"id": 3},
      "geometry": {
        "type": "Point",
        "coordinates": [-78.6408, 35.7795]
      }
    }
  ]
}

Non-Spatial CSV Data Source: tbl.csv

id,atrr
1,ipsum
2,lorem
3,ipsum

1. Join using -dialect sqlite

Command

ogr2ogr -f geojson \
  -dialect sqlite \
  -sql "select map.* from map join 'tbl.csv'.tbl AS tbl on map.id = tbl.id" \
  /vsistdout/ map.geojson

Result

{
"type": "FeatureCollection",
"name": "SELECT",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 1, "attr": "ipsum" }, "geometry": { "type": "Point", "coordinates": [ -78.653, 35.7874 ] } }
]
}

Only the first row of the join is returned when I expected 3 rows.

2. Join using OGR SQL

However, if I remove the -dialect sqlite parameter and the default OGR SQL dialect, the result is different:

Command

ogr2ogr -f geojson \
  -sql "select map.*, tbl.* from map join 'tbl.csv'.tbl AS tbl on map.id = tbl.id" \
  /vsistdout/ map.geojson

Result

{
"type": "FeatureCollection",
"name": "map",
"features": [
{ "type": "Feature", "properties": { "map.id": 1, "tbl.id": "1", "tbl.attr": "ipsum" }, "geometry": { "type": "Point", "coordinates": [ -78.653, 35.7874 ] } },
{ "type": "Feature", "properties": { "map.id": 2, "tbl.id": "2", "tbl.attr": "lorem" }, "geometry": { "type": "Point", "coordinates": [ -78.6298, 35.7873 ] } },
{ "type": "Feature", "properties": { "map.id": 3, "tbl.id": "3", "tbl.attr": "ipsum" }, "geometry": { "type": "Point", "coordinates": [ -78.6408, 35.7795 ] } }
]
}

3. Join using SQLite dialect and non-spatial table in SQLite database

I also reproduced the CSV as a table (tbl) in a SQLite database (tbl.db) and attempted to carry out the join using the SQLite dialect:

Command

ogr2ogr -f geojson \
  -dialect sqlite \
  -sql "select map.*, tbl.* from map join 'tbl.db'.tbl AS tbl on map.id = tbl.id" \
  /vsistdout/ map.geojson

Result

{
"type": "FeatureCollection",
"name": "SELECT",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 1, "attr": "ipsum" }, "geometry": { "type": "Point", "coordinates": [ -78.653, 35.7874 ] } },
{ "type": "Feature", "properties": { "id": 2, "attr": "lorem" }, "geometry": { "type": "Point", "coordinates": [ -78.6298, 35.7873 ] } },
{ "type": "Feature", "properties": { "id": 3, "attr": "ipsum" }, "geometry": { "type": "Point", "coordinates": [ -78.6408, 35.7795 ] } }
]
}

This result is what I expected when I ran the join on the CSV using the SQLite dialect (#1).

While I have demonstrated two successful methods (#2 & #3) for joining non-spatial data to a spatial source here, I specifically would like to be able to carry out a join of a non-spatial CSV to a spatial data source using the SQLite dialect in ogr2ogr (#1).

How should I proceed?


texts: Filtering image collection using date and lat long from feature collection in Google Earth Engine?

texts:
I'm trying to use the JSON data that i have turned in a feature collection using this code:

var dict = ee.Dictionary(JSONRAWDATA)
// inspect the dictionary
print(dict)

// make some months
var months = ee.List(['January', 'February', 'March', 'April', 'May', 'June',
                      'July', 'August', 'September', 'October', 'November', 'December']);

// make features from each element in the list
var feats = ee.FeatureCollection(ee.List(dict.get('pings')).map(function(feat){
  feat = ee.Dictionary(feat);
  var geom = ee.Geometry.Point([ee.Number.parse(feat.get('longitude')), ee.Number.parse(feat.get('latitude'))]);
  var getDate = ee.String(feat.get('datetime'));
  var systemDate = ee.Date.parse("dd MMM YYYY hh:mm:ss aa", getDate).millis();
  return ee.Feature(geom, ee.Dictionary(feat)).set('system:time_start', systemDate);

}))
  // set the other properties of the dictionaries as properties to the collection
feats = ee.FeatureCollection(feats.setMulti(dict.remove(['pings'])));

print(feats);
print(ee.String(feats.get('description')).split(' '))

The code generates a feature collection containing a list of pings and its respective date, lat and long.

I need to use this data (date, lat, long) in this code (below) to filter my imagecollection and give me a table with the spectral bands data based on the feature information. This is possible ?

var geometry = ee.Geometry.Point([67.42467260724823, 21.057842149424154]);

var rrs = ee.ImageCollection("NASA/OCEANDATA/MODIS-Aqua/L3SMI")
  .filterDate('2018-1-04', '2018-1-05')
  .select('Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555')
  .filterBounds(geometry);

rrs = rrs.toList(rrs.size());

var reduceR = function(image) {
  image = ee.Image(image);
  var reducedVal = image.reduceRegion({
    reducer: ee.Reducer.first(),
    geometry: geometry,
  })
  return ee.Feature(geometry).set(reducedVal);
};

var mRrs=rrs.map(reduceR);
mRrs = ee.FeatureCollection(mRrs);

Export.table.toDrive({
  collection: mRrs,
  description: 'rrs',
  fileNamePrefix: 'rrs',
  fileFormat: 'CSV',
  selectors: ['Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555']
});

Expected output: A table with the columns: pings, date, lat, long, rrs_488, rrs_531...

I'm trying with this code but returns a blank table:

var feats = ee.FeatureCollection(ee.List(dict.get('pings')).map(function(feat){
  feat = ee.Dictionary(feat);
  var geom = ee.Geometry.Point([ee.Number.parse(feat.get('longitude')), ee.Number.parse(feat.get('latitude'))]);
  var getDate = ee.String(feat.get('datetime'));
  var systemDate = ee.Date.parse("dd MMM YYYY hh:mm:ss aa", getDate).millis();
  return ee.Feature(geom, ee.Dictionary(feat)).set('system:time_start', systemDate);
}))

var rrs = ee.ImageCollection("NASA/OCEANDATA/MODIS-Aqua/L3SMI")
    .select('Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555')
  .filterBounds(feats, ee.Filter.stringContains('ping'));

rrs = rrs.toList(rrs.size());

var reduceR = function(image) {
  image = ee.Image(image);
  var reducedVal = image.reduceRegion({
    reducer: ee.Reducer.first(),
    geometry: (feats),
  })
  return ee.Feature(feats).set(reducedVal);
};

var mRrs=rrs.map(reduceR);
mRrs = ee.FeatureCollection(mRrs);

Export.table.toDrive({
  collection: mRrs,
  description: 'rrs',
  fileNamePrefix: 'rrs',
  fileFormat: 'CSV',
  selectors: ['Rrs_488', 'Rrs_531', 'Rrs_547', 'Rrs_555']
});


texts: Create ShapeFile from CSV Using OGR and Python

texts:
I want to convert a CSV file of point coordinates to a ShapeFile using OGR and Python. The example.csv file looks like this:

ID,X,Y
1,240007.000,647756.000
2,240008.000,647756.000
3,240009.000,647756.000
4,240020.000,647756.000
5,240021.000,647756.000
6,240022.000,647756.000
7,240023.000,647756.000
8,240024.000,647756.000
9,240025.000,647756.000
10,240026.000,647756.000

And I have created an OGR virtual dataset definition file with the *.vrt extension. It looks like this:

<OGRVRTDataSource>
    <OGRVRTLayer name="example">
        <SrcDataSource>D:\Temp\GCMRC\003L\example_short.csv</SrcDataSource>
        <SrcLayer>example</SrcLayer>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="X" y="Y"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

I have written a simple Python script that tries to open a dataset from the CSV file, loop over the features (simply to prove they are legit) and then export the points to a ShapeFile. I got this to work on an example that I found, but cannot get it to work on my data posted here.

from osgeo import ogr

in_ds = ogr.Open("D:/Temp/example.vrt")
lyr = in_ds.GetLayer('example')
for feat in lyr:
    geom = feat.GetGeometryRef()
    print geom.ExportToWkt()

ogr.GetDriverByName("ESRI Shapefile").CopyDataSource(in_ds, "D:/Temp/example.shp")

The code crashes on the GetGeometryRef() call. It also produces an empty "line" ShapeFile.


texts: Can I open and edit a point shapefile from another point shapefile

texts:
If out in the field gathering points in one shapefile with its own attribute table is it possible to create a form that will allow you to gather a point with a different attribute table

For example:

If I am gathering points on a pipeline which has its own attributes and I come across a valve which has its own attributes can I open the valve layer for editing from the Pipeline layer?

I have eleven different shapefiles but they are all associated with pipeline I would like to make a form that lets me fill in the attributes for a pipeline then click a button for the valve layer or any of the other layers then go back to pipeline


texts:
I am trying to calculate mean reflectance values across landsat 5 and 8 images using the following code:

var point = /* color: #d63000 */ee.Geometry.Point([-133.49, 69.18]);

var l5 = ee.ImageCollection('LANDSAT/LT05/C01/T1')
  .filter(ee.Filter.lt('CLOUD_COVER',10))
  .filterBounds(point)
  .filter(ee.Filter.calendarRange(7,8,'month'));

var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
  .filter(ee.Filter.lt('CLOUD_COVER',10))
  .filterBounds(point)
  .filter(ee.Filter.calendarRange(7,8,'month'))
  .select(['B6'])
 .map(function(image){
 return image.rename(['B5']);
});

var stack = ee.ImageCollection(l5.merge(l8));
   print(stack);
   var mean = stack.select(['B5'])
  .reduce(ee.Reducer.mean());

 Map.addLayer(mean, {});

which gives this error:

I have tried return image.rename(['B5']).toShort(); with similar results


texts: QGIS File Read Error when opening an existing project

texts:
My computer will not open a project i have been working on for weeks! it is coming up with an error of

  Project file read error: unexpected end of file at line 1 column 1 for
  file C:/Users/xxxx/Documents/Nxxxx/Exxxx.qgs

Is there anyway to get it back?


texts: How to extract the boundary of a raster image?

texts:
I am working in QGIS 2.10.1 and I have the following situation: I have some Landsat8 scenes (different paths and rows) and I want to extract their boundary. My final objective is to superimpose them to the vector of my study area, so that I can show how the scenes cover the study area and in which points they overlap.
I have already tried to convert the raster into a vector, but QGIS cannot make it, it crashes or it gives me back only part of the polygon.

Is there anybody who's got an idea to solve this problem?


texts:
Using ogr2ogr I was able to import a shapefile into SQL server, but it was imported as a geometry data type and not compatible to compare it to latitude longitude as the points were not correct on the polygons.

gdal\bin\gdal\apps\ogr2ogr -overwrite -f MSSQLSpatial -lco SRID=4326 -lco GEOM_TYPE=geography -a_srs "GIS\Kentucky\HH001M01.prj" "MSSQL:server=.\;database=GISData;trusted_connection=yes" "GIS\Kentucky\HH001M01.shp"

The last command I ran was above, but it gave an error that the Latitude values must be between -90 and 90 degrees. Which makes sense, but I don't know how to apply the project correctly to get it to convert the shapefile to the right format.

Am I missing a parameter to ogr2ogr or have I specified something wrong?

Data
HH001M01 is the data I am using here.
http://www.lrc.ky.gov/gis/gis_data.htm


texts: How to determine lock on file geodatabase?

texts:
I'm trying to delete a file geodatabase through Windows Explorer but I get the error message:

The action can't be completed because the folder or file in it is open in another program. Close the folder and try again.

I have no success deleting it through right-click in ArcCatalog, or using Delete_management in a Python script. I've deleted all map services that could be using this geodatabase. I've covered issues like making sure no one else has this geodatabase open. Does anyone know how I can delete this geodatabase? Or does anyone know how I can determine what might be locking it? Quick and dirty methods are welcome.


texts:
I'm using startup.py to import WFS layers in to a project template and ideally I would like to hide the layer data source popup that appears when hovering over the layer name. The popup can be quite big and temporarily obscures the map. I've found a way using QToolTip and stylesheets opacity to hide the popup but this also hides the tooltip popup too. Is there a better way ?
QApplication.instance().setStyleSheet("QToolTip {opacity:0%}") .... makes layer and tool popups hidden
QApplication.instance().setStyleSheet("QToolTip.QTreeView {opacity:0%}") ... doesn't work

Using QgsSourceSelectProvider gives me access to the layer tooltip but tells me I can't change it.
Is there a better / nother way ?


texts: Ensuring data quality from organizations

texts:
You are working for an organization that receives data from other organizations in different data formats (geospatial files, spreadsheets, text files, etc.)

Is there specific things you would ask these organizations to make sure that the data you are receiving from them is of good quality data?


texts: Is ist possible to export a digital elevation model as .reb file es used in CARD-1 or Vestra?


texts: Gdalwarp - Clip Raster by Mask - Missing Pixels (Cutline)

texts: I am clipping two - partly overlapping - geotiffs with Gdalwarp by the same shapefile, wich I want to merge in a next step. This works well, but after merging the rasters, I noticed that some pixels are missing along side the cutline/ clipline of the inputshapefile. Is there any option, which allows to include the pixels of the cutline? - Many Thanks.


texts: Get raster pixel value within a shapefile polygon

texts:
I have the below GeoPandas dataframe that has:

two columns: geometry and raster_val
13 rows

The first row is shown below.

    geometry                                                  raster_val
0   POLYGON ((746124.59744 3382358.69579, 746124.5...         5.0

I want to use the Geopandas geometry to get the raster pixels inside each polygon and store the pixel values in separate numpy arrays.


texts: QGIS: Plug-in to determine optimal distance between coordinate and shape file

texts:
I have coordinates of power plants and I would like to determine their optimal distance (shortest distance) to electric grid lines (shape file).
How could this be done in QGIS?


texts: how can i use the postgresql's Geometric Types

texts:
How can i implement Geometric Types in postgresql db..
Postgresql db is hosted in windows os.. and how can i get whether point is in circle or not?
getting errors when i am using predefined functions...
Is there anything do i need to install further .. i am using postgresql 9.1 version. I have seen PostGIS for Linux... what is that .. how can will it be useful?

Thanks in advance
Aj..


texts:
Had a quick look around and didn't quite see what I've been looking for.

I've got a .Net Web Application that is going to accept different map files and I want to convert everything over to KML so all of the different maps can be displayed in the same way. We are going to be accepting KML/KMZ overlays, Geospatial PDFs and other map types that include topology and other map overlays. Once they are converted they will be added to their 'MyMaps' so they can choose which overlays they want to have over top of Google Maps.

<asp:Content ID="content7" runat="server" ContentPlaceHolderID="cphAfter">

My Maps:

                <asp:DropDownList runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlMapSelect_SelectedIndexChanged">
                    <asp:ListItem Text="text1" />
                    <asp:ListItem Text="text2" />
                </asp:DropDownList>

Add Maps:

                <input id="txtMapLocation" type="file" runat="server" name="yourinputname" class="form-control" />

                <asp:Button ID="btnAddMap" Text="Add Map" runat="server" OnClick="btnAddMap_Click" CssClass="form-control" />

What software from ArcGIS is going to be needed to perform this?

I already have the SDK for .Net and have a request for ArcGIS Desktop. Just curious what objects are going to be needed from which packages to accomplish this task.

protected void Page_Load(object sender, EventArgs e)
{
    //Loading maps already uploaded into DropDownlist to Select
}
protected void btnAddMap_Click(object sender, EventArgs e)
{
    //Upload map then convert to KML format, store on server, create entry for map location in DB
}
protected void ddlMapSelect_SelectedIndexChanged(object sender, EventArgs e)
{
    //When map is selected, find overlay and add it to the google map created by master template
}

Code is still pretty rough right now, it's early on in development. But I hope it gives a good enough idea of what I need to get done.


texts: Creating View using spatial queries in PostGIS?

texts:
I am trying to create a view from a selection. One layer contains indian states boundary as polygon and other world forest fire as points.

CREATE VIEW myview AS
SELECT *
    FROM vnp14imgtdl_nrt_global_24h a, states b
      WHERE st_within(a.geom, b.geom)
      AND a.confidence = 'high'
      order by b.statename;

If I just run the select command it runs fine, but once I try to create a view it gives error stating

ERROR: column "gid" specified more than once
SQL state: 42701


texts:
Apple recently acquired WifiSlam.  How does their technology work?

Their website doesn't go into much detail.

  Allow your smartphone to pinpoint its location (and the location of
  your friends) in real-time to 2.5m accuracy using only ambient WiFi
  signals that are already present in buildings.

  We are building the next generation of location-based mobile apps
  that, for the first time, engage with users at the scale that personal
  interaction actually takes place. Applications range from step-by-step
  indoor navigation, to product-level retail customer engagement, to
  proximity-based social networking.


texts: Automating Intersect between two polygon layers

texts:
I have a spreadsheet that has county-level occurrences of around 1000 species within the US in the column headings (Species  State  County). Thus, for some counties there may be multiple species. I also have a county shapefile with the County field linking the shapefile to the spreadsheet. Finally I have a shapefile with multiple, separate polygons and I want to know which rows from the spreadsheet intersect or contain a polygon from the second polygon shapefile.

I am looking for the best way to automate this process so that I create a new column in the spreadsheet that has a 1 if the county occurrence of the species intesects with the second polygon shapefile. For example,

Species  State    County  Intersect

sp. A          NC     Durham   1

sp. A          NC     Orange   0

where species A county-level occurence intersects with the polygon in Durham County, but not in Orange County.

I have not specified a platform, but I have worked with R, ArcGIS, and Python. Currently I am most comfortable working in R (but not for spatial data, there I am a newbie), but not sure how to automate this process.

thanks for any information.


texts:
I am looking to make some updates to the Distance and Direction AddIn for ArcGIS.

I have downloaded the source code and opened the solution. However, I cannot seem to get the project to output any info to the debug window. I added some break points and when I run the solution it stops on the breakpoints but the Debug.Print statements do nothing. I am in Debug config in the solution.

How can I debug this solution?


texts:
Using ArcMap 10.6 I am trying to 'select by attribute' data that is separated by a comma.

For example: passive, football, soccer or passive, playground and so on
with the objective to calculate the number of each activity.

I don't use Python script.


texts: Geoserver Dynamic Symbolizers with SLD and CSS not working

texts:
when I am applying GeoServer Style CSS for points its applying style to all the
points and when I am binding image URL with the label there it's binding the URL string.

I am using geoserver 2.12.1

* {
   mark:
url(https://upload.wikimedia.org/wikipedia/commons/d/d7/Android_robot.svg);
 mark-mime: "image/svg";
 mark-size: 20;
 label: [ImageUrl];
 }

Same when I am trying to bind dynamic URL as below it's not binding the style.

   * {
     mark: url("${ImageUrl}");
     mark-mime: "image/svg";
     mark-size: 20;
     label: [ImageUrl];
     }

same dynamic binding i have tried with Dynamic Symbolizers sld where i am passing dynamic ImageUrl in sld:OnlineResource

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor
xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>Default Styler</sld:Name>
    <sld:UserStyle>
      <sld:Name>Default Styler</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Rule>
          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:ExternalGraphic>
                <sld:OnlineResource
xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple"
           xlink:href='${ImageUrl}'/>
                <sld:Format>image/svg+xml</sld:Format>
              </sld:ExternalGraphic>
              <sld:Size>20</sld:Size>
            </sld:Graphic>
          </sld:PointSymbolizer>
          <sld:TextSymbolizer>
            <sld:Label>
              <ogc:PropertyName>ImageUrl</ogc:PropertyName>
            </sld:Label>
            <sld:Fill/>
          </sld:TextSymbolizer>
        </sld:Rule>
        <sld:VendorOption name="ruleEvaluation">first</sld:VendorOption>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
 </sld:StyledLayerDescriptor>


texts: PyQGIS: qgis:refactorfields won't accept FIELDS_MAPPING data

texts:
I'm trying to create a PyQGIS script that changes length values of all shapefiles in a specified folder. I would like to save disk space by setting all length values to 2 which Refactor Fields will automatically change to the highest value in that row. I've successfully put together a script that converts shapefiles with a known amount of rows (I copy the FIELDS_MAPPING section).

import processing
import glob
import os

path = "C:/path"
for layer in glob.glob(path + "*.shp"):
    vLayer = QgsVectorLayer(layer, os.path.splitext(os.basename(layer))[0], 'ogr')
    fields = vLayer.pendingFields()
    field_names = [field.name() for field in fields ]
    processing.runalg("qgis:refactorfields",
                      vLayer,
                      [{'name': str(fields.field(0).name())[0:],
                        'type': fields.field(0).type(),
                        'length': 2,
                        'precision': 0,
                        'expression': str(fields.field(0).name())[0:]
                      }],
                      path + vLayer.name() + '_refactored.shp')

From this I wanted to create a script that converts all rows.

import processing
import glob
import os

path = "C:/path"
for layer in glob.glob(path + "*.shp"):
    vLayer = QgsVectorLayer(layer,os.path.splitext(os.path.basename(layer))[0], 'ogr')
    fields = vLayer.pendingFields()
    field_names = [field.name() for field in fields ]
    i = 0
    stitch = "["
    while(i < len(fields)):
        nameParam = fields.field(i).name()
        nameParam = nameParam[0:]
        typeParam = fields.field(i).type()
        stitch = stitch + "{'name': '" + str(nameParam) + "', 'type': " + str(typeParam) + ", 'length': 2, 'precision': 0, 'expression': '" + str(nameParam) + "'}"
        if len(fields)-1 != i:
            stitch = stitch + ", "
        i = i + 1
    stitch = stitch + "]"
    processing.runalg("qgis:refactorfields",
                      vLayer,
                      stitch,
                      path + vLayer.name() + '_refactored.shp')

This code does not work. I've tried running processing.runalg using the exec() function in python. It produces the same results. The PyQGIS console points towards the stitch variable (the data inside, not the variable itself) and displays a data error.

Any ideas why this won't work?

UPDATE

The error:

Error: Wrong parameter value: [{'name': <name>, 'type': <type>, 'length': 2, 'precision': 0,'expression': <name>}, {'name': <name>, 'type': <type>, 'length': 2, 'precision': 0,'expression': <name>}]

The values in <> are generated from the .name() and .type() functions.


texts:
I'm trying to understand the relation between QGIS and WMS services. I request for a WMS service (declared coordinate system : CGRS_93_LTM) via QGIS software in WGS84 coordinate reference system. Which software is responsible for service transformation from CGRS_93_LTM to WGS84?
As i know, the server provide the dataset with the reference system and a boundary box (min, max coordinates for X,Y axes). So, QGIS define the boundary box of the dataset in CGRS_93, and then transform it to WGS84?


texts: Apply categorized render to Vector Layer

texts:
I am new to QGIS and I am cannot find a solution to my problem. I have this piece of code:

coord_layer = QgsVectorLayer(coords, "my_layer")
single_symbol_renderer = coord_layer.renderer()

symbol = single_symbol_renderer.symbol()

symbol.setColor(QColor.fromRgb(255, 0, 0))
symbol.setWidth(3)

coord_layer.triggerRepaint()
iface.layerTreeView().refreshLayerSymbology(coord_layer.id())
QgsProject.instance().addMapLayer(coord_layer)

Which sets width and color to my layer.
However, I would like to use Categorized Renderer and paint my data based on one of my attributes.

How do I change renderer of a layer and perform this task?


texts: Automatically assigning numbers to point file in various order in QGIS?

texts:
I know how to automatically assign numbers to a new point files using the $rownum function in the field calculator. However it does it from the top-left over and down like reading a book.

I could manually add the numbers myself that would be very time consuming in large point features.

What I'm wanting to do, as shown in the picture, is the top-left group of points to have them labeled 1 to 33 and the bottom-right group from 34 to the end.

Also, if I wanted to label the points vertically and start at the furthest top-left point and go down and then to the right, how would that be accomplished.

I'm sure that there is just some "code" I need to put into the field calculator but I do not know how.


texts:
I've recently started investigating NASADEM for some terrain visualisation tasks, and noticed that the total number of tiles on the Earthdata portal is way fewer than the global ASTER GDEM v003 dataset.
NASADEM - 14,520 granules
ASTER v003 - 22,912 granules
I've searched extensively but can't find a definitive reason why there's far fewer tiles in the NASADEM dataset. Does anyone know the answer? Both appear to be global coverage and both appear to be 1° x 1° tiles, so I can't really account for the difference in tiles.
It sounds like NASADEM has an improved accuracy, but if there's a lot of missing land data then I'd sooner stick with ASTER for my purposes I think, I just don't want to overlook something obvious.


texts: Production of DEM on ArcMap from LiDAR data?

texts: I am trying to produce a DEM for my dissertation (i'm relatively new to ArcGIS) so that I can conduct hydrological analyses of catchments. I have downloaded LIDAR (.laz 2x2 km) data and have created a las dataset. It is my understanding that I now need to make this into a terrain dataset to analyse the data. I have made a feature dataset and have imported LIDAR ground points into a multipoint feature class. However, I do not know what to do next. I have read that adding breaklines is important and that there is more preprocessing I need to do.I have catchments that are separate to each other so I believe I may need to merge them. I am looking for help as to what processes I need to execute to have a data set upon which I can use the hydrology toolbox to carry out accurate analysis.


texts: Setting up QGIS Server/Lizmap with PostGIS database

texts:
I've installed Lizmap and set up a local PostgreSQL database for Lizmap configurations. Now I'm trying to run a new QGIS Project with the layers saved in a PostGIS/PostgreSQL database (also local) but Lizmap keeps loading the Map and there is an error message: "service non disponible!"

Do I need to configure the PostGIS database (user, pw,..) anywhere else besides the QGIS Project itself in the Lizmap respository? (as I did with the Lizmap Admin PostgreSQL db). How can I find a solution for this problem?


texts: Rockfall analysis (Nearest neighbor downhill) in QGIS

texts:
I am working on a rockfall guide for QGIS and I'm currently stuck on one of the stages.

I currently at a point in the guide where I have two point layers one "rockfall release point"-layer and "braking point"-layer.

We are assuming that any rockfall will loosen from a release point, continue down the slope in the steepest direction, then begin to brake when it reaches a braking point, before stopping shortly thereafter.

I was first planning on calculating drainage area for each braking point using watersheds like in ArcGIS Pro, where you can add a "pour point field", and then find which drainage field each release point is placed in (like in the figure above).

The only similar thing I can find in QGIS is r.water.outlet where you have to type in one coordinate, do the calculation and start all over again - this is going to be hard considering I have 2.5m points.

A solution similar to the ArcGIS one would probably be the easiest. The other solution that I can come up with is doing a nearest neighbour analysis between the two layers, but then I also have to make sure that it only joins the point that is at the steepest slope.


texts: Looking for QGIS 2.4 C++ Hello World example?

texts:
In the project I'm working on (C/C++/Qt application), we are trying to integrate QGIS (latest version desirable, 2.4 for the moment). But there is very little information in the web on how to use QGIS C++ API.

To start I wanted to write a simple code example (read shapefile and visualize it in a window). I found a code example for QGIS 1.8, but it does not work with QGIS 2.4 as the API has changed since. Then I tried to edit it in order to make it work with QGIS 2.4, but it did not succeed. Here is the original code:

#include <QtCore/QString>
#include <QtGui/QApplication>

#include <qgsapplication.h>
#include <qgsproviderregistry.h>
#include <qgssinglesymbolrenderer.h>
#include <qgsmaplayerregistry.h>
#include <qgsvectorlayer.h>
#include <qgsmapcanvas.h>

#include <iostream>

int main(int argc, char** argv)
{
  // Creation of the Qt GIS application
  QgsApplication app(argc, argv, true);

  // Hard coded paths
  QString myPluginsDir        = "/usr/lib64/qgis";
  QString myLayerPath         = "./HelloWorld/GUI/data/helloQGIS.shp";
  QString myLayerBaseName     = "helloQGIS";
  QString myProviderName      = "ogr";

  // Instantiate Provider Registry
  QgsProviderRegistry::instance(myPluginsDir);

  // Create a maplayer instance
  QgsVectorLayer* mypLayer = new QgsVectorLayer(myLayerPath, myLayerBaseName, myProviderName);
  QgsSingleSymbolRenderer* mypRenderer = new QgsSingleSymbolRenderer(mypLayer->geometryType());
  QList <QgsMapCanvasLayer> myLayerSet;
  mypLayer->setRenderer(mypRenderer);
  if (mypLayer->isValid())
  {
    qDebug("Layer is valid");
  }
  else
  {
    qDebug("Layer is NOT valid");
  }

  // Add the Vector Layer to the Layer Registry
  QList<QgsMapLayer*> theMapLayers;
  theMapLayers.append(mypLayer);
  QgsMapLayerRegistry::instance()->addMapLayers(theMapLayers, TRUE);

  // Add the Layer to the Layer Set
  myLayerSet.append(QgsMapCanvasLayer(mypLayer, TRUE));

  // Create the Map Canvas
  QgsMapCanvas * mypMapCanvas = new QgsMapCanvas(0, 0);
  mypMapCanvas->setExtent(mypLayer->extent());
  mypMapCanvas->enableAntiAliasing(true);
  mypMapCanvas->setCanvasColor(QColor(255, 255, 255));
  mypMapCanvas->freeze(false);
  // Set the Map Canvas Layer Set
  mypMapCanvas->setLayerSet(myLayerSet);
  mypMapCanvas->setVisible(true);
  mypMapCanvas->refresh();
  mypMapCanvas->show();

  // Start the Application Event Loop
  return app.exec();
}

I've tried many different ways to modify this code in order to make it work with QGIS 2.4, but no success. The only source of information I've used is the official doc API.

I said to myself that maybe someone has already did it and/or have any other code example of using QGIS 2.4. As GIS is a new domain for me, I have some difficulties in understanding how the API should work.


texts: Using my own hierarchy in network analyst

texts:
I am trying to use a hierarchy in my network model, but I have already assigned a hierarchy in my attribute table through a new field. All the ArcGis help guides point towards using the standard hierarchy ranges given:

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=types_of_evaluators_used_by_a_network&anchor=hierarchies

How do I go about using my own hierarchy ranges?


texts:
I am installing ArcGIS Pro onto my computer.  This is a work computer with multiple users but I have the permissions necessary to install where I want.
I am trying to follow these instructions: https://pro.arcgis.com/en/pro-app/get-started/install-and-sign-in-to-arcgis-pro.htm to install specifically to the file path C:\Program Files\ArcGIS\Pro.  However this is failing.
My ArcGIS Desktop which enables my Pro license is a 32 bit and installed in C:\Program Files(86)\ArcGIS\Desktop10.6.  So there was NO C:\Program Files\ArcGIS\Pro path.  I created and empty folder path --> ...\ArcGIS\Pro and tried installing there, to no avail.
Does it matter where I install it?  The recommended path by the installer executable is C:\Users\<myusername>\Documents\ArcGIS Pro 2.5.  I would prefer to install for all users.
Any ideas how to achieve this?


texts: Does an event get fired after a Layer has finished rendering in Openlayers 3?

texts:
I am rendering about 27000 Markers in different layers on a mapview. Everything works fine on fast devices.

I have a problem on older devices (like the iPad3). When i hide one layer and set another layer to visible = true, it takes several seconds for the change to take affect on the mapview. The mapview is frozen in this time and any user interaction is delayed until the cluster layer has finished rendering. It would be better for me to show a loading popup and wait until the view has finally finished rendering.

Is there any event which gets fired after the rendering on the mapview has finished and how can I connect to it?


texts: Problems adding calculated value (ee.reducer.mean) as band (Google earth engine)

texts:
Objective:
I work with an image collection and have calculated a mean value derived from the ee.Reducer.mean function. I would like get this mean value exported together with band pixel values when i sample the collection.

Background
I have managed to get the reducer mean output stored as a property using image.set, but i repeatedly run into problems when I try to access it using the get function (I have some ideas of why, but I do not want to clutter this question too much).

My attempted solution
Instead I was thinking of adding my mean value as a constant value band and sample it in the same fashion as the other bands.

I have thought about two reasonable candidates for this task (I am currently running for number 2):
1) Getting the value from the property in a similar manner to this example. (The central command reads as follow: img=img.addBands(ee.Image.constant(img.get('system:time_start')).rename('time'));).But I am unable to successfully access the value using the get function.

1) Apply the value as a new band directly after applying the reducer function. The code below show's my unsuccessful attempt with this method, resulting in a Parameter 'value' is required error.

// Define study area
var studya_area_geometry =
    ee.Geometry.Polygon(
        [[[-4.861076352175587, 14.291647050733893],
          [-4.861076352175587, 14.235081371627722],
          [-4.788463589724415, 14.235081371627722],
          [-4.788463589724415, 14.291647050733893]]], null, false);

// Add collection
var study_site_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
    .filterDate('2018-01-01', '2018-02-17') // Filter dates
  .filterBounds(studya_area_geometry); // Filter bounding box

// Define function to use Reducer.mean specifically on band 2 ('B2') in collection.
var mean_function_selected_band = function(image) {
  var B2_band = image.select('B2');
    var B2_band_mean = B2_band.reduceRegion({
      reducer: ee.Reducer.mean(),
      geometry: studya_area_geometry,
      scale: 30
    });

    return(image.addBands(ee.Image.constant(B2_band_mean).rename('B2_mean')));

    // I have tried to cast the value using following command, but it does not work either
  // return(image.addBands(ee.Image.constant(ee.Number.parse(B2_band_mean)).rename('B2_mean')));

  // The alternative solution mentioned above would be to save the value
  // as a property instead using following command, but I have not been able to solve it any how:
     // return(image.set('B2_mean',B2_band_mean));

};

// Apply function
var collection_containing_mean = study_site_collection.map(mean_function_selected_band);
print(collection_containing_mean);

My thoughts
I assume that the error message indicates that reducer output is not stored in a numerical format that server understands. I have tried to print it to see how the output is structured, but just get another error, leaving me in the dark to figure out how to cast or the transform the value.

Stack Exchange has been very useful to gather clues on what might be wrong in my code, but I haven't been able to wrap my head around all the possibilities.


texts: Getting: org.opengis.referencing.NoSuchIdentifierException: No transform for classification "Transverse Mercator Zoned Grid System" with geotools

texts:
Using geotools I've been trying to create a referenced envelope after converting/reprojecting from WGS 84 to UTM with specific zones and it seems that either I need to do something with authority factories or figure out some kind of a workaround for this.

Here are the errors:

Exception in thread "main" org.opengis.referencing.NoSuchIdentifierException: No transform for classification "Transverse Mercator Zoned Grid System".
at org.geotools.referencing.operation.DefaultMathTransformFactory.getProvider(DefaultMathTransformFactory.java:290)
at org.geotools.referencing.operation.DefaultMathTransformFactory.getDefaultParameters(DefaultMathTransformFactory.java:316)
at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateOperation(DirectEpsgFactory.java:2610)
at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateOperation(BufferedAuthorityFactory.java:1041)
at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:1955)
at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:783)
at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:801)
at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:640)
at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:644)
at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:801)
at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731)
at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179)
at org.geotools.referencing.CRS.decode(CRS.java:489)
at org.geotools.referencing.CRS.decode(CRS.java:417)

Here is the block of code that caused the error, it is related to trying to use CRS.decode():

    MathTransform mathTransform = CRS.findMathTransform(aoi.getCoordinateReferenceSystem(), CRS.decode("EPSG:" + epsg));
    DirectPosition2D srcDirectPosition2D = new DirectPosition2D(aoi.getCoordinateReferenceSystem(), aoi.getMinX(), aoi.getMinY());
    DirectPosition2D destDirectPosition2D = new DirectPosition2D();
    mathTransform.transform(srcDirectPosition2D, destDirectPosition2D);
    DirectPosition2D srcMaxDirectPosition2D = new DirectPosition2D(aoi.getCoordinateReferenceSystem(), aoi.getMaxX(), aoi.getMaxY());
    DirectPosition2D destMaxDirectPosition2D = new DirectPosition2D();
    mathTransform.transform(srcMaxDirectPosition2D, destMaxDirectPosition2D);

This is what I got when I printed out the coordinate reference system:

PROJCS["WGS 84 / UTM zone 18N",
GEOGCS["WGS 84",
DATUM["World Geodetic System 1984",
  SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
  AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic latitude", NORTH],
AXIS["Geodetic longitude", EAST],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
PARAMETER["central_meridian", -75.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","32618"]]

Apparently I may need to set a comparison tolerance when I use CRS related functions, but I'm not sure how to go about doing that.

http://docs.geotools.org/latest/javadocs/org/geotools/referencing/CRS.html


texts:
I am using this documentation https://geonetwork-opensource.org/manuals/2.10.4/eng/developer/xml_services/metadata_xml_search_retrieve.html to search for XML metadata in my local GeoNetwork.
Can I force GeoNetwork to return metadata title in xml.search response <geonet:info> element? Is it possible to do request that would return all metadata records like this
curl -X POST -u user:pass http://localhost:8080/geonetwork/srv/eng/xml.search

and would also return metadata title in response?
I'd like to be able to check if metadata with one of the titles from some group I'd like to insert into GeoNetwork is already in GeoNetwork. If so, remove it from GeoNetwork or just not allow to insert metadata with the same title again. There might many files to insert, so I don't think that search for specific title is a good option for me.
Or maybe is there a way to enforce unique metadata title in Geonetwork. By default, in my case, it doesnt't allow to insert metadata with the same UUID. Could this be done for title?
I could provide more details if needed. Or maybe this looks like some kind of bad approach?


texts: QGIS conversion of Microstation .DGN to .SHP?

texts:
I'm attempting to convert a .dgn file to .shp using QGIS.

I'm reading that support is only provided for v7 microstation files, is this still the case?

I've been using ogr2ogr -f "ESRI Shapefile" output.shp input.dgn and it throws the following error.

Unable to open datasource `input.dgn' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
... The list goes on.


texts: How to present parameters and their contents for each attribute

texts:
I have a table of data and I would like to know how I can use this data for a cartographic presentation and a publication on a geoportal as well as a map service.

The data represents measuring stations and for each measuring station, different parameters (130 parameters) have been measured, such as PH, turbidity, water temperature, calcium-ca ....

All the parameters are stored in the same excel file, but by sheet and for each parameter we have a table that contains: average, maximum, detections ....

I exported these stations on ArcMap and I made roles with Relationship Classes for each parameters (just for 20 parameters), witch mean one clicks with "identify" on a station, we can consult the list of parameters, as well as the contents of each parameter for this selected station.

The problem now is that these relationships can’t appear after a publication of this map like a mapserver.

What can you propose to me? Anyone have another idea of the presentation and consultation of this data as much as map service.


texts: How to pass select option value to inside jsp div?

texts:
data read here

<%
    String url = "jdbc:mysql://localhost";
    String dbName = null;
    String TbName = null;
    String driverName = "com.mysql.jdbc.Driver";
    String user = "root";
    String pass = "";
    Connection con = null;
    Connection conn1 = null;
    Connection conn2 = null;
    ResultSet rs = null;
    DatabaseMetaData dbmd1 = null;

    Class.forName(driverName).newInstance();

    conn1 = DriverManager.getConnection(url, user, pass);
    Statement stt = conn1.createStatement();
    ResultSet res1 = null;
    ResultSet res2 = null;
    ResultSet res3 = null;
    //ResultSet res4 = stt.executeQuery("SELECT id,facebook_id,name FROM profile where id <=10");

    DatabaseMetaData dbmd = conn1.getMetaData();
    ResultSet ctlgs = dbmd.getCatalogs();
%>

Face book Database Element

        <select  name="selurl" onchange="dbname(this.value)">
            <%
                while (ctlgs.next()) {

                    dbName = ctlgs.getString(1);
            %>
            <option value="<%=dbName%>"><%=dbName%> </option>
            <%
                }

            %>

        </select>

    <select onchange="dbname(this.value)">
        <option name="choice1" value="red">red</option>
        <option name="choice2" value="blue">blue</option>

    </select>

        <%String s = request.getParameter("val");

        System.out.print(url+"/"+s);
        conn2 = DriverManager.getConnection(url+"/"+s,user,pass);
      //System.out.print(url+"/"+s);
        Statement stmt = conn2.createStatement();
        dbmd1 = conn2.getMetaData();

                String[] types = {"TABLE"};
            res1 = dbmd.getTables(null, null, "%", types);

        %>

    <select id="selectB" name="selu">
    <%  while (res1.next()) {

            TbName = res1.getString("TABLE_NAME");
            System.out.print(TbName);
        %>
        <option value="<%=TbName%>"><%=TbName%> </option>
    <%  }
    %>

      <select onchange="dbname(this.value)">
      <%String locate=request.getParameter("name"); %>
        <option value="<%=locate%>"><%=locate%> </option>
        <option name="choice1" value="red">red</option>
        <option name="choice2" value="blue">blue</option>

     </select>

You want BLUE

here value pass null means conn2 database name is null


texts: The 3D polygon generated by skyline in arcgis has no Z value

texts:
I used the skyline tool to generate the skyline in a certain scenario, when the visible angle is less than 120°, the skyline is right, as the pic below:

When the visible angle is bigger than 120, the skyline looks well, but when I select the skyline, it shows that there is a project line on the 0 level, and when I use 'Feature vertices to point' to turn the skyline into point, the points also on the 0 level, see the two pictures below:

Also when all the parameters are the default:

Is this the software bug or I set the wrong parameter? The arcgis version is 10.2


texts: Is it possible to change where the Database connection folder is looking at?

texts:
In my workplace, we have just upgraded to Windows 7, we have a roaming profile, so all the files that are in the Application Data folder are in a folder called "\username\redirect\Folders.." also in this is the ESRI folder that contains the .sde files for the database connections.
We have teams that share generic mxd's and one problem that we have found is that when a user adds data from their database connection e.g.

\JoeBloggs\Redirect\AppData\ESRI\ArcCatalog\GIS.sde

and then saves it, when another user tries to open the mxd the data source is broken, as the 2nd user does not have access to JoeBloggs folder.

My solution is to create a new folder that everyone has access to, and place the .sde connections in that folder, but how do I make the Database connections node in ArcCatalog look at this new folder rather then the folder in AppData\ESRI\ArcCatalog.

Hopefully that makes sense.