texts: Change path in Anaconda environment to point to ArcGIS Python interpreter on Windows?

texts:
I want to have an Anaconda environment that will use the Python interpreter installed with ArcGIS Pro.

I am working in Windows. I have been using Anaconda Prompt to configure virtual environments, and this works fine. However, I would like to create an Anaconda virtual environment that uses the Python interpreter installed with ArcGIS Pro, so that I can import ArcPy and use ArcPy in that environment.

The Python interpreter that I think I should use is in C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

When I run conda info --envs I get something like C:\Users\MyName\Anaconda3 for all of my environments. I think I would like to change that path to C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

Is this the right approach, and is this possible? Is there another (or better) way to use ArcPy in conda environments if I installed Anaconda first?


texts: Is it possible to automatically snap polygons in the same layer in QGIS?

texts:
there are similar questions but I still couldn't figure out if it's possible to do this in QGIS.

I have a layer with categorized point data (3 categories), I use minimum bounding box/convex hull in order to create 3 polygons automatically covering these 3 categories. It does create the polygons but I need those polygons' adjacent lines to snap to each other. How could I achieve this? I tried many snapping tools but I couldn't find a tool that snaps polygons to each other in the same layer.

Two Polygons


texts:
I'm trying to convert GRS 1980 (ellipsoid) to WGS84 using Proj4js.
The code that I'm currently using is:

proj4('GRS1980','WGS84'[184058,674431]);

The problem is that Proj4js does not accept GRS1980 (getting uncaught GRS1980).

How can I properly put GRS 1980 as an input for Proj4js?


texts: How to export raster image using arcpy with dynamic range adjustment (DRA)?

texts:
I want to export raster satellite image into jpeg format as layout view (with scale bar, legend etc.).

I check on dynamic range adjustment (DRA) option in image analysis window. Manual export using ArcGIS Desktop 10.2.2 works well, but running the same procedure with a python script (see below) with the same mxd project gives other results than manual manipulations (somehow DRA option is disabled while executing script).

How to export raster image in layout view using arcpy with dynamic range adjustment (DRA)?

import arcpy
mxd_path = r"C:\project.mxd"
jpg_path = r"C:\test_image.jpg"
mxd = arcpy.mapping.MapDocument(mxd_path)
arcpy.mapping.ExportToJPEG(mxd, jpg_path)


texts: How to buffer a line with segments in PostGIS using unique segmentsize?

texts:
I want to buffer a line in PostGIS. For this purpose I created a line, split it into fixed segments (8m) and run the buffer function.

--CREATE TABLE line(name char(10), geom geometry);
--INSERT INTO line VALUES('line','SRID=32637;LINESTRING(423458.0 6857171.2,  423439.8 6857244.5, 423501.7 6857327.8)');

WITH
    segmentvertex AS (
        SELECT ST_Segmentize(geom, 8) AS geom
        FROM line)

SELECT ROW_NUMBER() OVER() AS segment_id, st_buffer(geom, 4, 'endcap=flat join=bevel') AS segment_geom

FROM (
SELECT dmp.path,
        ST_MakeLine(dmp.geom, LEAD(dmp.geom) OVER()) AS geom

FROM segmentvertex AS s,
LATERAL ST_DumpPoints(s.geom) as dmp
)   t

WHERE  geom IS NOT NULL

Somehow I cannot handle the vertexes at the corners of the line which creates bad looking transition zones. On the left hand of the picture I inserted a segment wise buffer based on output of the GRASS v.split tool in QGIS 3.1 which is more looking like expected.

How can I achieve the same result in PostGIS like in QGIS? Im using PostGIS 2.5.1


texts:
I want to merge two lines that their distance is from 0 meter to 20 meter. How can I do that by QGIS or ArcGIS ?

The link for download data.
https://drive.google.com/file/d/19Y-cuqGPypva0Xz97LLKrxK8zPraXCDd/view?usp=sharing

the result when I use the Collapse Dual Lines to Centerline (Cartography Toobox)

The result as you can see that
(2) the 2 lines did not merge into 1
(1) the tool did nothing
Here, I would like to see that 2 lines should merge into 1.


texts: ArcMap GeoTiff Sample command gives invalid values in lines of GDAL Geotiff

texts:
I have a puzzling problem using GeoTiff rasters which have been generated using Python + GDAL functions. When these grids are "Sampled" (ArcMap 10.4.1 Spatial Analyst Sample command), some rows of data contain either Nodata values, or in some cases very small or large negative values where there should be valid data values.

This occurs when sampling a grid, using the grid itself as the location of points to be sampled. There are no errors or warnings reported by Sample.

This image shows the X, Y values output for a grid (using Sample tool) which has been loaded into ArcMap with the values symbolised to show NoData (-9999) values in red. The output points all have the correct coordinates, and there are not gaps apparent. However, when symbolised to the value of the underlying raster, you can see the values in two lines across the grid either appear with NoData values, or in the case of the lower line, contain values which are not the same as the surrounding grid values that would be expected.  Inspecting the individual values in those rows, none of the extracted values correspond to any of the grids being sampled at that point. The lines are 140 m apart (70 rows of  2m grid)

Initially I was sampling several grids at the same time, but I found that I could reproduce the problem using only one of those grids at a time. I have tried many things to find a cause/solution this including:

defining the projection (the same as the grid already has defined),
sample using a similar grid created in ArcMap with same grid size,
exporting a world file for the Geotiff.

but these do not work.

Two things that DO have an effect are

converting the grid to a point Shapefile, and using the point Shapefile to sample with, instead of the raster.
I also found that projecting the raster (from GDA_1994_MGA_Zone_55 to GDA_1994_MGA_Zone_55) changes the spacing of the invalid rows. In the case of the grid shown, the rows disappear, but with a larger grid, the spacing of invalid rows simply increased

This suggests there is something going on in ArcMap's interpretation of the grid projection, which was based on EPSG in the GDAL functions. I am wondering if anyone has seen this issue with ArcGIS 10.x, and would like to know if there is a way I can resolve this in the Python GDAL functions used to generate the grid (or perhaps is this an ArcMap bug?).


texts: Write userID to field automatically every time an object is edited

texts:
Currently every user has to put his/her useriD in a field after every change made to an object in the database. This takes time and can be forgotten easily.

Is there a SQL-Command giving back the computer or user editing the data? How can I implement the field being refreshed everytime someone edits one of the other object attributes?

QGIS 2.10.1 Pisa


texts: Win7 Senior users_Which pgRouting and postGIS versions are stable with postgreSQL8.4?

texts:
I'm working on a postgreSQL ,postGIS and pgRouting project on  Windows 7
I need to work on a stable version (no time for risks), and I can see that many people are asking the same question many places..
 I think because there is not a clear instruction about the compatible and stable versions anywhere, so we (Win-pgRouting beginners) would appreciate a complete answer from senior users..
 Here are the tools I would like to use:
 PostgreSQL 8.4

postGIS  ??

pgRouting  ??

QGIS  ??

OpenLayers  ??

GeoServer   ??

osm2po   ??

Here are some facts I found on during my search about stable versions compatible with pgRouting

1) pgRouting on postgreSQL 9 is not a stable version (it is in beta form). postgis.net/windows_downloads

  2) Expert users confirming that version 8 is used by most of them who are working on the collection of tools that I'm interested in
rndxpress.wordpress.com/2012/07/11/…

3)Problems with the new version collections gis.stackexchange.com/questions/26816/…

4)This is a pgRouting4Windows mail list response, it is written couple of days ago it is stating explicitly by the Win pgRouting binaries' developers that it does not work properly with PostgreSQL 9 and they are at this moment forming a group of developers who are willing to build a stable version pledgebank.com/pgRoutingWindows

THE QUESTION:

From your experience using this collection of tools, what versions do you suggest that I should use?
I installed postgreSQL8.4,  but I’m not sure which compatible versions I should install for postGIS and pgRouting
and if you have any suggestions for QGIS ,OpenLayers and osm2po,
because I'm new to the area so I'm not sure if compatibility even matters for some of those tools,

I appreciate your support,
sara


texts: Create true color image from Sentinel-1 data

texts:
Is it possible to create or extract a true color (RGB) image from Sentinal-1 satellite data?

Like with Landsat8 data described in this article https://scientiaplusconscientia.wordpress.com/2014/11/18/working-with-landsat-8-a-tutorial-2-creating-simple-composites/


texts: QGIS - Label polygon with different projections

texts: I have a polygon layer projected in an UTM. In properties I checked 'show all labels for this layer'. Does anyone know why the label does not show until zoom 15:1 in QGIS with CRS-4326, while in another projection (an UTM) it will show always?


texts: produce images with shapefiles and OpenStreetMap

texts:
I have a python file http://pastebin.com/jzwE6c6P which iterates over the features of a shapefile and renders a simple image by zooming to the bounding box of each feature. What I need is OpenstreetMap as a basemap. I have OpenStreetMap successfully loaded in a postis database. I can produce an OpenStreetMap with the mapnik example generate_image.py, but I have no idea how to call the osm file.

http://svn.openstreetmap.org/applications/rendering/mapnik/generate_image.py

Any help would be greatly appreciated


texts:
I have a large number of polygons with matching points. I wish to move each respective polygon to its corresponding point (see attached image). I can't use the 'Move To' tool in the 'Editor', as I have too many polygons and points for this to be viable.
Is there a way to do this with ArcPy?


texts:
I would like to run a geometry processing algorithm from the Python console while using the Edit features in-place modifier.

I copied the output from the processing history to see if it works, e.g:

processing.run("native:rotatefeatures", {'INPUT':'/path/to/layer.shp','ANGLE':40,'ANCHOR':None,'OUTPUT':'memory:'})

but wasn't surprised that it didn't.
So what's the trick? (if there is one)

I'm on QGIS 3.6


texts: How to get the current map from a geoprocessing tool execute function?

texts:
I'm making a geoprocessing tool with the ArcObjects SDK Java 10.2. I need to modify labeling colors of a layer of the current map.
Is it possible from the execute function to access the map currently opened in ArcMap ?
I need to get the current IMapDocument or IMap in order to set up parameters of the layers (IGeoFeatureLayer).
How can I do that please ?


texts: Annotation missing from Data Drive Pages export to PDF?

texts:
ArcMap 10.2

I am exporting data driven pages to PDF within ArcMap, there are 12 pages to export. Each page has been set to a specific scale in order to match up with a corresponding annotation layer (ie. we have annotation layers for 1:1200, 1800, 3000, etc). All of the pages that export show the correct annotation on the PDF with the exception of one page. The annotations can be seen within ArcMap and the scale is at 1:1200 with our 1200 annotation layer enabled (the checkbox is fully checked in the Table of Contents, as opposed to the grey color check when not at proper scale).

What would cause a single page not to export with annotation?

There is another page at 1:1200 that exported just fine.

Settings:
- Quality normal (1:3) @ 300DPI
- Format RGB, Compress Vector Graphics, adaptive image compression, embed all document fonts.
- Pages are set to export as multiple pages by name.


texts: Using Python code in Qgis for first time; troubles: error that it is not a valid layer

texts:
My first try of adding a simple vector layer is not working. Does anybody know what I am doing wrong?
This is the code:

layer=iface.addVectorLayer("/C:/Users/Asus/Desktop/Thematicmapping/TM_WORLD_BORDERS-0.3/TM_WORLD_BORDERS-0.3.shp", "TM_WORLD_BORDERS-0.3","ogr")

I get a notification that the layer is not valid and that it cannot be added.


texts: How to mix polygon extrusion and different altitude modes in KML?

texts:
I want to create boxes by simply extruding polygons but with special "floors". I've been able to find several existing solutions for the extrusion problem. The remaining problem is that the "floor" of my boxes do not fit with the altitude modes provided by the KML reference. I want to be able to create floors with specifications like "max (100m absolute, 50m above ground)".

I don't see any simple solutions. I could do a grid sampling to get ground altitude (I'm already doing this for something else) and generate only absolute altitude. But I'm afraid that I will have problems in areas with too many mountains if the sampling is too sparse, or I will have a huge KML file if the sampling is too dense.


texts: Transform points into lines and calculate total distance in QGIS

texts:
I have a series of data, minutes and seconds that are associated with latitude and longitude. I would like to calculate the total distance within each minute, getting a value for each minute. Now I use:
length (transform (make_line (geometry ( get_feature_by_id ( @layer, $id )),
geometry ( get_feature_by_id ( @layer, $id+1 ))),'EPSG:4326', 'EPSG:23033'))

Which, however, gives me the measure of each point. Does anyone know how to do?
I dont know why but when i try aggregate( @layer, 'sum', length (transform (make_line (geometry ( get_feature_by_id ( @layer, $id )), geometry ( get_feature_by_id ( @layer, $id+1 ))),'EPSG:4326, 'EPSG:23033')) ) QGIS crashes.


texts: Passing variable to function when button has been clicked

texts:
I want the user to make a selection of a layer from a QgsMapLayerComboBox and setting up their settings they wish to use. After a click on a button, a function should be called which performs the work. There are different buttons to call different functions.

I actually have a working code below, but it seems quite ridiculous to me to catch the selectedLayer more than once. I think I am doing something completely wrong here and there must be an efficient and proper way of passing a variable from run to a function when a button has been clicked.

I actually managed to do it as explained here, but not as expected. (I must have obviously misuderstood the answer). When using self.dlg.Isochrones_RequestIsochrones.clicked.connect(self.Isochrones_RequestIsochrones(selectedLayer)) it seems to pass the selectedLayer to the function, but the function is beeing executed right on startup of the plugin. There is no chance for the user to make their settings.

class OpenTripPlannerPlugin:
    # other stuff here

    def Isochrones_RequestIsochrones(self, selectedLayer):
        # I am actually doing this twice because I am not able to pass the selected layer from run properly
        layers = QgsProject.instance().layerTreeRoot().children()
        selectedLayerName = self.dlg.Isochrones_SelectInputLayer.currentText()
        selectedLayer = [l.layer() for l in layers if l.name() == selectedLayerName][0]

        # doing stuff with the selected Layer here

    def run(self):
        if self.first_start == True:
            self.first_start = False
            self.dlg = OpenTripPlannerPluginDialog()

        # Using QgsMapLayerComboBox to make a layer selection
        vector_names = [l.name() for l in QgsProject().instance().mapLayers().values() if isinstance(l, QgsVectorLayer)] # Fetch vector layer names
        self.dlg.Isochrones_SelectInputLayer.addItems(vector_names) # Fill with layers
        self.dlg.Isochrones_SelectInputLayer.setFilters(QgsMapLayerProxyModel.PointLayer) # Filter out all layers except Point layers

        # Getting selectedLayer and hopefully passing it to functions
        layers = QgsProject.instance().layerTreeRoot().children()
        selectedLayerName = self.dlg.Isochrones_SelectInputLayer.currentText()
        selectedLayer = [l.layer() for l in layers if l.name() == selectedLayerName][0]  <-- I want to make this selected layer available in other functions I call

        # Doing some stuff with selectedLayer like setting up QgsOverrideButton
        self.dlg.Isochrones_WalkSpeed_Override.registerExpressionContextGenerator(selectedLayer)
        self.dlg.Isochrones_WalkSpeed_Override.init(0, QgsProperty(), QgsPropertyDefinition("walkSpeed", "Walk Speed km/h", QgsPropertyDefinition.DoublePositive), selectedLayer, False)

        # Doing more stuff...

        # Calling Functions on button click
        self.dlg.Isochrones_RequestIsochrones.clicked.connect(self.Isochrones_RequestIsochrones) # <-- Using ...(self.Isochrones_RequestIsochrones(selectedLayer)) seems to work, but the function is executed on startup of the plugin with no chance to make individual settings

        # show the dialog
        self.dlg.show()
        # Run the dialog event loop
        result = self.dlg.exec_()
        # See if OK was pressed
        if result:
            #Isochrones_RequestIsochrones()
            print("test!")

How do I properly pass the selectedLayer to a function after a button has been clicked?


texts:
I was under the impression that the Data Interop extension was needed to use a WFS service in ArcGIS Desktop, as outlined here. The page specifically mentions that a DI license is required.

Now I found another page that shows something different:

There is no mention of DI, and apparently there is a new option under GIS Servers ('Add WFS Server').

I don't have this option, in ArcGIS 10.3.1 or 10.4.1, so how do I get it? I thought I needed to install DI after all, so I did that, but the option is still not there, nor can I find a way to add it manually. Is this part of the Production Mapping extension?

I have an ArcGIS Enterprise license.


texts: Preventing Symbols offset in map from being offset in legend of QGIS?

texts:
I've been searching for a solution to this, but cannot seem to find an answer. I have a map where some stacked markers have been offset to be visible on the map. This makes their symbol offset in the layers panel, and subsequently in composer legends. I've played with spacing and other settings, but cannot get them to line up without removing the offset.

Is it possible to prevent symbols that have an offset applied in the map from having that offset displayed in the legend?


texts: FileGDB API for Visual Studio gives error?

texts:
I download API for vs 2008. When I try add reference VS show error:

What can I do?

Windows 7 64 bit

dll too for 64 bit

VS 2008


texts: Using CartoCSS to have polygon change shape or symbol upon different zoom levels?

texts:
I'm working with some small area parcel data.  When zoomed in it is important to see the actual polygon shape.  But when zoomed out, something like a simple point marker that scales would be better, otherwise the small polygon isn't really visible.

Is there a way to dictate this with CartoCSS?


texts:
Sometimes I find PostGIS sql examples like that, with a dot indicating a property name of a field, I suppose.

select st_dump(geom).geom from table

However, when I run this in my computer, I get:

Kernel error: ERROR:  syntax error at or near "."

I´m using postgre 9.6.

What´s going on?


texts: Generating contour lines and filled contours from points

texts:
I am trying to create contour lines and filled contours from a shapefile of height points using the contour plug in (have tried other tools but with no success).

The data is sourced from the UK Ordnance Survey in tiles of 400 x 400 points (NTF format). Each tile has been opened as a vector layer and then saved as a shp layer. The plug in will run properly with a single tile. However, the area I need is 3 x 3 tiles i.e. 1200 x 1200 points.

Initially I generated contour lines and filled contours for each of the 9 tiles. This is unsatisfactory since the spacing is slightly different for each tile according to its height range resulting in mismatch at tile boundaries. I then merged the 9 shp layers using the mmgis and vector menu merge. Running the contour plug in against either merged file fails with the dialogue box showing 'Not Responding'.

I am running QGIS 1.8 Lisboa on Windows 8 x64 pro with 32gb of memory and plenty of free disk space on all drives. I have had no problems with other imported layers, adding new layers of data. However, this is the first time I have attempted to generate a shaded layer or contour lines. I guess there must be a setting somewhere to allow the plug in to handle the larger data block - I found and increased the cache setting in 'options') or I am using the wrong tool for the job.

My project is mapping local history routes/settlements. The shading is needed to provide context.


texts: 2018 USGS US Topo Render Differently in Browsers

texts:
While opening in a browser a 2018 Geospatial PDF from the USGS, I noticed that different PDF browsers open the same file differently.  I'm looking for a clue as to why they are different.

Compare

When comparing the same Geospatial PDF in four browsers on macOS Mojave (macOS 10.14.3 (18D42)) —

Chrome & Opera show only the most basic vector layers (contours, roads, etc)
Safari & Firefox shows contours, roads, etc, but also shows the Orthoimage base layer.  The Preview app on macOS Mojave also behaves like Safari and shows the Orthoimage.

Issue

I am not certain which browser is right.  These are the scenarios that could be happening:

Chrome and Opera use the same PDF renderer; read the Geospatial PDF and decide to not show the Orthoimage layer, or
Firefox and Safari use strong rendering standards, and the Geospatial PDF does not give that proper directive, or
The issue is related to 2018 USGS Geospatial PDF produces `ERROR 1: insufficient arguments for Marked Content`, or
Your guess is good as mine. BTW, the USGS PDFs are excellent and my hats off to them for refreshing the US Topo products.

Steps to Reproduce

For example, if I obtain this 2018 Geospatial PDF from the NationalMap.gov

 wget https://prd-tnm.s3.amazonaws.com/StagedProducts/Maps/USTopo/PDF/CA/CA_Descanso_20180904_TM_geo.pdf

And I open it on the browsers I have on macOS (Chrome, Safari, Opera, FireFox), I get the rendering of each in the image below.  Safari & macOS Preview  & Firefox both show the Orthoimage layer.

Edit

I have found that a National Park Service Geospatial PDF for Joshua Tree has a similar issue. This again leads me to believe its how the PDF renderer for these browsers behaves differently.

Steps to reproduce Joshua Tree, where the Shaded Relief layer does not show in macOS Preview.

wget  https://www.nps.gov/carto/hfc/carto/media/JOTRmap1.pdf


texts: How to do spatial correlation between two variables on ArcGIS 10.1?

texts:
I have two raster datasets and I'm trying to determine the extent of their spatial relationship. I suspect they are closely related but I would like to produce a map output to illustrate this relationship.

The datasets are:

1 - a kernel density of prevalence of gambling locations (from their point locations)

2 - a deprivation index by Census Output Area converted to raster.

I don't know if it's best doing this as polygons or as rasters and which technique will provide me with what I want. Does anyone have any ideas of how I can investigate and represent this relationship in Arc?


texts: Spatial Analyst interactive tool bar histogram bins

texts: In ArcGIS 10.2, after I have created an histogram from the spatial analyst interactive tool bar, how do I collapse the number of bins to a smaller number?


texts: WMS and WFS Connections following upgrade to ArcGIS 10.4?

texts:
We recently upgraded from ArcGIS 10.3 to 10.4.  It turns out 10.4 handles WFS and WMS URLs differently and we now face having to update very many interoperability connections individually, and every historic MXD needs WMS layers replacing.

Any one come across any efficient ways of dealing with this?

We have 10.4 running on a server with WMS and WFS on a separate server - both maintained by outsourced IT.


texts:
I have tried this with different QGIS versions (3.14 & 3.16) on both Mac and PC, but am not able to resolve the following problem.
I derived vector contours from a DEM and made labels every 250 m using a Mask in Layer Styling.
I also added a point vector layer with places and made labels using a Buffer, not a Mask.
The issue now is that when I show both layers together the Buffer effect of places does not work. The following image shows an example called Place with the Buffer effect, without the contour layer activated. The buffer around Place is actually a 1 mm sized white colour, but using Blend mode "Soft light" in Layer Styling it blends into the background:

This is the image of both layers together:

The Mask of the contours layer works fine, but the buffer around Place now does not blend into the background, remaining white. No matter what Blend mode I used in Layer Styling, it remains white.
Does anyone have any idea if there could be a problem using Buffer and Mask for different layers together in the same project?


texts: Finding cities within radius usingPostGIS?

texts:
I'm new to PostGIS and I'm just trying to get a good grasp of the basics.

I've taken a dataset containing information on the world's cities, from https://www.maxmind.com/en/free-world-cities-database and imported it into a table.

I added a geometry column with:

SELECT AddGeometryColumn('cities', 'geom', 4326, 'POINT', 2);

And then populated the column with:

UPDATE cities SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);

I want to find all cities within the radius of a specific lat/lon. To do that I tried:

SELECT *
FROM cities
WHERE ST_DWithin(geom, ST_MakePoint(79.3832,43.6532)::geography, 50000);

...but no results are returned. The lat/lon I entered is that of the city of Toronto and I've verified that a record for Toronto exists in the table with the correct lat/lon.

If I increase the radius to something ridiculous, such as "5000000" a list of cities - most of which appear to be places on other continents - is returned.
What am I doing wrong? Is it my query? Am I filling the geom column incorrectly?


texts: converting a estUD object to a SpatialGridsPolygon or SpatialPixelsPolygon

texts:
I have used the package adehabitatHR in R to estimate the utilization distribution (UD) of a bird using a custom grid

#make the custom grid
x <- seq(-1723705, 2511295, by = 5000)
y <- seq(7085019, 9240019, by = 5000)
xy <- expand.grid(x=x,y=y)
coordinates(xy) <- ~x+y
gridded(xy) <- TRUE
class(xy)

kde.blsc <- kernelUD(blsc.ptt, h = "href", grid = xy)

#kde.blsc is an `estUD` object
summary(kde.blsc)

I would now like to extract the UD values from kde.blsc to either a SpatialPixelsDataFrame or a SpatialPolygonsDataFrame, so that I can link it to habitat variables saved in a separate SpatialPolygonsDataFrame.

However, when I try to use the function estUDm2spixdf, I get the following error:

blsc.pix <- estUDm2spixdf(kde.blsc)

Error in estUDm2spixdf(kde.blsc) : x should be of class "estUDm"

How can I turn kde.blsc into a estUDm object? Or are there any alternative methods?


texts:
I am trying to understand the behavior of Layer->Render-> Refresh layer at interval in QGIS

I sat up a flask rest api which serves a geojson.
I added the geojson to QGIS via Add Layer->
a. Protocol HTTP/cloud/etc
b. Type: HTTP
c.URI: localhost/points.geojson
The points are represented on the map correctly
I changed the layer->Properties->Rendering-> Refresh layer at interval (5 sec)

I would have expected that there would be a call every 5 seconds towards the server and the map data would be updated accordingly. But the layer does not get refreshed. I don't see any changes neither when I remove a point from the json file on my local drive, nor if I change an attribute. If I press F5 then the canvas refreshes and it automatically loads the new data and I can see the changes. Is this the behavior that is wanted or am I misunderstanding the function of this tool? It seems like the data is cached somewhere?
from flask import Flask
from flask_restful import Api, Resource
import json

app = Flask(__name__)
api = Api(app)

class point(Resource):

    def get(self):
        with open('C:/points/venv/src/points.geojson') as json_file:
            data = json.load(json_file)
        return data

api.add_resource(point,"/points.geojson")

if __name__=="__main__":
    app.run(debug=True)


texts: Change Coordinate System of a raster in ArcMap

texts:
I have a problem with changing the coordinate system of a raster data set in ArcMap. The actual spatial reference of the Raster is specified as GCS_WGS_1984 in the Layer Properties. I want to change this into WGS_1984_Antarctic_Polar_Stereographic. I tried to do so in the Data Frame Properties. As a result my raster disappears and I can't even zoom to the Layer. When I try it with Geographic Coordinate System Transformations I can not select the wanted System. Maybe it is also important to tell, that when I load the Raster into ArcMap the following Error Message appears:

  one or more of the added layers has an extent that is not consistent
  with the associated spatial reference information.

What can I do to change the Coordinate System?


texts: "Error in .subset2(x, i, exact = exact) : subscript out of bounds" in R-programming

texts:
I am trying to apply Radiometric correction to Landsat image in R.
I tried with the following code and got the error.

metadata <- readMeta("LT05_L1TP_141041_20110129_20161010_01_T1_MTL.txt")
TM5_RadParameters <- metadata$CALRAD
TM5_RadParameters
rad_TM5_pre <- radCor(TM5_RadParameters, metaData =  metadata, method = "rad")
rad_TM5_pre

ERROR

  rad_TM5_pre <- radCor(TM5_RadParameters, metaData =  metadata, method = "rad")
  Error in .subset2(x, i, exact = exact) : subscript out of bounds


texts: Iterate Row Selection takes too much of the model into ModelBuilder loop?

texts:
I am a little stuck with a relatively simple model.

What I want:

1) Create a table "results".

2) Loop over "Points".

3) Do some buffer and counting

4) Put the results (OBJECTID and count) into "results" via "addRecord"

5) Goto 2

What it does:
1) -> 2) -> 3) -> 4) and then it creates "results" again which somehow empties results.

Any hints ?

addRecord looks like this:

   import arcpy

   infile = arcpy.GetParameterAsText(0)
   IDFieldValue = long(arcpy.GetParameterAsText(1))
   CountFieldValue = arcpy.GetParameterAsText(2)

   rows = arcpy.InsertCursor(infile)

   row = rows.newRow()
   row.setValue("OID", IDFieldValue)
   row.setValue("count", CountFieldValue)
   rows.insertRow(row)

   del row
   del rows


texts: Conversion of DEM raster to ASCII format in ArcGIS10.4

texts: I have a DEM raster file in .tif format. I need to convert it to ASCII format. I used conversion tool in ArcGIS from raster to ASCII, but the result is in .txt instead of .asc. What should I do?


texts: How to sort legend values by an index item in QGIS?

texts:
Using categorized classification method for creating a legend  on QGIS permits to create an automatic legend based on the values or categories defined in on item or a combination of items, or a formula that define the categories. The legend is ordered in ascendent or descendent form using the values detected on that item or formula. But are there a way where the legend can be ordered using an additional item that works like an index?

Let give me an example: in geology, names like Quaternary, Paleocen, Eocene, etc. are referred to diferent geological ages and cannot be ordered in a legend by alphabetic order. They must be ordered from younger to oldest ages. In this case it is necesarry to use a different item that acts a index and can permits the appropiate display of the legend.


texts:
How to separate details by color from raster? Is it possible in ArcGIS or any other software? I have tried Spatial Analyst.

I want to use RGB .tiff image which is scanned map. It consists of all the details having different colors. I want to separate all details like roads, railway as they have different colors so that auto digitization by ArcScan tool will be easier.


texts: Merge sf() shapefile with CSV using shared field (by.x)

texts:
From what I can tell, sf() merge doesn't support comparison operations by.x etc. Is there a feasible way to mesh two data sets, one of which is a simplefeature and the other a basic table from CSV or xlsx?

Example, to give a sense of what I mean. I could do something like this with a spatial dataframe generated by sp():
admin_lev1 <- merge(x=admin_lev1, y=admin_lev1_pop, by.x = "code", by.y = "CODE") and I would end up with a pleasantly aggregated dataframe. I've mangled around with sf() and it seems like this functionality - to specify by.x and by.y isn't in place and can't be reproduced.

Data for reproducible example:

admin_lev1_pop.csv:

council areas,2011_pop,code
Aberdeen City,"222,793",S12000033
Aberdeenshire,"252,973",S12000034
Angus,"115,978",S12000041
Argyll & Bute,"88,166",S12000035
Clackmannanshire,"51,442",S12000005
Dumfries & Galloway,"151,324",S12000006
Dundee City,"147,268",S12000042
East Ayrshire,"122,767",S12000008
East Dunbartonshire,"105,026",S12000045
East Lothian,"99,717",S12000010
East Renfrewshire,"90,574",S12000011
"Edinburgh, City of","476,626",S12000036
Eilean Siar,"27,684",S12000013
Falkirk,"155,990",S12000014
Fife,"365,198",S12000015
Glasgow City,"593,245",S12000046
Highland,"232,132",S12000017
Inverclyde,"81,485",S12000018
Midlothian,"83,187",S12000019
Moray,"93,295",S12000020
North Ayrshire,"138,146",S12000021
North Lanarkshire,"337,727",S12000044
Orkney Islands,"21,349",S12000023
Perth & Kinross,"146,652",S12000024
Renfrewshire,"174,908",S12000038
Scottish Borders,"113,870",S12000026
Shetland Islands,"23,167",S12000027
South Ayrshire,"112,799",S12000028
South Lanarkshire,"313,830",S12000029
Stirling,"90,247",S12000030
West Dunbartonshire,"90,720",S12000039
West Lothian,"175,118",S12000040

download.file("https://borders.ukdataservice.ac.uk/ukborders/easy_download/prebuilt/shape/Scotland_ca_2010.zip",
              destfile = "data/Scotland_ca_2010.zip")
unzip("data/Scotland_ca_2010.zip", exdir = "data")

admin_lev1 <- st_read("data/scotland_ca_2010.shp") %>% st_transform(27700)

Ideally, what I need to do is join admin_lev1_pop data in the column 2011_pop to admin_lev1 but I'm at a loss as to how to accomplish this using the new feature set in sf().


texts: Identifying raster max and converting to point using ArcPy?

texts:
This is a variant of finding max elevations in a raster and converting them to point containing the max value. I have done this successfully using the full raster (39000x39000), zonal stats, and a CON expression. However, I want to use a small rectangle to define the search area, returning the max value and converting that to a point.

To speed processing, I first extract the portion of the raster delimited by master_mask (rectExtract). I then set the extent to that smaller raster and extract the maximum value within it using zonal statistics and store to a new raster (maxpixel). All proceeds fine to this point, both rasters having the same extent. (Alternatively, I skip this step and simply use rectExtract.maximum).

Then I use a CON expression to compare rectExtract with maxpixel. This is where the problem is. The output raster, instead of being the same extent as the inputs, is the extent of the full raster (39000x39000) and no match value is found, even though I explicitly set the extent to the size of the clipped raster beforehand. The convert-to-point then fails.

Any ideas?

import arcpy
from arcpy import env
from arcpy.sa import *
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

master_raster="NCALM_all.tif"
master_mask="Extract_peak_box"

# Set the extent environment using a shapefile
arcpy.env.extent = master_mask
print arcpy.env.extent
arcpy.env.snapRaster = master_raster
env.workspace = "C:/sapyexamples/output"

# Execute ExtractByRectangle
rectExtract = ExtractByRectangle(master_raster, master_mask, "INSIDE")
print "Max of extracted rectangle"
print rectExtract.maximum,rectExtract.height,rectExtract.width
rectmax=rectExtract.maximum
arcpy.env.snapRaster = rectExtract

maxpixel = ZonalStatistics(master_mask, "FID", rectExtract, "MAXIMUM", "NODATA")
print "below is the max pixel height"
print "maxpixel",maxpixel.maximum,maxpixel.height,maxpixel.width

arcpy.env.extent = master_mask
print "Extents before CON"
print arcpy.env.extent

#Problem is here, env.extent not being enforced
OutRas2 = Con(rectExtract == maxpixel,maxpixel)
print "OutRas2",OutRas2.maximum,OutRas2.height,OutRas2.width
#OutRas2 = Con(rectExtract == rectmax, rectmax)  (gives the same problem)
print "Finished peak pixel IDs"

try:
    arcpy.RasterToPoint_conversion(OutRas2, "Temp_peak", "VALUE")
    print "finished raster to point conversion"

finally:
    print "job complete"


texts: ArcGIS Server GP Service - RasterIO.dll crashing ArcSOC.exe

texts:
I've been having a terrible time this week turning some very simple geoprocessing scripts into gp services on ArcGIS Server 10 SP 4.  In the case of the linked post, I found that using certain raster formats seemed to be the trouble maker on ArcGIS Server.

Once again, I have a small, simple script that performs a viewshed analysis.  It runs perfectly from ArcGIS desktop.  As a gp service, all hell breaks loose...

Whats interesting about this case is that the analysis itself completes without error.  All of the processing is done within a gdb - and all output feature classes are being produced.  This eliminates the possibility of a permission related error.

The output of the gp service is a feature set - to be loaded from one specific feature class in my processing file gdb.  The feature class is always there, however the gp service crashes before the feature set is ever sent to client.  When I log into the ArcGIS Server, there will be windows message box open saying the ArcSOC.exe has stopped working.  Looking the Event Viewer; the faulting module is RasterIO.dll.

ArcGIS Server has no log entry for this crash.  All attempts to trap any errors in the python script itself dont yield anything either.

Has anyone experienced anything similar, or have any idea how I can get more useful information on the exception.


texts: QGZ file without any non-ASCII characters opens just as a completely blank project

texts:
I just wanted to open a qgz project file which I used one week before in QGIS 3.6.1 without any problems. Today it opens just as a blank project like a new empty one (same problem in 3.8.3 as well as in the long stable version).

But it should still work since it has 61 KB.

I read about the same problem on this page

http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-Sometimes-qgz-files-opens-just-as-a-completely-blank-project-td5389126.html

... but it cannot be an ASCII problem since the name of the file is "Resource-based Dependency in Tropical Societies". Saving as a new file doesn't work and unzipping either. Is there any known solution?

Elsewhere it was considered as solved with version 3.6, but obviously it is not.


texts: Setting Python script tool parameter Type based on another parameter Value?

texts:
In my script tool case, I've used the validation tool to make parameter[4] enabled only if parameter[3] equal a certain value, but i need to make this parameter[4] required only if enabled. the problem is that when i set it's type to "required" and i try to execute  the script it asks me to set a value for parameter[4] even if it stayed disabled!

Is There any solution to make it Required only if it's enabled?


texts: Determine left/right based on headings of in & out legs

texts:
I'm analyzing roads layer to create navigation layer. Each vector Linestring segment has direction of traffic.

Turn defined as where 2 directional segments meet.

However, I find it challenging to associate with turns what we know as "left/right" turn association.

Playing with headings (In both notations: [0,360], [-180,180]) - it's hard to find a formula. Example for the [0,360] notation:

However, I assume there is a known solution for that, since it's so common task (although I didn't find related questions here).


texts: Adding Geometry to a mapbox vector tile using java library

texts:
I'm attempting to make a mapbox vector tile to be used in leafletjs. I have a couple of layers I need to do with this, but I started with a point layer since I thought it would be easier.

I am using the mapbox-vector-tile-java library, but the documentation is pretty slim so I've struggled with figuring out the process to use it.

I have the following code that I got from it's github documentation.

IGeometryFilter acceptAllGeomFilter = geometry -> true;
Envelope tileEnvelope = new Envelope(bb.east, bb.west, bb.south, bb.north); // TODO: Your tile extent here
MvtLayerParams layerParams = new MvtLayerParams(); // Default extent

Geometry jtsGeom = gf.toGeometry(tileEnvelope);
TileGeomResult tileGeom = JtsAdapter.createTileGeom(
        jtsGeom , // Your geometry
        tileEnvelope,
        gf,
        layerParams,
        acceptAllGeomFilter);

VectorTile.Tile.Builder tileBuilder = VectorTile.Tile.newBuilder();
VectorTile.Tile.Layer.Builder layerBuilder = MvtLayerBuild.newLayerBuilder("myLayerName", layerParams);

MvtLayerProps layerProps = new MvtLayerProps();
IUserDataConverter userDataConverter = new UserDataKeyValueMapConverter();
List<VectorTile.Tile.Feature> features = JtsAdapter.toFeatures(tileGeom.mvtGeoms, layerProps, userDataConverter);

MvtLayerBuild.writeProps(layerBuilder, layerProps);
VectorTile.Tile mvt = tileBuilder.build();
try {
    String str = new String(mvt.toByteArray(), "UTF-8");
    System.out.println(str);
} catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

I have a set of point data in an ArrayList, but I can't see anything that takes a Point object. Originally, I used the GeometryFactory.createMultiPoint() method before I figured out that it just returns a multipoint object, but does not add those points to the GeometryFactory object.

What do I need to do to add my Points so they are included in the mapbox vector tile output? Subsequently, is that process going to be the same when I am making a layer of multi line features?

Edit:

The points I'm trying to use are a ArrayList currently, but I can change it to any structure that will work.

ArrayList<Point> pts = new ArrayList<Point>();
Point pt = null;
while( rs.next()) {
    points.add(rs.getString(1));
    pointData += rs.getString(1);
    pt = gf.createPoint(new Coordinate(rs.getDouble(3), rs.getDouble(2)));
    pts.add(pt);
    pt = null;
}

Solution:

With the help from @ShibaBandit, I came up with the following solution. They pointed me to a convenience class (MvtEncoder) and other documentation that led me to a much simpler solution.

Final Code:

    Collection<Geometry> geom = new ArrayList<Geometry>(points);
    JtsLayer layer = new JtsLayer("points", geom);

    JtsMvt mvt = new JtsMvt(layer);

    byte[] ba = MvtEncoder.encode(mvt);


texts: Setting masked pixel value in Google Earth Engine image export?

texts:
I'm using Earth Engine to preprocess and download some NDVI data. I used a region of interest to clip the imagery to a geometry, and values from the Summary QA layer to mask out pixels that were of poor quality. However, when I export imagery to my drive account, download, and open in R, the areas that were masked have pixel values set to 0. I want those pixels to be set to NA's instead. A repeatable example:

// Generate Region of Interest
var ROI = ee.FeatureCollection('TIGER/2016/Counties')
  .filter(ee.Filter.eq('NAME', 'Waldo'));

// Create clipping function
var clipper = function(image){
  return image.clip(ROI);
};

// Create a QA mask function
var masker = function(image){
  var mask1 = image.select('SummaryQA').lte(1);
  var mask2 = image.select('SummaryQA').gte(0);
  return image.updateMask(mask1).updateMask(mask2);
};

// Compile the data
var dataset = ee.ImageCollection('MODIS/006/MOD13Q1')
                  .filter(ee.Filter.date('2018-01-01', '2018-12-31'))
                  .map(clipper);
print("MOD13Q1 Image Collection", dataset);

// Select just NDVI for repeatable code
var ndvi = dataset.map(masker).select('NDVI');
print("MOD13Q1 NDVI Collection",ndvi);

// PREPARE DATA FOR EXPORT
// Tyler Erickson provided the stacking function
// https://gis.stackexchange.com/a/254778/67264
var stackCollection = function(collection) {
  var first = ee.Image(collection.first()).select([]);

  // Write a function that appends a band to an image.
  var appendBands = function(image, previous) {
      var dateString = ee.Date(image.get('system:time_start')).format('yyyy-MM-dd');
      return ee.Image(previous).addBands(image.rename(dateString));
  };
  return ee.Image(collection.iterate(appendBands, first));
};
var ndvi_img = stackCollection(ndvi);

// Export the data
Export.image.toDrive({
  image: ndvi_img,
  description: 'MOD13Q1_comp_NDVI',
  scale: 250,
  region: ROI,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});

If you take the product from Export.image.toDrive() and read it into R using...

library(raster)
NDVI = stack("/PATH/TO/MOD13Q1_comp_NDVI.tif")
plot(NDVI[[10]])

...you will find that areas outside the AOI, and areas that were masked, have values of 0, rather than NA. Is there a way to export imagery from Earth Engine with masked areas set to NA, or some other obvious non-standard value? I'd be fine with masked areas set to -99999 because they can get set to NA after the fact.

I looked into using the defaultValue argument described here but when I include that in the formatOptions an error is returned indicating that it isn't a valid argument ("defaultValue" is not a valid option, the image format "GEO_TIFF""may have the following options: cloudOptimized, fileDimensions").


texts: Orfeo Toolbox (OTB) Haralick texture extraction not running

texts:
I am using QGIS 2.8.1 (Wien) 64-bit

When I run it this error immediately shows up:

Algorithm Haralick Texture Extraction starting...
unsupported operand type(s) for +: 'NoneType' and 'str' See log for more details

I think my orfeo toolbox error because same problem when I run another tools(pansharpening), anyone can help me?


texts: Print Composer using input from several Spatialite-tables with PyQgis

texts:
How can I create PDFs out of QGIS using the Print Composer Templates that include a lot of text (from a text-template) and within the text several information comes out of my spatiallite-database. A map is also part of it, but I am only having problems with the spatialite-text-inputs.

Workflow:

User Selects a Polygon (This is the only layer that is loaded)
Users presses a „Print this for me“ Plugin Button (Using the
Polygon-Name I get out all the information I need from the tables in
my Spatialite DB)
User gets a wonderful PDF

The table that includes the polygon is different from the tables (yes, there are several) that have all the other information, this is due to data-entry reasons.

I already have a solution using QWebView(), but my solution is not very good for composing the map itself and if a user wants to change my templates, it is a bit complicated. Here my solution:

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import sqlite3

# create web view
webview = QWebView()

connection = sqlite3.connect('D:\allthedata.sqlite')
cursor = connection.cursor()
cursor.execute('SELECT name FROM information WHERE polygon_nr = 2015')
for row in cursor.fetchall():
    name = row[0]
# I use 15 inputs, but to simplify this, I am only using „name“ here

# get template and push into webview
template_txt_temp = open("c:/template1.txt") #I have several templates
template_txt = template_txt_temp.read()
html = template_txt.replace('$name$', name)

# the template ist just some html, but can have several pages;  html →
#
Hello, this is just a dummy text, I want to show you, where I
# want so insert the $name$ from the database

print html
print type(html)

webview.setHtml(html)

printer = QPrinter()
printer.setPageSize(QPrinter.A4)
printer.setOutputFormat(QPrinter.PdfFormat)
printer.setOutputFileName(r'C:\report.pdf')
webview.print_(printer)

And out of it I get a nice PDF. So the essential question:
How do I get the "name" information out of my database and into the Print Composer? (And is my Question even understandable?) Maybe this picture helps:


texts: Areas of imported features in Google Earth Engine

texts:
I originally wanted to ask the following question:
"In the FeaturesCollection r_features, why do the two features have such different areas? They should have the same areas because they are both buffers with a 10km radius around two different points. (Note that the points are "close enough" so that the earth's curvature shouldn't be creating "huge" differences.)"
But, no one would be able to help me with the question, because I generated these features in R, exported them to .shp, and imported them into EE.
So I decided to generate two buffers in EE around the same points, and compute their area. The answer is what I expected -- the areas are the same.
So now my question is:
Assuming that the two features that I imported in EE were constructed in the way I just described (they are both 10-km buffers around two different points), can anyone tell me why my calculation in EE is returning different areas? Perhaps something with the export-import process? But what exactly?
To be clear, I would expect some (although small) differences in the areas calculated in R and in GEE, just because of projections and machines' precisions. But I find bizarre that the two geometries have the same area in R, but different areas in GEE.
Here is my code -- and here's the link to run in in GEE, where you can also load the imported features:
// load features imported from R (public access)
var r_features = ee.FeatureCollection("users/dimitrijoe/r_features");

// create two points
var pt1 = ee.Geometry.Point([-64.64, -9.27]);
var pt2 = ee.Geometry.Point([-51.77, -3.13]);

// create buffers
var bf1 = pt1.buffer(10 * 1000);
var bf2 = pt2.buffer(10 * 1000);

// check areas of the buffers I just created (equal to the 9th decimal)
print('Area of bf1 in km2:', bf1.area().divide(1000 * 1000));
> Area of bf1 in km2: 310.4060072301467

print('Area of bf2 in km2:', bf2.area().divide(1000 * 1000));
> Area of bf2 in km2: 310.40600723013716

// calculate areas of the buffers I imported
var addArea = function(feature) {
  return feature.set({areaSqkm2: feature.geometry().area().divide(1000 * 1000)});
};

// map the above function over the FeatureCollection.
var fc = ee.FeatureCollection(r_features);
var fc = fc.map(addArea);

// Print the first feature from the collection with the added property.
var area1 = fc.filter(ee.Filter.eq('id', 206)).first().get('areaSqkm2');
var area2 = fc.filter(ee.Filter.eq('id', 1)).first().get('areaSqkm2');

print('Area of Buffer #1 in km2:', area1);
> Area of Buffer #1 in km2: 305.13

print('Area of Buffer #2 in km2:', area2);
> Area of Buffer #2 in km2: 310.15

Update: here's the R code that generates the same two features:
library(sp)

# projections
WGS84 = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
SAD69_POLYCONIC = "+proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs"

# data frame with poitns
points = data.frame(
            long = c(-64.64, -51.77),
            lat = c(-9.27, -3.13),
            id = c(206, 1)
        )

# create spatial object
sp = SpatialPointsDataFrame(
        cbind(points$long, points$lat), points, proj4string = CRS(WGS84))

# trabsform to planar projections to create buffer
sp = spTransform(sp, CRS(SAD69_POLYCONIC))

# create buffers
buffer = gBuffer(sp, byid = T, width = (10 * 1000))

# check area in km2
gArea(buffer, byid = T)/(1000 * 1000)
>  1        2
>  309.017  309.017

# export to shapefile
writeOGR(obj = buffer, dsn = TMPDIR, layer = "r_features", driver = "ESRI Shapefile")


texts: Can we manually select which satellites to use in solution?

texts:
For example, I have used below satellites ID in current solution:

ID    Signal Strength
______________________
 1         21
22         23
19         12
36         26
20         18
 3         29
32         14
13         15

But I want to filter and use only those satellites with higher signal strength in my solution, let say satellite ID: 1, 22, 36, 3. Is it possible?


texts:
I would like to download a terrestrial image from a WMS server. The Save as option in QGIS didn't work, so I tried to download it with the r.in.wms command from the GRASS shell as described at SE: Save a WMS layer on your Hard Drive via QGIS?. However, the r.in.wms module is broken (the method option is used twice in the run command and throws the error Option <method> does not accept multiple answers) and when I use the GRASS Shell of the above mentioned plugin I do get an HTTP error:

r.in.wms url=http://85.18.173.22:8080/DbMAP_WMS/ORTOFOTO_2011/WMSservlet output=Orthofoto_2011 layers='Egeos 2011' wms_version=1.1.1 srs=3003 format=png

GRASS_INFO_ERROR(44976,1): HTTP Error 505: HTTP Version Not Supported

Does anybody know what that error means or how I can fix it?

QGIS version: 2.18.3
GRASS 7 plugin
WMS url: http://85.18.173.22:8080/DbMAP_WMS/ORTOFOTO_2011/WMSservlet


texts: What open source software should I use to geocode the addresses?

texts:
Need to geocode the student addresses using the regular 5-digit zip
codes. Geocoder will give us an accurate point on the map, so in a Latitude and Longitude environment that should suffice for our specific data needs with respect to answering the question of what students belong to what congressional district. ArcGIS for Desktop
software will geocode the student addresses and get points on the map.
Then we need to create two other layers one for the representative
districts and the other for the senate districts. Then we have to use the
Spatial Join tool in the toolbox to combine the tables and give us one
attribute table that includes all of our geocode located points and what
congressional district they belong to.

So ArcGIS for desktop will be able to solve my puzzle, but is their any open GIS tool available which will solve this issue?


texts: OpenLayers.Layer.clone() not returning a unique Layer object

texts:
I'm taking a layer (layer_orig) and calling the clone method to create a new layer (layer_clone) with same features, styles, etc. I am changing the name and map instance of the layer with:

layer_clone.map = null;
layer_clone.setName(name);

This works exactly as expected, even giving a unique layer id to the new layer.

However, if I then update the styleMap of layer_clone, the styleMap of layer_orig is updated as well - suggesting that layer_clone is a reference to layer_orig and not a completely unique Layer object.

Is there a way to get a unique Layer object that is a direct clone of another layer?


texts:
I'm running Geoserver 2.1.3 (SVN 16668) and am trying to get REST working with GeoWebCache. I've got :8080/geoserver/rest working correctly, and am able to interact with that side of things. However, :8080/geowebcache doesn't exist. I'm told that the only two contexts that exist are /javadocs and /geoserver.

I understand that there is such a thing as a REST api for geowebcache. How do I get to it? Is there some additional plugin that I need to download for GeoServer before it becomes accessible, or something of that sort? I haven't been able to find anything on the net about someone just missing the REST section of GeoWebCache. The rest of it works fine. Any ideas?

Thanks!


texts: Compute the latitude of a center of mercator projection

texts:
Say I'm looking at a portion of a map that's displayed using Mercator projection with the view bounded at 40°N and 20°N. How do I compute the latitude of the point that's in the centre of that view?

I figured it's not 30° and can compute it by firstly projecting the bounding latitudes onto a square using Mercator, computing the middle point, and then projecting back onto a sphere. But is there a simpler way of achieving the same without having to project to and from Mercator?


texts: Multilingual capabilities in WAB and/or AGOL?

texts:
Looking for multilingual capabilities in AGOL and/or WAB... Seems like a widget or other setting ought to be available somewhere?
An option for the public to choose a language from a list of languages in a map viewer is what we are looking for.
Searched a bit and only thing that came up was esri's option to 'Switch Language' on the bottom of their AGOL documentation pages, for example:
https://www.esri.com/en-us/arcgis/products/arcgis-online/overview
https://www.esri.com/fr-fr/arcgis/products/arcgis-online/overview
tried Google Translator (English to Spanish) but that throws an error:
https://translate.google.com/translate?hl=en&sl=en&tl=es&u=https%3A%2F%2Fwebmaps.sandiego.gov%2Fcippublic%2F


texts:
I am trying to get the PyQGIS working with the Spyder installed as part of Anaconda.

I first get the path to PyQGIS and dependent packages from QGIS console, typing:

import sys
sys.path

After that I add the path outputted by this command in sys.path within Spyder:

sys.path.extend(['my/path/list']).

After this, I can import qgis.core, but while importing qgis.gui, it gives and error saying

  "RuntimeError: qgis._gui cannot import type '����' from PyQt5.QtCore"

From within the QGIS console everything works fine.

The spefications of my system are:

Operating system: Ubuntu (18.04 bionic) on Windows 10. For GUI I use VcXsrv X Server.
Python version: 3.7.2
PyQt5 version in Spyder: 5.9.2
QGIS version: 3.6

I thought it is, maybe, related to the version of PyQt5 that I use in Spyder. In Spyder it is 5.9.2, whereas in QGIS it is 5.10.1. However, installing newer version (5.12.1) of PyQt5 the problem did not solve, instead qgis.core also stopped importing. When I try to import qgis.core, python interpreter crashes saying "Segmentation fault (core dumped)".

What could be the problem here?


texts:
What is the safety guarantee using the QGIS platform for data storage?
I want no data loss and easy access to data when stored. Can passwords be used to safeguard data and how do I give permissions to users?


texts: how to tell google geocode() that you are looking for an administrative_area address and not a city?

texts:
If you were to do a reverse lookup for a region (States or Province) and that region happen to have a city with the same name, then Google geocoder will return the information on the city instead of the region.

How would you pass parameters to Google telling it that you are indeed interested in the region and not the city?

Calling Google WebAPI would be something like this:
http://maps.google.com/maps/api/geocode/json?components=administrative_area:Durango|country:MX&sensor=false

But instead, we want to call geocoder.

_geocoder = new google.maps.Geocoder();
_geocoder.geocode(request_dict, function(results, status) { ... }

How do you form the "request_dict"?


texts: geopandas error when writing to_file() "ValueError: 'long' is not in list"

texts:
I'm having a problem getting the "to_file()" function to work with geopandas

import geopandas as gpd
f  = gpd.read_file('fin.shp')
f.to_file('fout.shp')

Error Output:

    ---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-14-6fdee04dae37> in <module>()
      1 f  = gpd.read_file('fin.shp')
----> 2 f.to_file('fout.shp')

C:\Python27\lib\site-packages\geopandas-0.1.0.dev-py2.7.egg\geopandas\geodataframe.pyc in to_file(self, filename, driver, **kwargs)
    308         filename = os.path.abspath(os.path.expanduser(filename))
    309         with fiona.open(filename, 'w', driver=driver, crs=self.crs,
--> 310                         schema=schema, **kwargs) as c:
    311             for i, row in self.iterrows():
    312                 c.write(feature(i, row))

C:\Python27\lib\site-packages\fiona\__init__.pyc in open(path, mode, driver, schema, crs, encoding, layer, vfs)
    154         c = Collection(path, mode,
    155                 crs=crs, driver=driver, schema=this_schema,
--> 156                 encoding=encoding, layer=layer, vsi=vsi, archive=archive)
    157     else:
    158         raise ValueError(

C:\Python27\lib\site-packages\fiona\collection.pyc in __init__(self, path, mode, driver, schema, crs, encoding, layer, vsi, archive, **kwargs)
    129             self.encoding = encoding
    130             self.session = WritingSession()
--> 131             self.session.start(self, **kwargs)
    132             self.encoding = encoding or self.session.get_fileencoding().lower()
    133

C:\Python27\lib\site-packages\fiona\ogrext.pyd in fiona.ogrext.WritingSession.start (src/fiona/ogrext.c:15304)()

ValueError: 'long' is not in list

I'm using fiona 1.1.3 and geopandas 0.1 with Python 2.7 on Windows.  It may be a problem with my ogrext.pyd dll in fiona.


texts: What does control points look like in viewer ? How spread do they need to be ?

texts:
I have a question for you . As I am working on using ERDAS Autosync to orthorectify from an ungeoreferenced aerial photos to known reference image. I have a DEM that to go with it as well.

I understand that in order to use “Tie” points or control points need to have them to be spread out. What I would like to see is an example of control points?  I have been in searching for this information on google and I find very limited on it.  What I would like to find the information that I prefer to see them in pictures or they can come from the research papers to show what control points looks like.  It will help me to understand how spread-out they need to be.

Here is the example I found :

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.516.2917&rep=rep1&type=pdf


texts:
Background: We're doing a lot of project work using QGIS. These projects are based on "template"-projects for administrative units, which are always kept up to date, e.g. new WMS are added, newly downloaded data, etc. Once a project is created, we save the corresponding template to the project folder and usually add some project-specific layers. These layers are not relevant to all the other projects, hence the "separation" in order to keep the template as sleek as possible.

Problem: Sometimes datasources change. WMS get turned off, or new data becomes available, etc, pp. These changes are incorporated into the templates by us, naturally. But the already created projects also need to be updated - which can be labourous, especially if there are 50 or more projects within an administrative unit.

Question: Is there a possibility to automatically update the layers/links in these projects? Either by using the templates as reference, or by incorporating a database, or by some other means?


texts:
I'm doing research which aims to analyse location based social networks. So the Foursquare dataset is suitable for me. Is there any Foursquare dataset available? I need 4 information in the dataset: userID (number is ok); position(long,lat); time; relationship between user.

Thanks a lot.


texts: How to add layer with ArcPy and retain feature class metadata (like Credits) in layer properties?

texts:
I have multiple feature classes in a geodatabase, each feature class has metadata including a Description, Credits, and other information. If I use the 'Add Data' button in ArcMap 10.1 to add one of feature classes then that metadata is imported into the layer description. Ie, I view the layer properties and Description, Credits, etc., are filled in. However, if I use arcpy and add the feature class using MakeFeatureLayer_management and AddLayer then that metadata is not imported.

Does anyone know if its possible to get that full functionality of feature classes and their description, credits, etc to load with arcpy? Am I doing something wrong? Or, must I export the metadata, read the sections I want, and add that text to the layer file?

As requested, a code sample is:

mxd=arcpy.mapping.MapDocument(path_to_blankmxd)
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
arcpy.MakeFeatureLayer_management(featureclass_sde,activation+"_"+featureclass)
addLayer=arcpy.mapping.Layer(activation+"_"+featureclass)
addLayer.name=layername
arcpy.mapping.AddLayer(df,addLayer)

The feature class to be inserted in the MXD is 'featureclass_sde' with full metadata. However, once its inserted all metadata is lost. At present I am exporting metadata as XML, parsing XML to get metadata elements (description, source, etc), and then inserting those elements into the MXD. It works but seems so.... wrong....


texts: How to save a Polygon in an integrated Google Earth

texts: I created a Polygon in Google Earth which is integrated in my Website. Now i have to get the KML File from this Polygon. Can anybody tell me how to do this?


texts:
I am trying to finalize some code for a class that I am taking and had to move it to another location and I renewed the paths. After that things started to go crazy. I have copied/ paste all of the new directories and made sure that the shapefile still works (which it does) and is still located in the file folder. the error is on line 47 :layer = mapping.Layer(r"C:\Workspace\GIST315\Project_folder\New File Geodatabase.gdb\Active_Rigs"). below is the error.

Runtime error
Traceback (most recent call last):
  File "<string>", line 47, in <module>
AttributeError: 'module' object has no attribute 'layer'
>>>

import arcpy
import os
arcpy.env.workspace = "C:/Workspace/GIST315/Project_folder"
from arcpy import da #this will allow access to the data access module
from arcpy import mapping # Mapping Module
from arcpy import env
arcpy.env.overwriteOutput = True
# Open a map document (shell document)
Rig_mxd = mapping.MapDocument("C:/Workspace/GIST315/Project_folder/mxd files/Rig Activity.mxd")
AP_mxd = mapping.MapDocument("C:/Workspace/GIST315/Project_folder/mxd files/Permitted Activity.mxd")

#Setting Dataframes in order of MXD. Only one frame per MXD.
first_df = mapping.ListDataFrames(Rig_mxd)[0]
second_df = mapping.ListDataFrames(AP_mxd)[0]
#------------------------------------------------------------------------------
#Projection data procresses

#file output for Project active Rigs
file_output1 = "C:/Workspace/GIST315/Project_folder/Shapefiles/rig_exampleRigsDIShape.shp"
file_output2 = "C:/Workspace/GIST315/Project_folder/New File Geodatabase.gdb/Active_Rigs"

for infc in arcpy.ListFeatureClasses():

        # Determine if the input has a defined coordinate system, can't project it if it does not
        dsc = arcpy.Describe(infc)

        if dsc.spatialReference.Name == "Unknown":
            print('skipped this fc due to undefined coordinate system: ' + file_output1)
        else:
            # Determine the new output feature class path and name
            outfc = os.path.join(file_output2, file_output1)

            # Set output coordinate system
            outCS = arcpy.SpatialReference('NAD 1927 StatePlane Texas Central FIPS 4203')

            # run project tool
            arcpy.Project_management(file_output1, file_output2, outCS)

            # check messages
            print(arcpy.GetMessages())

#---------------------------------------------------------------------------------------------------------
#This is added to assure that rig symbology will always be on top
#Layers to be added to the data frame

layer = mapping.Layer("C:/Workspace/GIST315/Project_folder/New File Geodatabase.gdb/Active_Rigs")
# Change the name of the layer before adding
layer.name = "Rigs Locations"
# Add the layer at the top of the data frame
mapping.AddLayer(first_df,layer,"TOP")

#----------------------------------------------------------------------------------------------------------

#setting symbology

sym_layer = mapping.Layer("C:/Workspace/GIST315/Project_folder/sourceLayer/Rigs Locations.lyr")
layer_Rigs = mapping.ListLayers(Rig_mxd,"Rigs*",first_df)[0]
mapping.UpdateLayer(first_df,layer_Rigs,sym_layer,"TRUE")

Rig_mxd.saveACopy("C:/Workspace/GIST315/Project_folder/mxd files/Rig Activity_FINAL.mxd")

# Export Rig map to PDF
pdf_file = "C:/Workspace/GIST315/Project_folder/PDF exports/Rig Activity Map"
mapping.ExportToPDF(Rig_mxd,pdf_file,resolution=300)


texts: How to clip specific cells from raster that aren't fully covered by mask?

texts:
I have two data layers of the same geographic area, one which has a much coarser resolution and the other that is a much finer resolution. As such, the first layer has some cells that do not overlay perfectly with the second layer. That is to say, that some cells of the first, more coarse layer, are not completely aligned with the edge of the second layer.

I need to remove the cells from the coarse raster layer that are not fully covered by the finer one. No cells lie completely outside the second layer, but a few are partially uncovered, and I want to remove them from the raster and create an output that doesn't have these cells. Essentially, I want to edit the first layer so that every single cell lies completely within the coverage of the second layer. I want to remove the grey cells in the image that are peeking out from behind the landcover data in the foreground.

I've tried extract by mask, but as best I can figure, it's not working because the center of the cells still lie inside the polygon.

Does anyone know how to alter the environment somehow to make the extract by mask exclude cells that lie even partially outside the polygon? Or am I using a completely wrong method?


texts: Fmask 4.0 on Sentinel data from Sinergise/AWS

texts: I have downloaded Sentinel data from the AWS bucket on S3. How can I place this into the appropriate SAFE folder structure to run the Fmask cloud masking software (https://github.com/GERSL/Fmask)?


texts: openlayers - filter specific feature(s) from ol.Collection

texts:
I have a feature collection (ol.Collection) contains number of points, lines and polygons features that originated from interactive drawing.

I want filter/select  only for a certain geometry (e.g. Linestring) to write in GeoJSON format (All I can do now is looping on feature id via getFeatureById() methods)

is there any way to filter feature(s) based on its geometry type?


texts: Why can't I make GeospatialPDFs using QGIS 3.14?

texts:
According to this link, QGIS 3.10 and newer can create GeospatialPDFs. However, when I go to export through layout view, the box is greyed out. What am I doing wrong?
Edit: As someone below points out, this question has a workaround for PCs but Macs are out of luck. See: Export geospatial PDF from QGIS on Mac
More details: When I go to export PDF through the layout view, the box for Create GeospatialPDF (GeoPDF) is greyed out with the message "GeoPDF creation requires GDAl version 3.0 or later." I have tried manually updating my GDAL to the latest (3.1.2) and upgraded my QGIS from 3.10 to 3.14. The message persists. From past StackExchange messages, I see that there are a number of workarounds from before QGIS supported GeospatialPDFs, but I'm hoping to get this particular feature of the PDF export function to work. I'm using Mac OSX 10.14.6.
Screenshot of the About page:

Screenshot of processing options menu:


texts:
I am using "proj4js and OpenLayers" for my mapping. I got the projection and datum (which is based on "Transverse Mercator") of a local plane and
this plane is part of a grid which returns coordinates of local points in the form of Northings and Eastings.

Now, as we know that OpenLayers accepts latitude and longitude hence I am doing transformation of Northings, Eastings of a point to lat, long using Transverse Mercator (tmerc.js)

Script of proj4js...

So my question is will this be enough for the correct transformation or is there is any thought or suggestion you would like to give regarding the transformation script I am using?


texts: Raster symbology tab - compact display option for selected colors

texts:
I've recently switched from the 3.0 early adopter release to 3.8, and I'v noticed that the raster style/symbology tab became a lot less...convenient...to use if you're working with more than 5 values, since the displayed colors now take up 3-4 times the height of the the actual value&display text.

3.0

3.8

I might be missing something obvious here, but is there a way to switch this back to a compact display? I'm working larger color ramps and not being able to see all values at a glance kind of impacts my productivity. What version number introduced this change?


texts: Remove duplicate feature based on Condition

texts:
I have a line dataset that was produced from ModelBuilder (not built by me) that involves splitting lines into individual segments using existing Point dataset in between as the split zone. However, the process has a little "flaw" and it created two extra duplicates that retains the incorrect attributes from other Point on the original line.

So what I ended up with is 3 short lines (with identical length but incorrect attributes) on top of each points and only one of them has the correct attributes that I want to keep.

I've attached couple images below for clarity-

Figure 1: 3 Line feature stacked atop a single Point feature.

Figure 2: Table for the 3 selected identical lines

If you look to the far right of the table, the Shape_Length are identical, but the 3rd from the top is the only attribute that is correct based on its location. The other two lines have CROSS_PRCN and LENGTH taken from the purple Point to the right on the same original Line shown in Figure 1 which I want to remove.

Is there any way to remove the other two lines that have the incorrect attributes? There are over 600,000 line segments so I can't remove them manually. I tried using Delete Identical but because of their identical shape length, it doesn't select the ones I want to remove correctly. The single Point has one field (SplitID) that matches the correct Line segment but I'm still quite an amateur at GIS so I don't know if there is a tool that can select matching attributes from two dataset and delete the duplicates.

I have ArcGIS 10.2.2 w/ ArcInfo license installed. Available extensions are - 3D Analyst, ArcScan, Geostatistical Analyst, Network Analyst, Publisher, Schematics, Spatial Analyst, and Tracking Analyst.


texts: Specify a starting location with IgxDialog

texts:
I would like to know what is the easiest way to set the starting location of a data dialog to a IWorkspace?

My problem is that basically I do not want a connection (.sde file) for the users. I want to set the starting location to a workspace connected via IPropertySet. Is it possible?

This is related: Force a new AddDataDialog to open at a defined directory path but does not help.

EDIT:

following Kirk's suggestion, here's a code snippet. This does not work.

    public static IDataset OpenDatasetDialog(IWorkspace workspace,int handle)
    {
        var workspaceName = (IWorkspaceName)((IDataset)workspace).FullName);
        var gxDatabase = new GxdatabaseClass();
        gxDatabase.WorkspaceName = workspaceName;

        // we need to set a different variable as .NET runtime does not allow ref parameters with casts
        object gxObj = (object)gxDatabase;

        IGxDialog openDialog = new GxDialogClass();
        openDialog.RememberLocation = false;
        openDialog.set_StartingLocation(ref gxObj);
        var filterColletion = (IGxObjectFilterCollection)openDialog;
        filterColletion.AddFilter(new GxFilterTablesAndFeatureClassesClass(), true);
        openDialog.AllowMultiSelect = false;
        IEnumGxObject datasets = null;
        IDataset dataset = null;

        if (openDialog.DoModalOpen(0, out datasets) && datasets != null)
        {
            IGxObject gxObject = datasets.Next();
            if (gxObject is IGxDataset)
            {
                IGxDataset gxDataset = (IGxDataset)gxObject;
                dataset = gxDataset.Dataset;
            }
            else
                throw new ArgumentException();
        }
        openDialog.InternalCatalog.Close();
        return dataset;
    }


texts: How can I find the segment of a line that lies within a polygon using Postgis?

texts:
Given a "road", represented by a line, that crosses a "state", represented by a polygon:

What is the SQL query I can use to find the segment of the road that is within the state?

A concrete example.

I have a single line representing Route 66 which traverses the USA. I also have polygons for each state. I want to find the segment of Route 66 that lies within Texas.


texts: Using gdal_merge to create a grayscale mosaic

texts:
My gdal fu is weak and I need help! ;)

I'm creating a mosaic in geotiff from hundreds of ecw. I created a list of all my rasters and used this command:

gdal_merge -o c:\temp\output_image.tif -q -v --optfile c:\temp\rasterlist.txt

It's working, but I'd like now to create one with only the red band. Is it possible to do it with gdal_merge?

Thanks!


texts: I tried to run QGIS using python but I couldn't get any output on screen?

texts:
uri ="C:/Users/rajagopalv/Desktop/poi_sunnyvale.csvdelimiter=%s&xField=%s&yField=%s" % ("|", "x", "y")

vlayer = QgsVectorLayer(uri, "address_sunny", "delimitedtext")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

This my code as per the http://docs.qgis.org/ but I couldn't get the output layer on the screen.


texts: Deleting GeoServer coverage store using REST API

texts:
I was wondering if there is any example of using REST API with curl to delete a coverage store?

I looked at the examples at the boundless website http://docs.geoserver.org/2.5.x/en/user/rest/examples/curl.html, and there doesn't seem to be any.

I tried:

curl -v -u admin:geoserver -X DELETE http://localhost:8080/geoserver/rest/my_ws/coveragestores/my_cover

and

curl -v -u admin:geoserver -X DELETE http://localhost:8080/geoserver/rest/my_ws/coveragestores/my_cover?recurse=true

In each case, I get an 405 Method Not Allowed.

Can anyone advise how to fix this?

Output error was:

> DELETE /geoserver/rest/my_ws/coveragestores/my_cover?recurse=true&purge=all HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 405 Method Not Allowed
< Allow: GET
< Date: Mon, 20 Oct 2014 01:24:28 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact

--- EDIT ---

Additional Info:

$curl -v -u admin:geoserver -XGET -H "Accept: text/xml"  http://localhost:8080/geoserver/rest/workspaces/my_ws/coveragestores.xml

returns:

* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Server auth using Basic with user 'admin'
> GET /geoserver/rest/workspaces/my_ws/coveragestores.xml HTTP/1.1
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: text/xml
>
< HTTP/1.1 200 OK
< Date: Mon, 20 Oct 2014 02:53:53 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Content-Type: application/xml
< Transfer-Encoding: chunked
<
<coverageStores>
  <coverageStore>
    <name>my_cover</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/my_ws/coveragestores/my_cover.xml" type="application/xml"/>
  </coverageStore>
* Connection #0 to host localhost left intact
* Closing connection #0
</coverageStores>


texts:
An answer was provided to this question previously, however it did not solve the question.

I am analyzing MODIS data, and would like to download and process the data. Here's what I have done so far:

library(MODIS)

MODISoptions(localArcPath = "C:\\Users\\rameshv\\Downloads\\MODISDownloads\\",
         outDirPath = "C:\\Users\\rameshv\\Downloads\\MODISOutputs\\")

'outDirPath' does not exist and will be created in
'C:/Users/rameshv/Downloads/MODISOutputs/'
 'MRT_HOME' not set/found! MRT is NOT enabled! See:
 'https://lpdaac.usgs.gov/tools/modis_reprojection_tool'

 STORAGE:
  _______________
  localArcPath : C:/Users/rameshv/Downloads/MODISDownloads/
  outDirPath   : C:/Users/rameshv/Downloads/MODISOutputs/

 DOWNLOAD:
 _______________
 MODISserverOrder : LAADS, LPDAAC
 dlmethod         : auto
 stubbornness     : high

 PROCESSING:
 _______________
 GDAL           : Not available. Use 'MODIS:::checkTools('GDAL')' for more information!
 MRT            : Not available. Use 'MODIS:::checkTools('MRT')' for more information!
 pixelSize      : asIn
 outProj        : asIn
 resamplingType : NN
 dataFormat     : GTiff

As you notice above, it suggests that there is no GDAL. However, I have installed rgdal as well as:

> MODIS:::checkTools('GDAL')
 Checking availability of 'FWTools/OSGeo4W' (GDAL with HDF4 support for Windows):
  OK, 'gdalinfo' is not recognized as an internal or external command, operable program or batch file. found!

Any suggestions?


texts: Data Interoperability Toolset not working ArcGIS for Desktop?

texts: The Data Interoperability Tools .tbx appears in my system toolboxes, however when I double click quick export or import, a red X appears.  I have gone into the administrator settings and the tool doesn't appear to be installed. How do I install it?  I am using ArcGIS 10.2 for desktop trial.  After I attempt to evaluate extensions, I receive a message which states all requested features have already been authorized on this machine.


texts: Generate GPS coordinates for a shapefile in QGIS

texts:
I have a shapefile with the network or roads (lines) of the netherlands. I also have the .dfb (attributes) .prj(projection) and .shx (index) files. In the attribute table, you can find the addresses and some other information. When selecting them, they appear as crosses (points) on the map. What I now would like to do is generate GPS coordinates for these streets in the attribute table and export these as a excel file.

I already tried vector -> geometry tools and export/add geometry columns but this just add an additional column giving the length of the road. Anybody know what else i can do or i am overlooking?


texts: Why my markers move when I resize my map on Leaflet?

texts:
I have already get an eye on Google and seen that the solution should be the iconAnchor property.

I have set it to the same values that my iconSize. But it fails. When I resize my map the icon change their location with the map resizing.

How can I ensure my marker remain responsively on the same location?

Here my marker' code:

var placeholder1 = L.icon({
      iconUrl: "https://image.flaticon.com/icons/svg/484/484167.svg",
      iconSize:     [47, 47], // size of the icon
      iconAnchor:   [47, 47], // point of the icon which will correspond to marker's location
      popupAnchor:  [-25, -50], // point from which the popup should open relative to the iconAnchor
      tooltipAnchor:[30, -2]
    });

    var placeholder2 = L.icon({
      iconUrl: "https://image.flaticon.com/icons/svg/484/484167.svg",
      iconSize:     [47, 47], // size of the icon
      iconAnchor:   [47, 47],
      popupAnchor:  [-25, -50], // point from which the popup should open relative to the iconAnchor
      tooltipAnchor:[10, -2]
    });

    var placeholder3 = L.icon({
      iconUrl: "https://image.flaticon.com/icons/svg/484/484167.svg",
      iconSize:     [47, 47], // size of the icon
      iconAnchor:   [47, 47], // point of the icon which will correspond to marker's location
      popupAnchor:  [-25, -50], // point from which the popup should open relative to the iconAnchor
      tooltipAnchor:[0, 0]
    });

    var placeholder4 = L.icon({
      iconUrl: "https://image.flaticon.com/icons/svg/484/484167.svg",
      iconSize:     [47, 47], // size of the icon
      iconAnchor:   [47, 47], // point of the icon which will correspond to marker's location
      popupAnchor:  [-25, -50], // point from which the popup should open relative to the iconAnchor
      tooltipAnchor:[-30, 130]
    });

var marker1 = L.marker(location ,{icon: placeholder1}).addTo(this.map);
var marker2 = L.marker(location ,{icon: placeholder2}).addTo(this.map);
var marker3 = L.marker(location ,{icon: placeholder3}).addTo(this.map);
var marker4 = L.marker(location ,{icon: placeholder4}).addTo(this.map);


texts: Does anybody know how to install GeoNetwork in a port other than the deafault(8080), because, in my machine this port is already occupied and i don't want to remove the program running on this port because of its complexity.


texts: Querying Postgis data in R using dplyr package

texts:
Does anyone have a workflow for querying postgis data in R using the dplyr package?

R doesn't like the spatial columns in postgis data so can't read them in like a postgres table. I get the error message:

Warning message:
In postgresqlExecStatement(conn, statement, ...) :
  RS-DBI driver warning: (unrecognized PostgreSQL field type geometry (id:17846) in column 1)

I know there are other ways of reading in spatial data as all I want to do is join some data  that have in R to an existing postgis table using R. I'm trying to avoid exporting it to a shapefile first.


texts:
I have constant problems in saving edits in QGIS. I have seen this behaviour with multiple geometry types, namely polygons, multipolygons and points.

Say that I want to update a value in one cell of a point layer (.geojson). I press toggle editing, edit the cell content (using the right type of content), save changes with save layer edits-button and then press the toggle edit button once again to close editing. Then I close the attribute table, and when I open it again the edits have disappeared.

How should I troubleshoot this further? Can this be related to point / polygon type, e.g. multipolygon or multipoint?

I am using 3.4.10 LTR release.


texts: How can I tile a region in Google Maps given a zoom level

texts:
I am searching for a way to generate a tiling of a grid region using Google Maps. I have found a way to generate a grid and as well as a reference for pixel to width ratios given a zoom level, but I conceptually can't put them together.

Assuming I retrieve a static map from Google that I know the centre (lat,lon), zoom and dimensions (pixels), could someone point me in the right direction to calculate the coordinates at the centre of the 4 edges of my view or the centre of the next tile?


texts: What is the syntax for assigning a feature attribute value to a variable in the QGIS Advanced Python Field Calculator?

texts:
Using the QGIS Advanced Python Field Calculator, I am able to assign the new field a value from a feature an existing field using value = <Attribute_1>.  I run into a problem when I am using more complex code like the following used to calculate the absolute differences in azimuths:
diff = <Az_1> - <Az_2>
absDiff = abs(diff)

if absDiff == 180:
    value = absDiff
elif absDiff < 180:
    value = diff
elif <Az_1> > <Az_2>:
    value = absDiff - 360
else:
    value = 360 - absDiff

When I run the code through a compile and substitute the Az_1 and Az_2 variables with integers, the code works, yet I get the following error when executing the model the code is a part of in QGIS:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'


texts: How to force 1-bit raster output in ArcGIS 10.1 for Desktop?

texts:
Any ideas on how to force a 1bit raster output in ArcGIS 10.1? By default, ArcGIS is being very dense about recognizing  pixel depth. I have a binary raster [0,1] and a mask raster [1] and they are being written as 32bit. Because of this they are ~10GB rather than ~32MB.

The raster dimensions are row=51836, col=53276 at 30m. I am outputting an "img" format. I tried writing into a filegeodatabase and it outputs 8bit. However, when I try to convert the filegeodatabase raster into a img format it produces a garbage raster (scrambled pixels representing only part of the image). In the arguments for the "convert raster to different format" (ArcCatalog context menu), I am specifying 1 bit and removing the default NoData value or setting it to a 0 background value. The resulting rasters are either still 32bit or garbage.

When originally creating the rasters, I am wrapping my raster calculator statement in Int() but am still getting 32bit, which should not be possible. I could imagine 8bit output, but 32bit is nonsensical for integer and is normally assigned to floating point. I do have my geoprocessing environment defined and am working in an Albers projection.


texts: Getting roads with topography in CityEngine

texts:
I need to get a 3D model of both the terrain and the roads on/aligned to the terrain. However the import method I am using does not make useable files.
Following the process of importing map data in CityEngine, I

Click File -> Get Map Data

Select my region and check the download boxes

I leave the default data selected (when I select all I get an even worse result)

I click "Finish"

The results are pretty bad, with roads not making sense, floating the air, going halfway inside the ground, etc.

Is CityEngine not the best tool for this (I also have ArcGIS Pro if it is better)? Can this be easily resolved with some of the more advanced features of the downloader?


texts:
I am using the following coming back from a socketio connection:

L.geoJson(data.streets, {
     onEachFeature: map.onEachFeature
});

It's throwing the following error:

Invalid GeoJSON object.

My GeoJSON is here

I've run it through several JSON/GeoJSON validating tools and they all come back as valid. It's also definitely already a json object (I tried with JSON.parse(data.streets))

What am I missing? I did use a flatProperties option on my osmtogeojson library but as mentioned, the above code validates on all the online checks I can find.


texts: Why imported mdb database doesn't show any polygons

texts:
I've imported an MDB database to ArcMap but it doesn't show any polygon.
Do I have to modify something else after importing data? I  can only see the imported database tables


texts: Finding centroids for icosahedral gnomonic projection?

texts:
I've been trying to create an icosahedral gnomonic projection, like this example by Jason Davies or this one (the Fisher projection). The method that I initially used was using the centroid of each face of the icosahedron as the tangent point for projecting onto each face. Having oriented my projection so that the poles were at vertices, I found that the centroids would be at +-47.71 degrees latitude ((atan(1/2) + atan(1/2) + 90)/3) every 72 degrees longitude for the triangles touching the poles, and at +-8.86 degrees (atan(1/2)/3) for the other 10 faces.

However when I tried constructing it with these values, nothing aligns. I noticed that my regions were not the same as the ones in the examples, so I fudged with my centroid points, and I found that +-53 degrees and +-11 degrees more or less makes everything align. However, I have no idea where these numbers come from. I'm assuming that my method of using the centroids of the faces of the icosahedron is wrong. So my question is, how do I actually calculate these numbers/why do they work?


texts: How to extend multiple lines at once ArcMap

texts: I have 1700 cross sections lines in a shapefile that are too short and I need to extend all of them about 100-200ft. I don't really want to go click on each line vertex and extend each one individually or redraw 1700 lines to be longer. How can I lengthen a bunch of lines to my desired length at once?


texts: How can I place a ETRS89 layer to WGS84 project in QGIS?

texts:
I've got a QGIS project with several layers with SRC EPSG·4326 - WGS84. I have downloaded from a government website a layer projected in ETRS89. I have tried my very best to match this new layer with those of the project, without any success. Changing CRS or activating "on the fly CRS transformation" do not solve the problem.

Copy-paste of extent. First, layer correctly placed. Second, problem layer (in Spanish, sorry!)

Extensión
En unidades del sistema de referencia espacial de la capa
xMín,yMín 387849.41,4137256.07 : xMáx,yMáx 549392.49,4264982.51
Sistema de referencia espacial de la capa
+proj=longlat +datum=WGS84 +no_defs

Extensión
En unidades del sistema de referencia espacial de la capa
xMín,yMín -9.52083,35.1667 : xMáx,yMáx 4.47917,43.8333
Sistema de referencia espacial de la capa
+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs


texts: Use a spatial lag model to predict (in R)

texts:
I have two polygon datasets, one for year 2010 and another for year 2015, each containing multiple features with a number of different variables.

I used a spatial lag model to predict the dependent variables (urban density) in the 2010 dataset. This was done in R.

For the 2015 data I only have explanatory variables, no urban density, and would like to predict  urban density for 2015 using the results/coefficients from the 2010 spatial lag model.

I can do this with a linear regression model in R by using the predict function, see link. But I can't get that to work on spatial data, wont work because it doesn't take space in to consideration.


texts: Retrieving Full Path to Feature Class in ArcMap

texts: I often need the full path to various feature classes so that I may insert them into a Python script. I have been using ArcCatalog for this by copying the path in the Location bar for a given feature class and pasting this in my script. However, as I work mostly in ArcMap, I would rather have access to this path there. The General and Source tabs in a feature classes Properties window do not contain the full path in an SDE and the path is in two separate lines in a file gdb. How may I quickly find this path in ArcMap?


texts: Does anywhere host the OSM planet DB as a Postgresql dump? I have tried using osm2pgsql but I have limited processing capabilities so it is never finishing. I do not have bandwidth limitations so ideally I would like to download a Postgresql dump or another format that does not require as much processing. Data in a torrent would be ideal.


texts: Warning while importing GeoPandas in Jupyter notebook

texts:
While importing geopandas in jupyter notebook, I'm getting following warning.
import geopandas as gpd

Warning:
PROJ: proj_create_from_database: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
What does it mean?. I have been using geopandas for a long time. Never saw this while importing.


texts: How to crop raster in R without losing the colors?

texts:
I have a 2x3 raster in R, with values 1 to 6.

library(raster)
r <- raster(nrows=3,ncols=2,xmn=0,xmx=2,ymn=0,ymx=3,vals=1:6)
colors <- c('red','orange','yellow','green','blue','purple')
plot(r,col=colors)

Now if I clip the raster, leaving the first two values out (red and orange), the color palette becomes useless.

r1 <- crop(r,extent(c(0.5,1.5,0.5,1.5)))
plot(r1,col=colors)

Notice how the extent includes only the colors yellow, green, blue and purple from the first picture. However, these are not the colors in the second picture. The numbers in the raster are correct.

> values(r)
[1] 1 2 3 4 5 6
> values(r1)
[1] 3 4 5 6

How can I use the same color variable (colors) in both cases in a consistent way?

My real world problem is cropping a world raster into country maps, using the same vegetation color code.


texts:
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "F:/QGIS/bin/test.py", line 6, in <module>
    img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied)
NameError: name 'QImage' is not defined

I encountered this error when I was trying for Map Rendering and Printing on python console given in QGIS.


texts: Expected output for Geometry Generator of Polygon

texts:
I have a number of point features and created various font and simple markers for each point.

I now want to add background for the Font marker, so that it would be readable against the basemap background. I assume a way to do this would be to add a geometry generator (polygon) for the layer. Now, I have a trouble creating the output desired to produce the polygon.

I have tried using make_polygon, but I can't understand what arguments need to be to produce a polygon. Ideally I want to specify origin point ($geometry=original point layer location) and -x, x, -y, y extents. Maybe there is another way to accomplish this?

TL;DR: Need to create a polygon with defined size using geometry generator based on point layer.