texts: Automatic map rotation in map composer QGIS

texts:
The thing is that I wonder to make it possible to calculate automatically the map rotation in map composer. I have many maps in one file with their own projection parameters, and I would like to define map rotation in map composer based on projection formula (or smth else?)

e.g. location one specific map in project:

The projection is

In map composer map boundary looks like

And with selected rotation angle for the map with their projection parameters:

Map rotation angle is different for every map depending on its location and projection parameters.

Is it possible to automate this process and calculate map rotation angle automatically, for do not find this value manually each time (I would like to create universal composer for all maps via atlas generation menu)?


texts: Similar representation of flow using leaflet and its plugins for Polyline

texts:
Is there any javascript plugin of leaflet that can achieve that which are shown in the link?

http://gmaps-samples-v3.googlecode.com/svn/trunk/symbols/polyline-symbols.html

Is it as smooth as shown in the link? I am using Mapbox for the maps and I really hope that there is a leaflet-plugin which gives similar functionality as google-maps' Polyline.


texts: QGIS Model Designer - Select by Attribute with Multiple Field Parameters

texts:
I am building a model that includes a 'select by attribute' algorithm, and I am attempting to select by multiple fields where the value matches a model input.
Essentially, I want the selection query to be 'field1 = input AND field2 = input'
Based off the tooltip, and this question (Select multiple fields in Modelbuilder) I believe that the syntax for selecting by multiple field parameters should be field1;field2:

However, this is not working for the select by attribute tool. The dialog box closes and clears the 'Selection attribute' field when I hit OK.
Is there a different syntax for the select by attribute tool or is this not possible? I am able to work around it for now by having two 'select by attribute' algorithms in the model and selecting within the current selection. I am using QGIS version 3.16.


texts:
I'm trying to write the output of some raster processing using rasterio 0.36.0 (conda package, Python 2.7, Windows 32 bit). The output raster should have the same metadata as the input, including the coordinate reference system (crs). However when I set the output metadata using **kwargs, the crs is missing from the output.

See the simplified example below (without any further processing) importing then exporting a subset of a Landsat8 blue band:

import rasterio

raster_in = "Blueband_crestmap_sample.tif"
raster_out = "Blue_sample_copy.tif"

with rasterio.open(raster_in) as inrast:
    blue = inrast.read(1)
    kwargs = inrast.profile
    print inrast.crs
    print kwargs

with rasterio.open(raster_out, 'w', **kwargs) as outrast:
    outrast.write_band(1, blue)
    print outrast.crs
    print outrast.profile

Input dataset:

CRS({'init': u'epsg:32653'})

{'count': 1, 'crs': CRS({'init': u'epsg:32653'}), 'interleave': 'band', 'dtype': 'int16', 'affine': Affine(30.0, 0.0, 648855.0,
       0.0, -30.0, -2714235.0), 'driver': u'GTiff', 'transform': (648855.0, 30.0, 0.0, -2714235.0, 0.0, -30.0), 'height': 440, 'width': 503, 'tiled': False, 'nodata': -9999.0}

Output dataset:

CRS({})

{'count': 1, 'crs': CRS({}), u'interleave': 'band', 'dtype': 'int16', 'affine': Affine(30.0, 0.0, 648855.0,
       0.0, -30.0, -2714235.0), 'driver': u'GTiff', 'transform': (648855.0, 30.0, 0.0, -2714235.0, 0.0, -30.0), 'height': 440, 'width': 503, u'tiled': False, 'nodata': -9999.0}

Aside from the crs, the writing is successful. For example, I can very easily set the crs from the catalog in ArcGIS, but this is not a good solution for multiple datasets.

This is not specific to Landsat. I have the same issue when running a filter to smooth a DEM.

Is there anything I'm missing?
The code seems straight forward enough and matches a similar workflow from the rasterio cookbook: https://mapbox.s3.amazonaws.com/playground/perrygeo/rasterio-docs/cookbook.html#using-a-scipy-filter-to-smooth-a-raster


texts:
I am using the Vector Bender plugin to "georeference" a shapefile to a raster to point file. When I run the processes following this tutorial, my polygons are still not moving even though no errors were detected. Am I doing something wrong?

Vector Bender Plugin Interface:

Snapping Polygon To Raster to Point File:

Turning "plant_counts2" Editor On:

Running With No Problems:

No Changes:


texts: Checking if GPS coordinate is in country polygon

texts:
In order to check in which country GPS coordinate is in, I've found this github repo, where there is GeoJSON file for each country.

I've loaded the files to geojson.io, and they seem very accurate.

However, when I'm loading them into to my application code, some of the GPS coordinates fails to resolve.

For example, GPS coordinate from Paris [2.356652, 48.845483] which I would expect to resolve to France.
Looking at france.gsojson polygon coordinates I find they're in completely different scale, for example 722.5350952148436,51.10007257240614.

What am I missing here? How come the coordinates are completely different? and is there a way to convert one to another?

My code is written in Java and I'm using GeoTools libraries.


texts:
I'm using Leaflet combined with GeoJSON features. Is there a way to label GeoJSON features (in this case - polygons)? It should get labels from

feature.properties.name

This is my code where I think I could insert label:

function style(feature) {
            return {
                weight: 2,
                opacity: 1,
                color: 'white',
                dashArray: '3',
                fillOpacity: 0.7,
                fillColor: getColor(feature.properties.coloring)
            };
        }


texts: Converting shapefile to CSV file to shapefile with Add Delimited Text layer?

texts:
I'm using QGIS 3.4.6, working with a big biological dataset in several shapefiles.

I want to convert the working shapefiles to CSV files, add a column with new data, then convert the CSV files back to working shapefiles.

I got the first step done (by using semicolons to separate the columns), and before I start adding data, I want to figure out how to convert them back. So, I didn't change anything from the CSV file QGIS created. I select the CSV file in the Add Delimited Text layer popup, deselect 'first record has field names' and then get stuck on the Geometry Definition options.

The CRS gets autoselected correctly, but I can't select the 'lat' and 'long' columns (thats how they're named in the CSV file), it only gives me a 'field_1' option, then tells me X and Y can't be the same.


texts:
I'm working with an ArcSDE geodatabase v 10.0 in SQL Server 2008R2.
I added more than a dozen of rasters w/o problem.

Server: WIN 2008R2 12GB RAM
SPACE: 1TB
Created a mosaic dataset (empty) w/o problem.

My gis client is ArcGIS Desktop 10.3.
Previously changed raster storage to ST_RASTER.

Now I reverted this change and put raster storage back to SDEBINARY

Problem:
I cannot add any rasters to the mosaic dataset; not even a raster dataset inside the sde gdb itself.
I tried this many times, using python, different clients: one with standard, and advanced licenses... no results.
ArcGIS just crashes w/o any information, even when adding only one image.


texts: Adding and configuring a WFS service in Geocortex essentials

texts:
I need to add a WFS service to Geocortex essentials and view it the HTML-5 Viewer, I could add a WMS service and view it as a PNG image, still, I need to attach this WMS service to it's WFS capability so I can perform  the features the WFS offers.

What I've been thinking of is:

from "service connection", choose "add connection" and then choose a WFS service from the drop down list, the thing is that what is the correct
URL I should provide?? shall I put the whole thing with GetCapabilities, GetFeatureType ... or WHAT?? what is the correct URL I should provide??

I tried to edit my WMS service through the Query Builder, from the details tab, choose "edit connection settings" and then enter the WFS-URL:

Now, even though I was able to perform the two options, when I start the HTML5 viewer, it shows me an alert saying that "one of the layers can't be added ..." I don't know what's the issue, Geocortex support site showed me nothing, and I'm almost hopeless since I've been trying for so long and don't know even from whaere to start.

Anyone with knowledge in Geocortex can maybe help me


texts: Getting back to the Recent projects panel

texts:
The recent projects panel only appear at the opening of QGIS sessions.
Would it be a way to get back to this panel anytime (when no project is open obviously).
Getting back to it directly or using a script ... any way to achieve this ?
I find the projects "snapshots" so useful to find back projects ...


texts: Filling in Donut Polygons using ArcGIS for Desktop?

texts:
I have a set of polygons that represent bodies of water.

In the same feature are polygons that are the islands in the body of water.  So for a given lake, there are smaller polygons within that represent the islands in the same feature.  However, the actual water polygon itself for that lake there are "holes" where the islands exist.

So for a lake with one island in the middle, the water polygon would look like a donut.

Now I want to create a layer of water polygons with the holes filled in, so that when I want to view all the lakes in a map, I can see all the water polygons without holes in them.

Note: An island may contain bodies of water within itself.  There may even be nested bodies of water within an island, which is part of a body of water that is part of another island.  Kind of like an inception of water/islands :-).

How would I be able to do this in ArcGIS for Desktop?


texts: Digitizing RGB TIFF automatically using ArcScan

texts:
Is it possible to digitize RGB TIFF by color?

I need to select all the vegetation cover types from the image below, which is a part of an aerial photography of an island (http://george.wildlifeintel.com/stitches/southplazaall908geo/doc.kml)

I thought I can use ArcScan, but it works with binary pictures, and I need to select different colors.


texts:
I am new to GIS and have the following question. My shapefile has several coordinate pairs (x1, y1, x2, y2) and I would like to calculate the distances between the points within one go.

Any suggestions?


texts:
I have a program that has to loop throug a very large amount of features. I have created a wrapper for the feature. This made me think: How expensive is the Fields.FindField method? Would it be faster - and if so; how much - to store the field index in a static field in the wrapper class. An example:

internal class XFeatureWrapper
{
    private static int XColumnIndex =-99;
    private string _xValue;

    public FeatureWrapper(IFeature xFeature)
    {
        if (XColumnIndex == -99)
        {
            XColumnIndex = xFeature.Fields.FindField("XXX");
        }

        _xValue = xFeature.get_Value(XColumnIndex).ToString();

    }

    public string XValue
    {
        get { return _xValue; }
    }
}

Would this be faster than finding the field index in the feature every time?

Morten


texts: Python Addin installation on server for multiple users

texts: This may not be specific to Python Addin or could be related to Microsoft Windows Server 2003. I have installed a Python Add-in of ArcGIS for Desktop on server for to be used by multiple users. But it seems to work only for me even if I have administrator privilege. For other users, I have to install it individually. Is it related to server settings or Addin?


texts:
I'm building my first map, so please forgive me beginners mistakes.
I've downloaded QGIS 2.0.1 and following tutorial I was able to download data from http://sdi.geoportal.gov.pl/wfs_prg/wfservice.aspx?request=getfeature&version=1.1.0&service=wfs&typename=WOJEWODZTWA and present is as one layer in application.
My SHP file has 16 objects (Polish provinces).

My problem is that right now I have one layer (with one layer style) and I can show/hide all provinces at once, what I want to do is to have all provinces as layers (or groups) so I could show only some provinces and change their color.
I know that I can select shape using select tool, then export selection into SHP file and import 16 layers into project.
This is fine when layer has 16 objects, but my second map has over 3000 districts and I must be able to hide/show/change color of them individually.
Can this be done better/faster?
EDIT
I managed to split my SHP into layers, this way I have 16 layers and I can add style to every layer individually. I can also hide layers using layers panel.

Can I add similar select to layer? So I can choose which object to show/hide?


texts:
Using QGIS 2.4, I have tried labeling a polygon using the layer properties>label function but it doesn't show my label.

How and where do I type the text I want and get it to show?


texts: I'm busy cleaning up a lot of old data, layers, apps, maps, etc. in our ArcGIS Online content but I don't see the credit amount declining. Are credits returned when space is made available?


texts: Creating a vector tileset from a vector GeoPDF

texts:
I have a georeferenced PDF published by the USFS. It appears to have been created using Esri ArcMap, and all of the labels and linework appears to be in vector format.

Is there any way to convert this to a vector mbtiles or shapefile so that it can be used in a web map and remain sharp? I have successfully been able to convert it to a rasterized mbtiles file, but this isn't great as you don't get the full quality of the vector PDF at high zoom levels. I don't want layers, I don't care if the (currently selectable) label text gets converted to outlines. I just want a nice, sharp vector representation of my GeoPDF to show up in mapbox-gl-js.


texts:
How would you query a WFS using relative dates/ranges in a single URL call?

For example, I can do this:

https://my.server/geoserver/ows?service=WFS&version=2.0.0&request=GetFeature&typeNames=domain:dataset&outputFormat=application/json&count=50&cql_filter=(timefield DURING 2019-01-01T00:00:00/2019-01-10T00:00:00) AND ...

This is fine for discrete queries but not for subscription services.  If I want to pull "today" minus 365 days, how would I do that?


texts: GDAL for Python: extracting subdomains from NetCDF file?

texts:
I need to make a script that processes a NetCDF file that contains 3 days of hourly forecast data from the norwegian meteorological office.

The NetCDF file contains various data I need (Precipitation,Tmperature,Wind etc).
The NetCDF file is in a lambert projection while I will need to project it into WGS84 UTM 32N.
Also I will need to resample from 2.5km (forecast inputs) to 1km(output) grid cells.
I need to save it into the IDRISI format .rst

PROBLEM! The original NetCDF is HUGE, covering the whole of scandinavia + neighbouring countries. Thus I will need a system that processes quick.

I managed to do this already with ArcPy, but the process was too slow since for every hour timestep I needed to extract one by one the huge rasters, and only then could I clip them down.

Maybe in GDAL (in Python) there is a way to first clip at once the whole netcdf and then continue the processing with a smaller netcdf?


texts: I can't add an img file to QGIS 2.8.1 on Ubuntu 15.04

texts:
When I try to add an img file to QGIS 2.8.1 with Ubuntu 15.04 I get this error message:
Raster layer: /media/thomsec/D/Nu_Data/world/ocean_floor/age.3.2.img/age.3.2.img is not a supported raster data source

gdalinfo --format indicates that GDAL supports img files.

Any suggestions?


texts: Merging lines shows up as two parts in vertex list

texts:
I've merged multiple lines in ArcMap 10.5.1. When I go into the vertex list it shows up as two different parts. Why is this? I can also explode it as a multipart.  Is it possible to turn it into "one" feature, not a multipart?

The merged lines vertices:


texts: Error handling with python script in ArcGIS 10

texts:
I have a python script that I am using to create a list of all mxd files (with full pathing) in our Projects folder.  The script then uses that to iterate through the list and do a findandreplaceworkspacepaths on each mxd per ESRI's how to.  I am running into problems when I hit a corrupted mxd file.  The have tried try/except and haven't gotten it to work.  The ideal situation would be to write the corrupt filename to a file and move on so I can come back to them at the end.  I'm very new with python scripting, any help would be greatly appreciated.

import arcpy, os, sys, traceback, time

oldpath = 'W:'
newpath = 'W:\\GIS'

def find(path,pattern):
    matches = []
    for r,d,f in os.walk(path):
        for files in f:
            if files.endswith(pattern):
                fpath = os.path.join(r,files)
                matches.append(fpath)
                print (fpath)
    return matches

print ("Go: ")
mxdlist = (find('C:\\gis','.mxd'))
print (mxdlist)

print ("Starting Path Conversion")
try:
        for mxdold in mxdlist:
            mxd = arcpy.mapping.MapDocument(mxdold)
            mxd.findAndReplaceWorkspacePaths(oldpath, newpath)
            time.sleep(6)
            mxd.save()
            time.sleep(6)
            print (mxdold)
            del mxd
    except arcpy.ExecuteError:
        arcpy.AddError(arcpy.GetMessages(2))

    except:
        arcpy.AddError("Non-tool error occurred")


texts: Editing without clicking on a map - ESRI JS API

texts:
I'm looking to build a new application that allows staff to edit a service/layer. They will be inputting new survey benchmark data based on lat/long.

All of the current samples I have seen on the ESRI site show the editing done by clicking a point on a map and then populating the fields in the popup.

My goal would be to input the fields first and then have the app recognize the x,y and draw new point.

This would eliminate the error of the spot being clicked not actually being the correct coordinates.

Also, they will be doing the input at the office, so enabling GPS or similar in the app won't be helpful.

Does anybody know of a sample or way to do this?


texts:
QGIS 2.6.1
Microsoft Windows 7
Relative Newbie to QGIS; old hand at drawing software

Think I have corrupted this on my actual file that I'm working on.

Yes, I know that I can right click and get the panel back, but it's blank!

Have tried deleting export templates, tried opening on new machine!


texts:
I have downloaded Great Britain vector landcover data from Digimap. I was expecting it to look like the image on the left, however, when I downloaded it to ArcGIS Desktop it only displayed 1 colour (right). I have also tried downloading 20m landcover data and the same thing happened.
What have I done wrong?


texts:
I'm trying to draw a Bezier curve in OpenLayers (geometryFunction2) but there is something wrong with my approach I don't get. The first line seems fine but I can't place the next one. It work's fine with turf.js (geometryFunction). I'm trying that with a LineString geometry but I would also like to know if I could do that with Polygon lines also?
https://jsfiddle.net/komarara/7ejdwgL5/6/


texts: How to segmentize lines into dots in CARTO

texts:
I have this code generating a curve in Carto.

I want to convert it into a curve of points and then animate the points with torque.

WITH lines as (
      SELECT
         a.cartodb_id,
         a.origen_oaci || '-' || b.destino_oaci as route,
         ST_Segmentize(
                ST_Makeline(
                  cdb_latlng(1,1),
                  cdb_latlng(50,50)
                )::geography,
                100
            )::geometry as the_geom
      FROM
        modernizacion.datos_2016_resumidos a,
        modernizacion.datos_2016_resumidos b
      WHERE
        a.cartodb_id = b.cartodb_id)
   SELECT
     *,
    case    when ST_XMax(the_geom) - ST_XMin(the_geom) <= 180
                then ST_Transform(the_geom,3857)
            when ST_XMax(the_geom) - ST_XMin(the_geom) > 180
                then ST_Transform(ST_Difference(ST_Shift_Longitude(the_geom),
                  ST_Buffer(ST_GeomFromText('LINESTRING(180 90, 180 -90)',4326),
                            0.00001)),3857)
    end as the_geom_webmercator
   FROM
    lines

I know I can use something like this, but I'm not being able to integrate with the code above.

SELECT (ST_DumpPoints(
ST_Segmentize(the_geom, 1))).geom as new_the_geom FROM


texts:
I am used to using pgr-route driving distance function  to calculate how far I can go from a given point to a surrounding area

Assuming that I have a transport graph that includes costs and reverse costs is there any way off generating how long it takes to reach a single point from the surrounding area ?  A reverse driving distance ?

The only way I can think of doing this is to calculating the driving time for a series of points around the central point, but that strikes me as a rather expensive way of doing it.

Note my data includes cost and reverse costs values so I can just invert a driving distance calculation.


texts:
I've been using cartodb odyssey.js for a couple of months and the https://khms1.googleapis.com/kh?v=152&hl=es-ES&x={x}&y={y}&z={z} XYZ basemap has sufficed so far. However, I'm working on a location that doesn't seem to be covered beyond zoom 13 and the resolution is not good at zoom 13.

Is there a list of possible alternatives out there?

The current Google Earth data is super high resolution but I can't find it as a basemap. I've also tried the Nokia Day option but the area I'm looking at is cloud covered.

This is the map story I've made.  http://www.burdgis.com/blog/map/opwall-cusuco-national-park/  There's some great answers below but I can't find anything that allows me to zoom in close enough without cloud cover problems. Unsurprising as the park is a cloud forest. The current google earth imagery is very good but short of making my own tiles from that none of the free options are satisfactory right now. It would need to be satellite imagery rather than hillshade etc.


texts: Getting number of clusters and its markers with Leaflet?

texts:
I would like to know the number of clusters and its markers as soon as I open the map without zoom-in.

I'm using:

Leaflet 1.2.0
Leaflet.MarkerCluster 1.2.0
Firefox 57.0.1
OS/Platform

On the image below the expected result is demonstrated. It should represent:

1 cluster with 6 markers (marker1, marker2, marker4, marker5, marker6, marker7)
for each marker its details (name, lat, lon, ...)


texts: Keyboard shortcut for "delete" object in print composition?

texts:
Is it possible to have/add a shortcut from the keyboard to "delete" an object in print composition?

I use to add objects from models then I have to print and delete them to add obects from another model with the same composition structure. So I have to delete many object every time.

I use QGIS 2.6.1 on windows 7


texts: Why does Animal Movement toolbox give SyntaxError: invalid syntax?

texts:
I found a complete toolbox (Animal Movement tbx, by Regan Sarwas) for my tasks and I tried it.

I had a systematic problem with the codes for all tools (line 1), for exemple:

Executing: MinimumConvexPolygon D_VIVEK C:\Users\student\Documents\ArcGIS\Default.gdb\D_VIVEK_MinimumConvexPolygon 100 Fixed_Mean # #
Start Time: Sun Apr 13 13:12:47 2014
Running script MinimumConvexPolygon...
Failed script MinimumConvexPolygon...
SyntaxError: invalid syntax (HomeRange_MinimumConvexPolygon.py, line 1)
Failed to execute (MinimumConvexPolygon).
Failed at Sun Apr 13 13:12:47 2014 (Elapsed Time: 0.16 seconds)

Could anyone help me to understand and correct the problem?

ArcGIS 10.2.1 for Desktop - Windows 7


texts: Resampling Landsat 8 band 8 to 30m resolution (to same res as other bands)

texts:
I'm running a script in Matlab where I need to compare different Landsat 8 bands. The matrices of each band must match up, but I'm using band 8 which is at double the resolution of the others, and therefore has double the number of cells.

It was suggested to me that I use ArcMap to resample the band 8 to 30m res but I'm not sure how. It was suggested that I use 'extract by mask' but I'm not sure how this would work as I don't want to extract an roi, I want the whole image resampled.


texts:
I am building a routable network from OpenStreetMap using osm2po (v5.0.0). I would like to include ferry routes, but limit them to car ferries only.

I am using the following config (excerpt):

wtr.flagList = car, bike, foot, rail, ferry, poly
wtr.finalMask = car|ferry

wtr.tag.route.ferry =             2,   1, 10,  ferry

wtr.allow.motor[car|_vehicle].[yes|destination] = car|ferry

wtr.deny.access.no = car|bike|foot|rail|ferry
wtr.deny.vehicle.no = car|bike|ferry
wtr.deny.access.foot = ferry
wtr.deny.motor[car|_vehicle].no = car|ferry
wtr.deny.motor[_vehicle|car] = car|ferry

However, I keep getting pedestrian-only ferries. The problem is that often there are no other tags other than route=ferry by which I could filter (deny) them. Example:

https://www.openstreetmap.org/way/312631040

Any ideas?


texts: How to transfer attributes from standalone table to feature class using ArcGIS for Desktop?

texts:
In short, I have a stand alone table that has an identical table schema to a feature class.

I am creating a feature in the feature class and need to copy the selected row from the stand alone table into the selected feature.

The Attribute Transfer Tool only allows the source to be another feature class.

I cannot just create a null geometry record in the feature and then add the shape since it participates in a geometric network which does not allow records with null geometry.

Any ideas on how to do this without writing a custom tool?


texts:
I am looking at MapX and MapY coordinates. The docs say they are "truncated State Plane coordinates: NAD 1983 State Plane Louisiana South FIPS 1702 (US Feet)."

I am trying to reproject into a common lat/long like wgs-84 by using PostGIS so I need the srid for this projection.

I found the spatial reference page for the state plane coordinates http://spatialreference.org/ref/esri/102682/ -- but it does not list the SRID.

I found this page of common SRIDs -- but if I plug in the SRID the projection does not output correct lat/longs.

How can I find an authoritative SRID?


texts: QGIS OpenLayers 3 Google Maps not zooming

texts:
Google Satellite will not zoom. Although the scale changes as I zoom, as the map is re-rendered, it zooms out to its maximum extent every time.

This first happened in the latter part of November 2014 and I was able to fix it using unibasil's answer Misplaced Google Maps with OpenLayers plugin in QGIS?.

Unfortunately, Friday morning it started happening again. I can no longer zoom on any Google maps (Physical, Street, Hybrid, or Satellite). Although Bing maps work fine, Bing is not as up to date as Google maps.

Currently I am using QGIS 2.2 with the latest OpenLayers 1.1.4 that will work with that QGIS version. I also installed the newest version of QGIS 2.6.1 which uses OpenLayers 1.3.5 and it also will not zoom on any Google Maps.

I tried uninstalling and re-installing the OpenLayers plugin several times with same results. I also tried recopying the OpenLayers.js file as recommended by Unibasil (see above) with no success.

One more interesting clue is that my friend, who also uses Google Maps in QGIS 2.2, is not having this problem. The only difference I can tell is that he has not logged out of QGIS or removed the Google Satellite layer since last Thursday. I unfortunately log out every night. I believe if he were to remove and add Google Satellite layer, it would not be able to zoom either.

I have searched and have not found any recent posting on this problem. The couple old posting I have found do not solve the problem. I hope someone can help.


texts: ESRI add-in not installed automatically after build (locked-down environment)

texts:
We are using Microsoft Visual Studio 2010 to compile ESRI ArcMap 10.0 add-ins. Generally it works without problems. But we have some PC with very high security policies. For example they have (beside other restrictions) no write access to %ProgramFiles%, %ProgramFiles(x86)%, etc. and it is not allowed to execute batch files. On this PC after building an add-in the add-in is not installed automatically. Furthermore when we try to debug the add-in the execution hangs up somewhere during startup of ArcMap.

To solve the problem and adjust our security settings we would like to understand the technique of building and installing the add-in file. Does anyone has a hint or did anyone have the same problem before?


texts: How to relate Slope map and Curvature map so as to have in the end PERCENTAGE PROBABILITY MAP?

texts:
i am trying to deal with road detection this last month. So i am working with particle filtering that produces particles, that means possible targets(to my case cars)/points, with hidden information of speed). Further on, i implement spatial+statistical analysis through ArcGIS, using the density of these particles/points as an indicator of where could a road possibly be (through a methodology i follow, is possible to extract a road using the centroids od the polygons - small areas of bigger density of points. I have the slope map and the curvature map of the area. I have also converted everything to rasters and what i would like to do is a percentage probability map that will inform the user that "in this area is impossible what you see to be a target - so it's a false alarm". This will happen to my case in an area that the slope is smaller than 30 degrees of ground declination.
Are there any ideas of how could i RELATE SLOPE AND CURVATURE and later to proceed to PERCENTAGE PROBABILITY MAP? I am in a good path to achieve it , but i would appreciate any ideas!Thanks a lot!


texts: gdalWarp : Assigning more than one nodata value

texts:
I am working with a single band raster file in pyQgis and want to assign multiple Nodata values while reprojecting. I tried doing this but it took only the first value 32761 as Nodata value:
gdal.Warp(outputRaster,rlayer,dstSRS='EPSG:4326',dstNodata="32761 32762 32763 32764 32765 32766 32767")


texts: Change color polygons by area of polygons

texts: I have polygons with the area in the attribute table and I want change polygons to red color if they have area less 70.


texts: Keep getting ERROR 999999: Error executing function when invoking ReclassByASCIIFile

texts:
This error has puzzled me for days, as I can run this on my raster within Arcmap with no issues. My snippet of code is:

   # Process: Average FFPI cells to sub basins using Zonal Average technique
   global workingdir workingdir = ("N:\\FFPI\\tempdir") if not
   os.path.exists(workingdir): os.makedirs(workingdir)
   workingdir =  '/'.join(workingdir.split('\\')) + '/' global savingdir
   savingdir = ("N:\\FFPI\\FFPIrasters")
   savingdir = '/'.join(savingdir.split('\\')) + '/'
   arcpy.env.workspace = arcpy.env.scratchWorkspace = workingdir
   print "Averaging FFPI grid to sub basins weighting scheme #1"

   avgFFPI1 = (ZonalStatistics(inZoneData, "PFAF_ID", (savingdir + "FFPIfinal1.tif"), "MEAN"))
   avgFFPI1.save("InitialBasinFFPI1.tif")
   FFPIasc = (r"N:\FFPI\FFPI.asc")
   BasinFFPIreclass = ReclassByASCIIFile("InitialBasinFFPI1.tif", FFPIasc)
   BasinFFPIreclass.save (savingdir + "BasinFFPI1.tif")

This is my error:

Traceback (most recent call last):
File "N:\FFPI\FFPIAutomationtest.py", line 260, in <module>
BasinFFPIreclass = ReclassByASCIIFile(workingdir + "InitialBasinFFPI1.tif", FFPIasc)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py", line 5651, in ReclassByASCIIFile
missing_values)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Utils.py",  line 53, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py", line 5646, in Wrapper
missing_values)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\geoprocessing\_base.py", line 510, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (ReclassByASCIIFile).


texts: Can the "ol-layerswitcher" control be configured to indicate if a layer is not visible due to minZoom/maxZoom?

texts:
I have the OpenLayers layerswitcher control implemented and working.  However, there does not seem to be any visual cue to the user that the layer is not visible due to minZoom/maxZoom (e.g. my Parcels layer has a minZoom of 14).
Does the control have a way to configure this behavior?
Existing Code:
  private _parcelLayer = new TileLayer({
    name: "Parcels",
    title: "Parcels",
    minZoom:14,
    visible:true,
    source: new OlXYZ({
      url: sourceUrl,
      maxZoom: 19
    })
  } as BaseLayerOptions);

.
.
.

this.map = new OlMap({
  target: "map",
  layers: [baseMapLayerGroup, this._parcelLayer ],
  view: new OlView({
    center: [-8622609.656113915, 4480804.736605563],
    zoom: 7
  }),
  controls: defaultControls().extend([
    new ZoomToExtent({
      extent: [-9752043.186055679, 4046642.415945762, -7493176.1261721505, 4914967.057265365]
    })
  ])
});

setupLayerSwitcher();

.
.
.

private setupLayerSwitcher() {
    const layerSwitcher = new LayerSwitcher({
        reverse: true,
        groupSelectStyle: "group"
    });
    this.map.addControl(layerSwitcher);
}

"ol-layerswitcher": "^3.8.3",
"ol": "^6.4.3",


texts: Unable to set focus to the map from a dockable window

texts:
I have a dockable window with a single listview control on it.  Selecting an item in the view will build a layer and add it to the map.  At the point of the layer being added to the map, I need to set focus to the map.  However, focus remains on the listview.

My issue is exactly the same as the following thread:  How to set focus on ArcMap map window using arcobjects and c#.net. I have followed the suggested answer in that thread of using an IntPtr, but it doesn't set focus to the map.

The following is the line of code that I am using in a public method after the layer has been added to the TOC and map:

SetFocus((IntPtr)ArcMap.Document.ActiveView.ScreenDisplay.hWnd);

As an fyi, I have also declared the following at the top of the class:

// Sets the keyboard focus to the specified window.
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr SetFocus(IntPtr hWnd);


texts:
The following query and subquery help me finding a parcell using a GPS coordinate:

SELECT row_to_json(fc) FROM(
    SELECT 'FeatureCollection' As type,
    array_to_json(array_agg(f)) As features
    FROM (SELECT 'Feature' As type,
          ST_AsGeoJSON(lg.the_geom)::json As geometry,
          json_build_object('idu', idu, 'numero', numero, 'code_arr', code_arr, 'code_com', code_com, 'code_dep', code_dep, 'com_abs', com_abs, 'feuille', feuille, 'id', id, 'nom_com', nom_com, 'section', section) As properties
    FROM public.parcelle As lg
    WHERE ST_Intersects(
        lg.the_geom,
        ST_GeomFromText('POINT(4.4627171 48.505718)',4326)
        )
    ) As f)
As fc

I would like to use the properties named as lg to query the same table and get every rows that match those properties.

EDIT: Here is what I've done so far and it works, except the fact that I don't get a result every time, even if the GPS coordinates are correct and the query should actually find a result:

SELECT row_to_json(fc) FROM(
    SELECT 'FeatureCollection' As type,
    array_to_json(array_agg(f)) As features
    FROM (SELECT 'Feature' As type,
          ST_AsGeoJSON(lg.the_geom)::json As geometry,
          json_build_object('idu', pr.idu, 'numero', pr.numero, 'code_arr', pr.code_arr, 'code_com', pr.code_com, 'code_dep', pr.code_dep, 'com_abs', pr.com_abs, 'feuille', pr.feuille, 'id', pr.id, 'nom_com', pr.nom_com, 'section', pr.section) As properties
    FROM public.parcelle As lg
    LEFT JOIN public.parcelle AS pr ON ST_Intersects(
        lg.the_geom,
        ST_GeomFromText('POINT(4.4627171 48.505718)',4326)
        )
    WHERE pr.code_com = lg.code_com AND pr.code_dep = lg.code_dep AND pr.feuille = lg.feuille AND pr.section = lg.section AND pr.code_arr = lg.code_arr
    ) As f)
As fc

The features are set to null if I use the following coordinates lng:4.4627171 lat:48.505718. I've checked twice, there should be a result, there is a parcel at that position.

{
    "type": "FeatureCollection",
    "features": null
}

But when I'm using something different, a place in Paris for example, I actually get a result (lng:2.3522219 lat:48.856614):

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    [
                        [
                            [
                                2.35026891781536,
                                48.856341224567
                            ],
                            [
                                2.34962264291901,
                                48.8565904314831
                            ],
                            ...

Am I right using ST_Intersects here?

It seems like it can't always find a result, even if the parameters are correct and the related point should be found inside of an existing parcel.


texts: Replacing NULL values in geodatabase table?

texts:
How do you update NULL values within a geodatabase table using the ArcGIS Field Calculator (service pack 4) without changing other values to NULL?  I've tried the suggestions on this previous question:

How do you test for a NULL string  field in the Field Calculator with Python?

When I run the script it changes everything to NULL.

def RemoveNULL(x):
    if x is None:
        return '0'

RemoveNULL(str(!myxField!))

e.g.

before running script

1
23
NULL
5

after running script

NULL
NULL
NULL
NULL

Can you not use python script on mdb table?


texts: Add extra color class in leveleplot that covers values ranging from a threshold and above, supressing its extent in the color scale

texts:
I use levelplot in R to plot two raster stacks with values ranging from 0 to 600, by 20. This results to the first color palette below. However, I observed that I have some very sporadic pixels in my domain with values reaching up to 900. I want to include them to mu palette as well with a separate color, but I don't want the color to take so much space in my palette (as the second palette). How can I include an additional class with values ranging from 600-900, without taking so much space in the color ramp (denote it as >600 in the top of the palette)

 #
library("raster")
library("maps")
library("rgeos")
library("ggplot2")
library("latticeExtra")
library("grid")
library("colorspace")
library("rasterVis")
library("ncdf4")
library("colorRamps")
library("RColorBrewer")
library("maptools")
library("mapdata")
library("rgdal")
library("viridis")
library("rangeBuilder")
library("gridExtra")
#
#
r1 <- raster(nrow=18, ncol=36)
r1[] <- runif(ncell(r1)) * 10
r2 <- raster(nrow=18, ncol=36)
r2[] <- runif(ncell(r1)) * 2.345
r3 <- raster(nrow=18, ncol=36)
r3[] <- runif(ncell(r1)) * -4

months_obs = stack(r1,r2,r3)
months_cord  = stack(r1*2,r2*4,r3*9)
#
p1 = levelplot(months_obs, layout=c(4, 2), margin=T, at=at1, xlab=NULL, ylab=NULL, scales=list(draw=FALSE),
               col.regions=cr2, par.strip.text=p.strip, main=list(label="Precipitation Climatology [mm/month]", cex=0.7),
               colorkey=list(x=c(title=expression(mm/month), row=3, column=1, vjust=2, rot=90)))
p1 = p1 + layer(sp.polygons(afr))
p1 = p1 + layer(sp.polygons(africa, lwd=2))
#
p2 = levelplot(months_cord, margin=T, at=at2, xlab=NULL, ylab=NULL, scales=list(draw=FALSE),
               col.regions=cr3, par.strip.text=p.strip, main=list(label="Precipitation Bias [mm/month]", cex=0.7),
               colorkey=list(x=c(title=expression(mm/month), row=3, column=1, vjust=2, rot=90)))
p2 = p2 + layer(sp.polygons(afr))
p2 = p2 + layer(sp.polygons(africa, lwd=2))
#
grid.arrange(p1, p2, ncol=1, nrow=2,
             top = textGrob(paste("Precipitation for January (Climatology for 1990-2008)") ,gp=gpar(fontsize=12,font=1)))
#


texts: Print Selected Area in Map in Arcgis javascript API

texts: I'm working on arcgis javascript api, and I'm trying to implement a selection print tool, I'm new to this api, and don't know how to select area of the map, and after that, print the selected drawn area. Any help?


texts:
I am developing separate javascript widgets in different scripts and they work independently. However, when I try and put both scripts together, neither script works at all. So this brings me to my question, is there any way for me to easily integrate multiple Javascript ArcGIS scripts?

For example, if I only change the require statements from:

require([
        "esri/map",
        "esri/layers/FeatureLayer",
        "esri/dijit/PopupTemplate",
        "esri/request",
        "esri/geometry/Point",
        "esri/graphic",
        "dojo/on",
        "dojo/_base/array",
        "dojo/domReady!"
      ],

to:

require([
        "esri/map",
        "esri/tasks/RouteTask",
        "esri/tasks/RouteParameters",
        "esri/layers/FeatureLayer",
        "esri/dijit/PopupTemplate",
        "esri/request",
        "esri/geometry/Point",
        "esri/graphic",
        "dojo/on",
        "dojo/_base/array",
        "dojo/domReady!"
      ],

breaks all of my code. It gives me an error on the following line:

var popupTemplate = new PopupTemplate({
          title: "{title}",
          description: "{description}"
        });

In this case, when I say break I mean that the functional aspects of my code no longer work. It just shows an empty map, but none of my feature layers display anything.


texts:
My system crashed , so I had to reinstall the OS and so had to re-install ArcGIS.

But , while trying to reinstall ArcGIS, It is failing in the authorization step when I give my old Authorization Code, earlier obtained from my ESRI account.

Getting the below error on Final step of authorizing ArcGIS.

"Authorization denied because request would have exceeded max copies fo the following authorization number(s) :xxxxxxxxxxxx" "

Anyone Faced similar issue? Kindly guide me on the same, how to authorize ArcGIS again using my Authorization Code( valid till Feb 2017).


texts: Iterating through layers in mxd and describing coordinate system

texts:
I have mxd's that have information loaded from many different locations (some FCs from FGDB, shps, FCs in EGDB) and I want to check the coordinate reference system quickly for them. I have attempted the code below but get a error on line 16 for unsupoported operand type for +: 'layer' and 'str'.

import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")  # Uses your currently open MXD
df = arcpy.mapping.ListDataFrames(mxd, '')[0] # Chooses the first dataframe
layerlist = arcpy.mapping.ListLayers

for layer in layerlist(mxd, '', df): # Loop through layers
    sr = arcpy.Describe(layer).spatialReference
    if sr.name == "Unknown":
        print layer + " has an unknown spatial reference\n"

    # Otherwise, print out the feature class name and
    #   spatial reference
else:
    print layer + ": " + sr.name + "\n"


texts: Problem with deleting features/objects in Attribute Table

texts:
I am a new to the field of GIS-Software. So i hope for your patience. English is not my native language so sorry for that too ;).

My overall goal is to export a DXF-File with just the special objects with a special attribute for importing it into Vectorworks.

I have imported a shapefile in QGIS with the "add vector layer feature". I have a really big file with around 650.000 objects/features. I want to delete a lot of them with a special attribute in the attributes table with editing mode. I tried with QGIS and Arcgis and both are using 100 % CPU for a long time (2-5 hours), and nothing happens.
I did that some weeks ago with that procedure i described above but now it doesn't work anymore because both programs "die on it".

What am I doing wrong? Is there another way?


texts: An error has occured while executing Python code while doing home range analysis (Qgis 1.8.0)

texts:
It keeps appearing:

Traceback (most recent call last):
  File "C:/Users/Worten/.qgis//python/plugins\HomeRange_plugin\HRplugin_dialog.py", line 80, in
    QObject.connect(self.buttonBox, SIGNAL("accepted()"), lambda mth=mth: self.run(mth))
  File "C:/Users/Worten/.qgis//python/plugins\HomeRange_plugin\HRplugin_dialog.py", line 186, in run
    if not robjects.r.require(i)[0]:
NameError: global name 'robjects' is not defined

Python version:
2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.8.0-Lisboa Lisboa, 6416f38

Python path: ['C:\\Users\\Worten\\.qgis\\python\\plugins\\GeoCoding',
'C:\\Users\\Worten\\.qgis\\python\\plugins\\GeoCoding',
'C:\\Users\\Worten\\.qgis\\python\\plugins\\elevation',
'C:/OSGeo4W/apps/qgis/./python',
'C:/Users/Worten/.qgis//python',
'C:/Users/Worten/.qgis//python/plugins',
'C:/OSGeo4W/apps/qgis/./python/plugins',
'C:\\Windows\\system32\\python27.zip',
'C:\\OSGeo4W\\apps\\Python27\\DLLs',
'C:\\OSGeo4W\\apps\\Python27\\lib',
'C:\\OSGeo4W\\apps\\Python27\\lib\\plat-win',
'C:\\OSGeo4W\\apps\\Python27\\lib\\lib-tk',
'C:\\OSGeo4W\\apps\\qgis\\bin',
'C:\\OSGeo4W\\apps\\Python27',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\PIL',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\Pythonwin',
'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode',
'.',
'C:\\Users\\Worten\\.qgis\\python\\plugins\\ziplayers\\logic',
'C:\\Users\\Worten\\.qgis\\python\\plugins\\ziplayers\\gui',
'C:\\OSGeo4W\\apps\\qgis\\python\\plugins\\fTools\\tools',
'C:/Users/Worten/Desktop/Relatorio Anual 2012 - 2 de Mar\xc3\xa7o - 30 de Julho']


texts: How do I clip OSM basemap with a polygon?

texts: I've created a map in qgis 2.0. The map uses the OpenLayers plug-in to add the OSM layer as a basemap. I would like to restrict the basemap to be visible only inside a given polygon defined in a shapefile layer. How do I achieve this?


texts: GRASS GIS: red square around node topology information?

texts:
I've been using GRASS since 2005, but I cannot find an explanation to the square boxes that appear around the nodes of a lines layers, when I display topological informations on the map.

I thought they could indicate errors, but my layer appear to be topologically ok. Someone has told that those square lines refer to bboxes, but it doesn't convince me. Nodes' BBOXes? I have many layers and I only see them on this one...

Any GRASS user/dev out?

Giovanni


texts: How to import tiff files and generate contours in QGIS?

texts:
Very new to GIS, Just learning QGIS from product manuals and online resources. I have 2 .tif files of a regional municipality. I have another 3-4 files ( AutoCAD) which are survey files. I have another file (AutoCAD) utility info file. I would like to create a base file for other consultants to work on from these files. There are projection information only on the survey files.

Not sure if all this can be accomplished with QGIS?


texts: How to edit the position of a banner text's pointer?

texts:
I have build an ITool where one can add text (ITextElement) to the map. The user can choose the symbol from the ESRI symbology. There one can choose a symbol called "Banner Text" which looks like this in the preview:

When one adds the text with this symbol, only the rectangle is shown without the 'pointer'. How can I edit this pointer? I didn't find any information about it. Maybe I'm simply missing the right name or search phrase for it.


texts: Python for ArcGIS is a book that I have been looking at. Does anyone know if this would be applicable in QGIS? I am not looking to write application/plugins, simply get better at understanding expression etc. for standard workflow. e.g. queries and data-defined settings.


texts:
Currently I am developping a standalone python app and I am now working on the packaging with PyInstaller.

Configuration :

OS : Windows 10
QGIS : 3.4.9
PyInstaller : 3.5

Pyinstaller correctly finds many dependencies and manages to create an executable.

But when I run it, the output is :

  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "qgis\gui\__init__.py", line 27, in <module>
RuntimeError: qgis._gui cannot import type '����' from PyQt5.QtCore
[6752] Failed to execute script main

I found that the sip folder in QGIS 3.4\apps\Python37\ contains many files that might be useful, so I manually added the content of sip\PyQt5 in the PyInstaller package with other PyQt5 stuff and the new output is :

  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "qgis\gui\__init__.py", line 27, in <module>
RuntimeError: the PyQt5.Qsci module failed to register with the sip module
[4092] Failed to execute script main

Any idea about a file or folder I forgot to package ?
For PyInstaller I use a default .spec file.

Reviewing Working Windows Standalone .EXE From QGIS Python Script Using PyInstaller? with QGIS 2 didn't help


texts:
I am trying to add a merge layer to my project. I noticed that my merged layer has a region that is way too white, I am trying to fix that white space by adjusting the interval value from 0-255 to 0-1250, but whenever I set the values, it goes back to 0 - 255.

Here's a picture of my merged map, the link for the TIFF files are in here
Basically what I want to do is see what's in that white space, by increasing the interval to 0-1250, according to the original map scale. From what it looks like to me, it appears to not have any texture in that white area, therefore I would like to confirm it, by changing the interval.


texts:
I have migrated an toolbar initially developed for ArcGIS 9.3.  This tool is used by non-programmer or cartographers.

One procedure is called to generate centroids of attributes table and after to launch an calculation.

Anyway,

The source code used in 9.3 was :

(A)

    'instantiating new calculator and cursor
    pCalculator = New Calculator
    pCursor = CType(pFeatureClass.Update(Nothing, True), ICursor)

    'Centroid Y
    With pCalculator
        .Cursor = pCursor
        .PreExpression = "Dim pGeomShp as IGeometry" & vbNewLine & "Set pGeomShp = [shape]" & vbNewLine & "Dim pArea as IArea" & vbNewLine & "Set pArea = pGeomShp" & vbNewLine
        .Expression = "pArea.Centroid.Y"
        .Field = "centroidY"
    End With

    'try & catch *************************************************
    Try
        pCalculator.Calculate()
    Catch ex As System.Exception
        MessageBox.Show("Error: " + ex.Message)
    End Try

This was working until moving to ArcIS 10 (an upper). A crash was observed while launching pCalculator.Calculate().

I’ve migrated this code that way (like proposed here Syntax for ArcGIS ICalculator object? )  :

(B)

    Dim nCentroidXFieldIndex As Integer = pFeatureClass.FindField("centroidX")
    Dim nCentroidYFieldIndex As Integer = pFeatureClass.FindField("centroidY")
    Dim nBldg_sizeFieldIndex As Integer = pFeatureClass.FindField("Bldg_size")

    If TypeOf pFeatureClass Is IFeatureClass Then
        If TypeOf pFeatureCursor Is IFeatureCursor Then

            Dim pArea As IArea
            Dim pFeature As IFeature = pFeatureCursor.NextFeature()
            Dim myProgressCalc As New FileProgressForm
            myProgressCalc.set_maximum(iTotalRecords)
            myProgressCalc.Show()
            myProgressCalc.Text = "Veuillez patienter svp"
            myProgressCalc.lblProgress.Text = "Calcul des données géographiques"
            myProgressCalc.Update()

            pArea = CType(pFeature.Shape, IArea)

            While pFeature IsNot Nothing
                pFeature.Value(nCentroidXFieldIndex) = pArea.Centroid.X
                pFeature.Value(nCentroidYFieldIndex) = pArea.Centroid.Y
                pFeature.Value(nBldg_sizeFieldIndex) = pArea.Area

                pFeature.Store()
                pFeature = pFeatureCursor.NextFeature

                myProgressCalc.Go()

            End While
            myProgressCalc.Close()
        End If
    End If

It’s working but it’s working extremely slowly !   The first code (A) was executed in less than 3 minutes. The new one (B) in 25 minutes !

In fact, I just want to programmaticaly call a the new calculate geometry tool (when displaying attributes table - calculating-area-length-and-other-geometric-properties.htm )

Screen capture 1

or Arc tool => Data Management Tools => Entities => Add geometric attributes (/data-management/add-geometry-attributes.htm )

Screen capture 2

or any other methods !

Both tools are working great in ArcGis Desktop but I can’t find my way to make them work in VB.NET.

I'm using ArcGis 10.2 after having used ArcGis 10.0. The error was the same...

Sorry for screen capture in french and for poor english speaking.


texts: Start-up error message in QGIS: Unable to load the extension GoogleLayers causes an error when calling its method initGui ()

texts:
Possible Duplicate:
  Problems with Google layers plugins

Impossible de charger l'extension GoogleLayers provoque une erreur lors de l'appel de sa méthode initGui()

Traceback (most recent call last):
  File "C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 173, in startPlugin
    plugins[packageName].initGui()
  File "C:/Users/bruno.saphy/.qgis//python/plugins\GoogleLayers\GoogleLayers.py", line 33, in initGui
    self.sessionid = gmaps.get_sessionid()
  File "C:/Users/bruno.saphy/.qgis//python/plugins\GoogleLayers\gmaps.py", line 21, in get_sessionid
    sessionid = t.strftime("%d%m%Y_%H%M%S%s")
ValueError: Invalid format string

Version de Python :
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

Version de QGIS :
1.8.0-Lisboa Lisboa, 6416f38

Chemin vers Python : ['C:\\Users\\bruno.saphy\\.qgis\\python\\plugins\\GeoCoding', 'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/bruno.saphy/.qgis//python', 'C:/Users/bruno.saphy/.qgis//python/plugins', 'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\bin\\python27.zip', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\DLLs', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\qgis\\bin', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']ag


texts:
Is there a straightforward way to download data from OpenStreetMap (OSM)?

Using North America as an example, I realize Cloudmade (Cloudmade no longer provides downloads of OSM) and Geofabrik (http://download.geofabrik.de/osm/north-america/) both provide downloads, but the files are enormous (0.5gb - 4gb). I've also tried using the QGIS-OSM toolbar but I have not had much luck doing this, as similar to the OSM website the area you can select is very small. The amount of data I want to download is at the city level.

Finally, is there an easy of using OSM data? If I choose to download OpenStreetMap XML Data I can't open the osm.xml files using QGIS (even using the QGIS-OSM toolbar import function). I wonder if I'm missing a more obvious way of dealing with the data.

I just want to point out the very useful StackExchange clone for help with OSM related issues! http://help.openstreetmap.org/


texts: Meaning&Computation of range property in CMAPI map.view.zoom message

texts:
We are implementing a CMAPI 1.3.0 programming interface to abstract basic Gis commands from the actual Gis library underneath (Luciad Lightspeed 2016.0).

In the map.view.zoom command, I don't understand the meaning of the range parameter. I posted this message to the official discussion group. It's been a while now and nothing came out of it (yet).
For those who can't read the question, I wanted to emphasis the following post:

  Is there a formula for how "camera height above earth's surface" can
  be calculated from the map scale?

  The closest I have found is this article
  (https://blogs.esri.com/esri/arcgis/2008/02/25/map-viewing-altitude/)
  that explains that "the altitude depends on the map’s scale and then
  on your viewing distance away from the center of the map". As it does
  not make sense have the definition of the map zoom depend on your
  current viewing distance from the screen, it would be nice if someone
  can clarify how the CMAPI zoom property relates to map scale.

Does anybody knows how to convert Map Scale to/from CMAPI range?


texts: How to export a raster layer for external processing?

texts:
Is there a way to export  all values from a raster to for example a cvs or other textfile or dbf or xls and later import (changed) values from that file back into the raster? For vector-files this is no problem but for raster-files I have not found anything like this. (Important here: the export-file should be a table, not a grid).

The idea is to process raster-data with some external program like excel of statistics-software, to add channels (=columns) based on the data already there or create a new channel by linking data with data from a table. All this can be easily done for vector-layers but apparently not for raster-layers.

THX, stn


texts: How to Specify Out Unit to Be in Decimal Degree in ArcGIS JS API

texts:
I am using a Map service on ArcGIS Server 10.4.1 which is in this format

Spatial Reference: 102100  (3857)
Single Fused Map Cache: false
Initial Extent:
XMin: -9819759.37726215
YMin: 5128008.078704429
XMax: -9809084.764440382
YMax: 5132626.115644935
Spatial Reference: 102100  (3857)
Full Extent:
XMin: -9819004.6505
YMin: 5125535.589900002
XMax: -9809349.0802
YMax: 5131992.668099999
Spatial Reference: 102100  (3857)

Units: esriMeters

Now when I query the service it returns the data in Meter format which I can not display back them on the map as new graphics. Can you please let me know how I can change the service configuration or OutUnit in ArcGIS JavaScript API to be in Decimal Degree?


texts: Performing Raster Interpolation using QGIS

texts:
I am trying to use the Rasterinterpolation plugin to pick up elevations from a Raster DEM for a series of vector points.

Once loaded, the Plugin is accessible through Plugins Menu/ Raster Interpolation and seems set up to do exactly what I need.  However it will not let me select the correct Band of the Raster Layer.  The plugin sees the layer as only having Band 0, whereas the Raster only has Band 1, and as a result does not populate the 'height' field in the Vector layer.

SciPy and NumPy are both loaded

I have tried the same plugin with a multiband Raster layer and it still only indicates that the Raster has a single band, Band 0.

I am using QGIS 2.0.


texts: Why does Print Composer take ages "Creating icon for file ..."?

texts:
Every time I open a Print Composer, a box comes up, and text flashes by saying, "Creating icon for file [various random image files that I have on my computer]". It then pauses, and does it again, and does this 4 or 5 times before really opening it and letting me work.

Any idea why in the world it is doing this?

The image files I can see have nothing to do w/ anything I've ever done on QGIS.

Windows 7; QGIS 1.8.0.


texts: Which topology file formats are supported by QGIS?

texts:
I would like to know which topology file formats are supported by QGIS.

I am particularly interested in displaying topologies encoded with TopoJSON or GML. But any other portable topology file formats would be useful.


texts: Finding nearest neighbors between two tables with point locations in SpatiaLite?

texts:
I have started playing with SpatiaLite today and already stumbled upon a problem.

For each point location stored in tableOne I would like to select one, nearest (linear distance) point from tableTwo.

So far I came up with a clumsy solution that utilizes VIEW:

CREATE VIEW testview AS
SELECT
A.id ,
B.myValue,
Distance(A.Geometry, B.Geometry) AS distance
FROM tableOne AS A, tableTwo AS B
WHERE distance < 10000
ORDER BY A.Id, distance;

And then:

SELECT * FROM testview
WHERE distance = (SELECT MIN(distance) FROM testview AS t WHERE t.id = testview.id)

seems to do the job.

Two questions:

Is there a way to perform such query without creating a VIEW?

Is there any other way to optimize this query for better performance?
In a real world scenario tableOne will have hundreds-couple thousands records, and tableTwo - 1.3 million.


texts: Getting species geodata (via Lifemapper)

texts: In the search for species occurence data I stumbled on the Lifemapper project (http://lifemapper.org/). For creating biological models they posess a very comprehensive database. Unfortunately it does not seem to be possible to download everything in one time. Instead you can search and download one species at a time (as far I can see). I'm not looking forward spending days download all species one by one. Anyone has an idea what would be the most efficient way to download all the data...?


texts: Using WKT.writeGeometry for 'Circle' Geometry in OpenLayers?

texts:
In my application which I'm building using OpenLayers3, I'm trying to extract the geometry of a feature to WKT using
var format = new ol.format.WKT();
console.log(format.writeGeometry(geometry)); by following this docs.
 It works great for Polygon as I have tested, i.e. returning the Geometry String (WKT) but it fails when I try to apply it to Circle Geometry. In particular the log is printed as  Assertion failed: geometryEncoder should be defined

So, is there any solution to this as why this is particularly happening with Circle geometries. And how to resolve it, i.e. where to define this geometryEncoder as suggested in log?


texts:
In the attribute table I can use this expression

left(   "CODE" ,1)='E' or left( "CODE" ,1)='W'

to select features successfully, but when I try to use the same expression in the Properties, General, Query Builder window, to display a subset of features on the map it gives an error:

  SQL Expression Parsing Error: syntax error, unexpected LEFT

Is there an alternative syntax I can use in the Properties dialog to achieve the same?


texts:
I have uploaded bunch of gpx files into QGIS, but some of them has noise. This is what I have:

I tried that: Deleting lines in QGIS but no success.

What I want, is to delete selected:

but for some reason, delete selected option is grayed out. I also saved layer to shp.


texts: Longitude of GeoTIFF from grib2 not in negative for west lons using GDAL translate

texts:
I am trying to generate a GeoTIFF from a grib2 section of the GFS weather model.
After downloading the area needed I select the band that I want to make the GeoTIFF with this command
gdal_translate -of GTIFF -B 42 GFS_Global_0p25deg_20210108_F024.grib2 /var/www/html/data/gfs_pcpn1.tif

The TIFF is generated but longitude coordinates are in positive number for western longitudes for example if checking it on QGIS the points are like 289.5,14.5 instead of -70.5,14.5. I need to overlay this on a map using lon,lat.
Is there a way to set the correct coordinates in the gdal_traslate process? This is what is shown of the generated TIFF in gdalinfo command.
This coordinates system information seems so confusing.
Size is 233, 133
Coordinate System is:
GEOGCS["Coordinate System imported from GRIB file",
    DATUM["unknown",
        SPHEROID["Sphere",6371229,0]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (241.875000000000000,33.125000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (     241.875,      33.125) (241d52'30.00"E, 33d 7'30.00"N)
Lower Left  (     241.875,      -0.125) (241d52'30.00"E,  0d 7'30.00"S)
Upper Right (     300.125,      33.125) (300d 7'30.00"E, 33d 7'30.00"N)
Lower Right (     300.125,      -0.125) (300d 7'30.00"E,  0d 7'30.00"S)
Center      (     271.000,      16.500) (271d 0' 0.00"E, 16d30' 0.00"N)
Band 1 Block=233x4 Type=Float64, ColorInterp=Gray
  Description = 0[-] SFC="Ground or water surface"
  Minimum=0.000, Maximum=127.312, Mean=3.777, StdDev=7.540
  Metadata:
    GRIB_COMMENT=24 hr Total precipitation [kg/(m^2)]
    GRIB_ELEMENT=APCP24
    GRIB_FORECAST_SECONDS=0 sec
    GRIB_PDS_PDTN=8
    GRIB_PDS_TEMPLATE_NUMBERS=1 8 2 0 96 0 0 0 1 0 0 0 0 1 0 0 0 0 0 255 0 0 0 0 0 7 229 1 9 0 0 0 1 0 0 0 0 1 2 1 0 0 0 24 255 0 0 0 0
    GRIB_REF_TIME=1610064000 sec UTC
    GRIB_SHORT_NAME=0-SFC
    GRIB_UNIT=[kg/(m^2)]
    GRIB_VALID_TIME=1610150400 sec UTC
    STATISTICS_MAXIMUM=127.3125
    STATISTICS_MEAN=3.7773161444383
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=7.5399789437028


texts: How to unit test distance calculation beetween to points?

texts:
I want to write unit test for this query

select a.id, b.id
from channel a, channel b
where ST_Distance_Spheroid(
    a.coordinates,
    b.coordinates,
    'SPHEROID["WGS 84",6378137,298.257223563]'
) <= 1000.0 and a.id != b.id

What this query does is it find all points that are near each other.

What I'm thinking is this: create three points with known distance to each other. Run the query and then I test if points that are closer then some threshold are returned and so on.

The problem is I don't know how to get points of known distance from each other.

What I've tried is go to google maps pick some points and extract their coordinates from url (in EPSG:4326?) format. Then with google maps measure distance beetween them.

I've added this points to the database and computed distance with ST_Distance_Spheroid and I had different results from what Google Maps measurements tells me (about 100 meters difference).

So I don't know who to trust Google Maps or Postgis.

Here is my test data from google maps in geojson format.

[
  {
    "coordinates": {
      "type": "Point",
      "coordinates": [
        37.6154764,
        55.7573887
      ]
    }
  },
  {
    "coordinates": {
      "type": "Point",
      "coordinates": [
        37.5790479,
        55.8075773
      ]
    }
  },
  {
    "coordinates": {
      "type": "Point",
      "coordinates": [
        37.6176973,
        55.7578234
      ]
    }
  }
]

And Google maps that the distance beetween the first and the third one is about 250 meters while the ST_Distance_Spheroid gives about 147 meters, which is significant difference for me.


texts: I have the following problem with Flow Direction Tool in my DEM and with such wrong calculated flow direction in the centre of DEM I am unable to delineate any watershed. What can I do?


texts: Error in downloading MODIS image using R script

texts:
I am trying to download "MOD13A3" MODIS image using R script (http://r-gis.net/?q=ModisDownload) but each time it's ending in error. How to make it work ?

=================================================================================
setwd("D:/MODIS_Download_R")
source('ModisDownload.R')
library(raster)
library(RCurl)
modisProducts()
x="MOD13A3"
ModisDownload(x=x,h=c(25,26),v=c(06,06),dates=c('2013.01.01','2013.12.31'))

==================================================================================

Error in .modisHTTP(x, v = version) :
the http address does not exist! Version may be incorrect OR Server is down!

==================================================================================

I have kept ModisDownload.R, ModisLP and Rcurl in the same working directory.


texts: I feel like this should be really simple and I am missing something. All I wish to do is assign a unique ID to each polygon since I have multiple identical FID values. In MS excel I would simply type 1 then run this value down the rows of the column and it would automatically assign 1,2,3.....n. Can I do something in Arc10? Thanks


texts: LasDatasetToRaster does nothing to the Raster Layer

texts:
I have been trying to figure out how to clip and rasterize a LiDAR map file programmatically (Not through arcpy) I use C# but read many languages. So far I have been able to access and assign the LASD values but when I use ILasSurface.AsRaster or LasDatasetToRaster the RasterLayer outputs the same black square as if I did not call these functions. I can't find any documentation on this so I hope somebody can help.

    public void RasterDatasetToMap(IRasterDataset rDataset, IPointFilter pf, IRasterDatasetLayer pRasterLayer)
    {
        ISpatialReference sr = new UnknownCoordinateSystemClass();
        ITrackCancel2 tc = new CancelTrackerClass();
        //Define the position and dimension of the raster dataset.
        IPoint origin = new PointClass();
        origin.PutCoords(15.0, 15.0);

        int width = 100; //This is the width of the raster dataset.
        int height = 100; //This is the height of the raster dataset.
        double xCell = 30; //This is the cell size in x direction.
        double yCell = 30; //This is the cell size in y direction.
        int NumBand = 1;

        //Create new Raster Dataset
        try
        {
            rDataset = rWorkshop.CreateRasterDataset(
                "new raster layer - test 9", "TIFF", //filename and format
                origin, width, height, xCell, yCell, //Dimensions
                NumBand, rstPixelType.PT_FLOAT, sr, //Pixels, Spacial Reference
                true //Permenant?
            );
            status += "Default RasterDatabase Set! \n";
        }
        catch (Exception ex)
        {
            status += "Failed to create raster dataset: " + ex.Message + " " + status + "\n";
        }

        //Set Point Filter
        try
        {
            pf = (ILasFilter)new LasFilter();
            pf.AreaOfInterest = aview.Extent.Envelope;
            status += "Point Filter Set! \nDimensions: " + pf.AreaOfInterest.Envelope.Height + "x" + pf.AreaOfInterest.Envelope.Width + "\n";
        }
        catch (Exception ex)
        {
            status += "Failed to create point filter: " + ex.Message + " " + status + "\n";
        }

        //Rasterize Raster Dataset
        try
        {
            /*
             * Possible Methods
             */

            LASSurface.AsRaster(
                tc, //Track Cancel
                pf, //Point Filter
               rDataset, //Output Raster Dataset
               //Rastering Options
               esriPointToRasterMethod.esriPointToRasterNearest,
               esriLasZSource.esriLasZSourceZ,
               esriPointToRasterVoidFillMethod.esriPointToRasterVoidFillInterpolation,
               esriSurfaceInterpolationType.esriLinearInterpolation,
               1
            );

            /*LasDatasetToRaster conversion = new LasDatasetToRaster(
                LASDatasetLayer,
                rDataset
            );*/
            status += "Rastering technique finished. Check map for validity. \n";
        }
        catch (Exception ex)
        {
            status += "Failed to  raster dataset: " + ex.Message + " " + status + "\n";
        }

        //Experiment
        try
        {
        }
        catch (Exception ex)
        {
            status += "Failed to  create tin: " + ex.Message + " " + status + "\n";
        }

        //Create Raster Layer
        try
        {
            pRasterLayer = new RasterLayer();
            pRasterLayer.CreateFromDataset(rDataset);
            status += "Default RasterLayer Set! \n";
        }
        catch (Exception ex)
        {
            status += "Failed to create raster layer: " + ex.Message + " " + status + "\n";
        }

        map.AddLayer(pRasterLayer);
        status += "Check Your Map! \n";
    }


texts: Why would ArcGIS Bookmarks in a map not always be available?

texts:
I have a map (*.mxd) and every so often my bookmarks will disappear and reappear, apparently at will.

I am not sure why this is happening.

It seems to be isolated to one particular *.mxd.

Has anyone else had this problem?


texts:
I'm running the latest version of QGIS 3 from here and installed via DMG. However when I attempt to import a FileGDB, I'm not seeing the previous ESRI FileGDB option and the Open FileGDB driver doesn't seem to recognize it either.

When I attempt to drag it into the layers dialog box I get the following error message:

  Layer is not valid: The layer /Volumes/Macintosh HD/MSES6050/Geology/Formats/StanardsvilleVA.mdb is not a valid layer and can not be added to the map. Reason:

Without any further explanation of the reason. I've opened GDB files in previous version so I'm wondering if this is because of the way the DMG is compiled? Or can somehow add in this support after the fact?


texts:
I received raster data from a grid of 1100 by 1000 meters with a resolution of 1 meter. It is the output of EFC-400 software showing the field strength around power lines. The data is currently in Excel format and I want to use the raster in ArcGIS 10.2. In Excel the raster looks as follows:

x\y[m]
B[uT]   0   1   2   3   4   5   6
0   0.01    0.01    0.01    0.01    0.01    0.01    0.01
1   0.01    0.01    0.01    0.01    0.01    0.01    0.01
2   0.01    0.01    0.01    0.01    0.01    0.01    0.01

etc...

The second row indicates the y-direction (0-1000 meters) and the first column indicates the x-direction (0-1100 meters). I assumed that removing the first 2 rows and the first column and subsequently adding the header that ArcGIS expects would make the import in ArcGIS possible. I added the following header to the Excel sheet:

  ncols  1001
  nrows  1101
  xllcorner  0
  yllcorner  0
  cellsize   1
  nodata -9999

and saved the data in .txt format. In Notepad I made sure that all datavalues were separated by a space. In ArcGIS I used 'ASCII to raster'. This gave no error message, but the shape of the resulting raster does not resemble the original raster:

The raster should show two powerlines approaching each other. Anyone any suggestions?


texts: Can I create rasters from points with values based on a related table?

texts: I have weed mapping (points) and weed monitoring (tabular related table) data in a file geodatabase.  I would like to convert the points to raster based on the weed cover values in the weed monitoring related table.  The points to raster conversion function doesn't allow me to select values from the related table.  Is there a way to do this?


texts: How do you convert from GPS data in WGS84 to a GIS built in NAD27 in ArcGIS?

texts: I have GPS data that has been recorded in Datum WGS84.  The client has a GIS built in Datum NAD27.  Having looked into the conversions online I would like to know how to do this rigorously with minimum loss of accuracy.  Ordinarily I would build a GIS in WGS84 that uses GPS data and project it to the desired UTM (16N in this case).  I know I can transform in ArcGIS 10 but is this rigorous enough?


texts: Programatically adding popups into OpenLayers map

texts:
I'm developing a web service and want to inset multiple popups dynamically to a web page according to the request.

What I did was this

<script> //injected programmatically
var popups=[];
popups.push('11.1117177 46.077171   Title One   Description one,Second line.    24,24   0,-24');
....
</script>
....

function showPopups() {
    var vectorLayer = new OpenLayers.Layer.Vector(
    "Popup layer", {
    style : reconstructedTrajectoryStyle
    });

    var parser = new OpenLayers.Format.Text();
    var src = new OpenLayers.Projection('EPSG:4326');
    var dest = new OpenLayers.Projection('EPSG:900913');

    var s, wktLine, features, reprojectedFeatures;
    for (s = 0; s < popups.length; s++) {
    wktLine = popups[s];
    var wktLine1="lat   lon title   description icon    iconSize    iconOffset \n"+wktLine;
    features = parser.read(wktLine1);
    reprojectedFeatures = features.geometry.transform(src, dest);
    vectorLayer.addFeatures(new OpenLayers.Feature.Vector(
    reprojectedFeatures));
    }

    osmmap.addLayer(vectorLayer);
    osmmap.zoomToExtent(vectorLayer.getDataExtent());
}

$(document).ready(function() {
initialize();
....
showPopups();

});

What I got at the end was not successful. I got the error on the browser console saying Uncaught TypeError: Cannot call method 'transform' of undefined ز

What am I doing wrong? Should I use another easier technique?


texts: Why is the attached WMS service not working with QGIS and QGIS2WEB?

texts:
I am using QGIS2WEB (open layers) to develop a small platform with geodata. I am having trouble integrating the following WMS service into my webmap:

http://geoportal.frankfurt.de/opendata/bodenrichtwerte-2018.exe?service=WMS&request=GetCapabilities&

Using QGIS2WEB, no output is displayed, neither in the preview nor in the export. Other WMS services work. What could be the problem?

I work with QGIS (2.18.22) and QGIS2WEB (2.34.0).

From @TomChadwin'S comment, after activating "Match project CRS", the export of all WMS layers was almost correctly executed with OpenLayers. Unfortunately, Leaflet does not work.

However, a part of the OSM basemap is now not displayed in the northern part of the webmap. White background only.

Any ideas why the basemap doesn't fill the whole screen?

These are my settings:


texts:
I would like to show world map with Lizmap web client but I don't know how to do. Could you show me how?

I follow this tutorial: http://hub.qgis.org/wiki/lizmapwebclient/Installation_en for install lizmap web client. But I just load a part of world.


texts: Merge features in same feature class on same attribute

texts:
I have a feature class of lake contours. This feature class is the result of multiple lakes' contour data being appended into my Contours feature class. I now have over 300,000 lines of contours, and I'm not done. This is slowing down processing and performane to an untenable degree. I need to merge these lines based on the fact that they're from the same lake, and they share a common contour value. So for example, I am currently going about this by 'select by attributes' attributes on my contours feature class, where lake name = "" and contour = "" then I just merge them in editor. But I want to be able to automate this with a script.
Any ideas?


texts:
I have downloaded a shapefile of Stockholm (files on GitHub). I'm trying to convert the shapefiles to GeoJSON with the ogr2ogr command line tool. It does not work with the following error:

  Export to vector file failed.
  Error: creation of data source failed (OGR error:Failed to create GeoJSON datasource: test.geojson.)

The method that I'm using is as follows:

Open the Adm.shp file as a layer in QGIS
Right click on the layer and select "Save as..."
Save as GeoJSON

I've tried using different projections and such without success. Does anyone have an idea what could be wrong?


texts: R raster::shapefile() seems to overwrite ID when writing SpatialLinesDataFrame

texts:
I am creating a "nested" SpatialLinesDataFrame like so:
lines.list <- list()

id.vect <- c("A", "B", "C")

for (lines.index in 1:3) {

  line.list <- list()

  for (line.index in 1:2) {

    # create random path data:
    path <- matrix(data = rnorm(20), ncol = 2)

    # transform them to a line:
    line <- Line(path)

    # add to line list:
    line.list[[line.index]] <- line

  }

  # convert the line list to a Lines object:
  lines <- Lines(slinelist = line.list, ID = id.vect[lines.index])

  # write to lines list:
  lines.list[[lines.index]] <- lines

}

# Convert the Lines list to a SpatialLines object:
spatial.lines <- SpatialLines(LinesList = lines.list)

# create a data frame with the Lines IDs:
id.df <- as.data.frame(x = id.vect, row.names = id.vect)
colnames(id.df) <- "Lines_ID"

# convert to SpatialLinesDataFrame:
spatial.lines.df <- SpatialLinesDataFrame(sl = spatial.lines,
                                          data = id.df,
                                          match.ID = T)

Which works perfectly fine. The SpatialLinesDataFrame looks like this:

However, when I write this SpatialLinesDataFrame to a shapefile and read it back in, like so:
# go to output directory:
setwd("/output/directory")

# write output shapefile:
shapefile(x = spatial.lines.df, file = "output_shapefile.shp", overwrite = T)

# read the shapefile back in for comparison:
output.shapefile <- shapefile("output_shapefile.shp")

then the resulting SpatialLinesDataFrame (output.shapefile) looks different:

In particular, the Lines IDs have changed from 'A', 'B', 'C' to '0', '1', '2'. So I lost my originally defined IDs, likely while writing the shapefile. How can I prevent this?
Alternatively, is there a better way to create such a "nested" SpatialLinesDataFrame? My approach seems unhandy when even more levels need to be nested.
I am using R version 3.6.2 through RStudio version 1.2.5033 on macOS 10.14.6.


texts:
I'm experiencing an error when trying to run a heatmap in QGIS. I just downloaded QGIS 2.18.10 'Las Palmas' on my Windows 10 Laptop as the 64 bit option.

I am hoping to run some very simple heatmaps, following the instructions laid out here: http://www.qgistutorials.com/en/docs/creating_heatmaps.html.

I was able to follow those steps without issues when I used this in the past, but this time I get stuck after step 10 (converting the delimited text layer which I had imported from a CSV file to create the raster layer). When I follow the steps to add this layer, I receive the error "Raster update error: Could not open the created raster for updating. The heatmap was not generated."

My heatmap plugin came already installed, and I don't have the option to uninstall/reinstall it. Also I have already attempted to restart the program as the previous user had done.

Does anyone have suggestions as to what may have gone wrong, or what I should do differently?

Alternate instructions for creating a heatmap (to later layer over a world map and/or street view)?


texts: Extent of file is different in same coordinate system

texts: I have one TIFF file and one shapefile in the same coordinate system, but it's not overlapping. When I see the extent of both files both are in meters but they are very different.


texts: ArcGIS Select by location tolerance with "Are identical to"

texts:
I am wondering if there is a way to put a tolerance when doing a "Select by location" with the option "Are identical to the source layer feature".

Here is why I want to do this (I got a polyline layer). The problem is that I do a dissolve on a layer and the resulting layer has some lines that aren't dissolved. Now I need to select theses lines.

It should work but the problem is that sometimes, the vertex are off by 0.001 from the source layer. The "Select by location" isn't working in that case.

Is there a way to use a tolerance?


texts:
I am about to purchase a new GPS unit. I currently have a GeoXT and have used the combo of GPS Correct/ArcPad with GPS Analyst/ArcMap to correct the collected data to submeter (or close to it).

Looking at the GeoXH specs, it will already collect data at submeter. So if I use GPS Correct with a GeoXH, how much more accurate will it be? Will it just verify that my data has been collected at submeter accuracy or will it get corrected down to like subfoot accuracy or something?

I'm not familiar with technical details of GPS units, but was wondering if the upgrade to a GeoXH is worth the added cost?


texts: whereClause syntax for Cost Distance parameter

texts:
I am looking to create a sql expression regarding point feature class and selection based on 'Name' field to pass to arcpy.sa.CostDistance() param[0].

similat to:

savepath = env.workspace = r'G:\Xcel\Route Tool\Potter\Scratch.gdb'
weighted_Raster = r'G:\Xcel\Route Tool\Potter\Scratch.gdb\weighted_Raster'
fc = r'G:\Xcel\Route Tool\Potter\Data.gdb\Subs_w_dist'
Field = 'Name'
destValue = 'Coulter'
where_clause = createSQL(Field, destValue)

#Calculate the least accumulative cost distance for each cell to the nearest source over a cost surface.
outCostDist = arcpy.sa.CostDistance(where_clause, weighted_Raster,"", 'Output_Backlink')
outCostDist.save('distance_Raster')

How do I use make feature layer using variables as input. Similar to:

savepath = env.workspace = r'G:\Xcel\Route Tool\Potter\Scratch.gdb'
weighted_Raster = r'G:\Xcel\Route Tool\Potter\Scratch.gdb\weighted_Raster'
fc = r'G:\Xcel\Route Tool\Potter\Data.gdb\Subs_w_dist'
Field = 'Name'
destValue = 'Coulter'

destination = arcpy.MakeFeatureLayer_management(fc,'dest_Selection', [Field] = destValue)

#Calculate the least accumulative cost distance for each cell to the nearest source over a cost surface.
outCostDist = arcpy.sa.CostDistance(destination,weighted_Raster,"",'Output_Backlink')
outCostDist.save('distance_Raster')
distance_Raster = "distance_Raster"


texts: Finding watershed area for each point in river network using DEM using QGIS

texts:
I followed @Micha's instruction and successfully used the modules in GRASS.
I use r.watershed to get the basin raster and the drainage line：

and I use r.water.outlet to get the watershed of one outlet：

I got the whole basin area of the green outlet point, but all I want is the little part of the original basin area, like this：part B is what I want

This schematic photo shows the idea of what I want：

Can I achieve this goal using r.water.outlet or other modules in GRASS？ Or all I can do is using the intersect tool in Geoprocessing tools in QGIS？

I want to find the watershed area, but using QGIS.
I have following files to work with：

stream network shapefile(polyline)
point shapefile clipped from the polyline shapefile
a whole island(the stream is inside the island) DEM(I got 2 types:.lan & .tiff)

I want to find the total watershed area located upstream of every point in the network, here's the schematic diagram：

the green, red, and yellow line enclose the watershed of each point(here I only take 3 points as the example), and I want to calculate their area.
I already got the DEM file, and I must cut the region that contains the stream off, should I polygonize it first？
Can I directly use this form(.lan or .tiff) to work with GRASS？


texts: Polygons within Polygons Spatial Analysis

texts:
I have a polygon layer of planning applications and I am wondering if anyone can give any advice and or has seen or written a blog post that might point me in the direction of creating relationships between polygons that exist wholly within other polygons using QGIS. For example placing the parent ID in a field of the child records based on a polygon being wholly within the parent polygon.

I am thinking that I might be able to do something like convert the polygon file to centroids and then analyse the resulting points to identify inclusion within the former polygon table.

As it stands the polygon / planning application layer is one single table so the ideal procedure would actually analyse bigger and smaller polygons within the same table rather than between a duplicate table but that procedure may not exist.

The final objective is to create planning application histories for sites.


texts: Automatically Trigger write fields from polygon to point when adding point

texts:
When editing, I would like to create an SQL trigger that will write fields from my parcels layer to a point layer that the end user is editing.

Essentially, when a point is placed on a parcel, that point will automatically have all of the address information written to the point's attribute table from the parcel attribute table based off spatial location.

Any ideas?


texts:
I have a .txt file like this:

OID,reg,OW1980,OW1990,OW2000,OW2010
0,cea08_02,15.06,13.85,17.76,21.14
1,cea09_01,22.27,23.29,27.49,29.34
2,cea09_02,31.48,31.83,35.48,35.36
3,cea11_00,7.5,8.79,10.82,11.78
4,cea12_01,38.06,37.09,47.0,46.48
5,cea12_02,28.47,28.93,32.45,33.41
...

which I would like to join to a certain shapefile using arcpy like this:

indata = r'...path...\shapefile.shp'
infield = 'SHORT_NAME'
jointable = r...path...\OWByDecade.txt'
joinfield = 'reg'

arcpy.JoinField_management(indata, infield, jointable, joinfield)

But I get the following error message saying that there is no OID field:

ExecuteError: ERROR 000339: Input C:\Users\coug1812\Desktop\CISDA-
Statistics\Arcmap\OWByDecade.txt does not have OIDs
Failed to execute (JoinField).

The join works fine in arcmap using the 'join and relate' option on the shapefile I'm using. So is there a way to join a text file to a shapefile using arcpy or should I use another method?


texts: arcpy array: trouble with reassigning inf to 0

texts:
I've converted rasters to arrays via arcpy.RasterToNumPyArray() then divided them by 1. Some resulting values are zero and I need to reassign them after the division to zero. The array types are float64.

I've tried quite a bit of versions of the following code (from other SE searches assigning zero to infinity though) without luck. Any advice?

array = array[array == float("inf")] = 0

TypeError: 'float' object does not support item assignment


texts: Creating polygons via snapping to circle line

texts:
I am trying to digitalize my research areas. Those do have a radius of 250m which I created via the buffer and polygons to lines functions. Now I try to create polygons with the different land uses. However, when I want to snap it to the outer 250m line, it does not use the whole circle-part to snap to, but the polygon creates straight lines to the point I clicked onto.
It used to work beforehand and I have no idea what I changed (never worked with QGIS before and reading the introduction and playing around with different things did not work out).
I use QGIS 3.16 Hannover and my settings are Snapping enabled, All Layers, Segment, 14px, topological editing enabled, Tracing enabled, avoid overlap on active layer enabled, self snapping enabled.
If you need more information I am happy to post it.


texts:
I have a CSV file with one of the columns containing an array of consecutive lat/longs like the following:

[[[42.87596410238256,-70.57617187499999],[41.77131167976407,-70.048828125],[41.64007838467894,-72.0703125],[42.5530802889558,-73.212890625],[43.068887774169625,-72.421875],[42.87596410238256,-70.57617187499999]]]

What is the easiest way for me to import this into ArcGIS as a polygon? I would also like to maintain the other data in the CSV in the other columns that are associated with an individual polygon (row in the CSV).


texts: How to get list of sld with a specific symbol?

texts:
I am using geoserver and python to manipulate the things in geoserver. Geoserver have the ability for the REST API. Now i am trying to get the list of sld with a specific symbollizer. for example i want to get all sld's with a line symbollizer used in it.
Is there any way how to do it.


texts: Index express the similarity in shape between two data sets

texts:
I have two data sets.
One is points in the blue curve. The other is points in the green curve.
Now I want to find a property (P) or something else like index that has the following characteristics:

It represents the similarity between two data sets.
(With similarity I am referring to the same shapes plot by these points of two data sets)
It doesn't depend on the scale.
Two shapes have the same shape but different scale still give the same P value.

Could you suggest what P should I consider?


texts: How to use Leaflet to display a map in Lambert Conformal Conic without warping to EPSG:3857

texts:
I would like to display a map in leaflet which is in Lambert Conformal Conic. The CRS of this map is: '+proj=lcc +lat_0=38 +lon_0=-100 +lat_1=45 +lat_2=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'
I do not want to warp the image into EPSG:3857 as I want the image on the web to be identical to the image as it would be printed in real life.
I've been playing around with using proj4leaflet, but I am struggling trying to figure out the resolution and origin. I don't know if this is my problem, but my pixel size is different for the x and y-direction.
Pixel Size = (262.477506424478293,-262.465501517241137)
My original image size is:
Size is 18509, 11441
So, given a 262.477506 and -262.4655 I would think at zoom level 0 with a 256x256 tile, my resolution  (projection units (meters) to pixels) would be the total width in meters 18509*262.477506/256 would be 18,977.3287443516 meters to a pixel. But that just isn't working?
My steps are to:
gdal2tiles.py --profile raster U_S_VFR_Wall_Planning_Chart.tif -z 0-5 --xyz
Then I am using this:
var crs = new L.Proj.CRS("",'+proj=lcc +lat_0=38 +lon_0=-100 +lat_1=45 +lat_2=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
  {
    origin: ??
    resolutions: ??
  })

    var mymap = L.map('mapid', {
    minZoom: 0,
    maxZoom: 5,
    continuousWorld: true,
    crs: crs,
    tms: true,
    noWrap: true
}).setView([26,-80], 0);
    L.tileLayer('./U_S_VFR_Wall_Planning_Chart/{z}/{x}/{y}.png', {
    }).addTo(mymap);

When looking at the tiles they appear to be correct:


texts:
I'm trying to to detect changes in land surface over few periods in a specific polygon.
The problem is that I want to block water bodies from my calculations.

How can I do it?

This is the code I have created. All the objects called "period1/2/3/4" are NDVI images that I have ALREADY processed  and they reflect the average NDVI for few years i'm interested in.
 :

var diff1=(period1.subtract(period2)).divide(period1).multiply(100);
var diff2=(period2.subtract(period3)).divide(period2).multiply(100);
var diff3=(period3.subtract(period4)).divide(period3).multiply(100);
var diff4=(period4.subtract(period5)).divide(period4).multiply(100);
var meandiff=(diff1.add(diff1).add(diff3).add(diff4)).divide(4);

var visDiff={min:0, max:100, palette: [
    'FFFFFF', '#ffcccc', '#ff8080', '#ff1a1a', '#e60000'
  ]};

Map.centerObject(period1,7);
Map.addLayer(diff1,visDiff,'Diff periods1-2');
Map.addLayer(diff2,visDiff,'Diff periods2-3');
Map.addLayer(diff3,visDiff,'Diff periods3-4');
Map.addLayer(diff4,visDiff,'Diff periods4-5');
Map.addLayer(meandiff,visDiff,'18Years');


texts: How to refresh a Shapefile hexagon layer when joined DB changes

texts:
I have a table that I have created a spatial join with a layer that is a polygon grid (hexagons) this is fine and gives me the data I am looking for within each individual hexagon.

However, my underlying table will have data added to it (which updates ok when the SQL database receives new data). The spatial join layer does not update, so can this be refreshed (or do I need to create a new spatial join) and how is it achieved.


texts: How to reconnect Arc GIS Schematics diagrams to GIS data in another oracle/SDE

texts:
My problem: An Arc GIS Schematics diagram export with versioned oracle/sde GIS features can't be reconnected to GIS data on another oracle/sde instance.

I'm working on a project where in the first phase we created a railroad network stored in ESRI SDE 10.2.0 in Oracle.
This network we exported via XML-Workspace to the customers SDE.
In the next phase we started creating schematic diagrams at our SDE which now we would like to migrate and reconnect to their SDE.

The OBJIDs of the GIS features stay the same though the FCIDs are changed when importing the workspace to their SDE.

When reconnecting (setting the new data sources in the schematic dataset) the diagrams (which we exported for transport to a fgdb) to the SDE at the customer via OBJID and FCID - everything seems to work till we update the diagrams (against original query – with persist option). Here we get an error message:

"No initial objects can be retrieved. Unable to update the
diagram. Check to make sure the underlying version exists."

following with a German message that the geometric network also isn't found in case we try to reconnect in a fgdb.

Also Feature Info requests don´t point to the original GIS feature classes.

When updating with the Toolbox tool "update diagram" the same error message appears unless I explicitly set the datasources. But in this case (even with the Update/Keep_manual_edits option) the original query and the manual edits are lost.

When manually changing the UCID (FCID) in the schematic features the Feature Info requests recognize the GIS features again.

Last thing I tried was changing UCID, Schematicid/schematictid, FROMTID & TOTID in all the involved schematic feature classes in a diagram manually and then perform an update. This completes without error messages but many of the schematic features disappear after an update (though not all).

Also I noticed that UCID etc. are stored in A and E tables so there might be other places to manually edit stuff & I don't know if this is really wise to change too much in the diagrams "internals".

We are working with ArcGIS 10.2.0. The diagrams are based on the standard builder and input comes from a geometric network which consists of 3 node feature classes a line feature class and 1 nodeonlink feature class. The GIS features are stored in our oracle db in a versioned feature dataset.

Based on the error message - has this something to do with the versioning of the GIS features?

Does anyone have experience with exporting Schematic datasets and know a solution?
(On a sidenote: we didn't try Global IDs till now - kind of would like to avoid it - unless it is absolutely necessary.)