texts:
I am new to GIA domain. I am trying to learn new concepts around mapping etc and this is my first app/implementation. I am trying to implement a store locator kind of function.

I am thinking to calculate minimum latitude and longitude for a given geocode and distance. Lets say I have lat: 41.850, lng: -87.650 and distance of 10 miles. is it possible to calculate all possible lat and longitude? and from the resulting values i will find the minimum and maximum lat & long.
I am using oracle 11g DB and Java/JavaScript


texts: Setting temporary Processing path for standalone PyQGIS script/application

texts:
I know how to overwrite the TEMP variable path from the QGIS Interface, but I'm having problems doing the same thing via stand-alone Python scripts (using QgsApplication).

For example, I have the following script:

# Prepare QGIS environment
import sys
from qgis.core import *
from PyQt4.QtGui import *
app = QApplication([])
QgsApplication.setPrefixPath("E:\\QGIS\\apps\\qgis", True)
QgsApplication.initQgis()

# Prepare processing framework
sys.path.append('E:\\QGIS\\apps\\qgis\\python\\plugins')
from processing.core.Processing import Processing
Processing.initialize()
import processing
from processing.tools import *

# Set variables
algorithm = "saga:rastercalculator"
input = "E:/input.tif"
addInput = None
formula = "ifelse(a=0, 0/0, ifelse(a<0, 0/0, a))"
useNoData = False
dataType = 7
result = "E:/output.tif"

# Run algorithm
processing.runalg(algorithm, input, addInput, formula, useNoData,
                  dataType, result)

# Exit QGIS
QgsApplication.exitQgis()
QApplication.exit()

Along with the output, the script creates TEMP files in the following location:

%USER%\AppData\Local\Temp\3\processinga47e029c49534bc895c55106582f3a25\4398ed40e94f4f3285977b396abc2268\E:outputtif.sgrd

How can I set a different path for the TEMP files?


texts: New Google Earth app max overlay texture size reduced?

texts:
With the latest update of Google Earth on iPhone 6s plus, a kmz file containing a JPEG overlay reference is shown with red X. In the previous version, the overlay was shown correctly.

The problem should be tied to available memory not enough to show jpeg. Probably the new version leaves less free memory for overlay.

I would like to know if the maximum size for a pixel overlay is known for the new iOS android apps.


texts: Getting current zoom level in ArcGIS API for JavaScript 4?

texts:
The below code works to get the current zoom level in ArcGIS 3.18 JavaScript API.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.18/esri/css/esri.css">
<style>
  html, body, #map {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  body {
    background-color: #FFF;
    overflow: hidden;
    font-family: "Trebuchet MS";
  }
</style>
<script src="http://js.arcgis.com/3.18/"></script>
<script>
  var map;
  require(["esri/map", "dojo/domReady!"], function(Map) {
    map = new Map("map", {
      basemap: "topo",  //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
      center: [-122.45, 37.75], // longitude, latitude
      zoom: 13
    });
    map.on("extent-change",function(evt)
      {
        console.log("extent change",map.getZoom());
        if(map.getZoom() > 13)
          map.setZoom(13);
      }
    );
  });
</script>

But map.getZoom() or map.setZoom() is not a method in the ArcGIS 4.0 JavaScript API MAP Class.

How do I get the current zoom level in ArcGIS 4.0 map JavaScript?


texts: Georeferencing layer using another layer?

texts:
I have a dwg (Autocad) drawing file which represents an extract of a map. This file contains about 50 layers (on per kind of object : trees, road etc).
I have extracted all the layers in GeoJSON format (one GeoJSON file per layer).

What I am looking after is to georeference this map, basically I want 50 GeoJSON files so I can load them into a web interface and play with the opacity of each one.

The work had been partially done : One extracted layer (In GeoJSON format) is georeferenced. The layer is the one that represents the roads.

How to georeference the 49 other layers using this "master" layer?

I have already GDAL and python installed.

I am very new to the GIS environment.


texts: How to edit the GUI of a QGIS plugin not made with the plugin builder?

texts:
I edited a python plugin's code and had to change the UI a bit as well. However, unlike in the plugins I made from scratch with the plugin builder, the UI doesn't automatically update in QGIS when I change the .ui file with Qt designer and reload the plugin. I figured I'd have to compile it (to .py) manually with

"C:\Program Files\QGIS Chugiak\bin\pyrcc4" -o ui_changeDSDialog.py ui_changeDSDialog.ui

but that just throws a "No resources in resource description." error. How do I compile it?

/edit: pyuic4 doesn't work either.

ImportError: No module named site

Nor does -x -o


texts: Pathfinder Office not carrier correcting my data

texts:
I'm having an odd/frustrating issue with PFO. Specifically, I have not been able to correctly post-process any data for months.

To elaborate, my coworkers are all able to post-process the same SSF with 100% carrier correction, but my system fails (0% carrier correction).

Using the exact same file and post-processing settings, I get the following:

Differential Correction Summary:
1 file processed.  In this file:
    576 (100.00%) of 576 selected positions were code corrected by post-processing
    0 (0.00%) of 576 selected positions were carrier corrected by post-processing

Estimated accuracies for 576 corrected positions are as follows:
        Range   Percentage
        ----------  ----------
          0-5cm      -
         5-15cm      -
        15-30cm      -
        30-50cm      -
         0.5-1m 21.70%
           1-2m 70.31%
           2-5m  7.99%
            >5m      -

My coworkers (who all are using the same PFO version and server license) use the exact same settings and get the following:

Differential Correction Summary:
1 file processed.  In this file:
    576 (100.00%) of 576 selected positions were code corrected by post-processing
    576 (100.00%) of 576 selected positions were carrier corrected by post-processing

Estimated accuracies for 576 corrected positions are as follows:
        Range   Percentage
        ----------  ----------
          0-5cm      -
         5-15cm 100.00%
        15-30cm      -
        30-50cm      -
         0.5-1m      -
           1-2m      -
           2-5m      -
            >5m      -

Pathfinder Office version:5.65

Terrasync version:5.30

Handheld unit: GeoXH 6000

External antenna: Trimble Tornado


texts: Very slow trigger Function on insert, what am I doing wrong?

texts:
Trying to setup a trigger function to set geom on insert and update. The update part is working fine and response time is great (0.08sec)

However my insert triggers runs for 12-13 minutes for a single row. This is really unacceptable.

The function is to calculate the geom based on lat/lng for the new inserted rows.

What Am I doing wrong here...

  CREATE TRIGGER tr_insert_geom
      BEFORE INSERT
      ON schema.table1
      FOR EACH ROW
      EXECUTE PROCEDURE schema.fn_test_table_geo_update_event();
   -- ALTER TABLE schema.table1 DISABLE TRIGGER tr_insert_geom;

CREATE OR REPLACE FUNCTION schema.fn_test_table_geo_update_event()
  RETURNS trigger AS
$BODY$
  BEGIN
    -- as this is an after trigger, NEW contains all the information we need even for INSERT
    UPDATE schame.table1 SET
    geom = ST_SetSRID(ST_MakePoint(NEW.longitude,NEW.latitude), 3857);
    RAISE NOTICE 'UPDATING geo data for %, [%,%]' , NEW.index_pk, NEW.latitude, NEW.longitude;
    RETURN NEW; -- result is ignored since this is an AFTER trigger
  END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION locates_data.fn_test_table_geo_update_event()
  OWNER TO write_user;


texts: I am using QGIS 2.18 and I am trying to add symbols to my map but I cant find the kind of symbols I need. Is there a way I can get symbols depicting security threats, flooding, violence?


texts: PyQGIS CRS projection issue when converting shapefile to heatmap

texts:
I am trying to create a Python script that runs in the QGIS Python Console and uses the QGS API to create KDE heatmaps from shapefiles. The shapefiles can come in any number of CRS's but the heatmaps must all be created in EPSG: 6350
I am using a shapefile of points of chemical sampling sites and trying to create a heatmap of those points.
This is my first project in PyQGIS and I am having some trouble with the CRS projection of the heatmap.
When I do this process manually I have to export the shapefile in espg: 6350 then reimport it to create the heatmap. I have tried to do this in pyqgis but it is still projecting the heatmap incorrectly.
Here is the code I have been using:
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import processing
import os

#set project crs
canvas = iface.mapCanvas()
selectedcrs="EPSG:6350"
target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromUserInput(selectedcrs)
canvas.setDestinationCrs(target_crs)

sites = "/Users/justinandrew/Documents/Personal/geospatial_fall_2020/qgis_projects/shapefile_to_hmap_pyqgis_dev_2020_11_13/SHAPEFILES/NH_PFAS/PFAS_20200603_jwa_noneg_shp.shp"

vlayer = iface.addVectorLayer(sites, "sites layer", "ogr")
if not vlayer:
  print("Layer failed to load!")

from qgis.core import QgsProject, QgsCoordinateReferenceSystem

#set layer crs
for layer in QgsProject.instance().mapLayers().values():
    layer.setCrs(QgsCoordinateReferenceSystem('EPSG:6350'))

str = "/Users/justinandrew/Documents/Personal/geospatial_fall_2020/qgis_projects/shapefile_to_hmap_pyqgis_dev_2020_11_13/SHAPEFILES/NH_PFAS_epsg_6350/PFAS_epsg_6350.shp"

#export the layer with the new crs
_writer = QgsVectorFileWriter.writeAsVectorFormat(vlayer,str,'utf-8',driverName='ESRI Shapefile')

#process it using chemical value as the weighing factor
processing.run("qgis:heatmapkerneldensityestimation", {'INPUT':'/Users/justinandrew/Documents/Personal/geospatial_fall_2020/qgis_projects/shapefile_to_hmap_pyqgis_dev_2020_11_13/SHAPEFILES/gwTCE_NH/PFAS_epsg_6350.shp|\
layername=PFAS_epsg_6350','RADIUS':1600,'RADIUS_FIELD':'','PIXEL_SIZE':100,'WEIGHT_FIELD':'Total PFAS',\
'KERNEL':0,'DECAY':0,'OUTPUT_VALUE':0,\
'OUTPUT':'/Users/justinandrew/Documents/Personal/geospatial_fall_2020/qgis_projects/shapefile_to_hmap_pyqgis_dev_2020_11_13/HEATMAPS/Heat1.tif'})

#add the heatmap for viewing
path_to_tif = "/Users/justinandrew/Documents/Personal/geospatial_fall_2020/qgis_projects/shapefile_to_hmap_pyqgis_dev_2020_11_13/HEATMAPS/Heat1.tif"

iface.addRasterLayer(path_to_tif, "Heat1")

Any suggestions as to why I am not getting the correct projection of the heatmap or other suggestions to improve my code?


texts:
I have an elevation raster and I would like to get some basic terrain variables, such as slope, ruggedness, aspect or curvature.

The problem is that I don't seem to have the possibility to calculate curvature with the terrain analyst:

Can anyone tell me why this indicator isn't in the list? How can I calculate it otherwise?


texts: Trying to Export SDF to CSV and save locally using ArcGIS Notebook

texts:
from IPython.display import display
from arcgis.features import feature
from arcgis.geoprocessing import import_toolbox
import pandas as pd
gis = GIS("https://arcgis.com/","username","password")
item = gis.content.get('layernumber')
flayer = item.layers[0]

#create a spatially enabled dataframe object
sdf = pd.DataFrame.spatial.from_layer(flayer)
sdf. head()

# Filter feature layer records with a sql query.
sdf = flayer.query(where="Complete LIKE 'yes'").sdf

for a,b,c,d in zip(sdf.columns[::4], sdf.columns[1::4],sdf.columns[2::4], sdf.columns[3::4]):
    print("{:<30}{:<30}{:<30}{:<}".format(a,b,c,d))

# Return a subset of columns
sdf[['Label', 'Complete', 'Completed_By', 'Ribbon_', 'use_','Light_Less_5m', 'Heavy_Less_5m', 'Light_and_Heavy_Greater_5m', 'Paid_By', 'Additional']]

#Export as CSV
"sdf.to_csv (r'C:\Users\steven.kenny\Documents\CLM_Files.csv', 'w', index = False, header=True)

I can successfully return a subset of columns. The problem arises when I try to export as a csv and save on my pc. I am using arcgis notebook.


texts: Update colour interpretation with gdal apps

texts:
My problem started when I wanted to build a vrt from a set of tif files: it didn't work because some images were in red,green,blue,undefined colour interpretation while others were in red,green,blue,alpha.

My workaround (based on this post) was to copy all images with gdal_translate -co PHOTOMETRIC=RGB -co ALPHA=YES. But isn't possible to simply edit the colour interpretation (e.g. with gdal_edit.py) in order to avoid creating new files?


texts: Use python code to extract all attributes shapefile

texts:
I am using ArcGIS 10.2.

How to use ArcPy code to extract every row in the attribute table and save each row to separate shapefiles?


texts: Resample of mean of ImageCollection to higher resolution

texts:
I want to resample the mean of 48 images of GPM with 10000m to MODIS in GEE. My code works perfectly for one image but the result for the mean or median of 48 images (or any number) does not correct.
The code:
var GPM = ee.ImageCollection('NASA/GPM_L3/IMERG_V06').filterDate(startdate, enddate).filterBounds(roi).select('probabilityLiquidPrecipitation').median().clip(roi);
var modis = ee.ImageCollection('MODIS/006/MOD10A1').filterDate(startdate, enddate).filterBounds(roi).first().select('NDSI').clip(roi);
var modisProjection = ee.Image(modis).projection();
var crs=modisProjection.getInfo()['crs'];
// 10,000m GPM resampled to modis 500m
var GPM_500m=GPM.resample('bicubic').reproject({'crs':modisProjection,'scale':500});
Map.addLayer(GPM_500m.clip(roi).select('probabilityLiquidPrecipitation'),{min:50, max:95,palette:palette }, 'Resampeled GPM',true);

How can I do this?


texts: Can arcserver be used to populate jquery autocomplete?

texts: I would like to set up autocomplete on a text box using jquery autocomplete with data from an arcserver service.  I'm wondering if this is possible and if so how i would implement it.  I'm using the esri javascript api v3.3 and arcserver 10.1.


texts: Gdal Python Problem : Black strips in geotiff

texts:
I am trying to use GDAL (2.0.0) Python API in Blender, but I am having some difficulties. I am trying to save geotiffs for :
 - a 2D numpy array storing 32bits floats
 - a 3 channels rgb numpy array of bytes [0-255].
When I do so in Python, I get two tiffs (a grayscale one that I can open in ImageJ, an RGB one I can open with anything) correctly geo-reference

The problem is that they have black strips in them, and it seems they are not at the same place everytime. In the console, I have several errors of the type:

ERROR 1: TIFFFillStrip:/home/.../test.tif: Invalid strip byte count 0, strip 269
...

The thing is that if I am using the code below to save the grayscale array, I get a correct image (not georeferenced), so I know the data array is correct

arr_2D_uint8 = arr_2D.astype(gdalnumeric.uint8)
gdalnumeric.SaveArray(arr_2D_uint8, filepath, format="GTiff")

Here is the code I  use for the grayscale, which is similar for the rgb image:

srs = osr.SpatialReference()
srs.ImportFromEPSG(epsg_code)
driver = gdal.GetDriverByName('GTiff')
ds = driver.Create(filepath, Nx, Ny, 1, gdal.GDT_Float32)
ds.GetRasterBand(1).WriteArray(arr_2D.astype(gdalnumeric.float32))
ds.SetGeoTransform( (NW_x, lx, rx, NW_y, ry, -ly) ) # define GeoTransform tuple : top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolution
ds.SetProjection(srs.ExportToWkt())
ds = None

And here is an example image :

EDIT :
Is anyone having the same issue ? I am now having the exact same problem but this time, trying to load a Geotiff. I am thinking this may come from a size limitation problem, since the geotiff I am trying to load is 3600 by 3000 pixels wide.

Do you think this may be causing the issue ? Else, does anyone have an explanation ? Do not hesitate if you need further descriptions.


texts: ArcGIS File Geodatabase import failure on TS-453Pro

texts:
This is a very device-specific question but maybe someone has ideas.

Our problem is that we cannot import files into our File Geodatabases that are stored on a NAS device. When the import function is run, only an empty table is created and no data is transferred.

Error messages attached.

I can:

Create new File Geodatabases on the NAS device
Create new data within file Geodatabases on the NAS from Catalog
Export data from a file Geodatabase to the NAS
Import data into a local Geodatabase

There's a lot out there about Geodatabase locks (which seems to be the issue) but nothing I can tie directly to this issue.

Hardware/Software info:

NAS = QNAP TS-453 Pro (latest firmware installed)
ArcGIS software 10.2.1
Platform Windows 7 Professional 64Bit


texts: Preparing layout to print multiple images on page using ArcGIS Desktop?

texts:
I want to print multiple images on a layout page with legends.

All images are the same size and same georeferencing.

How should I prepare it?


texts: Flow Direction flowing opposite to actual direction

texts:
I am using ArcMap 10.7.1.
I am trying to delineate multiple urban watersheds in GIS for the City of Denver (sometimes called sewersheds) using Spatial Analyst. I am looking at several drainage points along the South Platte River and trying to determine their catchment areas to understand what land uses/areas are draining to each drainage point. These points include surface water gulches and underground outfalls.
Up to this point, I have a relatively high resolution DEM and effectively 'burned' the storm sewer mains into the DEM to account for city drainage and get reasonable drainage paths for the underground outfalls. I was getting some weird looking watersheds for the surface water gulches as their flow accumulation paths weren't showing up. As a result I burned in the surface gulches and the South Platte River as well.
Half of the sites are on the left (western) side of the Platte and the other half are on the right (eastern) side of the Platte. The watersheds on the left side of the Platte look good as drainage goes from left to right into the Platte River. However, the watersheds on the right side don't work, as I've noticed that the flow direction is going the wrong way on GIS. Theoretically, it should be going right to left (east to west) draining into the Platte River; however, the flow direction raster GIS computed has the flow direction going left to right (west to east) which is wrong. It doesn't make sense as the elevation is increasing along the flow paths west to east, so GIS is saying that flow is going uphill. Technically the burned gulches and storm mains are at the same elevation, so maybe this is the problem? I've filled the DEM too. This thread had the same issue but I wasn't able to pull any solutions from it: Flow direction generated for river is incorrect
I'm not sure what to do now.


texts: FME - MapInfo to File Geodatabase Conversion Project

texts:
I'm about to start a big project converting 25,000 MapInfo files to File Geodatabase.  I'm using FME to process the files.  I want FME to search all files in a directory (and subdirectories).  When FME encounters a TAB file which references a raster, I get the following error:

  TAB files referencing raster data cannot be read through the MapInfo
  reader. Instead, use an appropriate raster reader.  Error fetching
  dynamic schema definitions from reader `MAPINFO_1'.

Is there some sort of format attribute for MapInfo files which will identify TAB files which contain geometry and which ones reference Rasters?  I would also like to identify TAB files which reference Excel files or Databases.

I could try skipping these by ignoring failed readers,

but I want to be able to list the TAB files that I'm skipping and store those in a spreadsheet or text file.


texts: how to obtain world seafloor geomorphology layer/raster

texts:
This article
http://gizmodo.com/heres-the-most-complete-ocean-floor-map-ever-made-1750109568
references an updated world ocean floor map. Where is it possible to obtain a raster layer to display in ArcMap?

I tried going to ESRI and NASA to find one.


texts: How do I load layers defined by PostGIS views in QGIS 2.18?

texts:
I have a layer that is defined by a complex SQL query.   It works fine but I would like to move that complexity out of QGIS and into the data base so I can access it from elsewhere (GeoServer).

I have tried creating a postgres view which represents the layer by using the database manager in QGIS (save as view) and by creating the view from the database itself but when I try and load the layer it is marked with a '!' and I can not select it.

Yes this is a duplicate question (sorry I don't know how to insert a reference to it) but the answers to that question don't work with current (2.18) versions of QGIS.  In particular they do not include the step to click on the schema button which is what I was missing.  I suspect that needing to do this is a bug but I will check this in QGIS 3 before reporting it as such.

The process of adding views is rather unintuitive and 'Get Spatial's explanation is clearer than any of the answers to the original question.  If we dump my question (feel free :) then please ensure that this answer gets added to the original one.

I note that several people besides me have up voted that answer.


texts: ArcGIS Server 10 not publishing map services

texts:
In the past week, I managed to set up ArcGIS Server on the server but subsequently encountered errors when publishing a web map in ArcMap.

I have set up the ArcGISSOC and ArcGISSOM accounts and given rights to the specific folders. However I encountered the following problems that I have attached screen shots and highlighted in RED.

The error reads,

"The SOC account cannot resolve the path to the data, or the SOC account has not been granted read permission to the data. In the case of ARCSDE, direct connect may not be configured properly or the SOC account may not have permission to access the database."

I also noticed under the (ArcGISSOM Inheritance) screen shot, under the inherited from tab, the status reads as <not inherited>, what could be the cause of this because from my understanding, the webmapping folder should have rights from the server drive. I also tried publishing from the ArcGIS server manager but it was unsuccessful.

Could you kindly assist in solving the problems that I am encountering so that I can effectively do the web mapping.


texts: Sentinel-2 satellite images not aligning with basemap

texts:
I'm downloading Sentinel-2 tiles from Amazon S3 but they dont seem to be 100 % aligned. Right image is band 08 Sentinel-2 added to ArcGis Desktop (i have done nothing more than adding the 08.jp2 to the map), left esri basemap photo. The offset in Sentinel is about 35-40 meters. How do i correct them?

This is the downloaded tile. Level-1C, Sentinel-2:

SOLUTION:

From HDunn's answer i did this:

Using a road vector layer i added five point pairs and calculated difference in x and y coordinates. The mean differences i used as xvalue and y value in Shift tool. Result:


texts: processAlgorithm problem with QgsLayoutItemLegend.model()

texts:
I've got a script which adds a legend to a print layout. It works perfectly as a script but when I try to implement this in the processAlgorithm of a QGIS plugin, it doesn't work.

If it is helpful, the full code for the plugin is here: https://github.com/epurpur/eco-valuator/blob/CreateAndExportPrintLayout/create_print_layout_and_export_map.py

I'm pretty sure the problem is with the following line:

legend.model().setRootGroup(root)

Here is my script (outside the plugin):

"""This creates a new print layout"""
project = QgsProject.instance()
manager = project.layoutManager()
layout = QgsPrintLayout(project)
layoutName = "PrintLayout"

layout = QgsPrintLayout(project)
layout.initializeDefaults()
layout.setName(layoutName)
manager.addLayout(layout)

"""Gathers active layers to add to legend"""
checked_layers = [layer.name() for layer in QgsProject().instance().layerTreeRoot().children() if layer.isVisible()]
layersToAdd = [layer for layer in QgsProject().instance().mapLayers().values() if layer.name() in checked_layers]
root = QgsLayerTree()
for layer in layersToAdd:
    print(f"Adding {layer.name()} to legend")
    root.addLayer(layer)

"""This adds a legend item to the Print Layout"""
legend = QgsLayoutItemLegend(layout)
legend.model().setRootGroup(root)
layout.addLayoutItem(legend)
legend.attemptMove(QgsLayoutPoint(246, 5, QgsUnitTypes.LayoutMillimeters))

This adds a nice legend, with just the active layers:

When implemented in the processAlgorithm of my plugin, I either get a map with no legend or QGIS crashes. So something is broken. To help troubleshoot, I added a print statement in my for loop when adding layers to my "root" object, and this works correctly. The next time I interact with "root" is in this line (as stated above):

legend.model().setRootGroup(root)

To spare you another long code block, my processAlgorithm is EXACTLY the same code except it is all nested within this:

 def processAlgorithm(self, parameters, context, feedback):
    """This actually does the processing for creating the print layout and exporting as .pdf"""

    log = feedback.setProgressText

    rest of code exactly as it was above

If I comment out all lines related to gathering just the active layers:

between """Gather active layers...""" and root.addLayer(layer), and the line: legend.model().setRootGroup(root)

and then run my plugin, I get a legend (except it adds all layers and looks bad):

I asked a similar question on StackOverflow recently as I was having trouble with adding a map item to my print layout and Nyall Dawson was nice enough to provide me this function to include in my code:

def flags(self):
    return super().flags() | QgsProcessingAlgorithm.FlagNoThreading

and it worked! I was able to add a map object. But to be honest I don't know what this does, or if this issue is related.


texts: Mapcache installation in Red Hat Linux throws RHPG error when building from the source

texts:
I am trying to install MapCache in Red Hat linux 8 by building from the source. I am following the tutorial present in https://mapserver.org/mapcache/install.html. But when I run make command the following set of errors show up.
[ 87%] Built target mapcache
[ 89%] Linking C executable mapcache_seed
/usr/local/lib/libgdal.so: undefined reference to `PQresultStatus@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQcmdStatus@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQfname@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `lo_read@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQexec@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQsetClientEncoding@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQsetNoticeProcessor@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQgetlength@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQputCopyData@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQftable@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQstatus@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQftablecol@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQgetResult@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQfinish@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQconnectdb@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `lo_write@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQerrorMessage@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQclear@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQnfields@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `lo_open@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQexecParams@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQescapeStringConn@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `lo_close@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQputCopyEnd@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQntuples@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQgetvalue@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQgetisnull@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQresultErrorMessage@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQftype@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `PQfmod@RHPG_9.6'
/usr/local/lib/libgdal.so: undefined reference to `lo_creat@RHPG_9.6'
collect2: error: ld returned 1 exit status
make[2]: *** [util/CMakeFiles/mapcache_seed.dir/build.make:96: util/mapcache_seed] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: util/CMakeFiles/mapcache_seed.dir/all] Error 2
make: *** [Makefile:130: all] Error 2


texts: Is there a GroupRenderer in ArcGIS for javaScript?

texts:
Is there a GroupRenderer or similar functionality in ArcGIS for JavaScript?

What I would like to do is to show PictureMarkers with a label showing an attribute on the Graphics object.


texts: How to split a polygon into multiple equal-width polygons in ArcMap 10?

texts: I am adding parking spaces into a parking lot, and I need them to be exactly the same shape and not overlap each other or have spaces between. In ArcMap 9.3, there was an editing task that allowed you to split a long rectangle into multiple, equal-width polygons. I am having trouble finding this tool in ArcMap 10. Does anyone know how to do this?


texts: I have a table in PostgreSQL. And it has no X and Y coordinates. But, it has a geom column with the WKT. Also, I have created an empty column called LAT and other called LONG. So, what I want is to write the Latitude and Longitude of the WKT column for each point. How can I do that?


texts: How to deal with QGIS Viewshed analysis MemoryError?

texts:
I have one SRTM Dem file and one point on it. I'm trying to use the Viewshed Analysis plugin for QGis to calculate the viewsheds from that point. Instead, I get this kind of error:

Traceback (most recent call last):
File "C:/Users/Bogo/.qgis2/python/plugins\ViewshedAnalysis\viewshedanalysis.py", line 194, in run
z_obs_field, z_target_field, curv, refraction)
File "C:/Users/Bogo/.qgis2/python/plugins\ViewshedAnalysis\doViewshed.py", line 496, in Viewshed
mx_dist = numpy.sqrt(temp_x[:,None] + temp_y[None,:])
MemoryError

I searched everywhere for a solution and I even installed the latest version of QGis, but with no luck.

Any help/ideas on what should I do to fix this? By they way, which version of QGis is the most stable according to you and which one doesn't have problems with plugins from the Processing Box?


texts: Help simplifying multipolygons in geodjango

texts:
I have a few multipolygons that have several hundred points in them. I'm looking to create less complex "thumbnails" polygons.

Naturally I'm attempting to use the simplify method, which is supposed to apply the Ramer-Douglas-Peucker algorithm. However, it doesn't seem to be working:

>>> m = Multipolygon.objects.get(id=1)
>>> m.geometry.num_points
1007
>>> m.geometry.simplify(0).num_points
1007
>>> m.geometry.simplify(1).num_points
0
>>> m.geometry.simplify(0.5).num_points
0
>>> m.geometry.simplify(10).num_points
0

I'm clearly missing something. When I simplify, I either get the original polygon back or an empty one, depending on the tolerance value that I use. How is the tolerance parameter supposed to work?


texts:
I'm getting an invalid syntax error on line 20. Anybody see what's wrong?

import arcpy
import os

geo1 = GetParameterAsText(0)
goe2 = GetParameterAsText(1)
saveLoc = GetParameterAsText(2)
exportLoc = GetParameterAsText(3)

mxd = arcpy.mapping.MapDocument('CURRENT')
mxd.findAndReplaceWorkspacePaths(geo1, geo2)

df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd, "BLOCK", df):
    if lyr.name == "BLOCK":
        df.extent = lyr.getSelectedExtent()
df.scale = 10000

arcpy.RefreshActiveView()
mxd.saveACopy(os.path.join(saveLoc, (mxd.title + ".pdf"))
arcpy.mapping.ExportToPDF(mxd, (os.path.join(exportLoc, (mxd.title + ".pdf"))))

del mxd

The error I get is:

Executing: ReplaceWorkspacePathandExport \\Client\L$\17TSLB002_Morice\A95421_1_NO_82\Submission_GDB\A95421_1_TBA_Digital_Sub_July24_2017.gdb \\Client\L$\17TSLB001_Bulkley\A71932_1\Submission_GDB\A71932_1_TBA_Digital_Sub_Dec13_2017.gdb \\Client\L$\17TSLB001_Bulkley\A71932_1\Submission_PDFs \\Client\L$\17TSLB001_Bulkley\A71932_1\Submission_PDFs
Start Time: Thu Dec 14 11:07:15 2017
Running script ReplaceWorkspacePathandExport...
Failed script ReplaceWorkspacePathandExport...
SyntaxError: invalid syntax (ReplaceWorkspacePaths_and_Export2.py, line 20)
Failed to execute (ReplaceWorkspacePathandExport).
Failed at Thu Dec 14 11:07:15 2017 (Elapsed Time: 0.48 seconds)


texts: Avoiding invisible points when using fixed style in QGIS?

texts:
We often need to load measured data using predefined color style to make it simple and easy to compare layers with each other.

We have something like this:

the problem is that sometimes there are wrong data / outliers much higher than the upper class.

This results in "invisible" points in QGIS. Is there any nice way to change the style and somehow make QGIS to also display the data outside the style classes?

I mean without asking the user to reclassify the data in style settings or using a "dynamic" style (which changes all class definitions).

The only solution I have found so far is expanding the last class range to upper value like 999999 without changing the legend description.

Do you know better solution?


texts:
I have an issue with the tool "region group".
When I run my model, it always fails because of the region group tools.

The error state this:

  ERROR 999999: Error executing function. The table was not found.
  [VAT_BluespotRegions] A column was specified that does not exist. A
  column was specified that does not exist. The table was not found.
  [VAT_BluespotRegions] ERROR 010067: Error in executing grid
  expression.  Failed to execute (Region Group (2)).

I am not sure what table it is looking for, and why I need that table.

My model looks like this.

Someone who has similar experince with "region group tool", and knows how to fix it?


texts:
I have a problem to convert UTM datasets in to a .gpx file.
The dataset (800 sets) is like this:Name Number (Zone East North for UTM)
Adam-Riese-Strasse 40 (32U 5550307,25 475061, 14).
After importing from text file, I would like to convert the Layer, the problem is that I must select a field that contains MGRS coordinates. But I have 3 fields with coordinates.
I have no idea how to continue. File:
Name Number Zone East North
Adam-Riese-Strasse 36 32U 5550231,21 474947,80
Adam-Riese-Strasse 37 32U 5550232,80 474949,70
Adam-Riese-Strasse 38 32U 5550290,58 475033,05
Adam-Riese-Strasse 39 32U 5550298,99 475047,33
Adam-Riese-Strasse 40 32U 5550307,25 475061,14

http://up.picr.de/32303039ss.jpg
I believe in the import I'm still doing something wrong. my layer has a different icon than yours. It looks like a word document icon in front of the name. in your picture it is a dot in front of the name I do not get anything in the map


texts: GDAL Translation gives incorrect GeoTIFF Projection

texts:
I am very new to GIS.
I am trying to translate a single band of a NetCDF file to a GeoTIFF file, and then load it up into QGIS and have it overlap with a shapefile of the US. However, when I load up the shapefile and the GeoTIFF, I am not getting any overlap.

The top left is the shapefile, the bottom right is my GeoTIFF.
Here's the command I'm using to do the translation:
gdal_translate -a_srs EPSG:4326 NETCDF:evap.mon.mean.nc:evap -b 1 -of GTiff test2.geotiff
I have tried a wide variety of a_srs values but none seem to give the results I want.
Does anyone know what is going wrong here?
Result of gdal info:
Band 485 Block=349x1 Type=Float32, ColorInterp=Undefined

  NoData Value=9.96920996838686905e+36

  Unit Type: kg/m^2

  Metadata:

    actual_range={-0.53373265,2.7928879}
    coordinates=lat lon
    dataset=NARR Monthly Means
    GRIB_id=57
    GRIB_name=EVP
    grid_mapping=Lambert_Conformal
    level_desc=Surface
    long_name=Monthly accumulated total evaporation at Surface
    missing_value=-9.96921e+36
    NETCDF_DIM_time=1922592
    NETCDF_VARNAME=evap
    parent_stat=Mean
    standard_name=water_evaporation_amount
    statistic=Mean
    units=kg/m^2
    valid_range={-4,20}
    var_desc=Evaporation amount
    _FillValue=9.96921e+36

Also, when I open the GeoTIFF with RasterIO, it gives this warning:
NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)

Could that be the issue?
EDIT 02/18/2021:
Found this question and I saw it was unanswered. If anyone else is facing this issue, I can help. I was using the gdal_translate command which DOES NOT perform geospatial reprojection. I solved this by instead reprojecting using the gdalwarp command, and then using gdal_translate to convert the NetCDF to a GeoTIFF.


texts:
As you can see from the attached sample map, the Esri basemap credits are overpowering and reduce the cartographic design of the entire map.  These credits appear to be new to 10.1 and essentially make these maps unusable in any sort of publication.

Is there a way to remove the credits?


texts: ArcGIS 10 PDF exports: toggle polygon layer visibility?

texts:
In the past I have been able to export my .mxd to PDF and I have been able to turn individual point layer's visibilty on/off within the layer tab (if the layers are in a groub in the .mxd's table of contents). See the below screen shot, where all layers under 'Act booked' can be toggled.

When I try this with polygon layers, the option to turn on/off visibilty of these layers within the PDF is not there.

As far as I can see I have used the same export options for both .mxds; 'Export PDF Layers Only' is selected for both.

Is it simply not possible to export polygon layers individualy or am I missing something here?

I'm using ArcGIS 10.0, SP5 on windows XP.


texts: Selecting feature interactively (mouse click) in ArcGIS ModelBuilder?

texts:
I am trying to create a model using ArcGIS ModelBuilder.

The model intends to display the attribute of the selected feature. I intend to select the feature using the 'select by location' option. However, I need to specify the input feature interactively (mouse click).

Can anyone guide which option/tool can help me select features interactively in ArcGIS?


texts:
I am currently trying to build my first multimodal network using ArcGis 9.2. This is a test using simple data of what I will need to do later with more complex data.

Here is my data:

layer 1: One shapefile containing a line feature. It's the main road.
layer 2: One shapefile containing a polyline feature. These are the
secondary roads.

My problem is that layer 1 has not been created as connected to the features in layer 2 (created as a long line). As a consequence, there is no vertex where two features intersect, they simply overlap.

To be clearer here is a picture:

The blue line is layer 1, the black ones is layer 2 (all the vertices belong to the feature where they stand).

How can I make to overlapping lines intersect so they can understood as connected when I build my network?


texts:
I'm working on some images taken from a UAV over the course of a year. They are OSGB 1936 projection as is the whole project. Annoyingly they don't quite line up so I am trying to a few of the images using the georeferencer tool.

The problem is, is that when I run it, the resulting alignment is miles away.

You can see from the georeferencing screen that it doesn't need to move much. Every tutorial I've seen assumes that it's a completely new image, i.e. jpg or something, that needs referencing rather than a previously referenced image. Am I going about this the wrong way?


texts: How to use pgRouting (pgr_drivingDistance) with GTFS?

texts:
I used gtfs2pgrouting to import gtfs data in postgresql, then I have these tables

List of relations
 Schema |    Name     | Type  |  Owner
--------+-------------+-------+----------
 gtfs   | agency      | table | postgres
 gtfs   | calendar    | table | postgres
 gtfs   | frequencies | table | postgres
 gtfs   | routes      | table | postgres
 gtfs   | shapes      | table | postgres
 gtfs   | stop_times  | table | postgres
 gtfs   | stops       | table | postgres
 gtfs   | trips       | table | postgres
(8 rows)

(several tables as "shapes" are empty)

But is it possible to use pgr_drivingDistance on this or is it another way to do it? My goal is to create isochrones

Thanks


texts:
I am currently importing a bz2 country file into PostgreSQL 9.1 database for Nominatim 2 using its setup.php that runs osm2pgsql.

After processing the nodes. it seems to be stuck at a certain spot for hours without any changes and both CPU/memory usage for the server went down to idle levels.

Any idea what happened? The full output can be found here.

Output Snippet

                            addgeometrycolumn
--------------------------------------------------------------------------
 public.import_polygon_error.prevgeometry SRID:4326 TYPE:GEOMETRY DIMS:2
(1 row)

                            addgeometrycolumn
-------------------------------------------------------------------------
 public.import_polygon_error.newgeometry SRID:4326 TYPE:GEOMETRY DIMS:2
(1 row)

CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE INDEX
CREATE TABLE
ALTER TABLE
Partitions


texts: Cannot Select 'Input line or polygon vector layer' when trying to simplify Shapefile

texts:
I'm trying to simplify a Shapefile by opening it in QGIS, Go to the Vector menu, selecting Geometry tools, and selecting Simplify Geometries...

When I do this I get a modal window that I can fill out completely except the very first menu titled 'Input line or polygon vector layer.'

Can anyone help me understand why this might be?


texts: Projection issue causing clipping issue in R, different proj4 strings

texts:
I am trying to clip a grid of points to a vector polygon layer in R, but am encountering an odd error I can't figure out. The goal is to get a new layer that has the grid points, but only as clusters in the shape of the polygons, as invisible boundaries. I am working in R.
Here is my code:
library(sp)
library(rgdal)
library(raster)
library(rgeos)

polygons <- readOGR("C:/PATH_TO_FILE/POLYGONS.shp")
polygons <- gBuffer(polygons, width=0, byid=TRUE)
grid <- makegrid(polygons)
grid <- SpatialPoints(grid, proj4string = CRS(proj4string(polygons)))
clip <- gIntersection(polygons, grid, byid=TRUE, drop_lower_td=TRUE)

I am left with the following error:
spgeom1 and spgeom2 have different proj4 strings
I ran the following to see what proj4 string was set for each layer using:
proj4string(polygons)
proj4string(grid)

It is revealed that they are both in the same projection (or CRS. I am still a bit confused about the terminology, so please excuse me for that)
This reveal for the polygons:
CRS object has comment, which is lost in output[1] "+proj=lcc +lat_0=40.1666666666667 +lon_0=-74 +lat_1=41.0333333333333 +lat_2=40.6666666666667 +x_0=300000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs"
And for the grid points:
CRS object has comment, which is lost in output[1] "+proj=lcc +lat_0=40.1666666666667 +lon_0=-74 +lat_1=41.0333333333333 +lat_2=40.6666666666667 +x_0=300000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs"
So I cannot figure out why I am getting the error message. How can I fix this? Is there an extra needed step for re-matching the projections of the two layers? I am confused why they would be in different projections if the grid was made based on the polygons.
When I try plotting using:
plot(clip)
I get this error:
Error in plot.window(...) : need finite 'xlim' values
So something must be quite wrong here, since I am not seeing the points clipped to the polygon boundaries.


texts: Clean way to cancel QGIS processing scripts from gui

texts:
I've written a QGIS processing script that carries out a closest facility analysis. Taking the complete input data set (20k adresses as start points, ~100 target points, OSM road network with ~13k linestrings) the script runs about 3 hours, and therefore makes use of various progress indicators, to make shure to the user that it's still alive (log output, progress bar, time remaining,  rubber bands indication the way to closest facililty just processed, cp. screenshot below):

Now I would like to cancel the running script and as far as I can see, this can only be done with [X] top right in the processing script gui window.

But doing so, the script remains processing as indicated by the blue rubber bands as well as the processing time and the progress bar...

... and the system resources in the task manager:

However, couple of minutes (~14min) later on the script stops processing and the system is not consuming anymore resources:

Since the time span between closing the window and stopping processing seems fairly unpredictable to me, my question is: Is this a recommended way to cancel QGIS processing scripts, or are there other ways to cleanly cancelling such scripts from the gui?


texts:
I am attempting to import a CSV file as a delimted text layer that has decimal values into QGIS 3.2.  Whenever I do so, instead of QGIS reading the decimal values as real or double, it reads them as strings!

Interestingly, while I was working on the project as a draft prior to saving it, I had no problem with QGIS reading the data properly.  It seems that once I saved the project, QGIS is failing to read my imported decimal values properly.


texts:
HP5500PS A0 won't speak properly to QGIS.

When sending a plot via composer it plots a smaller print (less than A5 size) on an A0 piece of paper.

How can I get it to print an A0 map without changing it to pdf?

We produce A0 paper maps for our customers holding large datasets - too big to save to PDF and print off - quality degrades.


texts: Labels with buffers creates bloated PDF file in Composer

texts:
I know this question has appeared before, but the earlier questions appear to be linked to the old labeling engine. I'm running qgis 2.0, which I thought uses the new-generation labeling engine. In my map there are three labels (not three layers, but just three labels) that are buffered. The pdf file grows from 1MB to 18MB by turning on buffering.

Am I wrong in thinking that 2.0 uses the new labeling engine? The rest of the team I'm working with is on 2.0 and moving everyone is not easy for a variety of reasons.


texts: Running only selected lines in Google Earth Engine

texts: I would like to run only selected lines instead of the full script in Google Earth Engine. Is there any way to do so?


texts: Pass a variable from Modelbuilder into a Python script

texts:
I'm new to modelbuilder and python.
I have used modelbuilder to iterate through all rows in a shapefile (Points), process them, and produce a seperate output shapefile for each row.  The filename is generated using an inline variable (I think that is the correct terminology).  i.e. all output files have identical filenames except that the value of the PointID from the original input file is appended to the filename to enable them to be distinguished.  This works fine.

I've also written a python script to take the above output files from the model one at a time and do additional processing.  At present the input filename is hard coded into the script (i.e. I have to edit the script to change the input filename each time I run it).  Again this works fine while just processing a single file. However, I want to integrate the model and the python script so that I can run the script for each row in the original feature class automatically.

My question is therefore, how do I replace the hard coded name of the input file with a variable in the python script and how do I pass the filename to the script.


texts: Specifying region in export image in GEE Python API

texts:
When I export an image in GEE code editor  I can pass a geometry to the 'region' parameter without problem. However, it doesn't work for Python API and I get below error for the shown code:

task = ee.batch.Export.image.toCloudStorage(
    image=imageOfSeries.toArray(),
    description=AssetName,
    fileNamePrefix=AssetName,
    bucket=GCbucketName,
    scale=scale,
    region=box,
    fileFormat='TFRecord',
    formatOptions={
        'patchDimensions': [patch_size, patch_size],
        'tensorDepths': [tDepth],
        'compressed': True
    }
)

Traceback (most recent call last):
  File "D:/Shahriar/OneDrive - SUNY ESF/Thesis/Codes/Landsat_Classification/ExtractLandsatArrayImage.py", line 205, in <module>
    'compressed': True
  File "C:\Python36\lib\site-packages\ee\batch.py", line 332, in toCloudStorage
    Task.ExportDestination.GCS)
  File "C:\Python36\lib\site-packages\ee\batch.py", line 854, in _prepare_image_export_config
    _canonicalize_parameters(config, export_destination)
  File "C:\Python36\lib\site-packages\ee\batch.py", line 1418, in _canonicalize_parameters
    config['region'] = _canonicalize_region(config['region'])
  File "C:\Python36\lib\site-packages\ee\batch.py", line 1503, in _canonicalize_region
    return json.dumps(region)
  File "C:\Python36\lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "C:\Python36\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python36\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Python36\lib\json\encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'Geometry' is not JSON serializable

How can I solve this problem?


texts:
I'm new in Carto. I have been trying to figure out how Maps are used, I tried this code that is in the web; however the map is never displayed.

from cartoframes.auth import set_default_credentials, Credentials, get_default_credentials
from cartoframes.viz import Map, Layer

set_default_credentials('cartoframes')
current_creds = get_default_credentials()

Map([Layer('countries')])


texts:
qgis2web is a plugin for QGIS which creates webmaps. This question is about its OpenLayers 3 export. It exports QGIS layers to geoJSON to pull into the OL3 map. It writes them in EPSG:4326, as I believe this is at least a proposed standard for geoJSON. This works for default (EPSG:3857) OL3 maps.

However, I am trying to implement support for multiple projections in qgis2web.
I cannot get the geoJSON EPSG:4326 points to display on the OL3 map if it uses any projection other than EPSG:3857.

A sample qgis2web OL3 map is here: https://www.dropbox.com/s/76ru3x1b6mvjpc3/epsg_27700.zip?dl=0. Can anyone help me figure this out? What am I missing?


texts:
I'm responsible for updating many spatial datasets within my organisation. Some data suppliers notify me of a change, some suppliers don't. Sometimes it's not easily apparent if the data has changed at all.

I'm starting to become proficient in pyqgis. It occurs to me I could automate the downloading of a dataset, save it off as a shape, get an area size, number of features (or whatever makes sense) and compare these values to those previously recorded.

This could be scheduled to run at night time to reduce peak load on my organisations and our suppliers hardware.

Before I start, can anyone tell me if there is a more efficient way to do this. Take for example this WFS URL (super light weight at 23 features). I can't see how there could be a better way, but then again I don't know what I don't know.

http://www.geostore.com/OGC/OGCInterface?SERVICE=WFS&UID=UDATAGOV2011&PASSWORD=datagov2011&INTERFACE=ENVIRONMENTWFS&VERSION=2.0.0&LC=200000000000000000


texts: Determining projected coordinate system for area in Italy

texts:
I am working in ArcGIS and I have calculated the slope which shows higher values which is unusual. I came to know about projected coordinates system. I am working on a lake located in Italy.
Which projected coordinate system should I use for Italy?
I obtained elevation data from DEM downloaded from STRM 90 m resolution.


texts: Mapping over a reduceRegions command in Earth Engine

texts:
I have a feature collection of about 80,000 tiles, and I am trying to calculate the annual maximum drought severity index score for each tile using TerraClimate data. TerraClimate is an image collection, so I started by transforming it into a stack of images.
var drought_M = ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE").select("pdsi")
    .filter(ee.Filter.date('2000-01-01', '2012-12-31'));

//This function creates a stack of images from the image collection
function newCollectionToImage(collection){
    var stack = ee.Image(collection.iterate(function(img, prev) {
        return ee.Image(prev).addBands(img);
    }, ee.Image(1)));

    stack = stack.select(ee.List.sequence(1, stack.bandNames().size().subtract(1)));
    return stack;
}

//This function renames the image collection bands
var drought_M_rename = drought_M.map(function(img){
var y = ee.String(ee.Date(img.get('system:time_start')).get("year"));
return img.set("year",y).rename(y);
});

//Apply the function to create a stack of images
var droughtImageStack = newCollectionToImage(drought_M_rename);

I tried to use reduceRegions() to get the monthly score for each tile.
var droughtImageStack = tchImg.reduceRegions(tiles, ee.Reducer.mean());

This works in the terminal, but when I try to export the dataframe as a csv, GEE returns the error:
Error: User memory limit exceeded.

I've been told before that image reductions become a lot more efficient when you map over the feature collection. I tried to use the basic intuition of how to map over a feature collection for reduceRegion() and attempted the following:
var droughtTiles = tiles.map(function(feature) {
  return feature.set(droughtImageStack.reduceRegions({
    reducer: ee.Reducer.mean(),
    geometry: feature.geometry(),
    scale: 10
  }));
});

But this map function returns an error: Required argument (collection) missing to function: Image.reduceRegions(image, collection, reducer, scale, crs, crsTransform, tileScale)...
How can I adjust my mapping function to produce monthly tile means that export?


texts: Add Layers to an Existing Map Service Hosted on ArcGIS Server

texts:
We store our web services on ArcGIS Server and use ArcMap 10.6 to publish them. Is there a way to add new layers to an existing service rather than a complete overwrite every time I publish?

I have a MXD where I add 10 or so layers every time I an update, but need to keep all existing layers that are in the GDB, in the hosted service. It seems like a waste of time to keep overwriting the same 100 layers over and over again, when I just need the new layers added to the service. Am I missing something in the packaging/authorization step to do this?


texts: How to build a portfolio for a GIS/Java career path?

texts: I have been a GIS Analyst for over 10 years and am currently studying java (50% through the course). My plan is to develop GIS applications mainly focused towards open source solutions. I would like to develop some form of a portfolio to gain more experience, but I am not sure what the best way to do this would be. I have thought about joining some groups/communities like Geotools, but I am concerned with my lack of experience. I feel I would be more of a hindrance than a benefit. The other idea, is that I could look at developing some in house applications or even some Android application to build up some credibility. If anyone could provide some suggestions, or share their similar experiences, it would be greatly be appreciated.  How should I go about building a portfolio from scratch to further my open-source GIS App career aspirations?


texts: Seeking dataset which contains traffic and path network?

texts:
I'm looking to purchase a road network (e.g ITN), preferably with a traffic dataset (such as ESRI Streetmap). I don't know if the road networks with integrated traffic can be joined with path networks such as OS urban paths.

Does anyone know if this can be done?

Alternatively, I would purchase OS ITN and Urban Paths, and buy a traffic dataset to join with them.

Does anyone know if this is possible?


texts: How to fix ImportError: cannot import name MAXREPEAT on Ubuntu 12.04

texts:
I have problem with installing qgis 2.0 on ubuntu 12.04.
If I don't install qgis-python plugin then qgis starts normally but I can't access python console in plugins.
If I install that plugin  then I can't even start qgis because it gives me error
ImportError: cannot import name MAXREPEAT

I believe someone have already had this problem so I'd appreciate if you could tell me how to fix it. Thanks


texts:
I am using this code to draw points on the map:

coordsArray.push(lat);
coordsArray.push(lng);
marker = L.marker(coordsArray, {
    icon: myIcon,
    clickable: true,
    draggable: 'false',
    title: layerStringToJson.properties.id
}).bindPopup(coordinates).addTo(map).on('click', onClick);

And I have this method to get individual marker properties:

function onClick(e) {
      //marker=layerStringToJson.properties;
      console.log(marker._latlng)
  }

But when I click on the markers, I always have the same result, always the same coordinates instead of the coordinates of every single marker.

Anyway the pop up shows the correct coordinates.

How can I get the individual properties of each marker?


texts: Removing slivers from merged polygon using ArcGIS

texts:
I have a merged shapefile composed of 3 polygon classes (sand, water, vegetation) from where users have traced over a satellite image.
There a few slivers I need to remove. These are very slim polygons that are man-made errors from tracing. For example, a small thin water polygon in the middle of the sandy beach, or a small sand polygon in the middle of the open ocean. (I have circled these errors with a red pen in the images below).
I wish to eliminate these very tiny polygons by having them merge to the polygon class that surrounds them. I have tried using the Eliminate Tool.
However, I am struggling to select all the erroneous slivers because 1) there are thousands of slivers so it not possible to manually select every erroneous sliver, and 2) not every tiny polygon is an error. This means selecting for slivers simply by length/area may lead to genuine polygons being deleted.
I would like a solution where a very small polygon that is more or less enclosed by another class is merged to the big class. For example, a tiny bit of sand in the middle of the ocean merges to the water class.
What I've tried:
To eliminate the sand slivers, I've dissolved each layer (water.shp, sand.shp, vegetation.shp) and merged them together to create a shapefile that has just 3 polygons (merged.shp with sand, water and vegetation). I've then tried to remove sand slivers by using the Eliminate Tool and selecting sand. I hoped this would only merge the very small sand polygons that are surrounded by water but instead it merged the whole sand layer with water. This resulted in a shapefile with just water and vegetation, rather than the elimination of sand slivers.
I've tried to use the Eliminate Tool with the non-dissolved shapefile. However, there are thousands of potentially tiny slivers, so it is not possible for me to select them all manually (as per required by the Eliminate Tool).
Currently using ArcGIS Pro 2.5
Note: This is a separate problem to my other question Erase tool not erasing all overlapping features in ArcGIS Pro. That post relates to issues in deleting overlaps that arose from a problem related to CRS. This post relates to how to best merge slivers when there are thousands to select from, not all of which are erroneous.


texts:
In the example at http://jsfiddle.net/gwulo/w6cvagoL/4/ I'd like to force only one overlay to be visible. So if you select Cities2 in the layer switcher, the Cities1 overlay should be de-selected.

I'm trying to use the overlayadd event:

    map.on('overlayadd', function(eo) {
    if (eo.name === 'Cities1') {
        this.removeLayer(cities2);
    } else {
        this.removeLayer(cities1);
    }
    });

When I click the Cities2 layer in the layer switcher, I'd expect the above function to be run once, with the parameter set to Cities2. In fact the function is called five times, with the parameter alternating between layers: Cities2 / 1 / 2 / 1 / 2

What causes the event to be triggered so often, and how can I identify which is the event I'm interested in and which I should ignore?


texts:
I'm looking for a web service providing a full address based on coordinates (and reverse).

I'm ready to pay for that service.

I don't want to use Google's API.


texts: Installing base deployment of ArcGIS Enterprise on standalone VM?

texts:
For the purposes of a demonstration, I'm trying to set up a base deployment of ArcGIS Enterprise on a standalone VM (VMWare Workstation) running Windows Server 2016 Standard. It seems that, as it's been billed by Esri, using the ArcGIS Enterprise Builder it should be straightforward. However, as with most things Esri, it's one step forward and two steps back. I've fallen down a rabbit hole of setting up a domain controller and certificate authority on the VM, and now I'm mired in issuing and configuring domain certificates. As I rained blows upon it, I realized that there had to be another way.

Can anyone provide a concise set of steps for getting a base deployment up and running on a standalone VM? Happy to contribute to writing a guide if we can get it working.


texts: Using Select Layer by Attribute in ArcPy?

texts:
I want that one variable takes input from the user and then we compare the value to the attribute.

val = input("Ask user for something.")

arcpy.SelectLayerByAttribute_management("Sample", "NEW_SELECTION", """ "ATTRIBUTENAME" = 'val' """)

In this as we have to put apostrophes around "val" it takes it as string not as variable whose value we want to compare. So any way by which we can do this?


texts:
I'm new to SQL.
I wrote a query to perform a join based on a common attribute. I am having problems displaying it because the column the_geom_webmercator doesn't exist.

My question is, is my table produced after the join a "view", is it a new table I can modify? It might be important to note I am bringing in data from a PostGIS db via enterprise. Reading through the documentation it seems I should just add a new column for the_geom_webmercator and populate it with the information from the_geom. How can I do this?

Here's what I have:

SELECT
  id, name, region_id, phone_number, feature_order, cartodb_id, latitude,
longitude, addressable_type,
  ST_SetSRID(    ST_MakePoint(
      longitude,
      latitude
    ),
    4326
  ) AS the_geom

FROM (SELECT
_d.id, _d.name, _d.region_id, _d.phone_number,
_d.feature_order, _add.cartodb_id, _add.latitude, _add.longitude,
_add.addressable_type, _add.the_geom

FROM addresses AS _add
JOIN places AS _d ON _d.id = _add.addressable_id

WHERE _d.open = 'true'  AND _add.addressable_type = 'store'

) AS _camshaft_georeference_long_lat_analysis


texts: SELECT DISTINCT from table in Geoserver SQL view

texts:
The postgis table I have has the following columns,

id | name | style_id | unique_id | time_stamp | the_geom(polygon)

and logically the unique constraint (not currently imposed in the db) lies with unique_id+time_stamp.

Sample data:

1 |  comp one   | 1 | comp1_u | 2012-11-02 11:00 | <comp1_geom>
2 |  comp two   | 2 | comp2_u | 2012-12-01 12:00 | <comp2_geom>
3 |  comp one 2 | 1 | comp1_u | 2012-12-01 12:12 | <comp1_geom>
4 |  comp three | 3 | comp3_u | 2012-12-01 12:00 | <comp3_geom>
5 |  comp two 2 | 2 | comp2_u | 2012-03-12 01:34 | <comp2_geom>
6 |  comp four  | 4 | comp4_u | 2012-12-01 12:00 | <comp4_geom>
7 |  comp five  | 5 | comp5_u | 2012-12-01 12:00 | <comp5_geom>

My objective is to create a GeoServer SQL View with only distinct elements based on unique_id from the table order by time_stamp.
ie., I want my Geoserver layer to show only the latest distinct elements.

I tried this:

SELECT DISTINCT on (unique_id) * from my_table order by unique_id,time_stamp desc

Though this command runs fine in the psql client, it doesn't seem to go well with the style specified for the WMS layer.

The style basically colors each element based on the style_id.

When the layer is displayed, neither comp1_u and comp2_u elements are styled properly nor can I view their info on click in the layer preview window.

Am I using the right query for the view or is there any workaround to achieve the above?

Thanks.

PS. Setup is: Postgres 9.1 with PostGIS 1.5 and GeoServer 2.2


texts: Estimate cross-covariance of seasonality (NDVI) and precipitation data with a harmonic regression model then visualize a chart from the model

texts:
The challenge is to estimate cross-covariance of seasonality (NDVI) and 30-day precipitation with a harmonic model.  I added the UCSB CHIRPS rainfall data as bands to all available Landsat 8 imagery and computed cross-covariance. Would it be possible to plot the covariance with the original NDVI data and obtain a chart of the plot. I have attempted this but received an error. The step at Line 183 creates an image and later when I try to map a function over that image it doesn’t work. I believe .map() will only work with a Feature Collection or Image Collection.
How do I get the covariance as a Image Collection, then use it in the harmonic model?
I have tried this code:
// var collection = ee.ImageCollection.fromImages(image.get('images'));
// return ee.Image(image).addBands(collection.mean().rename('mean'));

I have included the script.
Can you give me advice on what I might have to add or change?
Script is here: https://code.earthengine.google.com/ee49496c6bbc2ab3a83898c348d0ae48


texts: Cartodb - SQL query of public visualization of a private table

texts:
The team at CartoDB have recently(last few days) made some useful updates that now allow public visualisation maps to reference data in private tables.  The change has only been made in the last day or two to the public UI.

Is it possible to run a query on the maps visitations?  I have a bit of html that uses cartodb.js to query the data based on some sliders.

I now getting an exception thrown in the console:

  Uncaught Error: sql is read-only in NamedMaps

or

  Uncaught Error: cartocss is read-only in NamedMaps

The code is:

subLayerOptions = {sql: "SELECT * FROM ......(dynamic query)...",};
layer.getSubLayer(0).set(subLayerOptions);

The code will work if I make the table public again.


texts:
I want to calculate an intersection between two geometries with the intersection function from JTS Geometry.
What happens, if the geometries have different SRIDs?

SimpleFeature sf1=...;      //SRID 31467
SimpleFeature sf2=...;      //SRID 4327

Geometry geom1 = (Geometry) sf1.getDefaultGeometry();
Geometry geom2 = (Geometry) sf2.getDefaultGeometry();

Geometry overlay = geom1.intersection(geom2);

Does the function calculate the intersection in respect to the different SRIDs or does it ignore it?
Which SRID does the calculated geometry have?

I didn't find any documentation about that.


texts: Exporting coordinates to CSV with 2 decimals using PyQGIS?

texts:
I want to export a point-layer to a CSV using a plugin I am working on. Amongst other attributes, the coordinates are exported via layerOptions=['GEOMETRY=AS_XY']. Everything is working fine, however, I need the coordinates with only 2 decimals instead of the standard 10 for further processing in LaTeX.

Here's a minimum example of my code:

QgsVectorFileWriter.writeAsVectorFormat(layerPKT, QgsProject.instance().readPath("./")+'/KVZ_NEU.csv', "utf-8", layer.crs(), "CSV", True, layerOptions=['GEOMETRY=AS_XY'])

This is the output I get:

X,Y,PNR,KG,IND,GFN,KLASSIFIZI,BEVTYP
31490.0792899652,181684.344823149,"1","75314",,,n,GP

And this is the output I want:

X,Y,PNR,KG,IND,GFN,KLASSIFIZI,BEVTYP
31490.08,181684.34,"1","75314",,,n,GP


texts: Changing individual text colour in Label Expression using Python in ArcGIS

texts:
I'm basic at Python and I would like to change a single value colour to red, in this case the 6.36 value.

I'm using this code:
[Nazwa] + "/" + [PPW]  + "/" + [DPW]

So I wanted to change the colour of [DPW] to red. I was also thinking about using string, due to summing up the values before, don't know why.
str( [Nazwa] ) + "/" + str( [PPW] )  + "/" + str ( [DPW] )


texts:
I have a world country map with a field of showing dengue data in some countries.

I want to label only those country with dengue data in the map. I do not know how to do that in ArcGIS. Can anyone please help me with this?


texts: Repairing data sources using ArcGIS for Desktop?

texts:
I work with MXD file that contain 50 layers (all layers located in different folders), some of them have broken Data source:

The problem is that anytime i try to repair all the layers data source simultaneously, with right click on the layer name in the table of content:

all the layers get the same path- and that absolutely wrong and mistake. How can i change each layer to her right path simultaneously using ArcGIS 10.3 for Desktop?


texts: QuickOSM downloads data outside of the extent of a specified polygon layer

texts:
I have several polygon/multipolygon shapefile layers, and used QuickOSM's Quick query to download waterways within that polygon layer by clicking "Extent of a layer" and choosing a polygon layer. But QuickOSM not only downloaded the waterways within the polygon but also those adjacent to/outside it. It looks like QuickOSM downloaded the waterways as a box/rectangle and not as the specified polygon shape.

How could I download the waterways only within the polygon layer?


texts: Rename section and change order of sections in QGIS Reporter

texts:
I am new to the qgis reporter and am wondering, if I can change the name of different sections and also change the order of the sections.

In my report, I will have approx. over 10 sections, and it would give me a much better overview if I can name the sections myself.

I searched on the web and watched a few tutorial videos, but am not able to find a solution. Any suggestion would be of great help.


texts:
I've installed rasterio using pip, I want to run command line rio, but I have this traceback:

 Traceback (most recent call last):
  File "/usr/local/bin/rio", line 7, in <module>
    from rio.manage import main
  File "/usr/local/lib/python2.7/dist-packages/rio/__init__.py", line 5, in <module>
    from .app import create_app
  File "/usr/local/lib/python2.7/dist-packages/rio/app.py", line 11, in <module>
    from rio.setup import configure_app
  File "/usr/local/lib/python2.7/dist-packages/rio/setup.py", line 10, in <module>
    from .core import db
  File "/usr/local/lib/python2.7/dist-packages/rio/core.py", line 14, in <module>
    from flask_user import UserManager
  File "/usr/local/lib/python2.7/dist-packages/flask_user/__init__.py", line 9, in <module>
    from flask_login import LoginManager, UserMixin as LoginUserMixin, make_secure_token
ImportError: cannot import name make_secure_token

What does it mean?


texts:
I have a point pattern (see below) in which I assume to find "significant" lines of points. However, I did not find any method that is integrated in a GIS or in R that searches for such line pattern in a spatial point pattern. There is one method that is implemented in the free software called PAST (http://folk.uio.no/ohammer/past) called point alignment.

the method is described in :

  Hammer, Ø. (2009). New statistical methods for detecting point alignments. Computers & Geosciences, 35(3), 659-666.

beyond this method I am not aware of any tool that finds lines in point patterns. Any hints on possible tools, r-packages, etc. are most welcome.


texts: Automatic batch update a file geodatabase from shapefiles

texts:
Every week I need to update the same shapefiles that are used to produce up to date maps. The files are downloaded from 3 different web-servers.

The thing I want to do is to have a script that can search my folder where I put my downloaded shapefiles and replace the ones I've already got. This shouldn't be a problem when the shapefiles have the same name. But still, I can't seem to figure out how to solve this problem. What to use, model builder? Python script?


texts: Exporting maps as PNG along a predefined grid

texts:
I need to export a series of maps along a predefined grid across a state. I'm trying to automate the process with arcpy. Right now I manually choose to export a TIFF file at 500 dpi resolution,  8-bit palette, no compression, and background color set to “no color”. The built in arcpy.mapping.ExportToTIFF code does not support “no color" as a background option.

I'm trying to use arcpy.mapping.ExportToPNG but I can't seem to get the arguments right. I think the problem is with my data frame, df_export_width, or df_export_height arguments. I tried to set up a code following this example, but the code to generate height and width always came back as 0, and didn't work.

My code is below, set up for the state of Colorado. I'm using ArcGIS 10.3.1. Any thoughts?

Import arcpy

#build list of all gridsquares
grid=list(range(64))
del grid[0]
#load predefined grid for Colorado
CO_net="C:\Data\CO.GDB\CO_net"

resolution=500

for g in grid:
    select="OID="+str(g)
    arcpy.SelectLayerByAttribute_management("CO_net","NEW_SELECTION",select)
    mxd = arcpy.mapping.MapDocument('CURRENT')
    export= "C:\Data\CO"+str(g)+".png"
    df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]
    df.zoomToSelectedFeatures()
    df.scale=250000
    arcpy.RefreshActiveView()
    arcpy.mapping.ExportToPNG(mxd,export,df,,,resolution,"TRUE","8-BIT_PALETTE","255, 255, 255","255, 255, 255")


texts: Why doesn't LeafletJS complete the conversion when re-projecting to Spherical Mercator?

texts:
When I use the Mapbox Leaflet pre-packaged Projection class SphericalMercator to project a lat/long coordinate into EPSG:3857 I have to multiply the result Leaflet provides by the earth's radius.

var latlng = L.latLng(45, -120);
var sphericalMercator = L.Projection.SphericalMercator.project(latlng);

The following is what Leaflet returns:

sperhicalMercator.x => -2.0943951023931953
sphericalMercator.y => 0.8813735870195429

But the actual answer is (-13358338.8952, 5621521.48619), which I got by multiplying the results returned by Leaflet by 6,378,137 (earth's radius in meters).

var actualAnswerX = sphericalMercator.x * 6378137;
var actualAnswerY = sphericalMercator.y * 6378137;

Am I missing something?


texts: Get Z value into attribute table from KMZ

texts:
I have extracted GPS data from photos using geosetter, so that I can then import them into ArcGIS Pro as a shapefile. This I can do but when I try to write the XYZ coordinates to the attribute table using either the 'Add XY Coordinates' or 'Add Geoemetry Attributes' tools I get a 0 or null respectively for the Z value, (the XY coordinates are written correctly).
This is despite the fact that the features have Z values which are displayed in the pop up when querying a point.

How do I get this data into the attribute of my shapefile or feature class?


texts: Peaks up to N kilometers from borders (Overpass)

texts:
I'm trying to extract peaks that are within and up to say 100 kilometers away from country boundaries. The second part is however what I cannot get right.

How to query for nodes up to N kilometers away from an area in Overpass Turbo?


texts: Why are there my_form_open() Python functions in my QGIS project file?

texts: I have a project open with 6 layers (MapInfo .tab format), have set the style for each layer and added labels for 1 of them. So for a simple project the .qgs file is about 2000 lines long and among other things I can't quite make sense of there are 6 (duplicate) examples of a Python function my_form_open(dialog, layer, feature) in the .qgs file (1 for every layer?). Does anyone know why they are there in the first place and then why would it write out the example 6 times...? the function doesn't have a return statement so it wouldn't work anyway


texts: Adding circle polygon to folium map (using OGR and Python) creates an oval - why?

texts:
I am new to OGR and Folium but learning fast. In short, I have an issue which I think might be a projection problem.

Basically, I have three circles plotted in folium that work fine. Then I have a fourth circle that I created with OGR, by adding a point then buffering it and plotting the geoJSON polygone onto the folium map. This fourth circle comes out as an oval, see:

The code to make this is as follows:

import folium
import pandas as pd
import json
from numpy import median
from osgeo import ogr

# MY CO-ORDINATES -- FOUR POINTS

datatest = pd.read_csv('data.csv')

p1_lat, p1_lon, p2_lat, p2_lon, p3_lat, p3_lon, p4_lat, p4_lon = datatest['POINT1_LAT'], datatest['POINT1_LON'], datatest['POINT2_LAT'], datatest['POINT2_LON'], datatest['POINT3_LAT'], datatest['POINT3_LON'], datatest['POINT4_LAT'], datatest['POINT4_LON']

# CENTER THE MAP

middle_lat = median([p1_lat, p2_lat, p3_lat, p4_lat])
middle_lon = median([p1_lon, p2_lon, p3_lon, p4_lon])

testmap = folium.Map(location=[middle_lat, middle_lon], zoom_start=13)

# MAKE THREE FOLIUM CIRCULES

folium.Circle(location=[p1_lat, p1_lon], popup='Point 1A', fill_color='#000', radius=2000, weight=2, color="#000").add_to(testmap)
folium.Circle(location=[p2_lat, p2_lon], popup='Point 1B', fill_color='#000', radius=2000, weight=2, color="#000").add_to(testmap)
folium.Circle(location=[p3_lat, p3_lon], popup='Point 1C', fill_color='#008080', radius=1000, weight=2, color="#008080").add_to(testmap)

# MAKE A FOURTH CIRCULE IN OGR

p4_lat = float(p4_lat[0])
p4_lon = float(p4_lon[0])

point_four = ogr.Geometry(ogr.wkbPoint)
point_four.AddPoint(p4_lon, p4_lat)

bufferDistance = 0.01
poly = point_four.Buffer(bufferDistance)

geojson_poly = poly.ExportToJson()

# STYLING THE FOURTH CIRCLE (IGNORE THIS)

import random

def random_html_color():
    r = random.randint(0,256)
    g = random.randint(0,256)
    b = random.randint(0,256)
    return '#%02x%02x%02x' % (r, g, b)

def style_fcn(x):
    return { 'fillColor': random_html_color() }

def highlight_fcn(x):
    return { 'fillColor': '#ff0000' }

# ADD CIRCLE FOUR TO FOLIUM

folium.GeoJson(geojson_poly,name='geojson', style_function=style_fcn).add_to(testmap)

# GENERATE MAP SEEN IN IMAGE

testmap.save('testing_map.html')

So, can anyone tell me why my OGR point is an oval shape? Do I need to set the proper projection somewhere? Presumably to WGS 1984?

EDIT: CSV coordinates are (1-4 in rows, lat and lon):

40.729047,-73.957472
40.70797,-73.93095
40.706799,-73.958416
40.681289,-74.004936


texts:
I have a machine setup with Windows 10, ArcGIS 10.2.1 and Python 2.7 from ArcGIS.  I installed GDAL according to cartometric. The gdal-202-1500-core.msi and then gdal-202-1500-filegdb.msi. With Python, when I load from osgeo import ogr, I have only 1 driver available, the NetCDF. According to www.gdal.org, i should see at least ESRI Shapefile, GeoJSON and Mapinfo File since they are compile by default and FileGDB since I added it.

What I am doing wrong?


texts: What is projection of WGS84 in GIS software?

texts:
WGS84 is a reference ellipsoid that determines coordinates of every point on Earth using latitude, longitude and height about the its surface.
This ellipsoid is often used as a base to make maps. Though, to make a map on a flat paper or a flat digital screen you need a projection too. An example of a popular projection would be UTM.

Mainstream GIS software give plethora of projection alternatives to display your data layers. Among them, they also let you display your data using WGS84 only.

I think they are using a certain projection but what projection is that?


texts: Shift between system time and Geonetwork's

texts:
I have an issue of session expired due to inactivity. I was about to go insane, I couldn't figure out how this is happening. Yet I noticed that when the alert pops up to tell me that I'm out of session, the shift between system time and geonetwork is 3600s though the maximum delay of inactivity is 2100s.
I searched in geonetwork settings to change the time but I couldn't find any way. Do you know how to update the time in this case?


texts: Display records on map from SQL Statement across a relate

texts:
I'm using ArcMap and I have a One-to-Many relate between two tables, one table contains polygons, and the other has additional data. Multiple records in the additional data table relate to a single record in the polygon table. The tables contain historical information.

What I want to do is use a SQL statement on the additional information table to select only buildings dating to the 1800s, and use my relate to have only these buildings shown on the map.

I've looked through all the information I can find, but there doesn't seem to be an answer. Is it possible to do this?


texts: 2 labels, 1 query - 1 a symbol and the other text: How?

texts:
I have a problem: I am trying to add a label to a feature that has two fields embedded in it.  The first field simple has two numbers and I would like them to be placed within a circle (text symbol - State Route HWY in arcmap).  The second field is the name of the feature.

Is there a script that I can use to specify that the first field needs to be contained within the symbol and the second field should be placed next to it or below it?

I am currently using Maplex to display both labels using 2 separate queries, but arcmap won't project them next to each other.  I am using arcmap 10.0 (arc info license).

Thanks!


texts: Creating points where lines intersect in QGIS

texts:
I have two line layers, and I want to create a point where they cross each other.
How can I solve it in QGIS?


texts: Missing Values in Crop identification using Python?

texts:
I am developing a Python based process that classify crops via time series analysis. Due to clouds there are many missing values. My problem is how to assign a value to these pixels that would be near the real value.

What is the best interpolation method to do this?

I have though of mean value of same month's rasters, but this seems as not a scientific method to me.


texts:
I am wondering what is the format of theses files: gvw

http://tracking2016.vendeeglobe.org/gv5ip0/resources/weather/20161110-030000.gvw

It is meant to store somehow the weather data but I can't figure out what is the format of this file and how to read it.

It seems related to Garmin but I can't find any specs about that.

Is there anything to convert it to a more comon file format ?


texts: OpenLayers plugin in QGIS 2.6.1 crashes and errors with zoom

texts:
I have a major problem with the OpenLayers plugin. The maps of the plugin won't zoom to the right scale, or they just simply crash. I never had these problems in the old QGIS versions. This way, I can't work with this version of QGIS. Does anyone know how to fix this?

The shape file opens on the right place on the OpenLayers map. However when zooming, the Google map is not in line with the shapefile (the added picture shows this in extreme, the lines should show up somewhere in the Netherlands).

OpenStreetMap don't seem to show the zoom problem. However, check the OpenStreetMap layer on and off, makes this layer to crash and show a white screen.

Where can I find a download of an older version of QGIS? E.g. QGIS 2.4 (64 bit)?


texts:
I am trying to run:

from osgeo import ogr

and I get:

Traceback (most recent call last):
  File "", line 1, in
    from osgeo import ogr
  File "C:\Python27\ArcGIS10.2\lib\site-packages\osgeo__init__.py", line 21, in
    _gdal = swig_import_helper()
  File "C:\Python27\ArcGIS10.2\lib\site-packages\osgeo__init__.py", line 13, in swig_import_helper
    import _gdal
ImportError: No module named _gdal

So obviously, it's finding the osgeo mod, but what the heck is the _gdal mod? A simple search within my Python paths, shows that I have a module called gdal, but not one with the underscore. Seems like a small issue?


texts: Connecting QGIS to Esri Enterprise Geodatabase of type Oracle Spatial

texts:
I have an Esri Enterprise Geodatabase (ArcSDE 10.2.2; Oracle 10G).

I am trying to connect it with QGIS 2.16.

So I clicked "Add vector layer" button with "Database"
Type : Oracle Spatial (I've tried with "ESRI Personal GeDatabase)
I filled the parameters of the connection.

I clicked "Test" button -> connection successful

When I click OK I've got this message :

  Invalid Data Source: OCI:admin/admin@dbpsigdat.nimes.fr:1522/psigdat
  is not a valid or recognized data source

Can anybody help me ?


texts:
I'm learning GIS in Java with MapXtreme Java Edition but I can't find MapXtreme Java Edition file setup for Window (trial).

Can you share link download or software for me?


texts: Keeping Default Version of Geodatabase protected?

texts:
I have a multiuser geodatabase with Oracle Enterprise RDBMS. The Version of the geodatabase is 10.4.1 and Oracle 11g.

We have over 35 data editors with the flat version tree, each user having their own version, editing their own version. We have set the current access of DEFAULT Version to PUBLIC because each user can Reconcile and Post their edits from their Version to the DEFAULT Version. Now, there have been instances where editors have accidentally deleted, edited the DEFAULT Version directly.

Is there a way to keep the DEFAULT Version protected and getting edited directly without changing its the Access from PUBLIC to
PROTECTED?


texts: Convert easting and northing to degrees north and west

texts:
I need to convert:

Easting 2451890.770
Northing 7438891.286

The location is in Dumfries, New Brunswick. I’m assuming it’s UTM from other search results I’ve seen. I have NO idea what to do

To degrees north and degrees west. How? Am I missing some piece of info?


texts: How to use the local macro to do ZonalStatisticsAsTable in batch

texts:
I have a series of files named as 'rawfile200101', 'rawfiles200102',...,'rawfile201104'.  I want to do ZonalStatisticsAsTable for each of them with names corresponding to the time of the raw files, such as 'newfile200101', 'newfiles200102',...,'newfile201104'.  I know how to script it for individal file, but I am trying to do it in batch.  I wrote the following codes for four files, it is always shown error that "I:/rawfile%list%.tif" does not exist.

import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")

yrmn = ['200101', '200102', '200103', '200104']

for list in yrmn:
    outZSaT = ZonalStatisticsAsTable("I:/boundaries", "ID", "I:/rawfile%list%.tif", "I:/newfile%list%.dbf", "DATA", "SUM")


texts:
I have a set of centroids to which are related a set of points characterized by linename.

The table with the points contains these fields:

id ¦ linename ¦ lat ¦ lon¦

I would like to make a diagram joining centroids through lines. I should connect the points with the same linename in order to make routes through centroids and place the linename on the line lenght.

Probably i shoud select these points with the same lanename and build each linename-route drawing a line but i'm quite new in postgis. Somebody can help me?


texts: Creating new field in ArcGIS Desktop which contains values from two different columns with certain conditions?

texts:
Suppose I have a attribute table as shown in the image below:

I have columns A and B with common FID. I would like to add a new column C, which contains the values of column A with the condition that if the value is equal to 25 in that column, then for those rows, the value should be assigned from column B.

The highlighted green color column C in the image is how the result should look like.

Is there a tool to do this or does an expression have to be used?


texts: Reprojection problem WGS 84 / UTM zone 21S - EPSG:32721

texts:
I'm working on a EPSG:32721 project that works just fine. I'm trying to add a new vector to this project, but I just can't find the way to align it with my others layers.

What is very strange is that this new vector is also part of the bigger layer from where I took the layers of my project (the original layer was a landcover layer from where I selected specific features that I saved as different layers with a metric projection - UTM 21S).

I tried everything I could find about projection problems on this forum, but I could not fix it. I saved my layer with right click and selected the projection that I wanted. OTF is activated. Nothing. The new vector is showed way out of the extent of the others layers.

What I can tell is that the coordinates are different, even if the CRSs matches. This is a screenshot of the information of one of the project's layers:

And this is a screenshot of the proprieties of the new layer:

How can I fix this?

UPDATE

I didn't know how to select a vertex, so I selected the polygon that I would like to save as EPSG: 32721. Is this what you asked?


texts: Error: local variable referenced before assignment in ArcPy

texts:
I have a directory with contain others subdirectory with shapefiles.
I access to the shapefiles using a for, but then when I ned to use the variable shape that I get this message:
UnboundLocalError: local variable 'shape' referenced before assignment
 def execute(self, parameters, messages):
    """The source code of the tool."""

    fd= parameters[0].valueAsText
    raster= parameters[1].valueAsText
    out_CRS=arcpy.Describe (raster).spatialReference

    out= "Z:\\EMSV-057_AOIs_Reshape\\5_Process\\1_TaskA\\ModelBuilder\\MB_pruebas.gdb"
#-------------------------

#leemos los shapes de la carpeta
    for i in os.listdir(fd):
        for entry in os.listdir(fd +"\\"+i):
            if os.path.isfile(os.path.join(fd, entry)):
                if entry.endswith(".shp"):
                    shape= fd +"\\"+i+"\\"+entry

# Cogemos datos alfanumericos del AOI y el CRS del raster
            desc = arcpy.Describe(shape)

            shape_CRS=arcpy.Project_management(shape, desc.path + "\\" + desc.baseName +
            "_REprj.shp", out_CRS)

        # Recortar-clip
            clip=arcpy.Clip_management(raster, "#", out+"\\" +"clip", shape_CRS, "0",
            "ClippingGeometry","MAINTAIN_EXTENT")


texts: Set Grid Composer Unit in UTM for QGIS 2.18.14

texts:
I was very confused with my QGIS 2.18.14,

i'm pretty sure that i used correct coordinate system, WGS84/UTM 48N, and the coordinate also said so. But why when i set the grid. The grid coordinate is not showing real coordinate? I found that the grid not change while i move item content(the point).

what's wrong?

showing that the coordinate in the system:

showing that the grid failure to not showing the coordinate:


texts: Print to PDF in QGIS 3.0 from layout cuts off a strip of the bottom and right hand sides

texts:
As per the title. It happens every time I export it through print to pdf. Doesn't matter if I choose "microsoft print to pdf" or "adobe pdf".

My map is within the canvas dimensions. When I select Export to PDF, it works fine. I use print to pdf because it comes out as a smaller file size for sending via email and placing in documents as compared to export to PDF which outputs massive PDF file sizes.

The canvas size is A4, the print to pdf preferences are set to A4.

Anyone else have this problem?


texts: What coordinates Field Calculator used when given $x to get X coordinate in QGIS?

texts:
I have a shapefile that I have saved in EPSG:3879 (.prj file shows that) and current CRS of the project has been set to EPSG:3879. Still when I used Field Calculator command $x to get X coordinates for points, it does not use that EPSG:3879 coordinates but seemingly EPSG:3067 (that some other shapefiles in the same project use).

How can I get coordinates in EPSG:3879?


texts: How to make certain part of raster as no data with other overlapping raster?

texts:
I have two rasters, one raster contains all the ground features (roads, buildings, Trees etc) and another raster contains only man made features (Roads, buildings etc). I would like to have raster output which will have no data or 0 values where 2nd raster overlaps 1st raster.
I tried SetNull tool but no luck so far.


texts: How to use field calculator in this situation

texts:
How to use this formula in field calcultor in ArcMap.
for example:
      A = Field1
      B = Field2

  if A =<B
      C = B
  else:
      C = A


texts: Earth Engine Image Zone Statistics (zonal stats)

texts:
I am looking at object oriented methods and wondered if there was a way of calculating image zone statistics (zonal stats) based on connected pixels. Essentially, I want to reduce the pixels in an independent image (eg. Sentinel-1) by the image object in a connected pixels image.

For example, I have a binary image (1m res) that I turn into objects using connected pixels and remove objects below 100 pixels:

// Convert to objects
var patchsize = InFile.connectedPixelCount(256,false).reproject({crs:'EPSG:4326',scale:1})
Map.addLayer(patchsize, {}, 'patch size');

// Remove small objects
var PatchMask = patchsize.gt(100)
Map.addLayer(PatchMask, {}, 'patch mask');

var FinalSegs = InFile.updateMask(PatchMask)

I also create monthly mean Sentinel-1 images using the following code:

var sentinel1 = ee.ImageCollection("COPERNICUS/S1_GRD");

var months = ee.List.sequence(1, 12);

var byMonth = ee.ImageCollection.fromImages(
      months.map(function (m) {
    return sentinel1
    // Filter to get images with VV and VH dual polarization.
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
   // Filter to get images collected in interferometric wide swath mode.
    .filter(ee.Filter.eq('instrumentMode', 'IW'))
  //clip to bangladesh
    .filterBounds(geometry)
    .filterDate('2018-01-01','2018-12-31')
    .filter(ee.Filter.calendarRange(m, m, 'month'))
                .select('VH')
                .mean()
                .set('month', m);
}));
print(byMonth);

I would ideally like to reduce the pixels in the Sentinel-1 images (12 mean images) using the objects the connected pixels. I presume the output would be a 12 band image where each object has the mean backscatter value for each connected pixel. Is this possible in EE?

A badly drawn example of this would like the following image:


texts: why there is no attribute like 'GetNAClassNames' in my arcpy

texts:
I want to do a network analysis, when I want to load a layer as a barrier using arcpy.na.GetNAClassNames, the message is like this:
AttributeError: 'module' object has no attribute 'GetNAClassNames'
why?my current version is arcGIS 10.3


texts:
I am trying to test adding a clickable layer to a web app. I am just using a test layer from arcgis online rest services shown in a tutorial. When I try to add the layer using esri/FeatureLayer I, get the following error:

Uncaught TypeError: FeatureLayer is not a constructor

Any suggestions on what the problem might be? Below is just my simple test code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Intro to MapView - Create a 2D map</title>
<style>
  html, body, #viewDiv {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
  }
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.8/esri/css/main.css">
<script src="https://js.arcgis.com/4.8/"></script>
<script>
  require([
    "esri/Map",
    "esri/views/MapView",
    "dojo/domReady!",
    "esri/layers/FeatureLayer"
  ], function(Map, MapView, FeatureLayer){
    var map = new Map({
      basemap: "streets"
    });
    var view = new MapView({
      container: "viewDiv",  // Reference to the scene div created in step 5
      map: map,  // Reference to the map object created before the scene
      zoom: 4,  // Sets zoom level based on level of detail (LOD)
      center: [15, 65]  // Sets center point of view using longitude,latitude
    });
    var featureLayer = new
    FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3);
    map.addLayer(featureLayer);
    featureLayer.on('click',function(e){
      var specific = e.graphic.attributes['SpecificAttribute']
      window.open("http://brazostacos.com/wp/"+specific);
    })

});


texts: How to read a FileGDB using QGIS 2.18.7 /GDAL 2.1?

texts:
I have imported a gdb file into PostGis using GDAL 2.1.3 and am facing the following issue :-

When I try to add the layer which is a multiline string to the canvas from the QGIS DB Manager I don't see anything in the QGIS canvas window. In the QGIS layers panel when I check number of features it shows zero. The attribute window is also empty (no rows) but the columns are populated. When I check in the properties window under fields, I do see a field which has a type QString and a type name as Binary.

  Field se_anno_cad_data ignored, because of unsupported type bytea

There also seems to be some data found in raster files as can be seen from the output of the ogrinfo command below :

How can I figure this out?