texts: Deleting geoprocessing results in ArcGIS without closing mxd file

texts:
I am trying to run a loop of a couple thousand maps in ArcGIS Desktop 10.1 but the program keeps crashing after printing about 100 maps at a time. I read at GeoNet that I need to make sure my results in Results Management are never saved, so I changed my settings accordingly. While this measure allowed the .mxd file to stay a constant size, it didn't resolve the problem of ArcGIS crashing after printing ~100 maps.

In addition, while I'm in a single ArcGIS session, all results still get written to the Current Session in Results. It seems like the reason ArcGIS ultimately crashes is that too much memory is occupied after the results from ~100 maps are memorized.

I just want to run a single ArcGIS session (never closing the .mxd file while the loop is running) because I have thousands of maps to print and I wouldn't like to open and close the same .mxd file and run the same Python script 20-30 times.

Is there a way I can delete the results from the Current Session at the end of each iteration of my for loop?

I was hoping this would prevent ArcGIS from crashing after every 100 maps.

In my Python script, I first read in relevant lists of parameters for my loop from a text file. Then I run my one main for loop. In each iteration, I am saving one buffer .shp and one polygon .shp in a workspace: env.workspace = r"C:\ArcGIS\Mapping Files\All Shapefiles" I then zoom to the buffer layer, export to pdf, and delete the two new layers like so:

for lyr in arcpy.mapping.ListLayers(mxd, "Shape_" + object[i], df):
    arcpy.mapping.RemoveLayer(df, lyr)
for lyr in arcpy.mapping.ListLayers(mxd, "Buffer_" + object[i], df):
    arcpy.mapping.RemoveLayer(df, lyr)
del mxd, df, lyr


texts: Copy first row of attributes and paste for each feature

texts:
In a newly digitised polyline vector layer, there are 7 columns attributes value that are choosen inside a value map combo-box that MUST be exactly the same for every newly digitised line (I choose the values for the first digitised line then all the other newly digitised lines must have the same value of the first one).

I'd like to fill them (in a kind of automatic, or auto completed way) with the exact same values of the first digitised row.

I was thinking about some unique values properties, but since the values are kept inside a combobox I can't use both field properties together.
OR to complete the missing values with some field calculator expression at the end of the digiting.

EDIT:
I'm using QGIS 2.8 and 2.10 running in both Windows and Ubuntu
I post a screenshot of the value map used for 7 different columns, all real(4,3)

The attribute table is the following one and all the "empty" () columns should have the same value appearing in the first row

Like this


texts: OpenLayers Plugin with on-thy-fly-transformation causes wrong coordinates

texts:
I am using the OpenLayers Plugin with the maps from Google Satellite. In Qgis I have chosen on-the-fly-transformation into WGS 84. But the WGS 84 coordinates in Qgis are now 0.15 degrees further E than they should be. When I am setting on-the-fly-transformation into UTM 32 N the values seems to be slightly wrong as well.

When I am loading the OpenLayers Plugin into Qgis do I have to confirm somewhere what the original projection is? Or what is the problem here?

Qgis 1.8.0 on Mac 10.6


texts:
So I have some points on a map. I've written code to allow the user to drag a point around the screen which more or less looks like this.

- (void) mapView:(AGSMapView *) mapView didMoveTapAndHoldAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint graphics:(NSDictionary *) graphics    {
    [self.polyLine updatePoint:mappoint onPath:0 atIndex:self.indexOfPointBeingMoved];
    [layerThatThePolyLineIsIn dataChanged];
}

However, this implementation seems to be amazingly laggy. Is it just me or the esri's ArcGIS SDK very bogged down and inefficient?


texts: How to add individual layer of WMS group layer to ArcMap?

texts:
I am attempting to add a single WMS layer that is part of a WMS service group layer.  I am writing code to do this using ArcObjects in C# .Net.  So far I have been unsuccessful.  I can either only add the whole group layer, or I can add the individual WMS sub-layer but the full group is also still added.

Here is the code I have tried.  I have allowed the user to select a layer from a list, and this code is trying to only add that selected layer.

    IWMSGroupLayer wmsMapLayer = new WMSMapLayerClass();
    IWMSConnectionName connName = new WMSConnectionNameClass();

    IPropertySet propSet = new PropertySetClass();
    propSet.SetProperty("URL", "http://www.___________________?");

    connName.ConnectionProperties = propSet;

    IDataLayer dataLayer = (IDataLayer)wmsMapLayer;
    dataLayer.Connect((IName)connName);

    IWMSServiceDescription serviceDesc = wmsMapLayer.WMSServiceDescription;
    IWMSLayerDescription groupDesc = serviceDesc.LayerDescription[0];

    for (int i = 0; i < groupDesc.LayerDescriptionCount - 1; i++)
    {
        IWMSLayerDescription layerDesc = groupDesc.LayerDescription[i];

        if (layerDesc.Title == lstWMSLayers.SelectedItem.ToString())//Checking if this is the selected layer
        {
            ILayer newLayer;
            IWMSLayer newWMSLayer = wmsMapLayer.CreateWMSLayer(layerDesc);
            newLayer = (ILayer)newWMSLayer;
            wmsMapLayer.InsertLayer(newLayer, 0);

            IMxDocument mxDoc = (IMxDocument)ArcMap.Application.Document;
            mxDoc.FocusMap.AddLayer((ILayer)wmsMapLayer);
            IActiveView activeView = (IActiveView)mxDoc.FocusMap;
            activeView.Refresh();
        }
    }

In ArcMap I get the following tree of layers

WMS Service Group Layer

Selected WMS Layer
WMS Group Layer

All the layers that are part of the service...

Any suggestions?


texts: Get google maps small portion for offline application

texts: Can some body help me in downloading some portion of hybrid maps of google as I want to store them in my server and display them on web application using openlayers so that the user will only have access to only that particular area, not the whole map


texts: Finding point on road network at specifc distance from a specific point

texts:
I have road network in a geodatabase. At a certain junction in network (Point A), I want to figure out Point B which is X kilometres away from Point A in certain direction.

Summary:

Point A: fixed point
Point B: Unknown
Kms: fixed distance

I have been doing it by using Network Analyst; plotting a route from Point A to B, clicking at info to see kms, then adjusting the point B and recalculating the route until I reach the desired kms distance.

Since the roads are curved, I can't use buffer. Please advise if there is a better way.


texts: Optimal Sentinel 2 Bands combination for NDMI

texts:
I want to calculate NDMI (Normalized Difference Moisture Index) using Sentinel 2 bands on QGIS. I am not sure if right formula is B8-B11 or B8A - B11. Band 8 seems to give better results but on the other hand band 8A is reported more often in papers.
Is there any expert who can help?


texts: Google Earth transparent weather KML file overlay

texts:
I am unable to make any of the weather overlays from the website below transparent/opaque once they are loaded into Google Earth.

I have attempted to modify the KML file directly by using the  attribute inside of the Screen Overlay tag but this did not work.

Is there any way of making the overlay transparent before it renders to the screen?

https://radar.weather.gov/ridge/kmzgenerator.php


texts:
I often visit strange-maps, cool-maps, makingmaps and hipkiss.org.

Do you know of other good websites for map-lovers?


texts: How to use Windows Form ListBox DragDrop to retrieve path names from MXD Layers

texts:
I'm trying to make a tool with a feature can drag in raster layers from an mxd to the ListBox on a Windows Form and retrieve their file paths. So far I've found that the only format the layer can be converted to is "ESRI Layers" but I can't find any documentation on what to do from there. When I drag in one raster layer:

public ExporterForm()
{
    InitializeComponent();
    listBoxLayers.AllowDrop = true;
    listBoxLayers.DragEnter += new DragEventHandler(listBoxLayers_DragEnter);
    listBoxLayers.DragDrop += new DragEventHandler(listBoxLayers_DragDrop);
}

void listBoxLayers_DragEnter(object sender, DragEventArgs e)
{
    string[] formats = e.Data.GetFormats(); //returns string[].Length = 1
    DataFormats.Format esriLayersFormat = DataFormats.GetFormat(formats[0]);
    //esriLayersFormat.Name = "ESRI Layers"
    //esriLayersFormat.Id = 50082
    if (e.Data.GetDataPresent(DataFormats.FileDrop)) //tests false
        //only way I can think to retrieve the file info
}

I've tried using Activator.CreateInstance(e.Data.GetType()) but then I can't cast the object to any ESRI interfaces.

EDIT: I removed this line from listBoxLayers_DragEnter():

e.Data.SetData(esriLayerFormat);


texts: GRASS module g.copy returns irrational outputs

texts:
I took this as reference, Moving raster to different mapset GRASS GIS, and I use pyscripter to use GRASS module g.copy from outside,

import os
import sys

#set up GRASS environment variables
sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))
import grass.script as g
import grass.script.setup as gsetup
gisbase = os.environ['GISBASE']
gisdb = 'C:\Users\Heinz\Documents\grassdata'
location = 'newLocation'
mapset = 'watershed_analysis'
gsetup.init(gisbase, gisdb, location, mapset)

#copy raster data
g.run_command('g.copy', rast = 'hc@TC, hc')

#check result
print g.read_command('g.list', _type = 'rast')

The output is raster files in mapset PERMANENT, thus not what I want. (current mapset is watershed_analysis)

*** Remote Interpreter Reinitialized  ***
>>>
----------------------------------------------

raster files available in mapset <PERMANENT>:
hc

----------------------------------------------

Seems I don't successfully copy the raster file to the mapset I want.

How to fix this problem？ I am using GRASS 6.4.3, python 2.7.6 under Windows 8.1 x64.

Update#1
@gene, I do the same thing in the python shell of the GRASS layer manager,

Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>import grass.script as g
>>>g.run_command('g.copy', rast = 'acc@TC, acc@watershed_analysis')
0

>>>g.read_command('g.list', _type = 'rast')
----------------------------------------------

raster files available in mapset <PERMANENT>:
hc

----------------------------------------------

g.read_command('g.mlist', _type = 'rast')
hc

In the output above, I want to copy the file acc from mapset TC to current mapset watershed_analysis, but the output still tells me about another mapset. (g.list and g.mlist outputs the same except the later one wouldn't tell me the info of mapset.)

And I go to check results in the file of this mapset, there are no new file copied to it. Maybe there are problems in my script.

Update#2
If I tried the module in GRASS GUI, here's result,

No output but the error message,

Traceback (most recent call last):

File "C:\OSGeo4W\apps\grass\grass-6.4.3\etc\wxpython\gui_c
ore\forms.py", line 655, in OnRun

self.goutput.RunCmd(cmd, onDone = self.OnDone)
  File "C:\OSGeo4W\apps\grass\grass-6.4.3\etc\wxpython\gui_c
ore\goutput.py", line 554, in RunCmd

task = GUI(show = None).ParseCommand(command)
  File "C:\OSGeo4W\apps\grass\grass-6.4.3\etc\wxpython\gui_c
ore\forms.py", line 1871, in ParseCommand

blackList = _blackList)
  File "C:\OSGeo4W\apps\grass\grass-6.4.3\etc\python\grass\s
cript\task.py", line 470, in parse_interface

tree = etree.fromstring(get_interface_description(name))
  File
"C:\OSGeo4W\apps\Python27\lib\xml\etree\ElementTree.py",
line 1300, in XML

parser.feed(text)
  File
"C:\OSGeo4W\apps\Python27\lib\xml\etree\ElementTree.py",
line 1642, in feed

self._raiseerror(v)
  File
"C:\OSGeo4W\apps\Python27\lib\xml\etree\ElementTree.py",
line 1506, in _raiseerror

raise err
xml.etree.ElementTree
.
ParseError
:
unknown encoding: line 1, column 30

I don't know if I did something wrong in inputs.


texts: Having difficulty retrieving city and area names using Geopy (Google V3)

texts:
I am using Geopy to call different addresses, to see what cities and neighbourhoods they belong to.

from geopy.geocoders import GoogleV3
import json

places = '1238 Davie St, Vancouver, BC'

geolocator = GoogleV3(api_key='')
location = geolocator.geocode(places, language='en')

c = location.raw['address_components']
print c

counties = [c['long_name'] for c in c if 'neighborhood' in c['types']]
localities = [c['long_name'] for c in c if 'locality' in c['types']]
print counties, localities

Its working for counties, but not localities (cities).

[{u'long_name': u'1238', u'types': [u'street_number'], u'short_name': u'1238'}, {u'long_name': u'Davie Street', u'types': [u'route'], u'short_name': u'Davie St'}, {u'long_name': u'Central Vancouver', u'types': [u'neighborhood', u'political'], u'short_name': u'Central Vancouver'}, {u'long_name': u'Vancouver', u'types': [u'locality', u'political'], u'short_name': u'Vancouver'}, {u'long_name': u'Greater Vancouver', u'types': [u'administrative_area_level_2', u'political'], u'short_name': u'Greater Vancouver'}, {u'long_name': u'British Columbia', u'types': [u'administrative_area_level_1', u'political'], u'short_name': u'BC'}, {u'long_name': u'Canada', u'types': [u'country', u'political'], u'short_name': u'CA'}, {u'long_name': u'V6E 1N3', u'types': [u'postal_code'], u'short_name': u'V6E 1N3'}]
[u'Central Vancouver']

---> 32 localities = [c['long_name'] for c in c if 'locality' in c['types']]
     33 print counties,     localities

TypeError: string indices must be integers

Not sure why I am getting that mistake. I also want to be able to pass a Pandas column instead of typing in a static address, is there a neat way of doing that?


texts: How to get server info from WMSCapabilitiesStore

texts:
I am using the following code to retrieve a list of data layers hosted on a WMS Server:

var store = new GeoExt.data.WMSCapabilitiesStore({ url: fullUrl });

// Add some callbacks to handle various situations
store.on('load',      successFunction);
store.on('exception', failureFunction);

store.load();

function successFunction(store, records)
{
    // Generate a nice table or something
}

That works well enough for retrieving layer data, but while I am connecting to the server, I also want to get the service/title attribute for the server itself.  That data is contained in the server's response to the GetCapabilities request, and it must be stored somewhere, but I can't figure out how to retrieve it from the data returned to successFunction.


texts: Replacing WKT with WKB in PostGIS query & Shapely

texts:
I am extracting a geometry (type geometry(Geometry,4326)) from a PostGIS database.  I managed to plot them from a GeoPandas GeoDataFrame using the following code :

cursor.execute("SELECT id, ST_asText(wkb_geometry) FROM mydb")

rows=[]
for id, geom in cursor:
    data = {'id': id, 'geometry': shapely.wkt.loads(geom)}
    rows.append(data)

geopandas.GeoDataFrame(rows,crs='epsg:4326').plot()

Figuring WKB would be more efficient than WKT, I was expecting querying with ST_Binary()/ST_AsEWKB()/ST_AsTWKB() and loading with shapely.wkb.loads(geom) to be equivalent to the above, but it throws a

  TypeError: bytes or integer address expected instead of memoryview instance

Why ?


texts: C# code to display result of spatial query on arcmap

texts:
the problem is i have to display those points on arcmap that lies inside the envelope.I am explaining what i have done so far.
    I have one point feature class say featureclass ,open it and used one ARCGIS Snippet i.e. GetActiveviewFromArcmap() and constructed one envelope as-:

Iactiveview pactiveview=GetActiveviewFromArcmap(m_application);
Ienvelope penvelope=new EnvelopeClass();
penvelope=pactiveview.extent;
penvelope.QueryCoord(out minx, out miny,out maxX,out maxY);

Ispatialfilter sp=New IspatialfilterClass();
sp.geometry=penvelope;
sp.geometryfield=featureclass.shapefieldname;
sp.spatialrel=esrispatialrelenum.esrispatialrelIntersects;

Ifeaturecursor fc=featureclass.Search(sp,false);
Ifeature feature=featurecursor.nextfeature();

What i have to do is to display the output of this spatial query on arcmap.how i will retrieve the selectionset of spatialfilter query and how to diaplay it on arcmap.


texts:
How do I upload a .tif file to my running GeoServer via Node.js?
I'd like to upload a GeoTIFF to provide it as a WMS by the GeoServer.

The GeoServer is responding with a 405, which I think is right (http://docs.geoserver.org/latest/en/user/rest/api/coveragestores.html#workspaces-ws-coveragestores-cs-file-extension). Unfortunately, I can't find the file on the GeoServer.

This is my code:

// GeoServer upload

    var http = require('http');
    var auth = 'Basic ' + new Buffer('admin' + ':' + 'geoserver').toString('base64');
    //build the object to post
    var post_data = (path.join(paperpath, paperid, "geotiff", req.files["otherfiles"][fileno].originalname)); // Path to .tif file

    var s = JSON.stringify(post_data);
    var post_options = {
      host: 'localhost',
      port: '9000',
      path: '/geoserver/rest/workspaces/Geosoftware-2/coveragestores/test/file',
      method: 'POST',
      headers: {
        'Content-Length': s.length,
        'Content-Type': 'image/tif',
        'Authorization': auth
      }
    }
      // Set up the request
    var post_req = http.request(post_options, function(res) {
      res.setEncoding('utf8');
      console.log(res.statusCode);

      res.on('data', function(chunk) {
        console.log('Success! ' + chunk);
      });
    });
    // post the data
    post_req.write(s);
    post_req.end();


texts: Why is "Add feature" of the GPS Information tool inactive for some of my PostGIS layers?

texts:
I cannot find any info on limitations/requirements of "GPS Information" tool for QGIS (2.2.0) against data layers.

For some layers I'm able to collect data for others button "Add feature" is inactive (despite layer is read/write and in an edit mode). My goal is to collect features directly to existing PostGIS layers.


texts: Dynamic Slope Calculation on ArcGIS Online Web Application

texts:
I have a DEM raster layer in our own GIS portal. It is then included in a web map online from which a web application is created.
I am looking for a way that would allow users to calculate slope by given two points on the web app. I can't find a widget in the web app builder that serves this purpose. I also tried the elevation profile service (https://www.arcgis.com/home/item.html?id=4aa7e7ae8b964ee88c78cc261b9faf82) but it didn't use my own DEM.
It also seems that none of the widgets in the web app builder works with a raster. Am I right?
Any suggestion?


texts: How to import DGN geometry into a file geodatabase?

texts:
Specifically, I have an empty File GeoDatabase template consisting of several Group Layers, each containing several Feature Classes. In fact each FC has several subtypes exposed by including a .lyr file in ArcMap. I want to extract the basic polygon geometry data from a dgn, and insert this geometry for each feature into one of the FCs in my FGDB.

This is what I have got so far:

I can import dgn data using arcpy.CADToGeodatabase_conversion(), but this only creates a new CAD dataset in the FGDB alongside my group layers. In ArcMap, by opening the attribute table on the Polygon FC in the new CAD dataset, I can see the fields I want (Shape, Shape_Length, Shape_Area), and I SUPPOSE I need to apply SearchCursor() and InsertCursor() to copy each geometry object to the correct FC in the FGDB. How would the code look to do this?

Is there a slicker way to read dgn geometry objects into an existing FGDB feature class?


texts: Error: "Layer is not valid" when adding a WFS layer in QGIS

texts:
Tried at both QGIS 2.16.3 and 2.18.8. Running on Windows 10 64bit.

Dutch government offers a particular WMS/WFS service. The WMS link works fine

I can also connect to a WFS link:

https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF/wfs?

But then I get an error:

  Layer is not valid: The layer retrictToRequestBBOX='1'
  srsname='EPSG:28992'
  typename='MBIZ4280LEEF_public:referentiekaart_grid_100m'
  url='https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF/wfs?'
  version='auto' table="" sql= is not a valid layer and can not be added
  to the map

Turning OTF on/off at project properties doesn't make a difference.
I was able to load in other WFS-layers from other Dutch government links, like the BAG.

Any ideas?


texts:
Spatial clustering with PostGIS including attributes

I have a points table with some attributes like : year, type, etc. And I'd like to do a points clustering in PostGIS. I followed the subject in Spatial clustering with PostGIS

But I have the following problems:

first problem without considering the attributes: I got a table with points and I can visualise it in Qgis but not in ArcMap and the result has no SRID (the original table has srid :4326) and I'd like the output with geom as point or polygon (not geometry collection); second problem: I'd like to do a clustering for every year (2014,2015, 2016) and every type (a, b, c) and get the result in one table but I do not know if it is possible and how to do it?

CREATE TABLE table_clusterd AS (
    SELECT row_number() over () AS id,
      ST_NumGeometries(gc) as radius,
      gc AS geom_collection,
      ST_Centroid(gc) AS centroid,
      ST_MinimumBoundingCircle(gc) AS circle,
   FROM (
     SELECT unnest(ST_ClusterWithin(geom, 100)) gc
     FROM myTable
   )
f);


texts: WFS request (INTERSECTS POINT) to Geoserver returns 2 features - 1 correct polygon and 1 near polygon

texts:
I am using a Geoserver with SHP layers, that works fine in my project.I am trying to migrate layers to MySQL db, works fine for WMS requests. But when I try to send a point coordinates to find if it is inside any polygon, I am getting 2 features as a response - one is correct (rda LO-28) and one is quite near but not includes the point in fact (rda LO-23).
Maybe "INTERSECTS" is not a proper CQL FILTER for a point? But it works for shape layer...
WFS requests returning strange results


texts: Why does rendering from a view take significantly longer than rendering from a table?

texts: Using QGIS, rendering from a view takes significantly longer than rendering the same data from the source table.  The view is just a select all from source table.  The database is SQL Server 2012.


texts:
Is there a service that can provide altitude isoline as vector tiles?

I've seen that there are some posts on how to convert elevation tiles (raster DEM) with python or javascript applying some image processing (threshold images and then apply marching squares algorithm for conturing)
as in those links:

https://github.com/mapbox/mapbox-gl-js/issues/5844
https://github.com/turf-junkyard/turf-isolines
https://github.com/osm2vectortiles/dem2vectorterrain
https://github.com/yvecai/DEM-scripts/blob/master/2015/merge_dem_hs_and_contour.py

But I don't find any already make service that can do it. What is the easiest way of doing it?


texts:
I imported water contamination data from surface water bodies from a CSV file. Each water body was georeferenced with a single pair of lat/long coordinates. Now I have a map full of individual points which are located somewhere at the border of a lake, river etc. I only have one point per surface water body (no contours or similar).

How can I manually draw a shapefile around the points (depict the surface water bodies) which has the same properties (attribute table) as the respective point?


texts: Convert Raster to Numpy Array with only Arcpy and Numpy

texts:
All the articles I'm finding including GDAL or PIL(?) which I cannot use. So I am trying to convert a raster I have to a Numpy Array with Arcpy and Numpy and then calculate some statistics on it but running into an error. Not much documentation on this and not sure what I am doing wrong. I am running ArcGIS 10.3.1 with Python 2.7.8 on a Windows 7 machine with 16gb ram.

Here is my code:

import arcpy
from arcpy.sa import *
from arcpy import env
import numpy as np
import sys, os, string, glob

#Set Environment
arcpy.CheckOutExtension("spatial")
arcpy.env.overwriteOutput = True
env.extent = "MINOF"
Coordsystem = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"

#Set Input Data
tcorr = arcpy.Raster(r"G:/P38R37/test4/TcorrCon/Tcorr198.tif")
lowerLeft = arcpy.Point(tcorr.extent.XMin,tcorr.extent.YMin)
cellSize = tcorr.meanCellWidth

#Convert Raster to Numpy Array
#Raster is 7951 columns x 6971 rows, Floating point 32 bit, 211MB in size
tcorr_arr = arcpy.RasterToNumPyArray(tcorr,lowerLeft,7951,6971,nodata_to_value=0)

#Calculate the mean and standard deviation of the array
arr_mean = np.mean(tcorr_arr)
arr_std = np.std(tcorr_arr)

#Take the mean and std and do math
double_std = arr_std * 2
cfactor = mean - double_std

print cfactor

The error I am getting says:

Traceback (most recent call last):
File "C:\Python27\ArcGIS10.3\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
exec codeObject in __main__.__dict__
File "C:\Users\mschauer\Documents\Py Scripts\scratch\numpytest_tcorr.py", line 20, in <module>
tcorr_arr = arcpy.RasterToNumPyArray(tcorr,lowerLeft,7951,6971,nodata_to_value=0)
File "C:\ArcGIS\Desktop10.3\ArcPy\arcpy\__init__.py", line 2244, in RasterToNumPyArray
return _RasterToNumPyArray(*args, **kwargs)

MemoryError

Any ideas as to what I am doing wrong?


texts: The shortest path is not shown correctly at the time box

texts: I am trying to find the shortest path using "Road Graph Plugin" in QGIS 2.18.22. When I set the Criterion as "Length", the length is shown but the time is not shown and it is shown as "infh". What does the "infh" mean? How can I fix it?


texts: Resume Tilemill MBTiles export after crash

texts:
Is there a way to resume a Tilemill export (MBTiles) after it has crashed?

Today I just got the following crash:

 FATAL ERROR: Evacuation Allocation failed - process out of memory

This was just a little sample export, but I will need to make a pretty huge export (size of Europe with Zoom Level from 0 - 18) and if that would happen inbetween this export I'd like to know that I don't loose everything, but just a little part and that Tilemill will continue afterwards...

Is there a button for resuming that I am missing?
Or what would be the most reliable solution for this process?

Thanks


texts:
I am just creating a simple web application using mapserver. It has the basic pan, zoom in/out functionality. Now what I want to try is to get an identify functional added into it so that when I click on a feature it populates the values in a table or a pop up.

Apart from using openlayers could anyone tell me how can this be implemented. Also the data is coming from PostgreSQL.

Thank You.


texts: map.getLayers().getArray() doesn't show all layers in OpenLayers

texts:
This is my code :
console.log(map.getLayers().getArray());

Output in console is correct (I have 7 layers)

But when I open the array I see only two layers.

What I make wrong?
All layers are active. I see my layers on the map.


texts: What does the extent mean when the map is rotated?

texts:
QGIS 2.18.

I have put a map into print composer and rotated the map clockwise by 45 degrees by setting "Map rotation" to 45 (it's what the client wants!).

I'm struggling to get the region I want into the print composer.

What do the extents (X min, Y min, X max, and Y max) mean when the map has been rotated?

Or if that isn't a sensible question, how do I move the portion of the map that is shown in print composer? I need to move the map down and left in the rotated view (or equivalently move the window up and right).


texts:
I use gsconfig in order to create  a layer in geoserver.
This works great but I have noticed that the title of the geoserver layer is the same as the name of the layer.
Is there a way to pass the title name when creating the layer or edit the resource of the layer later with the correct title of the layer?

I use gsconfig 1.0.0.

This is what I do right now:

    cat = Catalog(settings.OGC_SERVER['default']['LOCATION'] + "rest", 'user', 'pass')
    ds = cat.get_store("my_store")
    cat.publish_featuretype(new_table, ds, "EPSG:4326", srs="EPSG:4326")


texts: Creating an elevation profile along a KML road based on ASC files

texts: I want to make the elevation profile of a road in KML. I've found this online tool but its does not gives accurate elevations. I already have .asc files of the whole area that includes the KML route with accurate elevation details. Is there a way to extract the corresponding route elevation profile from the .asc files? Which tool can I use to do it?


texts: Iterating through geodatabase and assigning field value based on spatial location using ArcPy

texts:
This is very similar to  Python script to iterate through geodatabase and assign field value based on spatial location and Assigning field value based on location without join just different data. This worked at home on my test data but when I changed the data and ran it at work It field Calculates one time then hits me with the error below. The difference between the two systems is work is at 10.5 and home is schools 10.7. After I get this to work I was going to add in the loop through the dataset because I have 50 features and 3 more feature zones to run this through but I haven't gotten that far and I'm not sure how to name the looped layer so I don't get an error.

import arcpy

arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'\scw\ONUS_Joffre.gdb\Water'

arcpy.MakeFeatureLayer_management(r'\GDB\Basemap.gdb\Zones\BraggArea', "Bragg_area")

for fc in arcpy.ListFeatureClasses():

arcpy.MakeFeatureLayer_management(fc, lyr.name)
   # Create a search cursor for the Area
   rows = arcpy.SearchCursor("Bragg_Area")

for row in rows:

import arcpy

# Set overwrite option
arcpy.env.overwriteOutput = True

# KEEPING ORIGINAL LAYERS (NOT CREATING ADDITIONAL "JOINED" LAYER)
# Create FeatureLayers
arcpy.MakeFeatureLayer_management(r'\\GDB\Basemap.gdb\Zones\BraggArea', "Bragg_area")
arcpy.MakeFeatureLayer_management(r'\\scw\ONUS_Joffre.gdb\Water\ONUS_wMain_1', "WMain")
# Create a search cursor for the Area
rows = arcpy.SearchCursor("Bragg_Area")
for row in rows:
    # What you'll do is select each Area one at a time, and then select all the Features in that Area and calculate the field
    # NOTE: If you are using not using shapefiles, then you'll have to change the FID in the line below to OBJECTID (or similar)
    arcpy.SelectLayerByAttribute_management("Bragg_Area", "NEW_SELECTION", "\"OBJECTID\" = " + str(row.getValue("OBJECTID")))
    arcpy.SelectLayerByLocation_management("WMain", "WITHIN", "Bragg_area", "", "NEW_SELECTION")
    arcpy.CalculateField_management("WMain", "InstallationID", "'{0}'".format(str(row.getValue("InstallationID"))), "PYTHON_9.3", "")
    print "Finished processing " + str(row.getValue("InstallationID"))

Runtime error
Traceback (most recent call last):
  File "", line 17, in
  File "", line 1108, in getValue
    return convertArcObjectToPythonObject(self._arc_object.GetValue(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function.

WaterMain

Bragg Area Feature


texts: How to extract polygons that are not in one layer and overlap maybe a little bit

texts: I have two layers.  Some polygons overlap and some have new polygons that are not in my main layer however they overlap at some intersections. How can i select and extract only the polygons that are not in my main layer and have this data as a shape file or feature class.IE get only the polygons that are on my second layer which has additions to the main layer basically.


texts: Creating Multiple Webmap Applications linked to the same data

texts:
I am creating a webgis system for a smaller municipality. They need 3 different webmap applications, all of them referencing the same data. 2 of the apps are for public view and only contain certain layers, while the third map is for staff use only and contains additional layers on easements, rights-of-way, encroachments, etc.

The city staff plan to make some edits to the webmap layers. How can I set it up so that if they make changes on the staff only webmap application, those changes are automatically shown on the 2 public app?

I guess another way to put it is: is there a way to set up these 3 applications so they are referencing the same data?

For some extra info, the data is being stored through ArcGIS online servers (storage credits).


texts: Difference between MapBox mbtiles and offline mbtiles for MapBox Android SDK

texts:
I know what have some difference between MapBox mbtiles and offline mbtiles for MapBox Android SDK.

In offline  mbtiles for SDK besides tiles contains:

Style JSON.
All fonts and icons associated with the style.
TileJSON for all sources.
Map tiles covering the geographic area of the offline regions.

Then all this is Packed in sqlite, but according to what scheme?

MapBox mbtiles  have spec:
https://docs.mapbox.com/vector-tiles/specification/
https://github.com/mapbox/vector-tile-spec/tree/master/2.1

But i cant find some spec for offline packege.


texts: Local Nominatim install accessing with API

texts:
I have installed a local Nominatim install on Ubuntu using the instructions located at http://wiki.openstreetmap.org/wiki/Nominatim/Installation and I am using Apache.  The installation appears to function as I can open up the web site, see the map, and query the database and get results.

What I am tying to do is access a local version of the API:
For example:   http://myinstll/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1

Is there an additional package that needs to be installed or additional steps to expose the API?


texts: Checking Annotation overlap with other features using ArcObjects?

texts:
I want to check annotation features overlap with any other feature and also have to give other overlapped feature list....please tell any method for this?

Now i am using buffer around selected annotation feature...but that selected annotation feature only come within buffer,,other features from different feature class not coming....

I am new to ArcGIS.


texts: How to import ArcGIS 10.1 File geodatabase to MS SQL Server 2012?

texts:
I would like to import my File Geodatabase from ArcGIS 10.1 into MS SQL Server 2012.

I have never done it before, so I expect to do the import the same way as import data from excel table.

Problem is when I open MS SQL Server Import wizard and as a data source I choose Esri geodatabse OLE DB provider - an error occured:

ClassFactory cannot get required class. (Microsoft OLE DB Service Components)

Please does anybody know what I´m doing wrong, or is there some easiest way, for example with ArcSDE?


texts: Improving accuracy of mercator meters conversion to lat/lon?

texts:
My question is an extention to Converting mercator meters without UTM zone?
While the answer in the previous Q&A got me so far, I've now come to an impass. While the conversion I do from Mercator metres to lat/long works, I don't get the accuracy that I've seen possible with other programs. I've posted this query on a more dedicated forum (http://forums.sideimagingsoft.com/index.php?topic=7785.0) but haven't had any feedback so would like to see if the wider community may be able to help.
Here is the basic post I had on the other forum:

I've been working on extracting the header information from the raw
SON files from a 998c SI unit. I have hundreds of recordings so I'm
aiming to create a batch extraction of depth and coordinate
information. I've been successful at getting out the information from
the SON files but the final stumbling block is once again the handling
of the coordinates. I now know that the Sonar writes the coordinates
in World Mercator metres (EPGS: 3395). Unfortunately when I use some
spatial transformation libraries (GDAL and ProjNet) the conversion to
lat/lon is never accurate enough. I know it is possible to get a very
accurate conversion as HumViewer and HBSI Sonar File Converter both
produce accurate points with HumViewer the most accurate. Here is a
graphic of the various coordinates converted from the same Mercator
Meter coordinates 16044360, -4228674.

So my question is, what is being done to the raw data to improve its
accuracy? According to 'hydrograph' in this thread
http://bb.sideimageforums.com/viewtopic.php?t=118&highlight=source+code
there probably is some independent axis shift calculation being used.
Anyone have an idea what this might be? I don't mind going back to
basics and coding my own transformation function but I'm not keen if
I'm going to get the same result as other transformation libraries
without incorporating the independent shift, if required.
If it's any help to anyone I've attached the header structure from the
998c SI.

Here are a couple of lines data from B000.SON but I don't think the
adjustment needed is in it.


texts: Remove white background in Raster in QGIS

texts:
I'm sure this is a very simple task, I have a black and white basemap and i would like to remove the white from it in the latest version QGIS.

There are setting in layer properties and bands etc, but I don't know how to do it and have been unable to find a good explanation. The answer i found was for an earlier version of QGIS and the dialog box has changed!!


texts:
My requirement is to plot 50m*50m blocks on map and I was going through MGRS(https://en.wikipedia.org/wiki/Military_grid_reference_system)

It says Truncate, don't round

Is it possible to achieve 50m precision by flooring at 50m level.

Example converting 4QFJ 1234 6789 to 4QFJ 1230 6785


texts: ipyleaflet not showing map in JupyterLab

texts:
I've done conda install ipyleaflet and then conda install -c conda-forge ipyleaflet but when I run:

import ipyleaflet
map1 = ipyleaflet.Map(zoom=3, layout={'height':'400px'})
dc = ipyleaflet.DrawControl()
map1.add_control(dc)
map1

I just get an output kernel that says:

  Map(center=[0.0, 0.0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…

and no map shows up.

Does anyone know how to get ipyleaflet map to show up in JupyterLab?


texts: The geometry_type of a spatial column cannot be changed (Requested changing type from "MULTIPOLYGON" to "GEOMETRY" for column "geom" in table X)

texts:
Using Symfony 2.8.24, Doctrine 2 and Jsor's doctrine-postgis library, the latter to make Doctrine get along with spatial types like geometry, geography, etc.

So, I have a table with a column of type geometry(MultiPolygon, 3795), at least it is presented as so in pgAdmin III (I'm using OpenGeo's pgAdmin which includes the postgis extension, along with plpgsql)

I have the tables with the spatial info, so I created my entities from those tables, via doctrine:mapping:import and doctrine:mapping:convert commands, which indeed created the corresponding php classes without an issue.

THE PROBLEM came when I made some changes to other entities in my project, entities which did not even have spatial type attributes, after that I tried to "doctrine:schema:update" "--force" to sync the database with my new changes and I get the error from the title

  The geometry_type of a spatial column cannot be changed (Requested changing type from "MULTIPOLYGON" to "GEOMETRY" for column "geom" in table "X")

Fragment of the entity class as generated by the commands:

/**
 * TableName
 *
 * @ORM\Table(name="TableName", indexes={@ORM\Index(name="sidx_table_name_geom", columns={"geom"})})
 * @ORM\Entity
 */
class TableName {

    /**
     * @var integer
     *
     * @ORM\Column(name="gid", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="table_name_gid_seq", allocationSize=1, initialValue=1)
     */
    private $gid;

    /**
     * @var MULTIPOLYGON
     *
     * @ORM\Column(name="geom", type="geometry", options={"geometry_type"="MULTIPOLYGON", "srid"=3795}, nullable=true)
     */
    private $geom;
}

I tried to follow this solution in github to no avail, although it was exactly my situation.

Any help and insights appreciated.


texts: Trying to use OS Translator plugin and can't find ogr2ogr.exe

texts:
I have installed the OS Translator plugin from the Faunalia Repository but when I try to use the plugin I get a "Can't find ogr2ogr[.exe], can't continue" error message. I have tried reinstalling the complete GDAL package but to no obvious effect.

I am running QGIS on a MacBook Pro with an up to date version 10.8 of OS X and installed packages from the KingChaos site.

Any ideas please?

Update.
I have managed to find the ogr2ogr.exe file and, as it exists, that suggests that the installation of the the GDAL Framework does not properly edit the PATH to the file. I'm still trying to re-learn some basic bash shell commands under the OS X Mountain Lion environment to make the necessary changes to PATH.


texts: Importation of .csv on grass gis converts numeric data to string data

texts:
When importing a csv file on grass7, the numeric data is converted into a data of type string.

My csv looks like this :

    id_core value
1   F1  83.0611472396
2   F2  98.8584345936
3   F3  102.0621496367
4   F4  95.4304750175
...

The command I use is :
    db.in.ogr dsn=my_file.csv output=my_table

which displays the following message :

WARNING: Width for column field_1 set to 255 (was not specified by OGR),
         some strings may be truncated!
WARNING: Width for column id_core set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: Width for column value set to 255 (was not specified by OGR), some
         strings may be truncated!
WARNING: 50 features without geometry
Imported table <my_table> with 50 rows

And db.describe -c table=my_table returns :

ncols: 3
nrows: 50
Column 1: field_1:TEXT:1000
Column 2: core:TEXT:1000
Column 3: stock:TEXT:1000

I tried to import the .csv without the header, or with only 2 decimal places on the values. I also tried to import an sqlite file (that I created with with libreoffice base) but the output is identical.

Does anyone has a suggestion for specifying that some fields are numeric?

Thanks

Léo


texts: How do I set the width and height of a popup using QGIS2Web and Leaflet

texts:
I am a newbie to editing javascript.

I want to set the Max width and height of the popup that QGIS2Web generates with a Leaflet map (I have quite a lot of text in the attributes and will need a scroll bar).

Could someone help me out with the code that I would need to insert in my index.html file?


texts: Using Linestring distance in meters with GeoTools?

texts:
I want to use GeoTools for working with gis data. I'm most concerned about distance calculations, not so much about drawing a map.
What I still couldn't figure out is how to make distance calculations work smoothly on the WGS84 spheroid. As an example I want to calculate the distance (in meters) between two linestrings. The postgresql code would be

SELECT
  ST_Distance(
    ST_GeomFromText('LINESTRING(13.45 52.47,13.46 52.48)')::Geography,
    ST_GeomFromText('LINESTRING(13.00 52.00,13.1 52.2)')::Geography
)

The output is 38364.138314182

With geotools I would imagine something like

import org.geotools.geometry.jts.JTSFactoryFinder
import org.geotools.geometry.jts.WKTReader2,
import org.geotools.factory.Hints,
import org.geotools.referencing.crs.DefaultGeographicCRS

Hints hints = new Hints(Hints.CRS, DefaultGeographicCRS.WGS84)
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(hints)
WKTReader2 reader = new WKTReader2(geometryFactory)
Geometry g1 = reader.read('LINESTRING(13.45 52.47,13.46 52.48)')
Geometry g2 = reader.read('LINESTRING(13.00 52.00,13.1 52.2)')
System.out.println(g1.distance(g2))

Now the output is 0.442040722106004 which is the same as

SELECT
  ST_Distance(
    ST_GeomFromText('LINESTRING(13.45 52.47,13.46 52.48)'),
    ST_GeomFromText('LINESTRING(13.00 52.00,13.1 52.2)')
  )

which is the euclidean distance in degrees. For points I can use the OrthodromicDistanceCalculator but not for lines. Plus, it is very inconvenient to specify that distance calculations should be based on WGS84 over and over again.


texts: Intersecting area between two polygons in the same shapefile in QGIS

texts:
I have a shapefile with two polygons in it. I would like to be able to generate the intersecting area between the two polygons.
Please note, I have tried using the intersect tool, however this does not seem to work as the polygons are in the same shapefile.
How do I do this in QGIS? I am using QGIS 3.12.2.


texts:
I am working on Tile Mill Version 0.10.1 (v0.10.1) on windows 7. I have satellite image of world view 2. I am converting that image to .mbtiles.

My problem is I am unable to assign any band combination in above software.

I researched and going though this similar article but unable to get bands in image (it has 4 bands and output format is 'tif')

Please refer screenshots


texts:
I'm trying to make a join between two tables in SQL with 1: M relation. A table ejecutado_unificado_2018 is a dataset without geographic information and the dataset sectores_limpieza_2018 comes from a shapefile. When I do the join, I do not recognize the cartodb_id or the geometry when I use the_geom_webmercator. I would like to know my mistake.

SELECT sectores_limpieza_def2.the_geom AS the_geom_webmercator,
       sectores_limpieza_def2.cartodb_id
FROM ejecutado_unificado_2018
JOIN sectores_limpieza_def2
  ON sectores_limpieza_def2.codigo=ejecutado_unificado_2018.codigo


texts: Comparing string value in attribute table?

texts:
I am working on QGIS. It is a line feature.

Say we have three consecutive links. If the first and the last link has the same attribute value and the centre differs, I need to select those.

Is there any query for that in QGIS?

In the below picture, there are three consecutive links. Of that, I need to select the centre linke named "B", which differs from the other two. Can I have a query for comparing the attribution of the consecutive links and highlights the name which is odd (say "B" in this case) ?


texts:
I have a track of GPS position dots that are roughly going in a straight line, I would like to simplify the line to only have the central point from a group as in the bottom image creating a trend line from many points.

Is there anyway to keep attribution when going points to lines?
If not is there any way to remove points from a line of points?

In ArcGIS I can do this:


texts: How can I add custom CRS with +proj=mercxx to QGIS 2.2.0 Valmiera?

texts:
i've builded a custom proj.4 library, tested it by command line (proj and cs2cs) and with postgres/postgis. All works fine.

Now i'm trying to make the same with Qgis 2.2.0.
I've replaced the original proj.dll, cs2sc.exe, geod.exe, nad2bin.exe, proj.exe with my customs, in my /OSGeo4W/bin folder.

in Qgis: "settings/custom CRS" + "Add new CRS"
   in the "parameters" i've copied the same string as for other tests
as '+proj=mercxx +ellps=intl +units=m +datum=WGS84 +no_defs' (without quotes)

in 'name' field i've wrote...almost everthing my keyboard can write... even the default 'new CSR'
the result is always the same when i hit "OK" : "the proj4 definition of 'mercxx' is not valid.


texts: GeoJSON MultiPolygon/Polygon to PostgreSQL using Python/Psycopg2


texts: Identifying dangles and hanging roads in a map in geotools

texts:
Is it possible through geotools to identify and mark all the dangles and hanging roads(lines) in a .shp file representing a map. Any example would help me proceed forward.

So far I have found the below which gives me the number of dangles in the .shp files:

SimpleFeatureCollection col = featureSource.getFeatures();
SimpleFeatureIterator itr = col.features();
List list = new ArrayList();

while(itr.hasNext()){

SimpleFeature feature = itr.next();
Geometry geom = (Geometry) feature.getDefaultGeometry();
list.add(geom);
}

Polygonizer polygonizer = new Polygonizer();

polygonizer.add(list);

Collection dangles = polygonizer.getDangles();
Iterator it = dangles.iterator();
while (it.hasNext()) {
    System.out.println(it.next());;
}

Please let me know if we can locate these on a map. Possibly, I require to highlight these marking dangled lines.


texts: How do you make 3d features from survey point data in arcGIS 9.3?

texts: I have survey point data brought into ArcGIS using Survey Analyst Extension. I have created my 2D shapefiles of the cross-sections, thalwegs, and roadways but I can not get it to populate the zfield from the point data.


texts:
When using a MapServer layer with a TILEINDEX and TILEITEM defined... will MapServer clip the source raster to the dimensions of the identified tileindex item(s), or simply use it as a reference to locate the underlying raster file and output the file in its entirety?

My wish is to take a source index file and clip it to state boundaries so only those source files within that state will be accessed and their output will be clipped to the state boundaries for those files whose dimensions overlap the boundary


texts: Opening .shp file under Add Vector Layer

texts: When I try to open streets.ship file from the exercise data file downloaded for working in the Quantum GIS Training Manual, I get an error message: Invalid Data Source C:/Users/new user/Documents/streets.ship is not a valid or recognized data source. What am I doing wrong?


texts: Is it possible to store a default symbology layer in an arcpy add-in?

texts: Since arcpy is limited in how symbology can be manipulated, I was curious to know if a symbology layer can be stored in an arcpy add-in.  Does anyone know if it is possible to store a .lyr file, or anything else for that matter, in a .esriaddin so that it can be used once the addin is installed?


texts: Error: Pixel type not supported in Google earth engine

texts:
var collection = ee.ImageCollection('MODIS/006/MYD13A1').select('NDVI');

// Define reference conditions from the first 10 years of data.
var reference = collection.filterDate('2001-01-01', '2010-12-31')
  // Sort chronologically in descending order.
  .sort('system:time_start', false);

// Compute the mean of the first 10 years.
var mean = reference.mean();

// Compute anomalies by subtracting the 2001-2010 mean from each image in a
// collection of 2011-2014 images. Copy the date metadata over to the
// computed anomaly images in the new collection.

var series = collection.filterDate('2011-01-01', '2014-12-31').map(function(image) {return image.subtract(mean).set('system:time_start', image.get('system:time_start'));
});

// Display cumulative anomalies.
Map.setCenter(84, 27, 5);
Map.addLayer(series.sum().clip(Da),
    {min: -60000, max: 60000, palette: ['FF0000', '000000', '00FF00']}, 'NDVI anomaly');

// Get the timestamp from the most recent image in the reference collection.
var time0 = reference.first().get('system:time_start');

// Use imageCollection.iterate() to make a collection of cumulative anomaly over time.
// The initial value for iterate() is a list of anomaly images already processed.
// The first anomaly image in the list is just 0, with the time0 timestamp.
var first = ee.List([
  // Rename the first band 'NDVI'.
  ee.Image(0).set('system:time_start', time0).select([0], ['NDVI'])
]);

// This is a function to pass to Iterate().
// As anomaly images are computed, add them to the list.
var accumulate = function(image, list) {
  // Get the latest cumulative anomaly image from the end of the list with
  // get(-1).  Since the type of the list argument to the function is unknown,
  // it needs to be cast to a List.  Since the return type of get() is unknown,
  // cast it to Image.
  var previous = ee.Image(ee.List(list).get(-1));
  // Add the current anomaly to make a new cumulative anomaly image.
  var added = image.add(previous)
    // Propagate metadata to the new image.
    .set('system:time_start', image.get('system:time_start')).float();
  // Return the list with the cumulative anomaly inserted.
  return ee.List(list).add(added);
};

// };
// Create an ImageCollection of cumulative anomaly images by iterating.
// Since the return type of iterate is unknown, it needs to be cast to a List.

var cumulative = ee.ImageCollection(ee.List(series.iterate(accumulate, first)));

print (cumulative);

var counter = 0;

// loop through the year
for (var y = 2011; y < 2015 ; y++) {
  // loop through the months
  for (var m = 1; m < 12 ; m++) {

  // get the image
  var img = ee.Image(cumulative.toList(1, counter).get(0));

  // store the image
  Export.image.toDrive({
       image: img,
       description: y.toString() + m.toString(),
       scale: 1000,
    region: Da
 });
}}

I am getting this error while running this code Error: Pixel type not supported: Type<MaskOnly>. Convert the image to a floating point type or a smaller integer type, for example, using ee.Image.toDouble(). I tried to convert image to float but still getting this error. Please help. I am stuck


texts: Iterating list returned by arcpy.ListFeatureClasses() gives error 'NoneType' object is not iterable?

texts:
I have the following code, where i write from a list of featureclasses the fisrt row of 2 specific fields to a text file. But when i run it either erases all the previous stored data  from text or returns a 'NoneType' object is not iterable.

The script runs in ArcGIS 10.2 for Desktop

import arcpy
import os
from arcpy import env
arcpy.env.workspace = "c:/FolderM/Poor/Lines"
outFile = open("c:FolderM/Poor/moon.text", "w")
featureclasses = arcpy.ListFeatureClasses("RT", "Polyline", "")
for fc in featureclasses:
    fields = ['ASTRA', 'COMETS']
    with arcpy.da.SearchCursor(fc, fields, "FID = 0") as cursor:
        for row in cursor:
            ASTR = row[0]
            COMETS = row[1]
outFile.write('astra is ' + str(ASTR) + 'meters,\n comets is' + str(COMETS))
outfile.close()


texts: Altering raster values without using ArcPy

texts:
I'd like to be able to alter raster values, through fairly simple equations, without using the module ArcPy.

Is that possible?

It seems like gdal, numpy, and rasterlang might make this possible but I'm having trouble figuring out exactly how.


texts: How to export a MXD to a PDF but only switching the folder

texts:
Let say I have two variables.

    InputMXD = parameters[0].valueAsText
    PDF_Folder = parameters[1].valueAsText

I have my inputMXDs to have multivalues so I'll have around 10 mxds each time the script is run.  I want to put the exported pdf's into different directory, but I want to use whatever the mxd name is.  The input could be p:/mxds/oneexample.mxd and p:/mxds/onemoreexample.mxd and the output would be z:/pdfs/oneexample.pdf and p:/mxds/onemoreexample.pdf.

    MXDList = arcpy.ListFiles(InputMXD)
    for MXDPath in MXDList:
        MXD = arcpy.mapping.MapDocument(MXDPath)
        arcpy.mapping.ExportToPDF(MXD, PDF_Folder + )

Here's what I have to get me to the last line.  I don't know how to add the original file name of the mxd to the outputted PDF.

Updated:  It will run through it, but it doesn't output anything.  The output folder is empty.  I think there's something wrong with the loop.  Here's what I now have in my loop.

    MXDList = arcpy.ListFiles(InputMXD)
    for MXDPath in MXDList:
        MXD = arcpy.mapping.MapDocument(MXDPath)
        outputPDF = os.path.basename(MXDPath).split('.')[0] + ".pdf"
        arcpy.mapping.ExportToPDF(MXD, PDF_Folder + "\\" + outputPDF)

I tried the code below and still no dice.  Here's what the results kicked back.

I'm not sure why it's saying the output is empty?

Update 2:  I updated the code to this:

    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = PDF_Folder
    MXDList = arcpy.ListFiles('*.mxd')
    for MXDPath in MXDList:
        MXD = arcpy.mapping.MapDocument(MXDPath)
        outputPDF = os.path.basename(MXDPath).split('.')[0] + ".pdf"
        arcpy.mapping.ExportToPDF(MXD, PDF_Folder + "\\" + outputPDF)

I changed the workspace to PDF_Folder and it didn't kick back an error.  It also didn't output any PDF files.

Also, here's how my parameters are setup at the top.

    # First parameter
    InputMXD = arcpy.Parameter(
        displayName="Input MXDs",
        name="InputMXD",
        datatype="DEMapDocument",
        parameterType="Required",
        direction="Input",
        multiValue=True)

    # Second Parameter
    PDF_Folder = arcpy.Parameter(
        displayName="Output Folder for PDF",
        name="PDF_Folder",
        datatype="DEFolder",
        parameterType="Required",
        direction="Output")

Does my output need to be something besides a DEFolder datatype?

Update 3

Here's what my input looks like:

Input MXDs is a MapDocument that is a multiValue input.
Output Folder for PDF is a DEFolder output.  I've tried strings, workspaces, folders.  Nothing has worked.  I know its something small making this really frustrating.  I'm going basic to see if I can get just one mxd outputted to a pdf.  Crawl before I can walk.

Update 4

I'm trying to run the command directly in ArcMap from the python window.  Here is the kickback it's giving me.

Update 5

I have tried just running it in a small script to see if it worked with a file name.  It does and it includes spaces, commas, periods, dashes and underscores.  Here's the simple testing code that worked.  I have no idea what isn't working.

 import arcpy

 doc = arcpy.mapping.MapDocument("Q://Field Data//6th P.M//COLORADO//6N65W//PROJECTS//6N-65W-12//HOLTON 6-65-12//BEP.mxd")
 arcpy.mapping.ExportToPDF(doc, "C://temp//test2.pdf")


texts: Clipping points by a polygon attribute in QGIS

texts: I am trying to clip a point layer with a polygon layer. My polygon layer has multiple polygons (e.g. country with different states). I am wanting to clip the point layer based on the different states contained in my country polygon layer. I realised I could do it manually by selecting the state and then running the CLIP tool from under Vector and then checking the Use only selected features box. Although this works great for a few polygons I'm wondering if there is a better way of achieving my objective.


texts: Geoserver Optimization: 64 bit vs 32 bit + JAI?

texts:
Since as per my knowledge jai does not support 64 bit, what would be more efficient:

a   Oracle Corporation: 1.7.0_79 (Java HotSpot(TM) 64-Bit Server VM)

Vs

Oracle Corporation: 1.7.0_79 (Java HotSpot(TM) 32-Bit Server VM) + Native JAI ?


texts: QGIS-Processing runalg and Memory Layer issue

texts:
I'm trying to make a script for converting polygons to lines. But I'm having some issues while generating temporary layers.

In this script, I iterate through all the features of the input layer to run the function "qgis:simplifygeometrics" on each of them, after that I merge all layers back together. (This is a simplified case of my script)

However, I'm getting the following error when I run my script : TypeError: 'QgsVectorLayer' object has no attribute '_getitem_' and can't find out why.

Any help is welcome, I'm new to Python and SEXTANTE!

Code:

#Creation of the virtual output layer
vOutputLayer = SextanteVectorWriter(vOutputLayer, None, fields, QGis.WKBPolygon, layer.crs())

feats = sextante.getfeatures(layer)
for inFeat in feats:

    #Creation of the virtual input layer
    vInputLayer = QgsVectorLayer("Polygon", "tmp_input_vector", "memory")
    vInputLayer.addFeature(inFeat)
    vInputLayer.updateExtents()

    #Creation of the virtual layer for the simplified geometries
    simplifiedLayer = QgsVectorLayer("Polygon", "tmp_simplified_vector", "memory")

    #Simplify Geometries function
    sextante.runalg("qgis:simplifygeometries", vInputLayer, 1.0, simplifiedLayer)
    simplifiedLayer.updateExtents()

    #Merging of layers
    sextante.runalg("qgis:mergevectorlayers", simplifiedLayer, vOutputLayer, vOutputLayer)

Complete error :

Traceback (most recent call last):
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\core\GeoAlgorithm.py", line 145, in execute
self.checkOutputFileExtensions()
File "C:\OSGeo4W\apps\qgis-dev\python\plugins\sextante\core\GeoAlgorithm.py", line 238, in checkOutputFileExtensions
if not os.path.isabs(out.value):
File "C:\OSGeo4W\apps\Python27\lib\ntpath.py", line 57, in isabs
s = splitdrive(s)[1]
File "C:\OSGeo4W\apps\Python27\lib\ntpath.py", line 125, in splitdrive
if p[1:2] == ':':
TypeError: 'QgsVectorLayer' object has no attribute '__getitem__'


texts: Renderd outputs "failed to initialize projection 4326"

texts:
I'm setting up a tile server using the guide provided here.

I have everything set up. proj4 is installed in version 4.8.0.  The espg file is existant, I ran an xmllint over my xml style file without errors. mod_tile is also running without problems. I also have a fully populated PostGIS database running. I used osm2pgsql.

The problem is starting renderd. It gives me the following error message:

renderd[25257]: An error occurred while loading the map layer 'default':
failed to initialize projection with: '+init=epsg:4326'
encountered during parsing of layer 'necountries' in Layer at
line 58 of '/src/mapnik-style/osm.xml'

(I inserted line breaks for legibility)

It's the only error message. Everything else works fine.

I checked for the espg file at /usr/local/share/proj/epsg which is present and contains (of course) the WGS84 definition.

I googled around but couldn't find something. There were hints to the proj4 library. But since it's installed in version 4.8.0, i can't see the problem.

Thanks for the help!


texts: Setting layer blending as additive with opacity in Kepler GL for Python

texts:
I'm using KeplerGL in python (in a Jupyter notebook) to plot polygons on a map with different layers.
After setting the layers, I've tried to find where can I edit their opacity when adding them up, but can't seem to find this option.

Also, tried to look for that in the map_1.config but couldn't spot it there either.

import geopandas as gpd
from keplergl import KeplerGl

from keplergl import KeplerGl
map_1 = KeplerGl(height=500)
map_1.add_data(data=df, name=”data_1”)

EDIT: in fact, I found the opacity field in the config json, but it seems like it's not editable.

map_1.config['config']['visState']['layers'][0]['config']['visConfig']['opacity']

gives 0.8. But when I am trying to reassign:

map_1.config['config']['visState']['layers'][0]['config']['visConfig']['opacity'] = 0.25

It doesn't change the value and returns 0.8 again.


texts:
I am trying to pull together data from the attribute table based on which the atlas is created. I want the query to display the information if it occurs within the Atlas feature. In my project I am trying to produce maps of various parks and then pull details of various features in it. For example, a park may have playgrounds, barbecues, water fountains etc. and want information displayed just for those features. There are many more attributes. Just to clarify, all this information is present in the parks layer.

I am so far tried the following query and it works as long as the features exist in the atlas feature. If they don't the attribute query fails which is not what I want. Here's an example of the query:

[%'ASSET KEY'  ||  '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' ||  'ASSET NAME' || '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' ||'AREA (SQ. M.)' ||  '\n'  ||  '\n'  ||
title("pg_key")||  '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' || title("pg_nam") || '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' || "pg_area"  ||  '\n'  ||  '\n'  ||
title( "skt_key") ||  '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' || title("skt_nam") || '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||'\t' ||"skt_area"  ||'\n'  ||  '\n'  ||
title( "bmx_key") ||  '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||   '\t' || title("bmx_nam") || '\t' ||   '\t' ||   '\t'  ||  '\t' ||   '\t' ||   '\t' ||    '\t'  ||   '\t' ||   '\t' ||   '\t'   || '\t' ||'\t' ||'\t' ||"bmx_area"%]

In the above example, the query works as long as the features pg, skt and bmx occur within the park. Even if one doesn't the query fails. I want to create this query for all the possible scenarios so that the atlas puts the correct information in each of the maps.

Example image below:

With this one, I would like to information associated with green, red and blue hatching and the football icon. However, there are many other features within parks that are not present in this park here. So I want to set up the query for all the possible scenarios so that I don't have to manually change it for the 400 odd maps that I'm trying to produce. In the example below, if I try and put down a query for all the possible scenarios, it is failing as soon as one of the features that is not a part of the park is mentioned in the query.

This is how I would like the information to appear below the map. I tried to use the attribute table directly but the manner in which the data is organised in the atlas layer does not let me know populate the data row-wise. In other words, each park is a row and all the features whether present in the park are linked to the single row in separate columns.

This screen dump below shows how the features are linked to the different parks as separate columns.

I have since morning tried to tackle this problem differently. Rather than linking all the features to each and every row in the park, I have tried to keep the features in separate layers and then use a query to pull the desired information. Even this approach does not seem to work. The query I'm using is as follows:

"BMX_NAME" =attribute(  $atlasfeature ,'bmx_nam')

BMX_NAME is a column name in a separate layer called BMX whilst the parks layer has the name of the BMX track under the column bmx_nam. This query doesn't work even though my current atlas feature has a BMX track. So I'm back to square one now. If this works then it would solve the problem I think...

Any suggestions?

I changed the query to the following and it still does not work.

 "BMX_NAME"=attribute(@atlas_feature , 'bmx_nam')


texts: Clip a shapefile, given a set of coodinates

texts:
I need to clip a shapefile, the same way one would use Extract by Polygon on a Raster to achieve a smaller subset of the shapefile. I have previously exployed Extract by Polygon on a Raster and used that raster subsequently in an Extract by Mask operation on the desired shapefile of interest to obtain the final shapefile.

Is there any option to clip a shapefile, given a set of coordinates? I am open to solutions in either ArcMap or R.


texts:
I am looking for a database that offers good accuracy for obtaining region from an IP address?

Or, if this question is too fuzzy: Which one is (possibly) the most accurate?

Note: I only need a database with IPs in Brazil, and only with region level accuracy. The location would be used to prefill a form on a web site. We also considered using web browsers' Geolocation API. However, as seen in a demo, in major browsers, the user would first have to opt in.

I already found freegeoip.net (demo) and MaxMind (demo). Of these two, only MaxMind correctly detects my current location: Las Palmas de Gran Canaria. freegeoip.net falsely reports: Madrid. However, MaxMind is rather pricey, which may be OK if we needed data for the whole world. But for Brazil only, price is questionable, and in addition, it is not even clear that their data for Brazil is good.


texts:
I have some exiting shape files that supposedly have a CRS of OSGEO:41001.  If I import new data, and set the CRS to OSGEO:41001  they do not align.  If I change the CRS of the new layers to EPSG:4326, everything appears to line up.  While I can create pretty pictures, I can't do any distance or co-location calculations between layers. Apparently, I incorrectly transformed some data once in the past.

Starting for scratch, import old files (a base map of US) loads and displays.  Screen coordinates for St George UT show as -12460233, 4682824.  Load up new data consisting of Lat Long delimited text, the screen coordinates for St George show as -113.55, 37.02.  Both layers have a CRS of EPSG:4326

Question:  How can I fix my old files to be correct?

Question:  What did I do wrong?


texts:
I have successfully installed tilestache. I also has succesfully add a layer using shapefile from here. But when I tried to use my own shapefile, the server always return empty featurecollection. I have tried to add ST_Transform() in the query but still return empty feature.

My config file:

{
  "cache":
  {
    "name": "Test",
    "path": "/tmp/stache",
    "umask": "0000"
  },
  "layers":
  {
        "osm-processed_p1": {
            "allowed origin": "*",
            "provider": {
                "class": "TileStache.Goodies.VecTiles:Provider",
                "kwargs": {
                    "dbinfo": {
                        "host": "127.0.0.1",
                        "user": "postgres",
                        "database": "ts_data"
                    },
                    "queries": [
                        "SELECT gid, geom AS __geometry__ FROM osm.kalimantan"
                    ]
                }
            }
        }
  }
}

How can I fix this?


texts: Getting a list for Gdal "Merge" in QGIS Graphical Modeller

texts:
I am looking for a way to create an array from the attributes of a multipolygon layer for the algorithm "Gdal Merge".
In my layer I have stored file paths to .xyz-data that I want to read so they can be merged together.

I use the graphical modeling and expression manager for my algorithm which includes cutting.
Unfortunately, the expression manager does not show me any way to access the layers either. My knowledge of QGIS and the expression manager is not good enough either.
I tried something like this to get the attributes in an array, but it doesn't work:
array(attributes ('Furz_1343ad30_bdd6_4ab7_b737_676a72e0b380'))

Does someone has an idea for me?


texts: Security of data when using the qgis2web plugin

texts: While using Qgis2Web Plugin data will be save in any of cloud platform or Qgis Server ? In short usage of this plugin is safe or not ?


texts: Which is better for tiling: raster2pgsql or GeoWebCache?

texts:
We have some raster image data stored as GeoTIFF which we would like to make available online as an overlay using the OpenGeo framework. As the data covers only a spatially restricted area and we don't need too much zoom levels, we consider precomputing ("seeding") the tiles as applicable with respect to memory consumption. Using OpenGeo, there seem to be two modules which can handle tiling:

raster2pgsql: a command line tool which converts a raster file into a series of SQL commands that can be loaded into postGIS. It offers the option to specify the tile size and the zoom levels (in their syntax "overviews")
GeoWebCache: assists GeoWebServer with cache functionality and tile generation. The latter can be done prior to client requests or on the fly.

I'm not sure about how the two differ with respect to the precomputed tiles, can anybody clarify this? At first glance I tend to GeoWebCache because of the convenient access through its web interface.


texts: Combining information from two point layers based on the nearest neighbour relationship

texts:
I have two layers: One a modeled dataset with points on a 1x1km grid across the globe. I also have another layer which is my own data points which are scattered across the globe. What I want to do is find the nearest modeled value from the 1x1 grid data and append that to my table for my data points.
I thought it would be a join function but as the points are not from the exact same coordinates I need some way of extracting the nearest point to my sample point.
Can someone help me with which tool to use and how best to use it?
I am using ArcGIS and Windows 10.


texts: Unexpected token Identifier error - Import OpenLayers

texts:
I'm trying to use some OpenLayers libraries in my code, and called him in JavaScript like this:

  import Map from 'ol/Map.js';
  import Overlay from 'ol/Overlay.js';
  import View from 'ol/View.js';
  import {toStringHDMS} from 'ol/coordinate.js';
  import TileLayer from 'ol/layer/Tile.js';
  import {fromLonLat, toLonLat} from 'ol/proj.js';
  import OSM from 'ol/source/OSM.js';

But I'm receiving the following error:

  error unexpected identifier


texts: Topology exception on geometry intersection?

texts:
I am using the following PostGIS functions in a Postgres query:

ST_AsGeoJSON(ST_Intersection(p.geom,c.geom))

Where p.geom & c.geom are type multipolygon. The query works most of the time but with some layers I recieve the following error:

ERROR: Error performing intersection: TopologyException: Input geom 0
is invalid: Ring Self-intersection at or near point...

I tried applying ST_Makevalid() on the individual geometries in the ST_Intersection call but it doesn't seem to resolve the issue.

I also tried adding where conditions using ST_IsValid() on both table geometries and the intersection of the two. I can get the query working when I add where ST_IsValid(p.geom) but it excludes a large number of the features I'm trying to display in the application.

After running ST_IsValidReason(p.geom) I can see that several of the results have Ring Self-intersection[{long} {lat}].

How can I resolve this?


texts: How to define HTML templates with QGIS Server?

texts:
I usually use HTML templates in map files to show nicely formatted popups on my WMS layers with Openlayers. Here is the doc on templating with mapserver

I'd like to know if it is possible to do the same in GQIS Server and if yes how?

Thanks.


texts: From Overpass Turbo to GeoJSON without map

texts:
I would like to extract boundaries of some areas from Overpass Turbo in GeoJSON format.
At the moment I am using the website UI www.overpass-turbo.eu, write the query, execute it and export in GeoJSON format.

As the queries I am writing extract lots of information and taking into account that I always end with GeoJSON extraction (I don't need the map to be rendered) I am asking if it is possible to show in the right side of the side the GeoJSON and not the map (similar to when I say to output results in CSV).
Excluding the map rendere would be faster and assorbs less resources.

For example the following query gives me the boundaries of the Soho area in London: how can I execute it with GeoJSON output and not with a rendered map?

[out:json][timeout:25];
// gather results
(
  // query part for: “wikidata=Q124010”
  node["wikidata"="Q124010"]({{bbox}});
  way["wikidata"="Q124010"]({{bbox}});
  relation["wikidata"="Q124010"]({{bbox}});
);
// print results
out body;
>;
out skel qt;


texts: Understanding failures in the PostGIS TIGER geocoder

texts:
I have encountered an address that appears to be giving the PostGIS TIGER geocoder a hard time.  I've loaded the geocoder with the 2015 data, which includes the following in the ma_edges table:

gis=# select fullname, lfromadd,ltoadd,rfromadd,rtoadd,zipl,zipr from tiger_data.ma_edges where fullname like 'Preble Garden%';
    fullname    | lfromadd | ltoadd | rfromadd | rtoadd | zipl  | zipr
----------------+----------+--------+----------+--------+-------+-------
 Preble Gardens | 2        | 98     | 1        | 99     | 02478 | 02478
(1 row)

And yet, attempts to geocode an address like 20 PREBLE GARDENS, BELMONT, MA 02478 results in an odd failure:

gis=# select geocode('20 PREBLE GARDENS, BELMONT, MA 02478');
                                        geocode
---------------------------------------------------------------------------------------
 ("(,,,,,,Belmont,MA,01773,t)",0101000020AD10000076014F81DDD351C0999B13B16D364540,100)
(1 row)

I am confused on multiple accounts:

First, it seems as if the address falls solidly inside the address bounds in the ma_edges table, so I'm not clear why it's failing in the first place.
Secondly, I am puzzled how it is ending up with the wrong zip code (01773, which is Lincoln, MA) despite having the correct city and state.

For the curious, the debug about that results when setting the various geocoder debug_* settings to true is available here.

It looks like maybe the geocoder is trying to replace the phrase "Gardens" with the abbreviation "Gdns", which I guess would explain the first problem, but I'm still unclear why the second problem is happening.

Can you provide any insight on what's going on here?


texts: Question on Pictometry ImageNavigator API

texts:
I am working with Pictometry IMageNavigator API. I have created a simple JavaScript and ASP .NET web application as per instructions given at
http://dev.pictometry.com/imageNavigator/doc/GettingStarted.html.

However in both applications I am getting an error, "this.HitSetRegion.Y is null or not defined". I am looking for some directions to resolve this.

Basically I would be passing Latitude and Longitude values as a URL parameter to this application. But right now I am hard coding the coordinates.

Any help is greatly appreciated!!

Thanks.


texts:
I am having trouble in translating the geometry of donut polygons to layer. I am drawing polygons using the list of points as follows;

feature.setGeometry(QgsGeometry.fromPolygon([pLine]))

Here pLine is the list containing all the points to be drawn. But, the results are quite different from expectation.

Can someone please tell me how can I draw donut polygons through python script since the current code draws in sequence of the points and does not have any information of the hollow region between it?


texts: User Defined SQL Expression in Arc Toolbox parameters

texts:
I am trying to set up a tool that allows the user to input a field value, and was thinking SQL expression would be the way to go.

Sample -

#Selects structure by WorkOrderNumber attribute '150506'
arcpy.SelectLayerByAttribute_management("Structure", "NEW_SELECTION", "WorkOrderNumber = '150506'")

#Appends selected features from Structure to Structure_New (separate data set)
arcpy.Append_management("Structure", "Structure_New")

#Deletes the selected features from Structure
arcpy.DeleteFeatures_management("Structure")

this process selects features by a work order number and appends the selected features to a separate data set to archive, and then deletes the selected features. This works fine, what I am trying to figure out is how to set this up as a tool for other user to simply input the work order number and run it.


texts: Is it possible to use ipyleaflet in a jupyter notebook running on an Anaconda Enterprise server?

texts: This question is very similar to Ipyleaflet map object doesn't display in Jupyter Notebook but it gets created and uses the same example: https://ipyleaflet.readthedocs.io/en/latest/api_reference/map.html#example. In my case, the ipyleaflet Map object displays in a notebook that runs from a local machine, but does not display in a notebook running on an Anaconda Enterprise server. I created an environment yml file on the server and activated it via anaconda-project prepare. To recreate the project locally, I used conda env export --no-builds > env.yml (on the server) and conda env create -f env.yml (locally). All of the packages are installed with conda which automatically enables the ipyleaflet extension in the notebook.


texts: arcpy.Resample_management: Using cell size from another raster dataset

texts:
I am using arcgis 10.4. I want resample my geotif image same as resolution to a dem. I have the example from http://pro.arcgis.com/de/pro-app/tool-reference/data-management/resample.htm.

arcpy.Resample_management("c:/data/image.tif", "resample.tif", "10 20", "NEAREST")

Is it possible to use the name of my dem instead direct cellsize as input. Of course I could read cellsize first and use it for the tool.

Did anyone have any suggestion?


texts: Openlayers 4 WMS layer not showing after authentication

texts:
I'm new to OpenLayers and I have a problem I just cannot wrap my head around.

I'm trying to show a WMS layer from my GeoServer, but it passes through an authenticator I made with Flask. This definitely works, as I'm receiving 200 Response and the WMS server works fine with QGIS.
It's not a CORS issue either as that's set to enable all at the moment.

In order to allow the authenticator to work, it needs to pass through customLoader to add the authentication headers on which is read by my Flask API. Which seems completely fine.

So my issue is that OpenLayers isn't displaying anything from my GeoServer and I really want that to work.

Response sent back to the request from my API:

RES:  <Response [200]>\r
HEADERS:  {'vary': 'Origin', 'X-Frame-Options': 'ALLOWALL', 'Content-Disposition': 'inline; filename=OS_OpenData-ne_50m_admin_0_countries.png', 'Content-Type': 'image/png', 'Transfer-Encoding': 'chunked', 'Date': 'Fri, 05 Jun 2020 10:34:24 GMT', 'Keep-Alive': 'timeout=20', 'Connection': 'keep-alive'}\r

Now I've been pulling my hair out trying to get this to work with OpenLayers and this is what I have got so far:

<title>Tiled WMS</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">


texts: Introduce random error to location without losing data

texts:
I'm working on a project for which I need to insert some uncertainty into a layer of points, to protect the privacy of the data. I tried to do so in QGIS 2.18 as follows:

Create a buffer around the original locations, with the maximum random error distance to be assigned to each point (up to 300m).
Use the tool "Random points inside the (fixed) polygon", to insert exactly one point in a random location within each created buffer.
Create a new buffer around the new points, with the distance fixed in the maximum possible error (300m), to represent the uncertainty in the locations.

PROBLEM: When using these tools, all information in the original attribute table is lost, and I would like to use some of them in the final product. Joining by location is also no longer an option, since there is overlap between buffers (a point would not necessarily be the only one found within within its parent buffer).

QUESTION: Is there a way of joining the information from the original layer with the correspondent modified locations, or maybe a suggestion of a process or alternative tool that does not lead to losing this data on the way?


texts: Read only geometry from shapefile with python/geopandas

texts:
I would like to open a shapefile(shp) without loading the attributes(dbf), as I do not care about attributes and it takes about 25 minutes to load them. I am using Python Geopandas, so any Fiona or Osgeo solution is useful.

I want the results from below code, but not the waiting time!

  geometry =
  GeoDataFrame.from_file('easyshapes_bigattributes.shp').geometry


texts: Verify if a layer is filtered Qgis python

texts: I have loaded multiples duplicated layers in Qgis with different filters. I wonder if it is possible to find the layers that haven't any filter(setSubsetString method) with Pyqgs ?


texts: Geoserver printProvider don't show comment/mapTitle with hebrew fonts

texts:
I have a printProvider running on my site.

 printProvider = Ext.create('GeoExt.data.MapfishPrintProvider', {
        method: "POST",
        url: "http://xxxxx/geoserver/pdf",
        capabilities: printCapabilities,
        customParams: {
            mapTitle: "הדגמה",
            comment: "This is a map printed from GeoExt."
        }
    });

When I try to print , the comment appears on the PDF but the mapTitle doesn't (hebrew fonts).

I there a way to fix it ?


texts: Why doesn't the Python window in ArcGIS autocomplete arcpy.Describe objects?

texts:
I do a lot of testing in the Python window in ArcGIS Desktop (10.4.1). It's great, especially because it autocompletes code for me.

It will autocomplete for most objects:

However, something that has always annoyed me is that it won't autocomplete for arcpy.Describe objects.

Why is that?


texts: QGIS Align Rasters how to retain pixel values?

texts: I am attempting to align and then merge a number of rasters of the same resolution and extent, but where the pixels are slightly misaligned (creating small gaps when merged). This works fine using the Align Rasters tool, except that the pixel values are not retained and instead given a value of something like -3.23879e+8. I mostly want to keep the nodata pixels. Is this possible?


texts: How can I call a command programmatically and change its defaults?

texts:
I am quite new to ArcObjects and development, but from what I have researched I can run a command programmatically like so:
[VB]

Dim pUID As New UID
Dim pCmdItem As ICommandItem
pUID.Value = "esriArcMapUI.MxFileMenuItem"
pUID.Subtype = 4 'For Save As command
Set pCmdItem = Application.Document.CommandBars.Find(pUID)
pCmdItm.Execute

However I want to extend this example so when it executes it changes defaults to always the same folder location and filename. Is this possible with ICommandItem, or do I need another interface?


texts: Cannot select SHP format as saved format after merge two layers QGIS 2.16 and 2.18

texts:
I was using 2.16 version and everything was alright, I could merge two layers via Vector - Data Management - Merge and use .shp format as saved output format. Unfortunately my working laptop was reinstalled and now when I installed same QGIS back - I can't use this .shp option (I have only dbf, csv, xlsx and ods) and it really drives me crazy. I removed 2.16 and replaced with 2.18 but still have same issue. I 2.16 I could at least use SAGA merge tools for it but in 2.18 I can't.

I am trying to merge and save two layers (shp with same geometry type and CRS).

Add: I tried to download QGIS 2.18.4, removed all registry files and every single file related to QGIS to make sure I don' t have any hidden setting in Windows folders but it didn't help.

I looked into all QGIS Settings I found and I just can't see anything related to it.

Tried Vector menu, Processing Toolbox and nothing.


texts: Creating multiple polygons with the same parameters (width,height)

texts:
I would like to create 32 18 meters wide and 800 meters long polygons next to each other within the attached polygon. This would be an agricultural experiment, the only thing I have to take into account is the area in the middle where we usually have inland waters. So I have to create 24 parcels left to it and 8 to the right.

I've tried to split my base polygon with the basic Editor tools, but I just can't figure it out how and wehere I can specify the hight and wide of my new polygons to be precise. After I created the first one I should only multiply it I guess.

I'm looking for a method in QGis.


texts:
I have a GeoTIFF layer (downloaded from US Dept of Interior) that is US population density. The metadata claims it is in EPSG:4267, which isn't even intended for use in that part of the world. (east end is at -52°, I think).
If I add this layer to a map containing the world boundaries (layer source - Natural Earth, CRS = 4326), the two layers look like this (Natural earth admin boundaries on the bottom):

How do I go about figuring out the the CRS for the population density layer?


texts: Multiple Maps with Styles not working in OpenLayers

texts:
I have created 2 maps(within 2  in a same page) along with their respective style maps.

Both maps are having vector layers along with "LineString" geometry... added into them.

Both style maps are having common "label" symbolizer.

The issue is this that "label" symbolizer of map2 is getting added into the vector layer of

map1 rather than vector layer of map2.

Code:

mainHtml.html

Following are my 2 divs:

Following is the function which is rendering 2 different maps in above div :

function createMapForDiv1()
{
boundsForPatternMapImage = new OpenLayers.Bounds();
boundsForPatternMapImage.extend(new OpenLayers.LonLat(-180,-90));
boundsForPatternMapImage.extend(new OpenLayers.LonLat(180,90));

styleForFeature1 = new OpenLayers.StyleMap({ 'default': new OpenLayers.Style(null, {
rules: [new OpenLayers.Rule({symbolizer:
{
fillColor:"red",
fillOpacity: 1,
label:  '$'+'{myLabel1}',
pointRadius: 2.5,
pointerEvents: "visiblePainted",
graphicName:"x",
backgroundGraphic: "public/images/dot_cross_select.png",
backgroundHeight:10,
backgroundWidth:10,
backgroundYOffset:-6,
backgroundXOffset:-5,
labelAlign : "rm",
labelXOffset : "24",
labelYOffset : "0"
}
})
}

optionsForMap1 = {
maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
numZoomLevels: ${zoomScale},
controls: [
new OpenLayers.Control.Attribution()
]};

map1 = new OpenLayers.Map('divForMap1', optionsForPatternMap);

vectorLayer1ForMap1= new OpenLayers.Layer.Vector("Vector Layer",{styleMap:          styleForFeature1});

map1.addLayer(vectorLayer1ForMap1);

***//Following bounds,styles and layers are for "map2"***

  boundsForMap2 = new OpenLayers.Bounds();
  boundsForMap2 .extend(new OpenLayers.LonLat(-180,-90));
  boundsForMap2 .extend(new OpenLayers.LonLat(180,90));

  styleMapForMap2 = new OpenLayers.StyleMap({ 'default': new OpenLayers.Style(null, {
            rules: [
                        new OpenLayers.Rule({
                            symbolizer: {
                                 label: '$'+'{myLabel2}',
                                 strokeColor: "rgb(120,120,120)",
                                 strokeWidth: 1.5,
                                 fontFamily: "Calibri",
                                 fontSize: "10px",
                                 fontColor: "black",
                                 fontWeight: "bold",
                                 labelAlign : "rm",
                                 labelXOffset : "-10",
                                 labelYOffset : "-10",
                   }
                        })]

                })

            });

 vectorLayerForMap2= new OpenLayers.Layer.Vector("Vector Layer",{styleMap:   styleMapForMap2 });

optionsMap2 = {
                         minResolution: "auto",
                         minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
                         maxResolution: "auto",
                         maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
                         tileSize: new OpenLayers.Size(200,200),
                         controls: []
                 };

                map2 = new OpenLayers.Map('divForMap2', optionsMap2);

Now problem here is this that "myLabel2" defined in "styleMapForMap2" is getting added into

"vectorLayer1ForMap1" (I saw this while debugging in IE 8) and because of that "myLabel2"

is not appearing there where it is suppose to be.

Could anyone please help in this?

Thanks


texts:
maybe someone has already worked with the GPCC precipitation data from this site: ftp://ftp-anon.dwd.de/pub/data/gpcc/html/fulldata_download.html

and knows how i can convert this strange format to a data type which is readable by GDAL (like netcdf)?

Martin


texts: Assigning attribute values to map of city based on location picked?

texts:
I have a city map in arc GIS, with each parcel having it's own parcel number as an attribute in addition to other attributes.

I need to create a second layer of the same map and add data to it based on 4 additional attributes. These attributes are based on location in the city (the city would be split into 4 sections, each section would need to be it's own attribute.)

I tried to create a new feature class with the map, then I tried to split it up into 4 sections but then I get stuck on how to create the attributes and assign it to those areas with the parcel numbers.

Anyone have an idea on how I can digitize a map and assign it attributes? All the while linking it to my basemap that has parcel numbers for the addresses and attributes?


texts: I've downloaded from http://extract.bbbike.org/ a map of the waterways and waterbodies within Greater London, Uk. I've loaded the shapefile into QGIS and opened its attribute table. I see that the first column, titled osm_id, has numbers. I'd like to convert these to OSGB coordinates. I've attached a screen shot of the attribute table and its osm_id column.


texts: Removing 180th meridian line on map of Russia?

texts:
I'm not sure how to remove the line that represents the 180th meridian (international dateline) on my polygon. I have the "Russia Country Boundary 2017" feature layer added from the Living Atlas. My Projected Coordinate System is set to "Asia North Albers Equal Area Conic". I've tried to google this question, but I haven't come across an answer I can fully understand. I'm a student and very new to all this!

The line is actually a gap between the polygons.

Using ArcGIS Pro 2.3.1

ANSWER:

It turns out I was not projecting correctly, which was creating issues down the line when editing polygons. Here's what I did...

1. Start a blank project in ArcGIS. Insert new map, go into its
    properties, change the Coordinate System to "Asia North Albers Equal
    Area Conic".

2. Add "World Countries (Generalized)" from the Living
    Atlas. Select Russia and Export Features to new feature class layer.

3. Search and select the Project tool from Analysis>Geoprocessing>Tools.

4. Select the Russia layer for input. Select "Current Map" for Output Coordinate System. Run.

5.Now edit the polygons to close the gap and merge to remove any lines. All done!

The only thing that bothers me with this fix is the addition of shape area (484,914.49674 m²) and shape length (4.59 m) to the original Russia polygon. These numbers could be different depending on how you close the gap, and possibly affect data projections depending on your use of this map?


texts:
ArcGIS Desktop defaults the Home folder to something like C:\Users\<username>\Documents\ArcGIS - creating a folder in the My Documents or Documents folder depending on the version of Windows.

Personally I try to keep my GIS work out of the Documents folder, and usually store all my files in a folder called D:\GIS.  Primary reason for this was because my work had network stored Documents folders which had a quota of 5mb, which was much much much too small for storing any kind of GIS data.  This is made worse by the fact that Esri Add-ins default to installing into this folder also.

I've been trying to find a way to make ArcGIS default to my D:\GIS folder as the Home location without first saving an MXD.  I know that I can save an MXD into that folder and it will then become the Home folder for that MXD.  I'd like to be able to open ArcMap and have my files/folders already accessable from that Home folder D:\GIS without having to go find it, or even having it as a Folder Connection.

  The Home folder is used by default in ArcMap to save results, store
  new datasets, and access file-based information. It is the location
  that is initially used to add new layers to ArcMap and to store new
  datasets that are created during editing and geoprocessing.

  The same is true for nonspatial data. When you export a page layout as
  PDF, the default location will be the map's home location (the map
  document's workspace folder).

Working with the Home folder

I have found several posts (mostly on Esri's Geonet) asking how to do this, but none of these posts have a solution other than the two options I mentioned above (which aren't really a default).

How can I force ArcGIS to use my own folder location as the default Home folder without having to save an MXD first?


texts:
Nominatim geocoder returns osm_id as a location attribute. See this example

<result place_id="1620612" osm_type="node" osm_id="452010817">
  135, Pilkington Avenue, Wylde Green, City of Birmingham, West Midlands (county), B72, United Kingdom
</result>

Is it possible to get place ID with ESRI geocoder? Like esri_id or place_id?

I make the following request to geocoder http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?f=pjson&outFields=%2A&text=Big+Ben


texts: How can I overlay an image (exported via ArcGIS API) on an OpenStreetMap map?

texts:
Before I attempt to explain my situation, I'd like to disclose I'm very new to these apps and GIS in general.

There's a public ArgGIS server that I'd like to export a layer from and overlay on an OpenStreetMap map enabled by Leaflet. I've queried the API using the /export REST endpoint with the following parameters:

'dpi': '96',
'transparent': 'true',
'format': 'png8',
'layers': 'show:37,38,40,41,42,43,44,45,46,47',
'bbox': '-11872625.905327085,6573201.834478498,-6540378.812154609,7566271.705959245',
'bboxSR': '102100',
'imageSR': '102100',
'size': '1090,203',
'_ts': '1547504829299',
'f': 'image'

This generates a png that represents the layers I'm interested in. However, I'm having trouble overlaying on the map. I think the confusion is between bbox and lat/long coordinate systems. I'm not sure how to properly center the image on the map so the overlay works. I'm also not able to get it to zoom in properly on the OSM map.

I've tried the following configuration using Leaflet:

var imglayer = './layer.png';
var imgbounds = [[-11872625.905327085,6573201.834478498],[-6540378.812154609,7566271.705959245]];
L.imageOverlay(imglayer, imgbounds).addTo(mymap);

But the image isn't even visible.