texts: Showing a specific sound file as a pop up in ArcGIS Online based on a variable

texts:
I am trying to configure a pop up on a webmap in ArcGIS Online (Organisation).
I want the pop up to show a small audio player pointing to an mp3 file.
I want the mp3 file to change depending on what feature is selected on the map by the user.
I have a single point dataset with a single field "Species".  I have a value list assigned to this field of around 40 different species.
I also have an mp3 file for each of the 40 species.
My thinking was that I could use an if/else statement to select which mp3 file should be displayed in the pop up.
To create the pop up, I am creating a Custom Attribute Display.
{Species} was heard here

    <audio controls=""> <source src="https://www.xeno-canto.org/sounds/uploaded/XTVEPHMPPJ/Haematopus_leucopodus_1984_02_04e.mp3" type="audio/mpeg"></source> </audio>

The above code works to bring up a player

I can also add a second player to the pop up as per below
{Species} was heard here

<audio controls=""> <source src="https://downloads.esri.com/agol/labs/maptour/horse.mp3" type="audio/mpeg"></source> </audio>

<audio controls=""> <source src="https://www.xeno-canto.org/sounds/uploaded/XTVEPHMPPJ/Haematopus_leucopodus_1984_02_04e.mp3" type="audio/mpeg"></source> </audio>

This brings up 2 audio players within the pop up window.

But I am unable to choose the file based on the {Species} variable.
Attempting to do an if/else statement
{Species} was heard here

IIf($feature.Species=="Egret". "<audio controls=""> <source src="https://downloads.esri.com/agol/labs/maptour/horse.mp3" type="audio/mpeg"></source> </audio>", "<audio controls=""> <source src="https://www.xeno-canto.org/sounds/uploaded/XTVEPHMPPJ/Haematopus_leucopodus_1984_02_04e.mp3" type="audio/mpeg"></source> </audio>

Brings back this pop up:

I've also tried using this code in an Arcade expression, but I can't even get a single audio player to show.
Something like:

If {Species} = Crow Play crow MP3 URL Else if {Species} = Egret Play
Egret MP3 URL Else if {Species} = Robin Play Robin MP3 URL

Is anybody able to advise how I can show a single audio player depending on what {Species} value is assigned to the point the user has clicked on?


texts: Can individual feature properties be retrieved from the CartoDB.js API?

texts:
I'm building an application that uses CartoDB to show users how a proposed redistricting plan would affect them. The user enters an address and that fires a ST_Intersects query to CartoDB, the result of which is always two polygons: one is the old ward, one is the proposed ward. Type "40 Bradley Street, Burlington, VT" into the search box to see how this works.

I'd like to push answers to the indicated questions (e.g. "Where will my polling place be?") as well. However, this requires the ability to retrieve individual attribute values from the query results, and I can't figure out how to do this. Here is the structure I'm trying to use after running cartodb.createLayer();

var 1990ward = cartodbproperty.ward[1];
    var 2010ward = cartodbproperty.ward[0];

    if (1990ward == 2010ward) {
        $('#wardchange').text("No. You will remain in ward " + 2010ward + " under the proposed plan.");
    }
    else {
        $('#wardchange').text("Yes. You are currently in ward " + 1990ward + ", but you would be in ward " + 2010ward + " under the proposed plan.");
    }

    $('#distchange').text("The " + cartodbproperty.district + " District");
    $('#pollchange').text(cartodbproperty.pollingplace);

The "cartodbproperty" variables are dummies because I can't figure out how I would use the cartodb.js API to select the "ward" attribute value of the query-result feature where "year" = 2010.

I believe I could pull this off with a parallel call to the SQL API - which could then be parsed as JSON - but that seems horribly inefficient. How can I get this data from the CartoDB.js API?

Thanks as always for the great toolset!


texts:
I have to create several canopy height model (CHM) rasters from DTM & DSM rasters that are stored in different folders. The problem is that I have to repeat the process for more than 300 rasters.

Is there a way to loop the code for applying to one entire folder??

Here is my code:

#Packages needed
 library("raster")
 library("rgdal")

# load the DTM & DSM rasters
DTM <- raster("H:/ALS/DTM/33-122-117.tif")
DSM <- raster("H:/ALS/DOM/33-122-117.tif")

# CHM-overlay
CHM_ov<- overlay(DSM,
            DTM,
              fun=function(r1, r2){return(r1-r2)})

# export CHM object to new GeotIFF
writeRaster(CHM_ov, "H:/ALS/nDSMs/33-122-117.tiff",
        format="GTiff",
        overwrite=TRUE,
        NAflag=-9999)


texts: ST_Split with ST_Dump returns multipart Linestring with additional Splits

texts:
I am trying to split a lingstring using another linestring as my blade. The line to be cut crosses over itself at different locations. (to_be_cut is linestring, not multilinestring)

My query succesfully splits the line at the location of the blade BUT the other sections which cross-over themselves also get split into individual geometry_dump "paths".

Meaning i have 1 linestring that i wish to become two lingstrings - cut at the location of the blade layer.
But instead, my 1 linestring turns into 64 linestring segments which includes a split at the location of the blade (the line does not cross over itself at the location of the blade, so this confirms the blade is working)

SELECT
    ((ST_Dump(ST_Split(r.geometry,b.geom))).geom),
    r.line_identifier
INTO
    single_ling_test
FROM
    line_to_be_cut r,
    blade b
WHERE
    r.line_identifier= '555'
    AND b.name = 'blade_identifier'

should i post the full geoms in WKT here ? the line to be cut is quite long and i think the main cause of the unwanted behaviour is that the line crosses over itself.

not sure if posting pictures of the line before/after will help.

I am looking for a way to avoid the additional splits at unwated locations - OR - for a method of reconstructing the decomposed parts while maintaining the split at the blade.
thank you


texts: Using Open CL with AMD Radeon R9390 not possible - why? (QGIS 3.4)

texts:
I recently found out that you can activate OpenCL acceleration in QGIS 3.4. But QGIS can't find any device which is compatible. I checked my GPU, which is a Radeon R9 390 (16GB) and in the GPU's sofware menu it sais "OpenCL™ Version 22.19.677.257".
So shouldn't it actually support OpenCL? If yes - why can I not find and activate it in QGIS?


texts: Using feature access in python script to automate service publishing?

texts:
Using these resources:

http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/createmapsddraft.htm

https://community.esri.com/thread/139716

I have a script that is able to successfully publish my MXD to a service.  The only issue is when I publish the service all feature access (create, delete, query, sync, update) is enabled.  What I would like is only to have Query and Update enabled like shown in the screenshot below:

My code for that section is below,  I can paste the entire code but the problem is entirely with this section (when I comment it out everything publishes fine but with all the feature access operations allowed)

# Turn on feature access capabilities
configProps = doc.getElementsByTagName('Info')[0]
propArray = configProps.firstChild
propSets = propArray.childNodes
for propSet in propSets:
    keyValues = propSet.childNodes
    for keyValue in keyValues:
        if keyValue.tagName == 'Key':
            if keyValue.firstChild.data == "WebCapabilities":
                keyValue.nextSibling.firstChild.data = "Query,Update,Uploads,Editing"

I think it is probably just a syntax issue but I am not sure.

Has anyone done anything like this and if so what was your solution?

I found this page https://community.esri.com/thread/181211 which says that the proper index is [7] instead of [0] so I updated my code to this

configProps = doc.getElementsByTagName('Info')[7]
propArray = configProps.firstChild
propSets = propArray.childNodes
for propSet in propSets:
    keyValues = propSet.childNodes
    for keyValue in keyValues:
        if keyValue.tagName == 'Key':
            if keyValue.firstChild.data == "WebCapabilities":
                keyValue.nextSibling.firstChild.data = "Query,Update,Editing"

Now the script does  not error out when it publishes but it is still publishing with CREATE and DELETE still enabled.


texts: Qgis map composer shows a huge red cross

texts:
I can show this best by a picture:

This cross also shows when I export it as raster or pdf. What is it and how can I get rid of it?

I am using Qgis 2.4 and the map was done with the help of the Grass plugin AniMove on Linux Mint.


texts: How to merge raster quadrangle tiles in qgis?

texts:
I've downloaded some dem tiles from here http://www.granit.unh.edu/data/search?dset=dem/dem174, which I'd like to merge into a single smooth digital elevation model usinq QGIS.

So far I've tried to use the raster merge function (gdal_merge.py) with default options.  The merge is successful, but null value bands are introduced between the original dem extents that are actually larger than I would have expected from viewing the tiles separately.

How do I get rid of these gaps?


texts: JOIN on Oracle table and view with PyQGIS

texts:
I have a view v and table st with attributes and SDO_GEOMETRY columns in an oracle database.

I want to do an LEFT OUTER JOIN a common value with data filtering on the v.

SELECT ST.OBJECTID, V.ID_WS, V.NATURE, ST.SHAPE
FROM SCHEMA.VIEW V
LEFT OUTER JOIN SCHEMA.SPATIALTABLE ST
ON V.ID_WS = ST.ID_WS
WHERE V.NATURE IN ('ANIMAL','MACHINE')

I want to export this query (that works with cx_oracle) to QGIS or a shapefile

I tested the post with cx_Oracle, it works:

import cx_Oracle
#connect DB oracle to query tables names
con = cx_Oracle.connect('user/password@hosting.org:1521/SERVICENAME')
cursor = con.cursor()
cursor.execute(ABOVE_QUERY)
# Get features
features = cursor.fetchall()
#close properly
cursor.close()
con.close()

In the features list, the values are structured as tuples :

[(156, 163354,'ANIMAL',<cx_Oracle.OBJECT object at 0x000000002E91DE68>),(25, 8964,'MACHINE',<cx_Oracle.OBJECT object at 0x000000002E91DF48>)]

How to convert this list to Qgis compatible or shapefile ?

OR

I tested with pyqgis and that works but not LEFT OUTER JOIN :

uri = QgsDataSourceURI()
uri.setConnection("hosting.org", "1521", "SERVICENAME", "user", "password")
uri.setDataSource("SCHEMA", "SPATIALTABLE" , "SHAPE", 'OBJECTID=156',"OBJECTID")
uri.uri()
vlayer = QgsVectorLayer(uri.uri(), "requete", 'oracle')
vlayer.setCrs(QgsCoordinateReferenceSystem(31370))
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

How to add the LEFT OUTER JOIN in this request ?

I have only SELECT pivilege on this Oracle DB.

EDIT : That could be explained by this feature (Qgis bug tracker) not yet implemented. The join is occured on the layer not at the driver level.


texts: How to label only house number in python?

texts:
I have parcel data that has the site address field as ex. 123 First Avenue.

I only want to label the house numbers on the map, so 123 in the example.

How can I do this using the label expression in ArcMap 10.1?


texts: Javascript Map (ArcGIS API for JS v 2.9) Not Releasing Listeners

texts:
Our company uses a 'ArcGIS for Javascript' custom-developed map that was built on Dojo a few years ago. It has the 'usual' tools (Identify, Measure, etc) but the listeners won't release the tools.

I feel like the reason is because the maps are built on Dojo 1.4 (I believe Dojo is at version 1.9.x) and ArcGIS for Javascript 2.3 and 3.0 and so we are dealing with scalability issues from modern browsers translating older javascript.

Is there a means of checking this or adjusting these listeners without completely rebuilding everything?


texts:
I'm trying to build the gtfs_editor project by following the instructions on the given page.

But, while executing the command play run the log at localhost:9000 says
Compilation error
The file /app/controllers/Check.java could not be compiled. Error raised is : The type Check is already defined

Has anyone gone through this problem before?

I'm working on play framework -1.2.5.3,


texts:
I have the below code which ensures a layer is valid before adding it to the map. mapConfig.Services is an array of service url's and loadMapService is a simple function which returns an ESRI layer. The layer is added once it is "loaded" using an index (defined in mapConfig.Services). This works fine for two layers because no matter what order the event onLoad fires, they come in they will be normalised (0 will end up at position 0 regardless of if 1 was added before it). My problem is that I think that these could be different servers  in different locations firing the onLoad event with varying speeds.

For example, if I had 5 layers and by chance the onLoad event fired in the order 4,3,2,1,0 they would remain in that order since the index would always be greater than the number of layers and therefore append to the end (the objective is to order them 0,1,2,3,4).

I could use map.reorderLayer() to compare back to the original array, however, how will I know once all of the layers have been loaded? map.onLoad fires after the first layer is added so I can't do it here. Also assume that some of the layers could be missing and will not fire onLoad (I have connected to the onError event). I don't really want to check the layer order after a maximum timeout period.

Maybe there is something really obvious I'm missing?

for (var i = 0; i < mapConfig.Services.length; i++) {
    layer[i] = this.loadMapService(mapConfig.Services[i], true);
    if (layer[i] != null) {
    //In Internet Explorer, due to resource caching, the onLoad event is fired as soon as the layer is constructed. Consequently you should check whether the layer's loaded property is true before registering a listener for the onLoad event:
    //http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_events.htm
             if (layer[i].loaded) {
                 this.map.addLayer(layer[i]);
             }
             else {
                layer[i].index = i;
                dojo.connect(layer[i], "onLoad", dojo.hitch(this, function (addlayer) {
                var self = this;
                self.map.addLayer(addlayer, addlayer.index);
            }));
       }
    }
};


texts: Applying an extrusion to multiple layer from a python script

texts:
I'm trying to apply a Base Height extrusion that's 10 feet in height to all  layers in my ArcGIS Pro map document using a python script.  Per ESRI's documentation on extrusion, the syntax should be extrusion ({extrusion_type}, {expression}) .

Below is the code that I'm trying to use. It's not that graceful as I'm still trying to learn python:

import arcpy

# Variables to form defintion query
field = 'SUBCODE'
value = "(1152,1153,1154,1155)"

# concatenate query syntax
queryStr = str(field) + '"IN"' + str(value)

# Specify the aprx project (CURRENT), dataframe (Layers)
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps("Map_3D")[0]

# Apply defintion query to specified layer group
for lyr in m.listLayers("CONDO*"):
if lyr.supports("DEFINITIONQUERY"):
   lyr.definitionQuery = queryStr

# Make copy of selected features
arcpy.MakeFeatureLayer_management("CONDO_1ST","CONDO_1ST_LEVEL")
arcpy.MakeFeatureLayer_management("CONDO_2ND","CONDO_2ND_LEVEL")
arcpy.MakeFeatureLayer_management("CONDO_3RD","CONDO_3RD_LEVEL")
arcpy.MakeFeatureLayer_management("CONDO_4TH","CONDO_4TH_LEVEL")
arcpy.MakeFeatureLayer_management("CONDO_5TH","CONDO_5TH_LEVEL")

# Layer 3D To FeatureClass
arcpy.Layer3DToFeatureClass_3d("CONDO_1ST_LEVEL",'CONDO_1ST_LEVEL_3D')
arcpy.Layer3DToFeatureClass_3d("CONDO_2ND_LEVEL",'CONDO_2ND_LEVEL_3D')
arcpy.Layer3DToFeatureClass_3d("CONDO_3RD_LEVEL",'CONDO_3RD_LEVEL_3D')
arcpy.Layer3DToFeatureClass_3d("CONDO_4TH_LEVEL",'CONDO_4TH_LEVEL_3D')
arcpy.Layer3DToFeatureClass_3d("CONDO_5TH_LEVEL",'CONDO_5TH_LEVEL_3D')

# Apply extrusion
for lyr in m.listLayers("CONDO*"):
if lyr.supports("EXTRUSION"):
   lyr.extrusion('BASE_HEIGHT',10)

I'm not receiving any error when I run the script nor is it making updates to the layers.


texts: Implementing Python code in Whitebox GAT?

texts:
I would like to implement a script that

reads base file and appended file;
calls the program tool 'Mosaic with feathering';
creates a mosaic output file;
uses the output file as new base file and so on in a loop.

For starting I'm currently try this python code in Whitebox GAT:

import os
try:
   separator = os.sep
   wd = pluginHost.getApplicationDirectory() + separator + "resources" + separator + "samples" + separator + "multimosaic" + separator
   pluginHost.setWorkingDirectory(wd)
   baseFile = wd + "save1.dep"
   pluginHost.returnData(basefile)
   appendFile = wd + "save2.dep"
   pluginHost.returnData(appendfile)
   outputFile = wd +"output.dep"
   resamplingmethod = "nearest neighbour"
   matchHistograms = "true"
   args = [baseFile, appendFile, outputFile, resamplingmethod, matchHistograms]
   pluginHost.runPlugin("MosaicWithFeathering", args, False)
except Exception, e:
   print e
   pluginHost.showFeedback("Error during script execution.")
finally:
    print "I'm done!"

But when I execute the code I don't get any error and no output file is created.
Do you know what I'm doing wrong?


texts: Error while importing Curve/Arc Line feature in PostgreSQL?

texts:
I am facing a problem while importing/loading a feature class in a PostgreSQL data base through OSGeo4W.  The feature class has a Curve/Arc Line feature. But it's showing some problem. Below is the error report.:

Warning 1: Geometry to be inserted is of type Multi Curve, whereas the layer geo
metry type is Multi Line String.
Insertion is likely to fail
ERROR 1: COPY statement failed.
ERROR:  Geometry type (MultiCurve) does not match column type (MultiLineString)
CONTEXT:  COPY ewire, line 2, column wkb_geometry: "010B000000010000000109000000
050000000102000000030000000000005E44C7C6400000009CF0A3D3400000009028C7C6..."


texts: Finding semi attched or detached polygon in QGIS?

texts:
I am quite new to GIS,i've got polygon shapefiles and i want to find out the way that polygon are attached,semi attched or detached.i have area and perimeter of polygons,but i want to know length and width seperatelly of polygon.

How to findout these two parameters?

I also want to findout the direction of that polygon facing towards street.


texts: I'm working on an application based on Mapbox GL, I need to give to the user the opportunity to set the width and the color of the borders of polygons but I can't find the right GeoJSON proprieties to accomplish it. There's a way acting directly on polygon's GeoJSON or I need to create a whole new layer just to draw and customize the polygon's border?


texts: Calculating New Field using Python Field Calculator From Two Fields Returning Specific Numbers

texts:
I have never used the SQL function in the field calculator and need some guidance. I am attempting to calculate new field data (date update) using python for a client that will look at first at one column and then another.

I will need something that will look at column one (DateAsBuilt) and if not null will return the right four characters of that column. If DateAsBuilt is null I need the code to then look at another column (Project) and return only the left four characters.


texts:
I am new to the decoding world (and even to the world of gis), but I am definitely not new to programming and large data.  I was tasked with uncovering a column in our db with this information. It's probably some sort of geolocation w/ attributes... can anybody help?

The application is based in .net and the way we get this file (which i think is hexadecimal) is by ingesting a bunch of shp files, then storing them in an azure db.  Currently, the only way to read this blob is one manual click at a time down a huge hierarchy of subsets.

I went to

https://hexed.it/?hl=en

and pasted the code and it translated (binary/text) until line 000064A0

Even when it was translated, it just turned to random numbers...

I also asked for help on reddit.
reddit.com/r/codes/comments/421xek/can_somebody_help_me_decode_this_blob/

Here's the file:
https://www.dropbox.com/s/om7xjuoztafm17e/Blob.txt?dl=0

The end goal is to build a python program to read this blob.  Once I understand how to translate it, I can take it from there!


texts: Loading a symbol from db (symbology-style.db)

texts: I'm working on a Qgis python module. I would like to apply a symbol on a layer by his name entry from the symbology database. I know that some defaults symbols are saved into a sqlite db (symbology-style.db) in table symbol. I have not found how to apply the style loaded from the db on the layer. Someone know ?


texts: Calculating bounding box of given set of coordinates from Leaflet Draw?


texts:
I am getting an error while using Region Group on a large dataset. The errors are specified below:

  ERROR 999999: Error executing function. The table was not found.
  [VAT_final002] A column was specified that does not exist. A
  column was specified that does not exist. ERROR 010005: Unable to
  allocate memory. ERROR 010067: Error in executing grid
  expression. Failed to execute (RegionGroup).

I am currently running ArcGIS 10.1. I have 4 GB of total RAM. The raster I'm processing has 154242 columns and 97288 rows with 30x30 cell size (approximately 500 MB file size). All values = 1 or "nodata". Does anyone have a solution to this other than having to process in small sections?


texts:
I got the error message trying to establish a QGIS WMS:

  One or more layers failed to draw.

  QGIS Map Server: This WMS service has a layer limit of 99 per request.

I did not find anyone who already had this problem.


texts:
I´m setting up an database for an archaeological project with PSQL. There I have a field "material" connected with a table "materials" containing things like metal, stone, etc. In a third table I have stored more specific data on the materials like "gold", "iron" or "tuff". They all cary an attribute to which material they belong.

Now I set up a custom form in QGIS which works quite well. But now to my problem: I want to choose a material in the first combobox and the specification in a second one. The entries of that field should be filtered by the first one. So when I choose "metal" in the first field the second field should just show me iron, gold and copper.


texts: GDAL/rasterio multiple windowed reads in one I/O call

texts:
I have a cloud optimized geotiff that I need to read multiple small windows from. My current implementation opens the geotiff using rasterio and then performs the windowed reads iteratively. However, even though rasterio uses caching which can avoid unnecessary I/O calls, this may cause multiple I/O calls to the geotiff, either to S3 or the disk and I want to know if there is a way to read multiple windows using one I/O call.
This is how I currently call rasterio in order to obtain the images I want:
rasters = []
with rasterio.open(path) as f:
    for window in windows:
        rasters.append(f.read(1, window))


texts: Representing several points with same coordinates on map using ArcGIS Desktop?

texts:
I'm working on Arcgis 10.

I have a point shapefile representing events with several points having coinciding coordinates (They have the same coordinates). For representing them in a dynamic way, I found a nice way - Feature layers maptips.

Problem is: I was asked to produce a static (paper) map of the events. Is there a tool that can take these events and shift them apart a bit so all will be seen?

(I know that spreading them about will alter their coordinates, but I am prepared to do so on a duplicate shapefile for the display on the map).


texts: Pause drawing button (plus others) missing from view window

texts:
The pause-drawing, refresh, and data/layout toggle buttons have disappeared from my view window.  I'm using ArcGIS Desktop Standard 10.4.1. I've not upgraded recently or made any changes to the ArcMap configuration. I recognize there are other ways to accomplish these tasks, but I enjoy the convenience of these tools in the lower left corner of the map.

I'm not aware of this button configuration being a toolbar, but I did search through the toolbars unsuccessfully.

These tools are available in 10.4.1. See here.


texts: Sending valid UserAgent or Referer when Nominatim reverse geocode gets blocked?

texts:
I have a php page that requests reverse geocoding data from Nominatim OSM server.  It was working for over a year.  Recently started blocking my requests with the following message:

  You have been temporarily blocked because you have been overusing OSM's geocoding service or because you have not provided sufficient identification of your application. This block will be automatically lifted after a while. Please take the time and adapt your scripts to reduce the number of requests and make sure that you send a valid UserAgent or Referer.

I am sure that i am not exceeding the quota (1 request / second), because my code is still in pre-production.  i might have 1 request / hour on a busy day.

Below a sample of php testing code.  I used to get what i needed on line 6 $xml =..., which is now blank / not xml data (so i scrape the page and get the error message):

$latLast = 52.5487429714954;
$lngLast = -1.81602098644987;
$feedUrl = "http://nominatim.openstreetmap.org/reverse?format=xml&lat=".$latLast."&lon=".$lngLast;
$rawFeed = file_get_contents($feedUrl);
try { // nominatim server blocking this ip, must change solution
    $xml = new SimpleXmlElement($rawFeed);
    print_r($xml);
} catch (Exception $e) {
    echo $e->getMessage()."
second attempt:
";
    try {
        $html = file_get_html($url);
        echo "HTML2: [$html]
";
    } catch (Exception $e) {
        echo $e->getMessage()."
";

    }
}

How do i send a "valid UserAgent or Referer"?  How do i provide "sufficient identification"?


texts:
I currently have some scripts that use OGR2OGR to translate data form various source formats like ESRI Shapefile, GML etc to other file formats but especially to my PostGIS database.

My normal command would be:

ogr2ogr -f PostgreSQL PG:"pg conn settings" shapefile.shp

I now need to do this in a Node script so have installed the node gdal module (https://github.com/naturalatlas/node-gdal) which seems to have a lot of functionality of the GDAL library.

So I tried to use the example here to a least connect to my PostGIS database.

var connString = "PG: host=%s dbname=%s user=%s password=%s" %(databaseServer,databaseName,databaseUser,databasePW)

var conn = gdal.open(connString)

However, I receive an error saying gdal.open expects a path.

Has anyone got examples of using Node GDAL for ogr2ogr translations or loading to PostGIS.


texts: Converting worldclim data to 30m resolution

texts: I know that resampling from coarse resolution to fine resolution is bad. Effectively you are making up data. However, if the study area is small are there any other options? Worldclim comes at around 900m resolution at it's finest. But running an SDM (species distribution model) on a small study area is relatively pointless as the the 900 x 900 cells are too big. The easiest option is to resample the worldclim data to 30m. Worldclim data is interpolated from weather stations. Would this count as a further interpolation or would it create nonsense outputs?


texts: ArcMap and QGIS Raster Calculators giving different values

texts:
I was carrying out a calculation in raster calculator in ArcMap 10.4 where I multiplied two rasters together. Both rasters had the same extent, were snapped to each other and have the same pixels overlapping. When using the identify tool, I noticed that the result was different to if I worked it out myself. For example, the calculation for a particular pixel was 37.572238*90428390 (so should equal 3,397,596,991.03682). However the actual result from the raster calculator equaled 3,397,596,987.419. I also carried this out in QGIS to test and got another different result of 3,397,596,928.000.
Does anyone know why this happens?
I thought it may have something to do with the precision as the numbers are so large.  I know it isn't a huge difference but I need the result to be as accurate as possible.


texts: How to make Stamen's Toner labels bigger in QGIS?

texts:
When I zoom in on my basemap that includes an overlay of Stamen's Toner labels from the QuickMapServices plug in.

Looks like this: (I need bigger street labels!)


texts:
I just installed QGIS 3.6 64bit on a Windows 10 machine. I cannot get it to load. The splash screen hovers for some time before the main window starts to show. But the main window stops as a white box and it goes no further.

Any ideas? This is a new machine and QGIS has never been installed before.

Best to just go back and try an earlier version?


texts: How to fix the height in !text using MapFishPrint?

texts:
How fix height in text block using MapFishPrint  config.yaml. For example in A4 size paper, my text change by content of ${content}.

My config.yaml

layouts:
  #===========================================================================
  A4 portrait:
  #===========================================================================
    mainPage:
      pageSize: A4
      landscape: true
      items:
        - !columns
          # columns can have an absolute position. In that case, they need a width.
          absoluteX: 30
          absoluteY: 565
          width: 790
          config:
            borderWidth: 0.3
            cells:
              - padding: 2
          items:
            - !map
              width: 788
              height: 543

        - !columns
          absoluteX: 600
          absoluteY: 565
          width: 220
          config:
            borderWidth: 0.3
          items:
            - !text                     != FIX HEIGHT OF ITEMS
              text: "${content}"
              backgroundColor: #FFFFFF
              fontSize: 12
              font: Helvetica-bold
        - !columns
          absoluteX: 30
          absoluteY: 100
          width: 100
          config:
            borderWidth: 0.3
          items:
            - !text
              text: "Loc"
              backgroundColor: #FFFFFF
              fontSize: 12
              font: Helvetica-bold
        - !columns
          absoluteX: 130
          absoluteY: 100
          width: 80
          config:
            borderWidth: 0.3
          items:
            - !text
              text: "IMG"
              backgroundColor: #FFFFFF
              fontSize: 12
              font: Helvetica-bold
        - !columns
          absoluteX: 210
          absoluteY: 100
          width: 400
          config:
            borderWidth: 0.3
          items:
            - !text
              text: "Titulo"
              backgroundColor: #FFFFFF
              fontSize: 12
              font: Helvetica-bold
        - !columns
          absoluteX: 130
          absoluteY: 50
          width: 150
          config:
            borderWidth: 0.3
          items:
            - !scalebar
              maxSize: 100
              type: bar_sub
              units: m
              vertAlign: middle
              barBgColor: #FFFFFF


texts: leaflet: javascript scope issue within geojson onEachFeature function

texts:
I'm new to javascript and even newer to Leaflet (version 0.7.7), so I'm having difficulty determining how to ask this question.

With leaflet, when I click on a polygon, an ajax request is made, it is converted to geojson, and a popup appears on the map with some of the returned data. On the leaflet website, the example to do such a thing involves using the onEachFeature event of the geoJson method.

However, when I'm inside of the function called by onEachFeature, I can't access any variables outside of that function.  In the example below, in the neighborhood_popup, I'd like to be able to access the data in the ajax response.

How can I access data outside of this onEachFeature function? See comments in the example below.

var map = L.map('map').setView([y, x], 11);

// add some other map features here.

var _neighborhood_lookup;
function neighborhood_lookup(latlng) {
    /* do an ajax request to get geojson data */
    var neighborhood_url="/path/to/api/url?lat=" + latlng.lat + "&long=" + latlng.lng;
    var jqxhr = $.get(neighborhood_url, function(res) {
        _neighborhood_lookup = res
        var popup = L.popup({maxWidth:400});
        var style = {}

        function neighborhood_popup(feature, layer) {
            popup.setLatLng(latlng);
            var place = feature.properties;

            /* THIS IS THE PROBLEM I'M HAVING
               I'm trying to get more information out of
               _neighborhood_lookup at this location, which
               is an ajax response. However, the _neighborhood_lookup
               is undefined at this point.  How do I access variables
               outside of this function scope?
            */

            /* this part doesn't really matter for this question,
               but it's gathering variables and rendering them
               in a handlebars template */
            var context = {
                name: place.name,
                long_name: place.long_name,
            };
            var html = popup_template(context);
            // sets popup content
            popup.setContent(html);

        }

        // I think this determines what leaflet feature was clicked
        var neighborhood_layer = L.geoJson(_neighborhood_lookup.neighborhood, {
            style: style,
            onEachFeature: neighborhood_popup
        });

        layergroup.clearLayers();
        layergroup.addLayer(neighborhood_layer);
        map.openPopup(popup);
    })
}

/* when a polygon an the map is clicked,
   we call the neighborhood_lookup function */
map.on('click', function(e) {
  neighborhood_lookup(e.latlng);
});

Update: Here is the json that comes in via the ajax request.

{"neighborhood":
   {"id":"108","type":"Feature","geometry":
     {"type":"Polygon","coordinates":
        [[[-87.684152,41.971901],[-87.684148,41.971794],
          [-87.684146,41.971748],[-87.684143,41.971665],
          ...
          [-87.684159,41.972107],[-87.684156,41.972037],
          [-87.684154,41.971967],[-87.684152,41.971901]]]
     },
     "properties": {"created":"2016-06-19T21:50:35.060937Z",
           "modified":"2016-0619T21:50:35.060967Z",
            "active":true, "name":"108",
            "uuid":"1d6162af-2202-40a4-8f1a-697e266a07b9",
            "long_name":"Lincoln Square","stats": {}
     }
   }
}


texts: Needed help to launch SVM classification in eCognition

texts:
I would like if somebody help me to launch SVM classification in eCognition.
Have you met any tutorials?
I was searching through ecognition community, but there I find only basic KNN supervised classification tutorial.


texts: How to create a "ring" around an irregularly shaped polygon in Python?

texts:
I have an irregularly shaped polygon, and I want to create a 'ring' of fixed width around the polygon. Basically I need a polygon vector which surrounds the given polygon.

I am reading in the polygons from an ESRI shapefile. There are >500 features (all polygons) in the shapefile. I need a ring around each of them to do some computation on a raster file.

How can I create the ring in python?


texts: Convert a 3d polygon to 3d polyline using QGIS

texts: I am using QGIS 2.16 to try to convert polygons with 3d vertices to polylines with 3d vertices.  Using the tool Vector -> Geometry Tools -> Polygons to Lines writes out the polyines, but the z information has been removed.  Am I missing something or is there another workaround in QGIS to achieve 3d polylines from 3d polygons?


texts: spatial join field mapping Arcpy, change merge rule

texts: I have a line feature class which represents a stream network. At a confluence of two river segments, I'm joining the stream segments to the point of intersection via spatial join (one to one join). I would like to keep only the attribute of the field "level_St" (type: SHORT), all other attributes are not relevant for me. For the Join of the "level_St" attribute, I would like to specify a merge rule keeping only the maximum value.


texts: How to add a table into the TOC in a Python script?

texts:
I recently experienced some troubles in adding a table from a specific folder to the TOC using a Python script.
Any idea on how can I solve this?


texts: Reading shapefile in R with shapefile function?

texts:
I want to read a shapefile(polyline) into R, using rgdal and raster packages.

The code looks like:

d<-file("/Volumes/Environment_layers/original/WaterRoad/Road.shp")
o<-shapefile(d)

but I got a warning:

Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘shapefile’ for signature ‘"file"’

I am new in using R dealing with spatial layers.


texts:
I am trying to calculate NDVI using python and landsat imagery. I am able to calculate ndvi using the following equation:

def ndvi(sat, fp):
    raster = rasterio.open(fp)
    if sat.lower() == 'l8':
       red = raster.read(4)
       nir = raster.read(5)
    if sat.lower() == 'l5':
       red = raster.read(3)
       nir = raster.read(4)
    red = red.astype('float64')
    nir = nir.astype('float64')
    ndvi = (nir - red) /(nir + red)
    display(ndvi, 'Greens')
def display(img, ramp):
    plt.figure(figsize=(200, 200), dpi=80, facecolor='w', edgecolor='k')
    plt.imshow(img, cmap=ramp)
    plt.colorbar()
    plt.xticks([])
    plt.yticks([])
    plt.show()

This produce an image that looks like:

The image appears to show the inverse of what should be shown. The areas in the rectangles are golf courses that are shown with negative ndvi and the highways which are circled are displayed with a high ndvi. I know I could multiple everything by -1 and get the correct image but I would like to know why this happens.
Here is the corresponding image processed in GEE for reference:


texts:
GeoFabrik's extracts - as expected - have a massive amount of unnecessary information for most applications. Filtering this information is a critical step to decrease the map's size, especially for mobile uses. OsmFilter or Osmium seem to be the main tools for the job, however, the list of nodes, lines and so on in OSM is simply overwhelming. Could one method simply be retrieving the used named layers in Mapbox Strets v7 (for example), and remove everything else?

On a side note, it seems that converting tags might be necessary, is there any comprehensive list/guide on these subjects?


texts:
I'm using ArcMap 10.3 on Windows 10.

I have a number of .bil and .tif files pertaining to altitude and weather data. I want to open these in ArcMap. When I attempt to add them to the map I get this dialogue box:

Can someone walk me through how to use this to open these files in ArcMap?

This is the error that I've encountered trying to do this myself:

Or it throws up a generic "can't open this" error. I would share a screenshot of this but I can't replicate the error.

The goal is to use these data to find the average temperature, slope, etc for a number of points (n=157), so I assume I would need the .bil/.tif to have a spatial referencing system. I'm using the Irish Grid coordinate system.

EDIT
I used the Define Projection tool on the files and they did change to Irish Grid (when I right click the feature class go to Properties < Source it does say it's in Irish Grid) - but the data doesn't line up with all my shapefiles in the Irish grid, it's "off in space" just the same as having no coordinate system. I tried this with both file types and the result is the same.


texts:
It is possible to change the SRID from a shapefile to another SRID in QGIS ?
I have a shapefile in 2100 srid and i want to change it in 4326 SRID.


texts: Are British National Grid (BNG) 1km grid shapefiles displayed accurately in ArcMap?

texts:
I have downloaded the UK Ordinance Survey's 1km grids in shapefile format for ArcMap.

If you need to download them to have a look first you can find them here look for link in the first Answer to the Question Ordnance Survey grids - download or generate?.

They 'supposedly' represent 1km grids however here is where the first problem begins. If I calculate their dimensions and areas in ArcMap their size differ from one another. How is this possible are they not supposed to be regularly spaced every 1km?

The second problem I encounter is - of course as a result of the first problem - that if I try to divide the areas into smaller sections they grid would now shift slightly to one side.

Can you please advise if there is a way to solve this problem and/or if you get the same results?


texts:
I have two layers open.  One is a Natural Earth ocean layer, the other an output from an NOAA computer forecast model.  The forecast model is misplaced to the east as seen in this image.

QGIS knows:

Extent

226.8750000000000000,9.8750000000000000 : 300.1250000000000000,55.125000000000000

And assigns the data to:

CRS USER:100025 - * Generated CRS (+proj=longlat +a=6371229 +b=6371229 +no_defs) - Projected

How can I move my data where it belongs?


texts: How to update a field in one geodatabase table via a join to another geodatabase table?

texts:
I have 2 tables in a file geodatabase and I need to update a field (via ArcObjects) in the first table with a field in the first. Basically, the equivalent to SQL Server's update statement:

UPDATE t1
 SET t1.DacCode = t2.NewDacCode
 FROM Table1 as t1
 INNER JOIN Table2 t2 ON t1.PID = t2.PID ;

I would also be curious as to accomplish this sort of update (if different from a direct set of another field value):

UPDATE t1
 SET t1.DacCodeDesc = Concat(t2.NewDacCode,'_1201')
 FROM Table1 as t1
 INNER JOIN Table2 t2 ON t1.PID = t2.PID ;

I currently have a IQueryDef that returns a cursor of what I want to update but that's read-only. So I'm hoping there's a way to do it that is faster than IRow.Store.


texts: RGB Alos AVNIR 2 composition shifted in QGIS

texts:
Recently I started messing with the alos avnir 2 images, as they are old images with 10m resolution.
However, I had a problem, when I open the separate bands in QGIS I notice that they are well registered (georeferenced), however when I make the RGB composition with the miscellany> mosaic command that is traditionally used for this purpose, I notice that the RGB image generated it loses all the geographical reference, being necessary to make a georeferencing with control points to correct it to the correct position.
How could you solve this problem?


texts: Creating web site for people to input their locations and other info?

texts:
I am new to open source Web GIS and have done some self training about the basics of Geoserver, PostGIS and Openlayers. Right now I am in a rush to set up a web site for up to 100 people to access it internally and input their locations and name, etc.  When they open the sites, they should be able to find their location, click on it to create a point and in the pop-up window to input their basic information. I saw a similar site a long time ago.

I know how to overlay a point layer with Google or Bin, but how can I make it editable?

Are there any source codes I can refer to?

This will be a small project for an event and I plan to host it on a spare window box I have.I have installed the OpenGeo Suite 4.1.1 but I am also open to other sources that can help get the job done easily.


texts: How to remove shadows from high resolution imagery (IKONOS 1M)

texts:
I have dataset imagery comes from IKONOS satellite, the dataset contains "imagery with 1m resolution - metadata - rpc file", the metadata file contains the information about "Sun Angle Azimuth - Sun Angle Elevation - Acquisition Date/Time", so is there any way to remove the shadows area from the imagery data?

metadata http://rghost.net/6cb99zmLy/image.png

edit: i used GCP with Socet GXP to generate high resolution DEM (1m).


texts: QGIS 3.16.1: Clip by mask layer not working in macOS Big SUR

texts:
I am having an issue with clipping my raster as per the vector mask layer. I did try to counter the issue with projecting both files in same CRS, however, still getting the same error (ERROR 1: Cutline not of polygon type.). I am running QGIS 3.16.1 on macOS Big Sur. Already had so many issues in running QGIS on this Mac Platform. Now this simple problem is annoying. Files are attached here.
I did try the solution provided here but to no use.
Error in clipping raster (.bil) using vector polygon in qgis
Kind of novice with QGIS and its use on macOS.


texts: How to determine vector between two lat/lon points

texts: For all the math geniuses out there...given two lat/lon points (point A and point B), what is the simplest way to find the vector needed to reach point B from point A. For example, the vector needed to reach 36, -85 from 36, -82 would be 270°. I am not entirely sure if "vector" is the technically correct term so if there is a more accurate term, comment and let me know. The fact that the earth is a sphere is throwing me off...I feel as if I could tackle this problem if given a plane but the sphere complicates it too much for me. A chunk of code would be ideal but a simple algorithm that I can translate into code myself is perfectly fine also.


texts:
I am new to coding with QGIS.

However, when trying to geocode with MMQGIS I am confronted with:

  Failure connecting to API: urlopen error [SSL:
  CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get
  local issuer certificate (_ssl.c:1056)>.

I have tried redownloading python, updating qgis, making sure I hit "Install Certificates.command", all to no avail. I have seen MMQGIS Geocode is failing in QGIS 3, but the answers there are having no effect on my situation. Running QGIS 3.10, but have tried on 3.6 as well.


texts: Correct scale in print composer with QuickMapServices layer?

texts:
I'm trying to prepare basemaps from the south of France based off Google Satellite imagery (QuickMapServices).

I'm exporting these basemaps using the Print Composer, with a scalebar and coordinate grid. Under default settings, the coordinate grid is fine and accurate but the scalebar (and the lengths from the measuring tool) is approximately 40% too long.

When I change the project to the equal-distance RGF92/EPSG:2154, the scales are now correct in the normal project viewer but completely wrong in the print composer and the coordinate grid is completely wrong (e.g. giving a coordinate of -1.084, 35.426 instead of 2.902 43.406).

What do I need to do to fix this?


texts: Select feature if field value in another field

texts:
I'm working with a feature class in ArcMap. I want to select features if the text of one field is found in another field.

I have two fields, StreetName and StreetName_1. If StreetName == 'MAIN' and StreetName_1 == "N MAIN ST", I want to select that feature.

I tried the following script, but got an "Invalid expression" error with the SelectLayerByAttribute part:

where_clause = '''"StreetName" IN "StreetName_1"'''

with arcpy.da.SearchCursor(layerName,["StreetName","StreetName_1"]) as cursor:
    arcpy.SelectLayerByAttribute_management(layerName, "NEW_SELECTION", where_clause)


texts: I have set my CRS to NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet (ESRI:102649), the same CRS as my points. When I add the XYZ tile for Google_Imagery_Hybrid it prompts me to choose a transformation as the XYZ tile's original CRS is in EPSG:3857 - WGS 84 / Pseudo-Mercator - Projected. I choose the first transformation option, "Inverse of Popular Visualisation Pseudo-Mercator + Inverse of NAD83 to WGS 84 (32) + NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet", but the layer does not show up. When I zoom to the XYZ tile it doesn't seem to render at all. Is there something I am missing when it comes to transforming data layers in QGIS? Working in QGIS 3.10 A Coruna on Windows 10.


texts: What are the available global GNSS corrections?

texts:
How can I find out what GNSS corrections are available in a location?

For example, in the United Arab Emirates (24°03'22.8"N 55°46'42.9"E) what corrections are available to me assuming I have the best GNSS receiver? Or in this location am I only going to have autonomous GNSS?


texts: Error when activating plugins in QGIS 3 on MacOS X?

texts:
I'm a user of QGis, but this is the first time that I have it installed in a MAC (Sierra 10.12.6). I just installed the new version and I'm trying to install the plugins I usually use. OpenStreetMap gives me the following error:

Couldn't load plugin 'openlayers_plugin' due to an error when calling
its classFactory() method

I've read that we should move to QuickMapServices, but when I activate that plugin, I have the same error:

Couldn't load plugin 'quick_map_services' due to an error when calling
its classFactory() method

TypeError: 'QVariant' object is not subscriptable  Traceback (most
recent call last):   File
"/Applications/QGIS3.app/Contents/MacOS/../Resources/pytho/qgis/utils.py",
line 337, in startPlugin
  plugins[packageName] = package.classFactory(iface)
File "/Users/delati01/Library/Application
Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/__init__.py",
line 35, in classFactory
  return QuickMapServices(iface)   File "/Users/delati01/Library/Application
Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/quick_map_services.py",
line 72, in __init__
  self.locale = Locale.get_locale()   File "/Users/delati01/Library/Application
Support/QGIS/QGIS3/profiles/default/python/plugins/quick_map_services/plugin_locale.py",
line 30, in get_locale
  return QSettings().value('locale/userLocale')[0:2] TypeError: 'QVariant' object is not subscriptable

Python version: 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 19:50:54) [GCC
4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]  QGIS version: 3.2.0-Bonn Bonn, exported

Python Path:
/Applications/QGIS3.app/Contents/MacOS/../Resources/python
/Users/delati01/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/delati01/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Users/delati01/Library/Application Support/QGIS/QGIS3/profiles/default/python

Is this a general error because QGIS has just been updated or is it from MacOS X?


texts: Connect to a PostGIS database from GIS Cloud

texts:
I have a PostGIS database setup in PostgreSQL on port 5432 on an AWS Windows server shared with Geoserver, which is running on port 8080. I can connect from Geoserver to the PostGIS database with no issues using "localhost" as the host. The server is on the public domain so I can access Geoserver from any computer outside of out AWS network with an address, for example: http://product.company.com.au:8080/geoserver/web.

I need to be able to access the PostGIS database from applications outside the network, specifically from GISCloud. When I try to connect to the database from GISCloud (using http://product.company.com.au as the host), I get the error "Test Failed: Sorry, but you cannot use 'localhost'".

I imagine that this is either a configuration setting in PostgreSQL, however I have tried a few of the changes shown in other similar posts without any luck.

Alternatively, is it just a case of opening the specific port and this will work?

Or is there more to it than that?


texts: Migration from ol2 to ol6 fixed strategy missing

texts:
I try to migrate from ol2 to ol6.

My ol2 uses OpenLayers.Strategy abstract class with Fixed() and BBOX members:

var strategy = layerData.Strategy == "fixed" ? new OpenLayers.Strategy.Fixed() : new OpenLayers.Strategy.BBOX();

In ol6 docs discribed this module ol/loadingstrategy and from this module can be imported all, bbox and tile strategies. But I din't see fixed
strategy in OL6 module.

Any idea why this module ol/loadingstrategy dosen't contains fixed modul?


texts:
I used the nsidcICE function located here: https://github.com/cran/raster/blob/master/R/nsidcICE.R and the following code to open a sea ice raster file. However, I would like to overlap vector points and "zoom in" on the raster to the Canadian Arctic (lat: 72 to 75, long: -90 to -80). I am new to R and GIS.

library(raster)
library(graticule)
library(rgdal)

tfile <- system.file("extdata",  "nt_20140728_f17_v1.1_n.bin", package = "graticule")
ice<-.rasterFromNSIDCFile("nt_20140728_f17_v1.1_n.bin")

meridians <- seq(-180, 160, by = 20)
parallels <- c(-80, -73.77, -68, -55, -45)
mlim <- c(-180, 180)
plim <- c(-88, -50)
grat <- graticule(lons = meridians, lats = parallels, xlim = mlim, ylim =     plim, proj = projection(ice))
labs <- graticule_labels(meridians, parallels, xline = -45, yline = -60, proj = projection(ice))
plot(ice, axes = FALSE)
plot(grat, add = TRUE, lty = 3)
text(labs, lab = parse(text= labs$lab), col= c("firebrick", "darkblue")[labs$islon + 1], cex = 0.85)
title(sprintf("Sea ice concentration %s", gsub(".bin", "", basename(ice))), cex.main = 0.8)
title(sub = projection(ice), cex.sub = 0.6)


texts: Super large scale maps with Leaflet, how?

texts:
I have a map/architectural drawing of two floors of a huge building with a lot of rooms. Now I'd like to make an interactive slippy map using preferably Leaflet showing all the rooms and use markers/polygons showing what happens in each room and who's sitting where, etc. These markers should quite easily be editable.

Does anyone have any ideas of how to make this happen? First I was thinking about just pretending house covers the whole world and then use standard web mercator with generate_tiles.py.

Another idea is to use zoomify together with Leaflet.

The problem with both methods is that it's difficult to get right coordinates. Best would be to use some kind of a local projection.


texts: an efficient way to find the pgrouting edges contained within an isochrone

texts:
So I am working with some pgrouting road network data in postgis2.0/postgresql 9.1. I am interested in routing around certain types of disasters like tornados or such. If a disaster event happens at some spatial coordinate x1,y1. Then I would generate an isochrone from that point to every other point that is reachable at some cost c. So basically I am creating a travel buffer around the event. Then I would like to loop through all of the road edges that fall within this isochrone and increase the costs of travel along that road segment. I am trying to figure out how to reconcile the pgrouting part with the postgis part--I have less familiarity with pgrouting.

Would I create a polygon out of the isochrone and then do some sort of contains or within query to get the included edges, and then run an sql update to increase their costs. An additional consideration is the efficiency of this operation since this type of spatial operation might present a problem for a large number of network edges.


texts: Creating raster that contains gradients given contour shapefile using R?

texts:
Using R I'd like to create a raster from a set of contour shape files, where each cell in the raster contains a value for the derived gradient.

I am using OS Terrain 50 contour lines which is open data from, the Ordnance Survey: https://www.ordnancesurvey.co.uk/opendatadownload/products.html

* UPDATED QUESTION *

As requested, here is how I've approached the problem so far, which hasn't really worked and I'm not sure why.

Firstly I load my contour shapefile:

c <- readOGR("osrastersandvectors/terrain_shape_files/HP40_line.shp")

Then the following to create a raster at 10m resolution:

c.raster <- raster()
extent(c.raster) <- extent(c)
res(c.raster) <- 10

Then I rasterize:

c.raster <- rasterize(c,c.raster)

This works in that I get a raster of the original contour lines, where cell values are elevation. Note, there are no elevation values beyond where the original contour lines are. Then I'm thinking I need to calculate a value for each cell, given the contour line values. So some form of interpolation to give slope (gradient?). So something along the lines of:

slope = terrain(c.raster, opt=c('slope'), unit = 'degrees', neighbours=8)

This returns a raster but it's not what I want: a single layer raster where each cells value represents the gradient at that point.


texts: Exporting coordinates from LAS files to CSV?

texts: Is there any tool available for extracting the X, Y and Z coordinates from a .las file and exporting them to a .csv or similar file?


texts: Add hot point in android application based on Arcgis SDK

texts:
I am working on an application based on Arcgis android SDK.

Now I wonder if I can add the hot point like google map and etc.

For example, not matter you use google map in pc or your phone, when you touch the text or symbol of the poi, the detail information of the poi will be displayed by inforwindow(pc) or something else.

I wonder if we can make it in android?


texts: Check File Extension in ModelBuilder OR Python Script Tool

texts:
I am making a model with ModelBuilder and my question relates to a smaller part of the model (or like a beginning), where I need to check whether the user input file extension is SHP or GPX and order the model to do different series of geoprocessing for both cases. I didnt find a tool in ModelBuilder that would do exactly what I need, so I guessed that I will need to write a Python script and use script tool in my model.

Could you tell me what I´m doing wrong?

I wrote the following script in PythonWin and saved a .py file, and inserted the script tool into the model. But I don't get the result I expected, as whatever file the input gets, it says either true true for both, or false false for both.

And also how to connect then those "correct" true or false answer values to the next tools?

Is it over a precondition or what exactly?

Here is the script and a few screenshots for better understading. (im a very beginner in scripting....)

Also a link to another topic for reference from where I took the script and tried to adapt it: Checking field type in ModelBuilder using if else?

import arcpy
import os
input = arcpy.GetParameterAsText(0)
name = os.path.basename(input).rstrip(os.path.splitext(input)[1])
extension = os.path.splitext(input)[1].lstrip(".")

def CheckExtension(extension):
  if extension == 'shp':
    arcpy.SetParameterAsText(1, "true")
    arcpy.SetParameterAsText(2, "false")
  elif extension == 'gpx':
    arcpy.SetParameterAsText(2, "true")
    arcpy.SetParameterAsText(1, "false")

CheckExtension(extension)


texts: Changing MXD to relative links in ArcMap?

texts:
I have an mxd file with absolute file pathways. The pathway of each file points to a specific location on C:. Now, I want to change to relative pathways so that the map and files can be moved to a different location without having to redirect all the pathways. The internal structure of the main folder will be identical, it's just that it won't be stored on C:.

However, when I click on relative pathways under Map Document Properties nothing seems to happen. The file pathways still points towards C:.

To be clear, the links can't point towards C: since other people won't be able to connect to my local harddrive. The links need to relative to the map location.

What am I missing?


texts:
I am using this script in openlayers 3:

  var geojsonFormat = new ol.format.GeoJSON();

  var vectorSource = new ol.source.Vector({
    format: new ol.format.GeoJSON(),
    loader: function(extent, resolution, projection) {
      var url = 'http://www.sujb.cz/gis/geoserver/wfs?service=WFS&' +
          'version=1.0.0&request=GetFeature&typename=abmerit:mleko&' +
          'outputFormat=json&format_options=callback:loadFeatures' +
          '&srsname=EPSG:3857&bbox=' + extent.join(',') + ',EPSG:3857';
      $.ajax({url: url, dataType: 'jsonp', jsonp: true});
    },
    strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
      maxZoom: 19
    }))
  });
  window.loadFeatures = function(response) {
    vectorSource.addFeatures(geojsonFormat.readFeatures(response));
  };

 var vector = new ol.layer.Vector({
                    source: vectorSource,
                    name: 'layer9',
                    visible: false,
                    style: vectorstyle
                    });

from XML file like this:

<gml:null>unknown</gml:null>
</gml:boundedBy>
  <gml:featureMember>
    <abmerit:mleko fid="mleko.fid--36e9d52e_1533e824588_-735d">
    <abmerit:id_zppr>1000</abmerit:id_zppr>
    <abmerit:odbermisto>Bohunice - kravín</abmerit:odbermisto>
    <abmerit:monit_polozka>mléko kravské - surové</abmerit:monit_polozka>
    <abmerit:datum_zac>2015-01-14T07:55:00</abmerit:datum_zac>
    <abmerit:datum_kon>2015-12-30T08:00:00</abmerit:datum_kon>
    <abmerit:the_geom>
    <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#900913">
      <gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">1601158.32985051,6310367.83231571</gml:coordinates>
    </gml:Point>
  </abmerit:the_geom>
  <abmerit:hodnota_cs137>None</abmerit:hodnota_cs137>
  <abmerit:monit_polozka_en>raw cows´milk</abmerit:monit_polozka_en>
  </abmerit:mleko>
  </gml:featureMember>

and I'm still not able to draw at least points at those coordinates.. only in debug mode in browser i can see, that its connected to xml file right..


texts:
I want to add the ADMIN2_CODE from the dataset FAO/GAUL/2015/level2 to a featurecollection I have created to get information on some forests in Wales. I have added the elevation to the polygons but I can't work out how to add the (first) ADMIN2_CODE. My code doesn't work - can someone help please - I know I am doing something blatantly wrong!

var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2");

var filter = ee.Filter.inList('ADM2_NAME', ['Gwent']);
var filteredArea = fromList.filter(filter);

Map.setCenter(1.1, 51.5, 8);
Map.addLayer(filteredArea, {}, 'Regions');

var gfc2018= ee.Image('UMD/hansen/global_forest_change_2018_v1_6').clip(filteredArea);

var lossImage = gfc2018.select(['lossyear']).gte(7);
var lossBand = lossImage.and(gfc2018.select(['lossyear']).lte(20));
var zones = lossBand.updateMask(lossBand.neq(0));

// Add the loss layer in red.
Map.addLayer(lossImage.updateMask(lossBand),
            {palette: ['FF0000']}, 'Loss 2007 onwards');

var area_threshold = 300; // about 30 hectares?

// Define whole county as a region
var geom = filteredArea.geometry();

// Convert the zones of the forest loss areas to vectors.
var vectors = zones.addBands(zones).reduceToVectors({
  geometry: geom,
  crs: lossBand.projection(),
  scale: 30,
  geometryType: 'polygon',
  eightConnected: true,
  labelProperty: 'zone',
  reducer: ee.Reducer.count()
}).filterMetadata("count","greater_than", area_threshold);

// Make a display image for the vectors, add it to the map.
var display = ee.Image(0).updateMask(0).paint(vectors, '000000', 1);
Map.addLayer(display, {palette: '000000'}, 'vectors');

var SRTM = ee.Image("USGS/SRTMGL1_003"); // exampleelevation image

var slope = ee.Terrain.slope(SRTM);

// add min, max and mean elevation of each geometry
var reducers = ee.Reducer.median()
                .combine(ee.Reducer.min(), 'Elevation', true)
                .combine(ee.Reducer.max(), 'Elevation', true)
                .combine(ee.Reducer.mean(), 'Elevation', true);

vectors = SRTM.reduceRegions(vectors, reducers, 30);

// Get Admin Districts
var fromList = ee.FeatureCollection("FAO/GAUL/2015/level2");
var filter = ee.Filter.inList('ADM0_NAME', ['Romania']);
var filteredArea = fromList.filter(filter);

var AreaName = filteredArea.aggregate_first("ADM2_CODE")

reducers = ee.Reducer.first();

// This next line is wrong!
vectors = AreaName.reduceRegions(vectors, reducers, 10);

// Export the FeatureCollection to a CSV file.
Export.table.toDrive({
  collection: vectors,
  description: 'Forest',
  fileFormat: 'CSV'
});


texts: Creating Hovmoller Diagram in ArcGIS Desktop?

texts:
Hovmoller diagrams are useful in indicating changes through time in specific locations. I usually create this in GrADS but I am wondering if it is also possible to create Hovmoller Diagram in ArcGIS 10.

Has anyone done this before?


texts: Bug in ControlMapMeasureTool? "Measure An Area" creates a duplicate dialog in ArcGIS Engine 10

texts:
When we add a measure tool to the AxToolbarControl through the properties dialog, we can change to measure length and area in the dialog that pops up. But when we add a  ControlsMapMeasureTool through code like this:

Dim control As AxMapControl = axMapControl1
Dim tool As New ControlsMapMeasureTool()
tool.OnCreate(control.[Object])
control.CurrentTool = DirectCast(tool, ITool)

We followed the instructions in the documentations How to create a command or tool to work with the controls The dialog pops up but when we choose "Measure An Area" a new Measure dialog pops up and we can still only measure length. What are we doing wrong?

Steps to reproduce:

Create a new MapControlApplication
in VS
Create a new MenuItem in the Menu
"Test"
Create a new OnClick event handler
TestToolStripMenuItem_Click
Paste the code above into the event
handler
Run the application
Load a map that has a spatialreference that is a projected coord system (not a geographic coord system).
choose the Test menu item
Change to "Measure An Area" in the
dialog
Drag the dialog to the side.
Two dialogs are active but only
length can be measured.


texts:
I am trying to orient a set of intensity LiDAR images in ERDAS Stereoanalyst for
stereo digitizing. The set is consisted of an intensity image and its stereomate.

Stereoanalyst is configured for orienting typical aerial photography which is not the case for me. So I used custom parameters for external orientation (XoYoZo out of the center pixel of the images and omega=phi=kappa=0) as well as custom affine coefficients to move from XY image axis to rows,cols axis (internal orientation), as calculated from image size.

When I try to load my pair to the interface I get an error message about images being of the same geometry. Can't seem to get around it.


texts: How to use attribute as image name with the SYMBOL keyword?

texts:
I have a set of PNG images contained in a server folder that I wish to use as point symbols. The symbol should be defined by the attribute symb_name. So in my MAP file, I'd like to do something like this:

CLASS
    EXPRESSION (xxx)
    STYLE
        SYMBOL '../symbols/images/' + "[symb_name]" + '.png'
        SIZE 10
    END
END

I just don't seem to be able to concatenate or include the image file name correctly in the SYMBOL keyword. Is it possible, and what would be the correct syntax? (I'm using a fairly old version of Mapserver, 5.2.1.)


texts:
I’m working for a large organization which are using ArcGis Desktop on some (windows) clients. The security requirements for the system is very strict, and a part of that is prohibiting the users the ability to use compilers and interpreters. This pose an issue with ArcGis products since they rely heavily on Python scripting. We are looking into different ways of locking down python as much as possible without rendering ArcGis Desktop useless. The environment is Windows 2008 R2 servers with Windows clients. We would prefer to lock down python to only allow for execution of scripts in the ArcGis folder, and block other folders as well as the interactive prompt.

We have heard rumors that a solution for locking down Python in ArcGis has been presented at a user conference but we have not seen a description of how it was done. The ArcGis version we are using is 10.2 and we have experimented using both the “in process” bundled python as well as the external python installation in the system. Our first approach was looking into restricting python with group policies, but that is not easily done since Python is not “GPO aware”. Using software restriction policies are basically a block Python for all or allow Python for all. Since python scripts are run through the interpreter (python.exe), the GPO software restriction settings for executable locations only checks the python.exe and not the script location itself (the GPO system only sees the python script as a generic argument to the python.exe executable).
So my question is if anyone has have any experience in tightening the security concerning ArcGis and Python?


texts: QGIS - Visibility Analysis fails with "AttributeError: 'NoneType' object has no attribute 'GetGeoTransform' "

texts:
I'm using Visibility Analysis plugin to generate cumulative viewshed maps. The base DEM map is created using GRASS GIS (r.surf.contour).

I'm running using the following setting below - but have also tweaked things around trying to make it work:

Does anyone know how to work around this issue?

Versions

QGIS 2.18.28
Visibility Analysis 0.5.4

Error Log

 An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'GetGeoTransform'
Traceback (most recent call last):
  File "C:/Users/user/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysis.py", line 197, in run
    Algo)
  File "C:/Users/user/.qgis2/python/plugins\ViewshedAnalysis\doViewshed.py", line 356, in Viewshed
    gt=gdal_raster.GetGeoTransform()#daje podatke o rasteru (metadata)
AttributeError: 'NoneType' object has no attribute 'GetGeoTransform'

Python version: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.18.28 Las Palmas, aa30730ac6

Python Path:
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python
C:/Users/user/.qgis2/python
C:/Users/user/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins
C:\Program Files\Laubwerk\Python
C:\PROGRA~1\QGIS2~1.18\bin\python27.zip
C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.18\bin
C:\PROGRA~1\QGIS2~1.18\apps\Python27
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/user/.qgis2//python
C:/GIS


texts: Looking for a Provider of UK boundary data

texts:
I'm working on a web project centered around the input and mapping of GIS data. We have a need to display polygons of town boundaries.

The RightMove.co.uk website has and uses this data: http://www.rightmove.co.uk/property-for-sale/map.html?locationIdentifier=REGION^20140&insId=1

Does anyone know a provider of this information (town/city boundaries)?

I've contacted Google sales, but they've said they don't have this data. So it appears RightMove got it from another source.


texts:
I have a table which has latitude, longitude and some sensor data (data 1, data 2,data 3) saved in postgresql 12. I am running the database on ubuntu 18 virtual machine with windows as host. I dont want to run the database on windows at all.

The expectation is to somehow query the table ,get the data including coordinates and plot it on a map.
So far i tried :

Using tableau desktop but it does not support Ubuntu.
I tried grafana but the map does not have the required functionality
I also tried Metabase. It does not let you have multiple data on map, only one at a time is allowed. You have no control at all.
I tried PostGIS with qgis. But there is no simple way to achieve it. The learning curve seem to be very steep. I only need to plot.
Google map lets you plot from a csv. I do not know if postgres or any database access if available. It is very manual process to save the file from postgres as csv and then use google maps.

Please let me know if there is a better  approach to this problem.


texts: Snap points to nearest line - however limit snapping to polygon the point sits within

texts:
I am trying to snap a series of points relative to the nearest line (which i know can be achieved via "Snap geometries to layer", however, i want to restrict snapping to the polygons the points sit within.

Does anyone have any ideas?


texts: Create multiband raster from a single band raster with fields

texts:
I have a raster which has a single band containing what is effectively a lookup code. When I open the raster in ArcMap and open the attribute table I can see several fields which I guess come from the accompanying .vat.dbf file. There is also a .csv file for looking up the field values.

I want to output a multiband raster where the bands are formed from a selection of the fields found in the input raster. So effectively converting some of the fields to bands.

I know that this could be achieved by first creating serval single-band rasters using the Lookup function inside the RasterCalculator to extract each required field and the use the Composite Bands tool to produce the desired output. However, the dataset is fairly large so this would take too long, can anyone suggest a more efficient way?

Any solution using GDAL, GRASS, QGIS or ArcGIS (with SA Extension) is welcome.


texts: Mapbox API - Regenerate a Tileset after it's related Dataset has been updated

texts:
I'm using Mapbox's API to update the features on a dataset. However, I'm not seeing the changes automatically appear in the tileset that's been generated from it afterwards.

Is there an extra step that I need to trigger, via the API, to accomplish a tileset refresh from the updated dataset?

I can confirm that the dataset when viewed in Mapbox Studio does have the expected data changes present, but maps that use the related style which uses the related tileset still shows the old data.

I believe I need to find the API equivalent of "Update a connected tileset" that is available via Mapbox Studio.


texts: Can I increase up to 5000 points limit of feature layer?

texts:
I have created searching functionality to using the JavaScript API and I have feature layers which has grater than 1000 points. I want to put all point of particular feature layers on map but currently, There are only 1000 or less than that displayed over there.

currently I'm using following code :

    layer.setMaxAllowableOffset(5000);
    layer.setDefinitionExpression(expString);

is there any help for me?


texts: Display list of OpenLayers Features which are currently visible on screen

texts:
I have an OpenLayers map a few thousand Points of Interest. These POIs are Vector Features rendered in a Vector Layer.

We are loading the POIs once in order to minimize load on the server.

Next to the map will be a box which will display the names of POIs currently in view.

I'm not clear on the best way to update this list of names.

I believe that I can store an array of the POIs (Features). Then, when the map is panned/searched/zoomed, loop through them, calling the "onScreen" function.

map.events.register("moveend", map, function(evt) {
      var output = [];
      for (var i=0;i<myFeatures.length;i++) {
          var poi = myFeatures[i];
          if (poi.onScreen()){
             output.push(poi.attributes['name']);
          }
      }
     // then, use output to display the list in html...
     myDOMbox.innerHTML = output.join();

});

Is there a more efficient way to do this?

Thanks in advance.


texts: QGIS Composer map scale turns incorrect after working properly

texts:
I am working on a project with several QGIS Project files. I have one Project file with certain layers and settings which I copy every time I need to create a new Project file within this work. I have used a composer template to print maps with identical framing from these different Project files. It has worked fine for long, until these several issues appeared at once:

I loaded once again the composer template but the map in the template appears blank, and does not reappear by Refreshing the View.
I can add a new map frame to the template, but the map scale appears incorrect. For example I set the scale to 1:10'000, but it gives me a map with a scale of 1:5000. Scale bar equals to the scale of the map, not the setup in scale bar properties. There is only one map frame in composer.
I create a completely new composer inside the current Project file, but the scale issue remains.
Also these issues appear in all the composers which I had created earlier in other Project files under this work.

However the scale problem disappears when I create a completely new Project file. It seems that the root of the problem is in the Project file - but where to start looking for the reason? I have not changed any setup in Project file, at least not consciously. I didn't find similar issue from earlier Questions.

I am working with QGIS 2.18.11 in Windows 10 Pro. Since I started this work I have updated QGIS twice, but I am not sure at which point this issue appeared.


texts:
I have a list of shapefiles stored in a group: pump

I want to save all shapefiles as a new shapefile with a new CRS.

For that, I wrote the following script:

import os as os
from qgis.core import *
import processing

root = QgsProject.instance().layerTreeRoot()
prjpath =QgsProject.instance().readPath('')

groups = ['pump']
groupPump = root.findGroup(groups[0])
pathPump = prjpath + '/layers/hydrology/' + groups[0]

crs = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)

def saveGroup(group, crs, savePath):
    group = group
    for layerId in group.findLayerIds():
        layer = QgsMapLayerRegistry.instance().mapLayer(layerId)
        layerName = QgsMapLayerRegistry.instance().mapLayer(layerId).name()
        path = savePath + '/'+layer.name() + '_' + crs.authid()[-4:] +'_' +'.shp'
        print path
        QgsVectorFileWriter.writeAsVectorFormat(layer, path, "utf-8",crs, "ESRI Shapefile")
        path)

saveGroup(groupPump, crs, pathPump)

No error, nothing happens...What did I do wrong?


texts: ARCGis LayerToKML Skips Feature Layers and Doesn't Process Layers in Group Layers

texts:
I am using ARCGis desktop and have written a quick conversion program to convert my layers to kml but I ran into some issues.  It seems the only layers it can process correctly are group layers.

When it processes the group layers I am missing all the feature layers included in the group layer in the resulting doc.kml.  It's also failing on feature layers with an error that says it's not a layer with the following message: ERROR 000840: The value is not a Layer.  When I know it's a layer, I can pull it up in ARCMap and, indeed, ARCMap agrees with me that it's a layer.  I can use the MapToKML function without issue but I need to control my layers individually so I was hoping I can generate KML for each individual layer on a map.

Thanks in advance for any help you can provide.

Here is my source code:

  static void Main(string[] args)
  {
   IMapDocument mapDocument = new MapDocumentClass();
   IPage page;

   string mapFilename = @"c:\maps\BaseMap_NAD83_SD_StatePlane_Plumes_Scott.mxd";

   Console.WriteLine("Initializing GEO...");
   Geoprocessor GP = new Geoprocessor();

   if (mapDocument.get_IsMapDocument(mapFilename) && mapDocument.get_IsPresent(mapFilename))
   {
    Console.WriteLine("Loading map...");
    mapDocument.Open(mapFilename, "");

    page = mapDocument.PageLayout.Page;

    IMap map;
    for (int iMapIndex = 0; iMapIndex < mapDocument.MapCount; iMapIndex++)
    {
     map = mapDocument.get_Map(iMapIndex);

     Console.WriteLine("Converting layers for map {0}...", map.Name);

     ILayer layer;
     for (int iLayerIndex = 0; iLayerIndex < map.LayerCount; iLayerIndex++)
     {
      layer = map.get_Layer(iLayerIndex);

      ConvertLayerToKML(GP, layer as ILayer2);

      Marshal.ReleaseComObject(layer);
     }

     Marshal.ReleaseComObject(map);
    }
   }

   mapDocument.Close();
   Marshal.ReleaseComObject(mapDocument);
  }

  private static string[] ConvertLayerToKML(Geoprocessor GP, ILayer2 layer)
  {
   string [] messages = new string[] {};

   string layerName = layer.Name;

   LayerToKML layerToKML = new LayerToKML();
   layerToKML.layer = layer;
   layerToKML.layer_output_scale = 10000;
   layerToKML.out_kmz_file = string.Format("{0}.kmz", layerName);

   Console.WriteLine("Converting layer {0}", layerName);

   object result = GP.Execute(layerToKML, null);

   messages = new string[GP.MessageCount];
   for (int i = 0; i < GP.MessageCount; i++)
   {
    messages[i] = GP.GetMessage(i);
   }

   return messages;
  }


texts: Create basic GB region postcode area map

texts:
I want to make a simple map of SW England that shows polygons over the postcode areas (e.g. EX1, PL19, each in an shaded area with boundary line). If I search the postcode area on Google Maps (online) it shows exactly the kind of area highlight I want on this map, only I want multiple ones on a single map.

My data is number of respondents per postcode area. I am happy to manually label each polygon with a number to show the respondents in that area, as I don't have that many areas. Or can create a CSV file with postcodes listed so they can be counted and displayed automatically (if such a thing is possible and worth the effort).

So far I have managed to bring up a basic ordnance survey map. I downloaded what I thought was the right postcode area shapefile but it is too broad - It shades the whole of e.g. EX rather than just EX1, EX2 etc. as separate areas.


texts: Materialized view with FAST refresh on remote table: How to include a SHAPE column?

texts:
I want to create an Oracle materialized view with the fast refresh option on a remote table (in an enterprise GDB).
I can do this successfully without a  SHAPE column:
create materialized view log on maximo.workorder with primary key;  --remote table
grant select maximo.mlog$_workorder to schema_for_dblink; --I've provided a dblink access to everything in a certain schema

create materialized view my_gis_schema.wo_mv --enterprise GDB
build immediate
refresh fast
start with sysdate next sysdate + (15/(60*60*24))
as
select
    cast(workorderid as number(38,0)) as objectid, --workorderid is a fake primary key; it has a NOT NULL constraint and a unique index
    wonum,
    status,
    --other fields
    longitudex,
    latitudey
from
    maximo.workorder@my_dblink

The MV above works, but I want to store the XY coordinates from the remote table in a SHAPE column in the MV.
Unfortunately, my options seem pretty limited:

Oracle doesn’t seem to support SDE.ST_GEOMETRY in MVs (more info here and here).

Although, I didn’t get that far — due to the fact that the schema I was using (SYSTEM) to create the MV  doesn’t have the “inherit privileges” for the SDE owner (more info here and at the bottom here). I assumed, even if I sorted out the SDE privileges issue, I still wouldn't be able to proceed, due to the limitations in #1.
The SQL would be: sde.st_geometry(longitudex,latitudey,null,null, 26917 ) as shape

Additionally, Oracle doesn't seem to support SDO_GEOMETRY in MVs on a remote table with the fast refresh option: ORA-12015: cannot create a fast refresh materialized view from a complex query

The SQL would be: sdo_geometry(2001, 26917, sdo_point_type(longitudex,latitudey, null), null, null) as shape

Question:
Is there a way to include a SHAPE column in a materialized view  in a remote table with the fast refresh option?


texts: Add nodes automatically to adjacent objects QGIS

texts:
I'm currently using QGIS 3.10.2 A Coruna.

I'm translating an analogue map into QGIS and there are different classes of objects within the same Layer (streets, buildings, properties, etc...).

I just ran a topology check, and I have a lot of errors especially in the overlapping of objects, due to the missing nodes of adjacent features.

In the screen shot I try to visualize my problem. The green feature is smaller than the adjacent object (orange) left of it.
Is there a possibility in QGIS to add nodes automatically to adjancent objects?


texts:
My company has ArcSDE to run our webmapping system.  We want our ArcGIS for Desktop Basic license users to be able to edit this data without dropping 30k for 6 users on upgrading to standard.

Can we run GISquirrel next to ArcSDE to edit the same database?

I'm assuming we can't, but wanted to be sure.

I'm using SQL server 2008.


texts: What causes error 000860 when running stream definition for Arc Hydro tools?

texts:
I am using Arc Hydro tools, but whenever I reach stream definition, it fails, giving error 000860. Yet I think I have done everything right. What could be the problem?

I have run DEM reconditioning, filling sinks and store my work on local disk C:. I projected my datasets to the same cordinate system but all in vain.
I am using ArcGIS 10.3 and Arc Hydro 10.3


texts:
I am presenting some percentage change data, and I created a color ramp such that negative values are shades of red and the positive values are shades are blue.

I want to use a custom classification with data exclusion so that I create a classification scale for negative values and scale for positive values.

However, data exclusion doesn't seem to be working.

Is there a different way to achieve my goal? I am using Arcmap 10.1.


texts: Union anti-meridian "multipolygons" after re-centering world map

texts:
My goal is to create a world map (using ggplot2) with a Pacific perspective.

I have managed to re-center the map, by following this solution. Code below:

    # world country layer
    sppolys <- rnaturalearth::ne_countries(scale = "medium", returnclass = "sp")
    wgs84 <- CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")

    # =========================================================================
    # Split sPolygonsDF object by "split line"
    # =========================================================================
    # shift central/prime meridian towards west - positive values only
    shift <- 152

    # create "split line" to split worldmap (split at Prime Meridian)
    split.line    <- sp::SpatialLines(list(Lines(list(Line(cbind(180 - shift,
     c(-90, 90)))), ID="line")),
     proj4string = wgs84)

    sppolys <- gBuffer(sppolys, byid=TRUE, width=0)

    # intersecting line with world polys
    line.gInt     <- gIntersection(split.line, sppolys)

    # create a very thin polygon (buffer) out of the intersecting "split line"
    bf            <- gBuffer(line.gInt, byid=TRUE, width=0.000001)

    # split world polys using intersecting thin polygon (buffer)
    sppolys.split <- gDifference(sppolys, bf, byid=TRUE)

    #==========================================================
    ## plot
    #==========================================================

    countries <- data.table(map_data(as(sppolys.split,
    "SpatialPolygonsDataFrame")))

    # Shift coordinates to fall correctly on shifted map
    countries$long.shift <- countries$long + shift
    countries$long.shift <- ifelse(countries$long.shift > 180,
    countries$long.shift - 360, countries$long.shift)

    # plot shifted map
    ggplot() +
      geom_polygon(data=countries,
        aes(x=long.shift, y=lat, group=group),
        colour="black", fill="gray80", size = 0.25) +
      coord_equal()

Which results in the map below, providing a Pacific perspective, as desired.

However, polygons along the anti-meridian (now the map center) are still split. I suppose these could be unioned together somehow, which I tried to do with the following code (basically the inverse of the above splitting).

    # create SpatialLine where along anti-meridian
    old.split.line    <- sp::SpatialLines(list(Lines(list(Line(cbind(180, c(-90,
    90)))), ID="line")),
      proj4string = wgs84)

    # ID intersection btwn this line and polygons layer
    old.line.gInt     <- gIntersection(old.split.line, sppolys.split)

    # buffer it to ensure intersection
    old.bf            <- gBuffer(old.line.gInt, byid=TRUE, width=0.000001)

    # union polygons which intersect the line
    sppolys.union <- gUnion(sppolys.split, old.bf)

The problem with this solution (as far as I can tell), is that the re-centering is done after converting to a data.table object, and therefore there is no actual intersection between the polygon parts. The only solution I can think if is to reconstruct a polygons object (sp or sf) after the shifting is done, but this is a huge hassle just to perform the unioning.

So in a nutshell, I'm looking for a way to shift/re-center the polygons THEN combine polygons along the old anti-meridian.

This can either be before or after converting to a data.table, whatever is most efficient. (Simple Features solutions are also welcome)


texts: Getting topology or out of memory errors with large dataset intersects and spatial joins in ArcMap

texts:
I receive a topology error notification when intersecting a point dataset (with ~5 million points), with a polygon dataset created by buffering those points by a half mile. The goal is to create a table containing the intersection of the two datasets such that I have a list of all points within that half mile radius of each starting point. I can generate effectively identical results using either an intersection or a spatial join.
My prototype of this process works fine when I work on a small subset of each dataset. When I scale up to the full dataset, the intersect operation fails with a topology error, and the spatial join fails with an out of memory error (which is plausible given the dataset size, and memory addressing limitations of a 32bit application).
Much of the time I do these operations in PostGIS (successfully and easily), but on this project I'm constrained to working in ArcMap, with the assumption that my users will have only the ArcView (Basic) level of licensing. I've also done these operations in spatiallite. I'd really rather not have to pull in OGR2OGR to move the datasets to spatiallite for the processing, but can if I must.
Machine specs: Intel Core2 Quad (Q9550), Windows 7 (64bit), 8GB of ram, plenty of hard drive space


texts:
I'm attempting to debug a code for a conditional label expression. The code is based on one i have previously used and did not have any issues. The python code is as follows.

def FindLabel ( [TF], [INV_1], [DIR_1], [INV_2], [DIR_2], [INV_3], [DIR_3], [INV_4], [DIR_4], [INV_5], [DIR_5], [INV_6], [DIR_6] ):
  return def FindLabel ( [TF], [INV_1], [DIR_1], [INV_2], [DIR_2], [INV_3], [DIR_3], [INV_4], [DIR_4], [INV_5], [DIR_5], [INV_6], [DIR_6]):
  myLabel = "TF  {0}".format([TF])
  if not [INV_1] is None:
myLabel += "\nINV  {0}".format([INV_1]) & [DIR_1]
  if not [INV_2] is None:
myLabel += "\nINV  {0}".format([INV_2]) & [DIR_2]
  if not [INV_3] is None:
myLabel += "\nINV   {0}".format([INV_3]) & [DIR_3]
  if not [INV_4] is None:
myLabel += "\nINV   {0}".format([INV_4]) & [DIR_4]
  if not [INV_5] is None:
myLabel += "\nINV   {0}".format([INV_5]) & [DIR_5]
 if not [INV_6] is None:
myLabel += "\nINV   {0}".format([INV_6]) & [DIR_6]
  return myLabel

Where TF, INV_1, INV_2, INV_3, INV_4, INV_5, and INV_6 are numbers, and DIR_1, DIR_2, DIR_3, DIR_4, DIR_5, and DIR_6 are text, all have the potential to be null. When I click "OK" arcgis returns the following error

The expression contains an error.
Modify the expression and try again.
Error 0 on line 0.
Syntaxerror: invalid syntax (<string>, line 2).

Coding is far from my strong suit.


texts:
I'm trying to import an Access file (.mdb) to QuantumGIS.
This database comes from a geodatabase from ArcGIS.

Can someone explain me how to do it?

I tried to import from Add Vector Layer > Database > ESRI Personal Geodatabase ...

But from there, I am confused...
What are the next steps?
Do I have to connect it to an existing shapefile?


texts:
I have a model where I want to check the projection. If it is GCS_WGS_1984, I want it to go one path, and if it isn't, I want it to go another path.

I created a "Check Coordinates of Input" script to output two Boolean values of True or False. The script is:

import arcpy, os
from arcpy import env
env.overwriteOutput = True
arcpy.CheckOutExtension("Spatial")

Footprints = arcpy.GetParameterAsText(0)

desc = arcpy.Describe(Footprints)
type = desc.spatialReference

try:
    if type.name == "GCS_WGS_1984":
        arcpy.SetParameterAsText(1, "True")
        arcpy.SetParameterAsText(2, "False")

     else:
        arcpy.SetParameterAsText(1, "False")
        arcpy.SetParameterAsText(2, "True")
except Exception as e:
    AddPrintMessage(e[0], 2)

When the input isn't in GCS_WGS_1984, the model is able to run okay. I get the True.kmz file but in the messages I also get "The process did not execute because the precondition is false" and "All the inputs are not current". When the input file is in GCS_WGS_1984 however, I get and error message from the Project function of "invalid geographic transformation" and it stops there.

How do I get it so that if the coordinates are true, the goes along the upper path, and if it's false, to go along the lower path?

I was reading something on ArcGIS's online resource about a Run Model Parameter http://resources.arcgis.com/en/help/main/10.2/index.html#//002w0000007r000000 being checked and was wondering if that would make a different? Still though, I don't know how to access that.

And this is for later if it all works out: If I'm running this in a tool dialog box, the options for the true and false kmz will be required, even if only one is going to be created?


texts:
I am developing a car pooling website. For that, I have created the database which has the different route options selected by different user. These routes are saved in the Database as Geography datatype. For data access, I used Entity Framework. In the C# code, I used DBGeography datatype for process the routes.

I have a requirement that, the user can select one route, and identify the users who selected the same/nearby route which is saved in the database. How do I achieve this?


texts: How do you insert a cartoDB map using Cartodb.js into a wordpress site?

texts:
I've been looking at http://developers.cartodb.com/documentation/cartodb-js.html so that I can put a customized map into a wordpress site.

I've been copying and pasting the following code into the wordpress text editor. However, it is not displaying a map on my website.

How do I display a map in wordpress, using cartodb.js?


texts: Creating "heatmap" based on data with legend in QGIS?

texts:
I am new to QGIS.

I need to make a map that looks like a heatmap, but is based on data values, not point concentrations, and with a legend. I was able to make a heatmap based on data values, but not able to create a legend also based on the data values instead of the point concentrations.

I also tried making a raster map, but the map values seem to be based on point concentration instead of the data values.

How can I do this?


texts: OpenLayers plugin not loading in QGIS 2.16.3 in OS X.

texts: I get this error whenever I try to open any map through OpenLayers plugin. Please help! I have tried searching online for the solution but could not find any or rather could not figure out much.


texts: QGIS split vector layer gives me GPKG files but I need shp files

texts:
QGIS 3.6.0

I am new to QGIS software and not very technical on its deep workings. I am trying to split a .shp file using split vector layer. I need .shp file outputs but it auto creates .gpkg files.

I cant seem to find any settings that will change the default from .gpkg to .shp


texts: How to do a layer/ shapefile filling of thickness / transparent by value in QGIS?

texts:
I have a shapefile with 500 rows.
My goals is to assign each row a specific value of transparency.
I know I can group these and then manually assign a transparency to these groups, however I want to have them assigned an individual value automatically.
Eg.:
name_of_shapefile  value
        A           500  --> 0%
        B           499  --> 1%
        .            .       .
        .            .       .
        .            .       .
        H          -12   --> 99%

Currently I have a simply query of >0 = transparent and <0 = not transparent.


texts:
I'm trying to use DDP to produce a map book for a series of works. Each item of work is a feature in a polyline feature class, and a copy of the class is being used to define my DDPs. I already have set up dynamic text, page definition queries etc.

As the work lines are variable in length, I want to constrain my map scale so that they are not zoomed in or out too far. My code:

import arcpy
from arcpy import env

env.workspace = r"U:"
mxd = arcpy.mapping.MapDocument(r"U:\EMS.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
ddp = mxd.dataDrivenPages
indexLayer = ddp.indexLayer

# def ddpScale():
#     if df.scale < 6000:
#         df.scale = 6000
#     elif df.scale > 10000:
#         df.scale = 10000
#     else:
#     df.scale = 10000

for i in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = i
    for scale in df.scale:
        if df.scale < 6000:
            df.scale = 6000
        elif df.scale > 10000:
            df.scale = 10000
        else:
            df.scale = 10000
    #df.scale = ddpScale

ddp.exportToPDF(r"U:\test.pdf")

del mxd

The commented out lines were my attempt to define a function for setting the scale, but I opted for a elif statement instead. I basically want any pages with a scale less than 1:6000 to be 1:6000, and all others to be 1:10,0000.

As an addition, I would like lines that are above 1:10,000 originally to be split across multiple pages as needed.

How would I got about setting the scale in this manner?

The error I am getting:

Traceback (most recent call last):
  File "C:/XXXddp.py", line
20, in <module>
    for scale in df.scale:
TypeError: 'float' object is not iterable