texts: ArcPy update a field based on the value of another field containing wildcard text

texts:
I have a file geodatabase feature class (fc). I want to update Field 1 (Colour) with text where Field 2 (Description) contains a certain word. ie. Field 2 contains the string 'the ball is red and small' so...

if Field 2 contains %red% then update Field 1 with the value 'Red'

In ArcPy I've tried this to no avail:

import arcpy
arcpy.env.overwriteOutput = True
fc = r"D:\Pathtodata\database.gdb\featureclass"

with arcpy.da.UpdateCursor(fc, ['Colour', 'Description']) as cursor:
    for row in cursor:
        if row[1] == '%red%':
            row[0] = 'Red'
        elif row[1] == '%blue%':
            row[0] = 'Blue'
        cursor.updateRow(row)
print("Finished")

When I run this, no updates are made. It cannot seem to use wildcards. It only seems to work with exact matches ie:

with arcpy.da.UpdateCursor(fc, ['Colour', 'Description']) as cursor:
    for row in cursor:
        if row[1] == 'the ball is red and small':
            row[0] = 'Red'
....

etc. etc.

How can I make this work?

I'm working in a standalone Python script, in PyCharm, not in ArcGIS.


texts: Count points that are within certain radius within a polygon

texts:
I have 4 table, I want to count police that are within 5km of a point (dam), schools and clinics within 3km same dam. So far I do get the results if I'm focusing on one table

$str = pg_query($conn, "SELECT count(a.geom) as health c.name as names FROM health as a dams as c WHERE ST_DWithin(a.geom, '$geoms', 3000, true) AND c.name = '$names' GROUP BY c.name ORDER BY c.name") or die ("Data loading failed: ".pg_last_error());

..but if I get more tables I get a a timeout.
I am looking for something like this...

Dam        Police     Health     Schools
Orange       3         12          26

Please assist


texts: Inserting line feature class values to point feature class in ArcGIS?

texts:
I have two feature classes. A line feature class and a point feature class.
The point feature class snaps to the line and the line feature class splits at points. I want to insert the value of Shape_Length in each point automatically. For example the point 1 should have 1087.7382 and so on. The end point must have a zero value.

How can I insert the values in Point feature class?


texts: Getting WGS84 height of a given place mark - Google Earth

texts:
Setting manually a place mark for a given location or obtaining the coordinates via Google Earth search yields the (Long,Lat) WGS84 coordinates.
I'm fully aware of map is a 2D concept, yet is there a possibility for getting the WGS84 height of a given location ?


texts: How can I pan an ArcGIS map from an external application?

texts:
I have a web application with geocoded addresses.  I would like to be able to click on an address within that application, and have ArcMap 10 respond by panning the map to the corresponding location.

Is there some sort of API or Python script that could accomplish this task?  I imagine my application would work similarly to Skype, and have a link to an address like:

arcgis://46.52,-84.46

where arcgis is the application, and 46.52,-84.46 are the coordinates to pan to.

I may be reaching pretty far here, but perhaps someone has tried to do this before.


texts: Accumulating values of date field using Python parser of ArcGIS Field Calculator?

texts:
I would like to modify the following accumulative/sequential python code sample in field calculator in a Date Time field. I think this is the correct code to use but let me know if not. The Date Time field is formatted like so: 30/01/2015 18:30:00. I need to add increments of 162 seconds to the time portion of the value for 24 records. The date will not change.

Here is the code sample copied from http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000004s000000
and I've put my field name 'Date_Time) in

Expression:

accumulate(!Date_Time!)

Expression Type:

PYTHON_9.3

Code Block:

total = 0
def accumulate(increment):
    global total
    if total:
        total += increment
    else:
        total = increment
    return total

I know that I can change a single row's Date_Time value once by running this syntax in field calculator: DateAdd ("s", 162, [Date_Time] ) but I need to loop through the values in the Date_Time column starting with 30/01/2015 18:30:00 for the first row and adding 162 seconds to the new total each time.


texts: Ranking cell values across multiple grids using ArcPy?

texts:
I have multiple grids, one for each month of a year. I would like to create a new grid for each month/year combination that the cell value is the percentile rank of that cells value in the grid stack.

Is there a way to iterate through the grids cell by cell, grab the values rank them and write them out to a set of clean grids using ArcPy?


texts: Copy and Paste Attribute Table Loses Formatting

texts:
I have 4 shapefiles in total, and for 3 of my attributes tables, I was able to directly copy it (including the formatting) into Excel. I do this by using 'Select All' and 'Copy Selected'. When I went to copy my last table, which has 57 features, it copied, but it loses its formatting when pasted (it became one long line to text) into Excel. I'm pasting into a new spreadsheet for every table and they're all point shapefiles. Does anyone know why sometime copy and pasting keeps the formatting while other times it does not?

I'm running ArcMap 10.3 and using Excel 2010.


texts: How to load .geojson file w/ properties and polygons into SQL table?

texts:
I have an Azure SQL table:

-- Create the table in the specified schema
CREATE TABLE dbo.geoTest_DEV
(
    fAssetId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    fAssetGeoId [NVARCHAR] (50),
    fAssetType [NVARCHAR](255),
    fAssetStatus [NVARCHAR](255),
    fAssetDesc [NVARCHAR](255),
    fGeoType [NVARCHAR](50),
    fGeoCoord [GEOGRAPHY]
);
GO

I have set up an Azure Blob Storage container as an external data source for this database. This holds .geojson files to be loaded into the Azure SQL table:

CREATE DATABASE SCOPED CREDENTIAL uploadGeo
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '<bigLongString>';

CREATE EXTERNAL DATA SOURCE geoStorage
    WITH (
        TYPE = BLOB_STORAGE,
        LOCATION = 'https://mycoolthing.blob.core.windows.net',
        CREDENTIAL = uploadGeo
    );

Here is the schema of geotest.geojson:
NOTE: There are multiple polygons in the actual file. This is just a sample of a single feature.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "geometryId": "1",
        "assetType": "residential building",
        "assetStatus": "active",
        "assetDesc": "Bills place"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -121.39254742860793,
              47.668080416965564
            ],
            [
              -121.39254742860793,
              47.66804784193947
            ],
            [
              -121.39257156848907,
              47.66804603221521
            ],
            [
              -121.39257156848907,
              47.668002598814054
            ],
            [
              -121.39236772060394,
              47.668002598814054
            ],
            [
              -121.39236772060394,
              47.668080416965564
            ],
            [
              -121.39254742860793,
              47.668080416965564
            ]
          ]
        ]
      }
    }
  ]
}

I can't quite figure out how to get each of the properties, the geometry type AND the geometry coordinates objects into the SQL table in a single call.

Here is where I'm stuck:

DECLARE @geoJson NVARCHAR(MAX)
SELECT @geoJson = BulkColumn
FROM OPENROWSET (
    BULK 'geoTest.geojson',
    DATA_SOURCE = 'geoUploads',
    SINGLE_CLOB) as JSON

INSERT INTO dbo.geoSQL_DEV (fGeoCoord)
SELECT
  geography::STPolyFromText('POLYGON ((' + STRING_AGG(CAST(Long + ' ' + Lat as varchar(max)), ',') + '))',4326).ReorientObject() AS fGeoCoord
FROM
    (
    SELECT
        Long,
        Lat
    FROM
        OPENJSON(@geoJson, '$.features[0].geometry.coordinates[0]')
        WITH
            (
                Long varchar(100) '$[0]',
                Lat varchar(100) '$[1]'
            )
)d

GO

DECLARE @geoJson1 NVARCHAR(MAX)
SELECT @geoJson1 = BulkColumn
FROM OPENROWSET (
    BULK 'geoTest.geojson',
    DATA_SOURCE = 'geoUploads',
    SINGLE_CLOB) as JSON

INSERT INTO dbo.geoSQL_DEV (fAssetGeoId, fAssetType, fAssetStatus, fAssetDesc, fGeoType)
SELECT
  fAssetGeoId,
    fAssetType,
    fAssetStatus,
    fAssetDesc,
    fGeoType
FROM
OPENJSON(@geoJson1, '$.features')
    WITH (
        fAssetGeoId [NVARCHAR] (50) '$.properties.geometryId',
        fAssetType [NVARCHAR](300) '$.properties.assetType',
        fAssetStatus [NVARCHAR](300) '$.properties.assetStatus',
        fAssetDesc [NVARCHAR](300) '$.properties.assetDesc',
        fGeoType [NVARCHAR](300) '$.geometry.type'
    )

GO

SELECT * FROM dbo.geoSQL_DEV

ALMOST THERE! This results in:

I just need to figure out how to insert each fGeoCoord in the correct record instead of in the single record as shown.

ANY IDEAS?


texts: ArcGIS WMS in Android. ArrayIndexOutOfBoundsException

texts:
I have a simple Android application that used the ArcGIS SDK to render a map, that works fine, but when I try to use a WMSLayer to render over my map, it generates me an ArrayIndexOutOfBoundsException and I don't get why.

My code:
MainActivity.java

package wmstest.com.wmstest;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.esri.android.map.MapView;
import com.esri.android.map.ogc.WMSLayer;

public class MainActivity extends Activity {
    MapView mMapView;

    // Called when the activity is first created.
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mMapView = (MapView) findViewById(R.id.map);

        try {
            String wmsURL = "http://srv1.nanoterra.ro:8080/geoserver/wms" +
                    "?SERVICE=WMS" +
                    "&VERSION=1.3.0" +
                    "&REQUEST=GetMap" +
                    "&FORMAT=image%2Fpng" +
                    "&TRANSPARENT=true" +
                    "&LAYERS=craiova_site" +
                    "&TILED=true" +
                    "&time_=1424422953367" +
                    "&WIDTH=256" +
                    "&HEIGHT=256" +
                    "&CRS=EPSG%3A31700" +
                    "&STYLES=&BBOX=312735.5839256644%2C403135.7136541791%2C313346.39561301924%2C403746.52534153394";
            WMSLayer wmsLayer = new WMSLayer(wmsURL);
            mMapView.addLayer(wmsLayer);
        }catch(Exception e){
            e.printStackTrace();
            Log.e("WMSTEST", e + "");
        }
    }

}

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <com.esri.android.map.MapView
        android:id="@+id/map"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        mapoptions.MapType="Topo"
        mapoptions.center="34.056215, -117.195668"
        mapoptions.ZoomLevel="16" />

</LinearLayout>

Stacktrace:

6835-6899/wmstest.com.wmstest E/ArcGIS﹕ url =http://srv1.nanoterra.ro:8080/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=craiova_site&TILED=true&time_=1424422953367&WIDTH=256&HEIGHT=256&CRS=EPSG%3A31700&STYLES=&BBOX=312735.5839256644%2C403135.7136541791%2C313346.39561301924%2C403746.52534153394
    java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
            at com.esri.core.internal.tasks.e.a.b.<init>(SourceFile:61)
            at com.esri.core.internal.tasks.e.a.b.<init>(SourceFile:43)
            at com.esri.android.map.ogc.WMSLayer.initLayer(SourceFile:382)
            at com.esri.android.map.ogc.WMSLayer$1.run(SourceFile:206)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
            at java.util.concurrent.FutureTask.run(FutureTask.java:234)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
            at java.lang.Thread.run(Thread.java:856)


texts: Leaflet CRS.Simple or CRS.EPSG3857 conversion Problem

texts:
I'm using v-leaflet (0.61) , a vaadin plugin, to visualize some layers over a map. Clicking on the map, I create a wms query to geoserver.
The query needs some parameters and one of them is the bbox. I suppose, by default, that the bbox, returned by the map, is in CRS.Simple, a mysterious coordinate system of leaflet.

if I set EPSG3857, both on the map and the layers, it returns me something like this as bounding box :

  Bound:6.0919189453125, 45.11617660357484, 11.134643554687498,
  46.50217348354072

if I set EPSG4326, with the same view :

  Bound:6.0919189453125, 44.81597900390625, 11.1346435546875,
  46.80450439453125

Seems that only the latitude values have been changed.

I've tryed also to use JTSTool (jts-topology-suite) to convert from EPSG3857 to EPSG4326 and the values are :

  bbox=4.0528551003362907E-4,5.4724638981914947E-5,4.1773613184440224E-4,1.0002420488398699E-4

It sounds so strange....

Can someone help me to understand the CRS used to define the bbox ? Or any way to transform them ?

"
            CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
            CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857");
            MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false);
            GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
            com.vividsolutions.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(bbb.getSouthWestLon(),bbb.getSouthWestLat() ));
            com.vividsolutions.jts.geom.Point point2 = geometryFactory.createPoint(new Coordinate(bbb.getNorthEastLon(),bbb.getNorthEastLat() ));
            com.vividsolutions.jts.geom.Point targetPoint = (com.vividsolutions.jts.geom.Point) JTS.transform(point, transform);
            com.vividsolutions.jts.geom.Point targetPoint2 = (com.vividsolutions.jts.geom.Point) JTS.transform(point2, transform);"


texts: Changing data source path involving feature dataset in *.lyr files using ArcPy?

texts:
How can one change the source data paths for every layer file in folder X using arcpy?

I've followed Updating and fixing data sources with arcpy.mapping as best I can, yet all I get is an unhelpful Runtime error <type 'exceptions.ValueError'>: Layer: Unexpected error which doesn't tell me enough to troubleshoot what's wrong or missing.

Heres the code (simplified to test a single layer file):

import arcpy, os

fname = r'K:\Layers\xxx.lyr'
lyr = arcpy.mapping.Layer(fname)
oldpath = lyr.workspacePath
print 'oldpath: ', oldpath
lyr.findAndReplaceWorkspacePath(oldpath, r'C:\some\other.gdb')
print 'newpath: ', lyr.workspacePath

and the results:

oldpath:  K:\Canvec_Utility\Temp.gdb
Traceback (most recent call last):
  File "x10x.py", line 12, in <module>
    lyr.findAndReplaceWorkspacePath(oldpath, r'C:\some\other.gdb')
  File "C:\ESRI\ArcGIS\Desktop10.0\arcpy\arcpy\utils.py", line 181, in fn_
    return fn(*args, **kw)
  File "C:\ESRI\ArcGIS\Desktop10.0\arcpy\arcpy\_mapping.py", line 601, in findAndReplaceWorkspacePath
    return convertArcObjectToPythonObject(self._arc_object.findAndReplaceWorkspacePath(*gp_fixargs((find_workspace_path, replace_workspace_path, validate), True
)))
ValueError: Layer: Unexpected error

((moved 'update' section into an answer))


texts: Is there any GRASS command to measure the distance between a point in rastermap and another in vector map?

texts:
I have a question about WinGRASS 6.4.3.
Is there any GRASS script　command to measure the distance between a point in rastermap and another in vector map?

I have a raster map and a vector map. Raster is mapped fire points, and vector is mapped houses as point data in same area. Now I can see the raster map superimposed with the vector map on the Map View.
I would like to know which fire points are most close to house. So, I would like to know distance between each fire and house.

I know there is GUI tool to measure distance, however, I have to measure many distances for many maps.
So, I need to know the GRASS command to measure distance.


texts: Drag and drop layers / layer groups between instances of QGIS

texts:
I am missing the functionality to drag and drop layers between QGIS instances a lot! I know there is a plugin that enabales the user to load layers from certain project files but I think it is cumbersome and directly dragging an dropping should be core functionality.

Is it currently possible?  Has it ever been possible or is it scheduled for V3?


texts: Problem with QFieldSync "offline editing" for more than one layer

texts: I want to edit two layers with QField offline ("offline editing"): A polygon- and a line geometry (both stored as sep. layers in a gpkg, no multigeometries). While packing it with QFieldSync, an error appears, which says: WARNING FEHLER: Layer ist nicht veränderbar (s. like: Error: Layer is not editable/changeable). Well, both layers were exported to QField, but one layer is empty (missing all the geometries), the other one is ok. I assume, there is some sort of conflict, but I can not figure it out.


texts: Grouping several types of shapefiles into one layer being able to turn on/off

texts:
I am wondering if QGIS (or qgis2web) can realize this: I have various shapefiles (label as points and lines) and I want to categorize them into one single layer which can be turned on and off. (It needs to have a blue tick-box in front of the top hierarchy).
Plus, there is another strange exporting issue. That is: Grouped layer will be automatically placed to the bottom layer regardless where you put it when editing. Then I need to manually modify the js code in layers.js.
Please see the example:
"I would like to have a blue tick-box for ROAD grouped layer"

output on web

QGIS editing panel

This is what I expect to realize:


texts:
I have downloaded the shapefiles from the following website:

http://download.geofabrik.de/europe/france.html

Each zip contains a "landuse" shapefile and I want to merge all of them in one single spatialpolygon object in R. My session crashes when executing the file, maybe because the memory gets full. Here is my code:

#directories of the shapefiles
directories <- list.dirs()

#read the first shapefile
shp.landuse <- readOGR(dsn=directories[1],
                  layer="landuse")

#merge all the shapefiles together
invisible(foreach(i=2:length(directories)) %do% {
temp <- readOGR(dsn=directories[i],
              layer="landuse")
shp.landuse <- rbind(shp.landuse,temp,makeUniqueIDs=TRUE)
}
)

Is there a better method? If it is indeed a RAM issue is it possible to store the data on a temporary database on the diskdrive instead than on the RAM?


texts: QGIS DB Manager - Load new layer not loading SQL query

texts:
I am trying to load a set of queried data into the map window but the layer will not load.

I have a query that has successfully run returning data from two tables.

When I select to 'Load as new layer', set the columns, geometry column and layer prefix nothing loads and there is no error report or explanation as to why not.

I saw else where that you need to make sure a geometry column is returned in you query which as you will see from the image below one is.

Not sure why I can;t display the layer?


texts:
We use ArcObjects pretty heavily and simplify polygons using something similar to the ITopologicalOperation::Simplify(void).  No tolerance is passed in as the parameter (it uses the XY tolerance of the associated spatial reference).

Now, we're using OGR for some functionality and would like to simplify using this library.  What's the equivalent?  I'm aware of OGRGeometry::SimplifyPreserveTopology(double dTolerance) but I'm not sure where to get the tolerance from the in OGR library.


texts:
I would like to have a shapefile with the airports position and the routes of the planes I've found Openfilghts but I can't use it in QGIS.

Seems that the format of the DB .dat is not supported by QGIS.

How can I overcome this problem?


texts: More on cutting polygons with polygons, in PostGIS

texts:
I had a really good answer to my question Using CASE to select between two geometry functions? but a problem arises if there are more than one lake in a forest; then the solution returns multiple forests.

Let me rephrase the question in much more general terms.

Problem

I have some forest polygons, and some lake polygons, in separate tables (layers) in PostgreSQL. I want to use PostGIS/PostgreSQL to create a new table with forests, that have holes where the lakes are.

Some forests have many lakes, some have one, and many have none. I expect the number of output forests to be the same as the input forests (except if a forest is actually cut entirely by a lake).

I need to preserve an ID-number attribute on the forests.


texts: We are currently working on a project where we have to merge sections (polylines) to a route, but the big question is how to do this. We have currently tried adding those two as segmentcollections but it gives some rather wicked results.


texts: In ArcGIS how can I append the number of points that are located inside each individual block groups of the entire US?

texts:
I am using ArcGIS 10 and I have two shapefiles; (a) a polygon shapefile of block groups of the entire US, (b) a point shapefile of customer locations throughout the US.

What I want to know if how many points (b) are within each block group (a).  What tool should I used to add a new field to the block group shapefile that will count and show the total number of points located inside each individual block group?

I also would like to show that number as a percentage of the total number of points.


texts: customize the silverlight esri feature data grid form template?

texts:
I would like to add drop down box and multi-column text box to the feature data form which pops up when i click on the feature data grid.  Instead of the regular text box i would like to replace some other controls.

<esri:FeatureDataForm x:Name="MyFeatureDataForm"  Style="{StaticStyle1}"  IsReadOnly="False" LabelPosition="Left" />

How can i achieve this customization?


texts: Forcing QgsTask to cancel in QGIS plugin?

texts:
I want to force closing Qgis project (QgsTask) in some point

  NOTE:
   QgsProject.instance().clear() # NOT WORKING

  QgsTaskManager().cancelAll() # NOT WORKING

  QgsTask.cancel() # NOT WORKING

    task.canCancel() # FALSE

project = QgsProject.instance()
project.clear() # NOT WORKING
QgsTaskManager().cancelAll() # NOT WORKING
tasks = QgsApplication.taskManager().activeTasks()
for task in tasks:
    print (task.canCancel()) # False
    print (task.description()) # Loading “C:/Users/User/Desktop/some_project.qgs”
    print (task.flags()) # <qgis._core.QgsTask.Flags object at 0x000002330527E4C8>

    task.cancel() # NOT WORKING

Is there any way to force closing project or task or change flag QgsTask.CanCancel to True ?


texts: Find GPS midpoint and SD of GPS coordinate along a certain heading in QGIS

texts:
I have a set of GPS coordinates (x, y) along with heading information. The heading for these coordinates is more or less the same and the coordinates are within a few meters of each other. How can I use QGIS (or any other tool) to find the mean and standard deviation of these GPS coordinates along the heading, i.e. looking to rotate the X, Y plane along the heading direction and then find the mean and SD.

Thanks!


texts:
Is it possible to delete a vector layer when a user pans or zooms a map? I saw in the documentation that there is a function called onMapResize. Can this also be used to detect a pan change?

I want to delete a point if the map is panned or zoomed and tried using it in the following way (which does not work):

map.OpenLayers.vectorLayer.onMapResize(console.log('map was moved'))
//use removeAllFeatures() to remove vector points


texts: Remove Duplicate Spatial Lines in R using SF Package

texts:
I want to remove duplicated/overlapping lines from a multiline layer using the sf package in R.

The layer I have has a lot of attributes, and in many cases one line is recognized as 5 overlapping lines. I want to remove the repetitive lines so that every line is unique. It is fine to lose attributes, but I need a way to reconnect those coordinates into lines. The layer is big enough that I can't query based on conditions to remove each repetitive line.

A similar question-- https://github.com/r-spatial/sf/issues/669 --was asked regarding spatial points, and the solution requires the distinct() function from tidyverse. However, when you do that with lines, you lose the attributes necessary to reconnect coordinates as lines in the first place.

Here would be example code, where the goal would be to remove the duplicate line3.

library(sf)
library(dplyr)

# Example lines (note these are taken from the sf vignette)
line1 <- rbind(c(0,3),c(0,4),c(1,5),c(2,5))
line2 <- rbind(c(0.2,3), c(0.2,4), c(1,4.8), c(2,4.8))
line3 <- rbind(c(0.2,3), c(0.2,4), c(1,4.8), c(2,4.8)) # Repetitive to line2
line4 <- rbind(c(0,4.4), c(0.6,5))

# Merge together as sf object
lines <- st_multilinestring(list(line1,line2,line3,line4))

# Recommended method to remove identical spatial objects using sf
lines_distinct <- data.frame(st_coordinates(lines)) %>% distinct(X,Y)
head(lines_distinct)

The problem here is that the object lines_distinct just has the coordinates, I have no way to differentiate line1 from line4.

I would also accept any answer using the sp package, but I'm trying to transition more to sf.


texts:
Is it possible to get source codes of all implemented wps processes?
I want to create one big chained process in Java instead of using WPS builder.


texts: Refering to (Joined) Field Names in arcpy in Field Calculator

texts:
I'm trying to update the locations of a point FeatureClass using a table.

I have joined the table to the featureclass, and am attempting to use Field Calculator to update the SHAPE field.

I found the following code snippet that does what I want:

def Update(shape, newX, newY):
   pnt = shape.getPart(0)
   pnt.X = newX
   pnt.Y = newY
   return pnt

Update( !SHAPE! , !NEAR_X! , !NEAR_Y! )

which ends up looking like this:

When I try this on a test featureclass, with no joined fields (just 3 columns; shape, newX, newY) it works perfectly. However, when I try it on my real data, with the table joined, it will not work. It gives a 'Failed to execute' error, and the ever-joyful 'ERROR 999999: Error executing function.'

I have tried making a Feature Layer from the joined table, and that doesn't help either.

How do I properly refer to the field names to make this work?

EDIT: In response to @Emil Brundage - when running the query on the joined layer, I did use the tablename.fieldname structure, as per the image below.

I receive a syntax error:


texts:
We would like to offer our Client a webGIS solution for showing/Monitoring their data. Based on my Knowledge WebGIS by ESRI would be helpful and provide the user with the Login Information and it is safe. However, due to the costs of server, it is not possible for us.

I first offered them ArcGIS Earth. It worked for a while but it is very slow and most importantly it is not possible to Show a feature with classification in Colors and that is what the Client wants.

I lerned a bit About WebGIS through QGIS and did a sample data with it is not clear for me how secure it is as there is no Password defining possibilty and I am not sure where the data is published. Is it under Cloud?

How can I secure this Approach?


texts: Using QGIS, how can I create attributes within a polygon layer based from a selection in that layer?

texts: I'd like to add a column, or attribute rather, to selected rows within a polygon layer. I would simply like to make a binary system, where those that are selected receive a "1,' let's say, and all others are represented by a "0." How can I do this?


texts: Integrate JSON file inputs (specifically latlng) in Leaflet with JS

texts:
It's my first time using Leaflet and I wanted to simply put two markers based from my inputs. I managed to connect my JSON file with the JavaScript and the only problem I have is how to dynamically display two markers based from the inputs.

My HTML file:

            <input type="text" name="srce" id="src" placeholder="Source">

        <input type="text" name="dstn" id="dstn">

        <button class="calculate" type="submit">Calculate</button>

snippet of my json file:

    { "name": "1st Valley Bank",
   "latlng": "8.481868, 124.638211"
    },
    {
   "name": "3Cs Store",
   "latlng": "8.472811, 124.633821"
    }

and the part where I want the latlngs to be dynamically inputted (Leaflet file):

var marker1 = L.marker([8.47753, 124.64646]).addTo(mymap);
var marker2 = L.marker([8.484844, 124.638073]).addTo(mymap);

I've searched through the other queries and I think there's a simpler way in integrating these two.


texts: Has anyone been able to run OpenGeoSuite on openshift using the free 3 gears?  There is plenty of documentation on getting geoserver running on openshift there is even a GIT repo.   However I have not been able to find any documentation for running OpenGeoSuite on Openshift. The free account they offer is right at the minimum specs. Is there any documentation for this and/or an example of a site hosted using this method?  I have done the standard searching and found nothing (Google) on the subject positive or negative. It may have never been attempted, if it has I'm looking for documentation on how it was accomplished, or the reasons why it did not work.


texts:
sadly I don't have any keyword that reflects what I'm looking for:

I have a vector layer consisting of points, which have an integer attribute ("signal quality" here), that I want to plot as a convex hull. While the resulting shape is what I expected, I want to have some colouring on the shape that represents the quality level, too. IMHO a heatmap would only add simple spots, but is there a way to generate something that looks like a weathermap like multicolored shapes? I tried buffers but didn't managed it to bring everything playing together :/


texts:
I use tippocanoe to build Mapbox Vector Tiles from GEOJSON features but can't get the filter to work.

I use a geojson file which contains millions of features and want to filter them for different zoom levels using property "ZOOM".

My geojson file looks like that:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "OBJECTID": "2580023",
        "ZOOM": 2
      },
      "geometry": {
        "type": "MultiLineString",
        "coordinates": [
          [
            [
              -95.847916666999936,
              41.16875
            ],
            ...
          ]
        ]
      }
    },
    ...
  ]
}

I try to use this tippocanoe command but resulting vector tiles contain all the features and not just the once where "ZOOM"<3:

tippecanoe --no-tile-size-limit --feature-filter='{"features": ["<", "ZOOM", 3]}' -Z3 -z3 -o output.mbtiles input.geojson

Something is wrong in the --filter-feature attributes. Actually I suspect that "features" is not ok but I don't know what to put there. But the filter itself should be like that as described in Mapbox GL Style Specification.


texts: Editing related records for layer that has been added using ArcGIS Web AppBuilder?

texts:
In our web application we add layers programatically when a user with editing permissions logs in.

However when the layers are added using this method (map.addLayer(Layer)), the related records are not visible.

If those layers are loaded into the portal webmap by default however, the related records are visible and editable.

This leads me to believe that I am missing a process which occurs when the webmap is loaded but is absent when a layer is loaded using map.addLayer().

I have discovered that in jimu.js\LayerInfos\LayerInfos.js there is a function called _addTable() which I am now using within the function _addToFinalLayerInfos()...

if (newLayer.id === "myRelatedTableLayer") {
  if (newLayerInfo) {
   var newTableInfos = [];
   var newTalbeInfo = this._addTable(newLayerInfo.layerObject, this._finalTableInfos);
     if (newTalbeInfo) {
      newTableInfos.push(newTalbeInfo);
     }
   this._onTableChange(newTableInfos, 'added');
  }
}

Using this function now means that the related table / related record appears where it should be, but whenever you click on the record, the attributeinspector doesn't appear and there are no errors in the browser console to explain why.

The layerInfos and fieldInfos of the config_Edit.json file all seem correct.

I am comparing the two attributeInspector objects that are created in the showInspector() function of the Edit Widget, but I cannot find any major differences between that of the webmap layer and that of the programatically added layer.

Does anybody have any idea as to why the attribute inspector of a related record might fail to load when the layer is added programatically?

I am using webappbuilder v2.5


texts: Can I automate State Plane to Lat/Lon conversion in CartoDB?

texts:
Reading this: How do I convert State Plane coordinates to latitude-longitude? but ... I'm using CartoDB and wondering if there's a straightforward way to convert New York-Long Island State Plane coordinates to lat/long geometry en masse?

Happy to accept a pointer to documentation I should be reading.


texts: QGIS Clipping and reprojecting SRTM data creates a HUGE file

texts:
I'm having difficulty in QGIS doing what should be a very simple thing and I haven't been able to find anyone who has had the same issue.

What I'm trying to accomplish:  I need to export a very specific clipped region of elevation data from SRTM tiles in .bin format.  It needs to be in my local UTM zone projection.

Problem:  This should be simple but the process I'm using creates a runaway file size that fills my hard disk.

My process is:

Download SRTM tiles (SRTM3 data version 2.1 from http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/North_America/
Import as layers of raster data.  CRS is WGS84
Change project CRS to UTM zone 18 (EPSG:32618) enabling "reproject on the fly".  (Note - some of the data in in zone 17, but not the area I am trying to clip)
Raster->Misc->Merge.  This works properly and creates a 23.1MB file which loads into the canvas as a layer.  Remove all other layers to clean things up.
Raster->Extract->Clipper.  Mode "Extent"  Enter extent coordinates manually.  The area is very small - perhaps 10 miles by 10 miles.  The dialog appears to freeze but if you look at the output file it is building, it expands to gigabytes in size eventually filling the hard disk after an hour or two and generating an error.  The file size is around 300 gigabytes when it errors.

I suspect the problem is related to my merge/reprojection and subsequent extraction of the merged rasters.  If I simply clip a small section from a single tile without reprojection or merge, it works instantly, creating a small file.  However, my scenery crosses tiles and I cannot extract the area I wish without first merging the SRTM tiles together, as far as I can tell.

I'm brand new to QGIS and GIS in general and am trying to use SRTM data as elevation data for a Condor soaring flight simulation scenery landscape.  If anyone has a better suggestion or tool for exporting clipped SRTM data to the .bin format, I'd welcome it.


texts: Python toolbox works in ArcToolbox and in Python console, but not in ArcCatalog

texts:
I have a set of Python tools in a Python toolbox (.pyt). They are broken into multiple files and modules and have been functioning correctly, but now I'm seeing inconsistent behavior on multiple machines.

Basically, I can run the tools from code, I can import and run them from the Python shell in ArcMap, and I can import the toolbox into ArcToolbox through ArcMap and run them from there. But when I browse to the toolbox in ArcCatalog, each of the tools has a red X and when I right click "Why?" it tells me:

AttributeError: 'module' object has no attribute 'Parameter'

I also get the same error if I open the Python shell in ArcCatalog and do:

arcpy.ImportToolbox("C:/path/to/toolbox.tbx")

Although that same command, and subsequent invocation of the tool, works fine in the ArcMap Python console. This is on the first line that references arcpy (this is toolbox_utils.py).

import arcpy

def make_parameter(displayName, name, datatype, defaultValue=None,
              parameterType='Optional', direction='Input'):
    """
    This method prepopulates the paramaeterType
    and direction parameters and leaves the setting a default value for the
    newly created parameter as optional. The displayName, name and datatype are
    the only required inputs.
    """
    # create parameter with a few defaults
    param = arcpy.Parameter(
        displayName=displayName,
        name=name,
        datatype=datatype,
        parameterType=parameterType,
        direction=direction)

    # set new parameter to a default value
    param.value = defaultValue

    # return the complete parameter object
    return param

I have tried removing the .pyc files, removing and resetting the .xml metadata files and reducing the tools to a bare minimum. If I put an empty tool in a generic toolbox with no parameters, it works. Once I try to break it into the modules (which were working just fine), I start getting this error. It's as if ArcCatalog isn't resolving the arcpy reference.

EDIT:

Just to make it extra confusing, if I open ArcMap, open the Catalog window in ArcMap and browse to the exact same toolbox, all of the tools work. No red X's. Started and stopped both applications - ArcCatalog gives me the error, Catalog window in ArcMap doesn't.

Also, I checked to make sure ArcMap and ArcCatalog are using the same version of Python and they are both pointed to my Python27\ArcGIS10.3 directory.

Sample Project

If anyone wants to see what I've been doing and offer any improvements, I put the sample project that I whittled my real Toolbox down from on github. If anyone wants to help me expand it into a really tight sample structure, that would be great. https://github.com/cmpalmer66/SamplePythonToolbox

This is my structure:

arcpy_utils
  __init__.py
  toolbox_utils.py
service
  __init__.py
  services.py
  settings.py
  test_services.py
toolpackages
  __init__.py
  service_one.py
  service_two.py
toolbox.pyt
test_toolbox.py
*.xml

Toolbox.pyt looks like:

import arcpy

from toolpackages.service_one import ServiceOne
from toolpackages.service_two import ServiceTwo

class Toolbox(object):
    def __init__(self):
        '''
        Define the toolbox properties here. Do not change the name of this
        class. ArcGIS locates this class by name. It will not be able to find
        the toolbox and your toolbox will not work if you modify this.
        '''
        self.label = 'Toolbox'
        self.alias = 'ABCD'

        # List of tool classes associated with this toolbox
        self.tools = [ServiceOne, ServiceTwo]

The toolpackages directory contains the tool definitions, with the actual code in the services module.

Here is an example of one of the files in toolpackages (just the first few lines):

import service.services as services_main
import arcpy_utils.toolbox_utils as utils

class ServiceOne(object):
    """
    Does Service One
    """
    def __init__(self):
        """
        Define the tool class attributes, including your tool parameters.
        """
        self.label = 'ServiceOne'
        self.canRunInBackground = False


texts: How to remove line segments from a polygon for borders on a map in QGIS?

texts:
I am making a figure of the northern Himalaya, and in it are India, China, and Pakistan. These countries have disputed borders so I want to display these borders like they are displayed on Google Maps with dashed lines. But I don't know how to do this?

I have three vectors:

Country borders (thick black)
Regions borders (thin black)
Disputed borders (red dashed)

As you can see in the image below, the red dashed line has black lines appearing under it. For where there is a red line, I want only the red dashed line appearing and not the black lines. Everywhere else the black lines are fine. I believe they are polygons so that makes it a bit harder.


texts: Move a layer in QGIS to a precise position based on centroid

texts:
I'm not quite sure how to phrase this so apologies if it is a duplicate. I have a project that uses a series of lines created from the boundaries of polygons overlaid onto a map in QGIS. I understand how to use QGIS to create a point layer with the centroid of the initial polygon before it is converted to a line. How can I move a polygon or line layer to a new location based on the centroid placement?

To try to explain it more clearly, imagine 2 buildings on a map, both in separate locations. Each is expressed as a polygon layer in QGIS. What I am trying to do is calculate the centroid of each and then move building A so that it sits in the position of B, using the centroids of each to ensure that they are positioned in the same place, even though they are different shapes. All I can think of is there might be a way to lock the centroid layer to the line layer and then move them both by editing the coordinates of the centroid? I am fairly new to GIS in general though so I'm not sure how to approach the problem.


texts:
I know this is an almost too simple question. But maybe there is a fast answer. Looking through some code to build a leaflet map in R I found that part of code:

mypal = colorNumeric(
  palette = "YlGnBu",
  domain = df$median
)

map<-leaflet() %>%
  addProviderTiles("CartoDB.Positron") %>%
  setView(myLNG, myLAT, zoom = 12) %>%
  addMarkers(lat=lat, lng=lng) %>%
  addPolygons(data = df,
              fillColor = ~mypal(median), ...

What is the "meaning" of the ~ before mypal in the last row. In R I see so many tildes that they kind of scare me as I don't know what they really mean...


texts: Reprojecting data from "arbitrary" coordinate system to state plane

texts: I have been "gifted" a large cache of data (mostly CAD DWG, some TIF based photography) that is in an "arbitrary" coordinate system.  I have determined that the system used is the correct NAD27 state plane zone for that area, except the first two digits of each coordinate pair have been clipped off.  Is there a way to create a prj file or proj4 definition for this system to allow easy re-projection of the existing data?


texts: OpenLayers: projection of WMS and vector layers

texts:
I have two layers in my OpenLayers map, the background in WMS and GeoJSON features in a vector layer, both in ESPG:3006. (And a standard OpenStreetMap background just to see which one of the layers that shows correct).

The problem is that the default projection is ESPG:4326, and if I specify the projection in the view of the map-object to ESPG:3006, the vector layer is correct but the WMS doesn't appear at all. To see the WMS layer, the projection needs to be specified for the WMS layer and the map will automatically be in correct projection, but then the vector layer appears in wrong position at the map.

What can I do to get both layers in correct projection and position?

const standardmap = new ol.layer.Tile({
            source: new ol.source.OSM()
        });

const WMSmap = new ol.layer.Tile({
            source: new ol.source.TileWMS({
                url: 'xxxxxxx',
                params: {
                    'LAYERS': '0',
                    'CRS': 'EPSG:3006',
                    'VERSION': '1.3.0',
                    'FORMAT': 'image/png'
                }
            })
        });

const geoJsonFeatures = new ol.layer.Vector({
            source: new ol.source.Vector({
                features: (new ol.format.GeoJSON()).readFeatures(geojsonObject)
            }),
            style: styleFunction
        });
let map = new ol.Map({
            target: 'map',
            layers: [standardmap, WMSmap, geoJsonFeatures],
            view: new ol.View({
                center: center,
                zoom: 5
            })
        });

The small red figures should be somewhere in "Region Mi...", not in Netherlands.


texts: Geopandas unary_union keeping lowest value

texts:
I have a shapefile with 850,000 records. What I am trying to do is merge all adjacent polygons and keep the lowest value for the group.

so for example my polygon is land_plots and has a crop_yield field which is numeric. Some of my land plots touch and some do not.

So i am

import geopandas as gpd
shp = '/content/drive/land_plots.shp'
df = gpd.read_file(shp)
# merge adjacent polygons
mergedPolys = gpd.GeoDataFrame(geometry=list(df.unary_union))

so here i end up with around 50,000 records and i need to assign the lowest crop yield from each plot.

in the image they are squares but in reality they are irregular shapes.


texts: QGIS Advanced labeling features with atlas

texts:
I'm using the atlas to generate 50-75 page map packages.  All pages are at about the same scale but some areas are much denser and have many more labels on a page to display.  I am running into the issues of labels not displaying or overlapping if I turn on colliding labels.  I have to have all of these labels being displayed and they are all rule based labels already so it is only displaying the important information.
I have lines, points, and polygons.  The polygons I can use free placement so they place fine.  Lines and points only have options for an offset which forces them to be very far away from the items.  Is there an expression that can be used to set the distance to 1 unit away but if there is a conflict then 2 units and so on and so on.  All the ways to check overlaps was for the geometry and not the labels.  Some items have the callouts but the same issue with them having a set distance not a variable distance.


texts: Frame and coordinates disappear when printing in QGIS

texts:
I'm trying to print my map in QGIS 3.18.0 including a zebra frame.

It looks great in the Print layout but when I print it, the zebra frame and coordinates are not there.

Is there a setting or checkbox that I'm missing?


texts: Google Earth Engine: Adding raster assets. How long can the ”Asset ingestion” take in Earth Engine after a successful upload?

texts:
I am trying to add a relatively large raster dataset (single band data, 8.05 GB GeoTiff, semi-global coverage) as an asset to Earth Engine through the web interface.

The upload succeeded, but now the status of Ingest image in the Tasks toolbar has been saying State: Running on server for 6 days and counting. There is no other status indicator.

I haven't had my own computer running continuously for that time, but this shouldn't make a difference after the upload was successful. Can it be expected that the task will finish at all, and if so, after what time, or should I just retry the asset ingestion?


texts:
I have encoded the roads based on the column Fclass as an example of "international, primary, secondary, sub"
Can I specify the scale range for each encoding on the same layer without exporting them to multiple layers?


texts: Why can't I reproject from HARN State Plane Ft Intl to State Plane Ft?

texts:
I'm attempting to reproject a feature class that is:

NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601_Feet_Intl

to our standard, which is:

NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet

When I use the Project tool it automatically selects this transformation:

NAD_1983_To_HARN_WA_OR

But when it finishes, the two feature classes are not aligned propery.

Now there are a gob of other transformations, but how do I really know which one to choose? I've always been a little confused by this.

Is the 3 ft misalignment to be expected?

Thanks for any guidance.

EDIT

I tried this transformation:

NAD_1983_HARN_To_WGS_1984_2 + WGS_1984_(ITRF00)_To_NAD_1983

And now the misalignment is well under a foot. But is this acceptable? To just choose a transformation that works best? And is it a true statement that after the reprojection there may be no transformation that aligns the reprojected data perfectly?


texts: Copying coordinates under mouse to clipboard in QGIS

texts:
I need a way to quickly copy coordinates under mouse to paste them to external program (3D reconstruction software I use for making maps from photos).
I see the coordinates within status bar at bottom of the screen; my hack of getting what I want right now is to:

Place mouse over the place you want coordinates of
Press Alt-tab to switch to another full-screen application
Now you can move the mouse without changing coordinates in QGIS; get mouse to the bottom of the screen, outside of map area
Alt-tab back to QGIS
Copy the coordinates from the fields at bottom, be very careful not to get the mouse over the map or the coordinates will get updated

So this works, but is a bit annoying. Is there a better way?
When I try to google this, I'm getting articles on "Coordinate Capture" Plugin. But it doesn't seem to be present in current versions of QGIS.


texts: qgis and geoserver or national map download

texts:
I am trying to get layers into qgis. Using QGis 2.18, Web, GeoServer, but get the message 'Tried to make a GET request to http://localhost:8080/geoserver/rest/workspaces.xml but got a 503 status code'.

How do I add layers from the U.S. National Map Download site?

At this site, I can't seen to get to the correct URL.


texts: Openlayers: is there any way to combine DragFeature and ModifyFeature?

texts:
I'm new to OpenLayers, and I am developing a basic editor using it. I can place different kind of icons (points) or paths (lines).

An "edit" tool is required. It is supposed to allow you to modify the line path, and move the icons position. However, this is where Im facing problems... to move a point DragFeature must be used, and to edit a line ModifyFeature should be the one.

image sample here

In this approach, both controls have the same tool, and I am not being able to modify a line or drag a point with the same tool. What I tried, was to use the select control instead. Once a feature is selected, according to its type, I can swap to the appropriate control (drag or modify). However, this technique is far for from perfect, since then, two clicks are required in the feature to start dragging it. The first click, is used by the select feature to capture the event and activate the DragFeature control, and the second one is to start dragging.

I would like to be able to drag a feature with one single click, and be able to edit a line with one single click.

¿Can anyone please help me? Thank you guys


texts: Saving Virtual Raster Layer with Project using QGIS

texts:
I have a project that uses multiple DEM tiles to create a Virtual Raster Layer. The Virtual Raster is then used to calculate a Slope and an Aspect layer.

I've attempted to save the Project, but when I open the Project, the virtual and subsequent layers are not found.

How do I save the Virtual Raster with the project?


texts:
Recently I have reprojected Ordnance Survey data from British National Grid (ORD SURV GB) to WGS-84 using ArcGIS 9.2.
After re-projecting I have found some shift in the data.
Can any body guide me what i am doing wrong?

Thanks for you reply.

Here is my observations. I have download the boundary files from here:
http://parlvid.mysociety.org:81/os/

When I re-project boundaries there no shift.
But when i used any layer from the tile, it is shifted.

After this I have just compare the projection information of both layers.

Boundary file have this projection info:

Projection: Transverse_Mercator
false_easting: 400000,000000
false_northing: -100000,000000
central_meridian: -2,000000
scale_factor: 0,999601
latitude_of_origin: 49,000000
Linear Unit: METER (1,000000)

Geographic Coordinate System: unnamed
Angular Unit: degree (0,017453292519943299)
Prime Meridian: Greenwich (0,000000000000000000)
Datum: D_OSGB_1936
  Spheroid: Airy - 1848
    Semimajor Axis: 6377563,000000000000000000
    Semiminor Axis: 6356256,161000000300000000
    Inverse Flattening: 299,319997677743000000

and in tile layer for example NaturalFeature_Area have following projection info:

Projection: Transverse_Mercator
False_Easting: 400000,000000
False_Northing: -100000,000000
Central_Meridian: -2,000000
Scale_Factor: 0,999601
Latitude_Of_Origin: 49,000000
Linear Unit: Meter (1,000000)

Geographic Coordinate System: GCS_OSGB_1936
Angular Unit: Degree (0,017453292519943299)
Prime Meridian: Greenwich (0,000000000000000000)
Datum: D_OSGB_1936
  Spheroid: Airy_1830
    Semimajor Axis: 6377563,395999999700000000
    Semiminor Axis: 6356256,909237285100000000
    Inverse Flattening: 299,324964599999990000

The bold lines are changed in both layers.

Any idea which one is correct?


texts: QGIS Elevation Classification by Intervals

texts:
I am trying to classify the elevation of the information on a raster by intervals. Right now I am only able to produce a continuous band of color.

How can one display the elevation information like this:
elevation map.


texts: Is there a way to loop raster calculator through a set of variables in QGIS model builder? (I realise I can do this in python)


texts:
We are developping a C# ArcObjects Class extension assembly.
Our development machine was  recently updgraded to ArcGIS 10, but when we try to install the assembly on a 9.3.1 machine, we get an R0000 error while registering the assembly with regasm.

Is it possible to deploy on a ArcGIS 9.3.1 machine a component created with ArcGIS 10?

Edit: We also develop a c++ ArcObjects library and we have no trouble deploying to a 9.3.1 machine
Edit2: In our .NET project, the ArcGIS Assembly references where explicitly set to Version Specific : false
Edit3: I learned that setting an Assembly reference to Version Specific : false is only relevant to the development environment. It has nothing to do with which assembly is loaded at runtime.


texts: How to mosaic Landsat 7 images correctly?

texts:
This is a result of mosaicing of two Landsat 7 images (layer stacked) in TIFF format.

I was aming to put these images together with no overlaping visible line between them.

The process was: Added raster layers (two tiff files) then Raster-Miscellaneous-Merge then input files and then named the output file in Tiff format.  Where is my mistake? I use QGIS 1.8.0.


texts: How can I enable a file to be edited if ArcMap won't let me edit it already?

texts:
I have two wetland layers. One file downloaded from the National Wetland Inventory and one from the U.S. Fish & Wildlife Services. Both layers were downloaded through MassGIS's Online Mapping Tool, OLIVER.

When the layers are loaded into ArcMAP I right click the layers but do not see the editing option as I usually do.

When viewing the Source Tab in the layer properties I notice a few things different from layers that I usually work with.

1.)Data Type is: ArcGIS Map Service (usually this field says: File Geodatabase Feature Class)

2.) Connection is: Internet (Usually this field is absent, may be the source of the problem)

3.)Map Service Type: Not cached (Again this field is usually not here)

Is there any way I can enable these layers to edit?

I'm thinking creating a copy of the file that does not have a connection to the internet but when i try copying a layer it also has an internet connection.


texts: Generating polylines where polygons of two different layers meet in QGIS

texts:
I am fairly new to QGIS and just now encountered my first obstacle that i can't solve simply from checking questions already posted here.

For my current study project i would like to highlight the lines along which two different polygons meet. I understand that this can probably be done with vector -> geometry, ->analysis or making use of buffers with fixed distances. However, i just cant seem to find the right option.

Here's my project with two different layers consisting of the clc 10 dataset. Basically, I would like to have lines drawn where the red and green polygons are directly adjacent to another. These lines would ideally be in a new layer.

To give you an idea of what im looking for: In this example green lines are drawn wherever two different layers are directly adjacent to each other.


texts: Custom Dynamic Layer draws below annotations

texts:
My custom dynamic layer (moving vehicles) is at position 0, specified by this code:

mapControl.Map.MoveLayer(customDynamicLayer, 0); //smaller numbers draw later

But the annotations of the layer at position 1 (my map) still draw over my dynamic layer.  Is this normal?   Is there a workaround?   I'm guessing there isn't a workaround because the non-dynamic layers get tiled, but I thought I'd ask anyway.


texts:
I am new to Leafletjs and I am trying to figure out how to plot a polyline on a map using a geoJson object. I've gotten as far as getting a map, making it centered on a given lat/long and setting the zoom. However, I cannot determine how to display the lines using geoJson data.

I confirmed that the coordinates work - I was able to plot them using the Leaflet polyline layer.

<title>Leaflet GeoJSON Example</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="leaflet.css" />


texts: How to get the Lat/Lon coordinates if I am given a table of the MINxy and MAXxy, so that I can map it out in ArcMap?

texts:
Right now I have a table that looks a little like this:

and I have the geographic coordinate system they were mapped in, but I need to display them as the polygons that they are in ArcMap.


texts: How to have a layer with many images that scale?

texts:
I know that in OpenLayers you can add Features to a Vector Layer which each have image but then they will not scale (i.e. their size stays the same independent of the current zoom) or at least I do not know how to make them scale. For example:

            var vectorLayer = new OpenLayers.Layer.Vector("Overlay");
            var feature = new OpenLayers.Feature.Vector(
            new OpenLayers.Geometry.Point(0,0)
            .transform(projWGS84, map.getProjectionObject()),
            {some:'data'},
            {externalGraphic: 'http://www.gatesms.eu/img/loga/java.png', graphicHeight: 30,graphicWidth: 30});
            var feature2 = new OpenLayers.Feature.Vector(
            new OpenLayers.Geometry.Point(1,1)
            .transform(projWGS84, map.getProjectionObject()),
            {some:'data'},
            {externalGraphic: 'http://blog.tiger.com.pl/wp-content/uploads/2012/02/Duke256.png', graphicHeight: 30,graphicWidth: 30});
            vectorLayer.addFeatures([feature,feature2]);
            map.addLayer(vectorLayer);

On the other hand the scaling of image works fine if you set an image for an Image Layer but then you can have only a single image in a layer.

            var options = {
                opacity: 1.0,
                isBaseLayer: false,
                numZoomLevels: 20,
                transparent: 'true'
            };
            var extent = new OpenLayers.Bounds(WEST,SOUTH,EAST,NORTH)
                .transform(projWGS84, map.getProjectionObject());
            var gO = new OpenLayers.Layer.Image('Image',
                'http://www.gatesms.eu/img/loga/java.png',
                extent,
                new OpenLayers.Size(1,1),
                options);
            map.addLayer(gO);

My question is: How to have, in OpenLayers, many images on a single layer that will scale as in the above case?


texts: WMS Requests - does 1 request = 1 response tile

texts:
I'm using OpenLayers and GeoServer when I pan or zoom the map - OpenLayers kicks of a series of WMS requests. Does 1 WMS request = 1 tile in response?

I'd have thought if you sent a WMS request with the map extents then we'd get multiple responses back to reduce the number of requests - is this possible?


texts: sampleRegions deleting input feature collection properties, how to stop that?

texts: How do I retain the existing properties of an input feature collection to sampleregions, as well as the ones that it extracts from the images? When I leave it to default it deletes the input properties and only has the image extracted values.


texts: Importing 1000s of svg symbols into QGIS 2.18

texts:
Does anyone know a way to import 1000s of svg symbols into QGIS without having to painstakingly click on every single XML file to import?  I created SVG files (with xml) of all of the CAMUTCD sign symbols for CA, but it is so painful in QGIS to bring them all in and associate them automatically to the "class" classification in a categorized style process.

I would like to automate the process so it points to the svg directory in QGIS and in style have it automatically find the catagorized "class" value which is identical to the name of the SVG symbol.


texts: Installing QGIS-Server on Ubuntu 14 (64-Bit AWS EC2 Instance), /cgi-bin/ doesn't work

texts:
I've been trying to install qgis-server (2.14) on Ubuntu 14 (64-bit) using instructions from the the qgis-server installation instructions and tips from this question. All the packages install, I can access the Apache landing page and qgis-server is listed as an active service. However the api call below does not work. A call to the cgi-bin directory also doesn't work.

http://localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

Does anyone know if there are extra steps needed outside the steps outlined in the docs?


texts: Cutting a shape from a VRT file with GDAL warp

texts:
I have a couple of overlapping TIFF files which I want first to merge and then to clip a shapefile from the result TIFF. The problem is that the TIFFs are pretty big and when the TIFFs are overlapping the merge process is really slow.

I discovered the VRT format so I made a virtual raster from the TIFF files but after I clip the shape from it the result TIFF can not be opened in QGIS for example.

Is it possible at all to clip a shape from a VRT?

Here is the command I'm trying.

gdalwarp -of GTiff -dstnodata -999 -cutline my_shape.shp -crop_to_cutline -dstalpha virtual.vrt cliped.tif


texts: Creating points from a one to many relationship

texts: I have created a one to many relationship within a geometric shapefile. Is it possible to to create points from the 'many' records in this shapefile as I would like to output the records into a leaflet based map for other users? I'm using qgis 2.18.


texts:
I am working on a code to detect/count the patches of burned areas in an image. I thought using the function connectedPixelCount() in GEE would help me in doing so. However, the latter seems to not work with composite images. Is there a way to make it perceive the composite image as a typical one layer image? (If there is an alternative function for composites, that would solve my issue too)

Code

var country = ['ZA'];
var geometry = ee.FeatureCollection('USDOS/LSIB/2013')
                      .filter(ee.Filter.inList('cc', country));
Map.centerObject(geometry, 5);

var modisFire = ee.ImageCollection('MODIS/006/MCD64A1')
                  .map(function(image) { return image.clip(geometry);})
                  .filter(ee.Filter.date('2017-06-01', '2017-08-31'))
                  .select('BurnDate');

var date = ee.Date('2017-06-01');
var composite = modisFire.mean().set('system:time_start', date.millis(),
                                     'dateYMD', date.format('YYYY-MM-dd'),
                                      'numbImages', modisFire.size());

var img = ee.Image(modisFire.toList(3).get(0));
var img1 = ee.Image(composite);

Map.addLayer(img, {palette: 'red'}, 'June Fire');
Map.addLayer(img, {palette: 'orange'}, 'Summer Fire');

var patches = img1.connectedPixelCount(5, false);
patches = patches.updateMask(patches.gte(5));
Map.addLayer(patches, {palette: 'blue'}, 'Burned Area');


texts:
I'm developing an interface with arcgis and python.

When I have only python, I can make my script interactive using:

S = float(raw_input( 'Please enter the value: '))

I can open and run my script at the python window of the ArcGIS, and the script run, but when I try become this interactive, asking the value, ArcGIS gives me an error:

Runtime error
Traceback (most recent call last):
  File "<string>", line 769, in <module>
EOFError: EOF when reading a line


texts: get layer names from a group within a group

texts:
Trying to get the layer names from a group that are inside a group. I have the code the gets the layer from a group, but not group inside group. any ideas?

Dim pDoc As IMxDocument
Set pDoc = ThisDocument
Dim pMap As IMap
Set pMap = pDoc.FocusMap

Dim pCompLayer As ICompositeLayer
Dim pCompLayer_child As ILayer
Dim pGrplyr As IGroupLayer
Dim i As Integer
Dim l As Integer
Dim k As Integer

For i = 0 To pMap.LayerCount - 1
 If TypeOf pMap.Layer(i) Is IGroupLayer Then
 Set pCompLayer = pMap.Layer(i)

For l = 0 To pCompLayer.Count - 1
 UserForm1.ComboBox1.AddItem pCompLayer.Layer(l).Name

 ' detect if group is within group?? stuck here
 Set pCompLayer_child = pCompLayer.Layer(l)
 If TypeOf pCompLayer_child Is IGroupLayer Then
 Set pCompLayer_child = pCompLayer.Layer(l)

  UserForm1.ComboBox1.AddItem pCompLayer_child.Name

 End If

Next l

End If
Next i

UserForm1.Show

End Sub


texts: Possible to downgrade Postgresql and PostGIS versions and still be compatible with latest OpenGeo Suite?

texts: I'm trying to connect ArcGIS Desktop 10.1 to PostGreSQL/PostGIS tables. I have PostGreSQL 9.2/PostGIS 2.0, which was installed with the latest OpenGeo suite. Unfortunately ArcGIS direct connections to PostGres are only supported by ESRI for version 9.1.3. Would it be possible to downgrade my version of PostGres 9.2 to 9.1.3 while maintaining the other up-to-date components of the OpenGeo Suite (i.e. geoserver, geowebcache, etc.)?


texts:
I want to clip a hole into a shapefile.
The underlaying shapefile (greenish) consists of many polygons. The overlaying (red) is only one polygon.

When I use the clip tool I get this

or this result (depending on the order of the input shapes for the clip tool).

What I need is basically a hole in the underlaying polygin in the shape of the red polygon. Like on the first images, where there is white underneath the green polygon. What am I doing wrong?


texts:
How can I cast type record /subquery/ to  geometry type? My example:

select  geom from  (select  (ST_Simplify..... ) as geom

and result is type record, but I need to convert to geometry.


texts: Can't create grid cell with specific cell area

texts:
So I need to create a cell grid with 1km2 for each cell. Since the default WGS84 uses degrees and not meters/kilometers for unit of measurement, I tried to change the projection for one that use meters (EPSG:5017 and others Portugal based ones), and changed de CRS of the layers to the same one. That made QGIS give this error message (Error: Fallback transform failed) every time I try to move around the map (though zooming in and out still works), and I still can't create a grid because when I try to use a layer for the grid extent or try to draw it, it gives WGS84 coordinates, while the "create grid" function interprets them as EPSG:5017 coordinates (image 1). Also, the thing at the bottom that shows the coordinates of the mouse still seem to be in WGS84, so I can't input the coordinates myself.
This is getting frustrating because every time I think I found a work-around, something doesn't work the way that it should (or that I though it should) or doesn't work at all. I don't think it's a problem with the projection system it self, but it might be because I only tried systems that start with "Lisbon", but I don't what other systems could work.
Image 1


texts: Openlayers redraw layers: consecutive redraw calls not working

texts:
SETUP

OpenLayers / GeoServer + PostGIS

REQUIREMENT

I have a map with multiple WMS layers and of these I need to refresh a few after inserting a polygon in one of the layers.

PROBLEM

Given below are three options of the AJAX success callback function on successful insert of polygon geometry in the PostGIS backend and the corresponding errors/observations.

Option 1:

if(data == "SUCCESS")
{
   map.getLayersByName('dummy_nodes')[0].redraw(true);
   map.getLayersByName('bldg_logical')[0].redraw(true);
}

// Throws error: Uncaught TypeError: Cannot call method 'redraw' of undefined

Option 2:

var tempLayer;
if(data == "SUCCESS")
{
   map.getLayersByName('dummy_nodes')[0].redraw(true);
   console.log("Prev cmd is successful");
   tempLayer = map.getLayersByName('bldg_logical')[0]
   tempLayer.redraw(true);
}

// Outputs: 'Prev cmd is successful'
// tempLayer gives proper layer object: OpenLayers.Layer.WMS.OpenLayers.Class.initialize {metadata: Object, options: Object, singleTile: true, ratio: 1, isBaseLayer: false…}
// But still throws error: Uncaught TypeError: Cannot call method 'redraw' of undefined

Option 3:

if(data == "SUCCESS")
{
   map.getLayersByName('dummy_nodes')[0].redraw(true);
}

// Works fine (but I need both layers to be refreshed)

QUESTIONS

Could anyone let me know why the error occurs?
Is my usage wrong?
Does it have to do anything with the order in which the layers have been added to the map?


texts: Method bounds() not invoked in custom QgsMarkerSymbolLayer

texts:
In a custom QgsMarkerSymbolLayer for drawing large symbol, the override method bounds() is never call. Other override methods are called : clone(), hasDataDefinedProperties(), startRender(), renderPoint(), stopRender() and usedAttributes().

Some lines of code of my plugin :

class MarkerSymbolLayerDebug( QgsMarkerSymbolLayer ) :
  def __init__( self, prop = None ) :
    QgsMarkerSymbolLayer.__init__( self )
...
  # for Debug : square of 10 pixel around the point
  def bounds( self, pt, qsrc ) :
    return QRectF( pt.x()-10, pt.y()-10, 20, 20 )

If I comment the bound() method, qgis doesn't complain but in C++ include, the method is declared as pure virtual.

(Slackware 14.2, Python 3.7.2, qt 5.9.9, QGIS 3.12.1, sip-4.19.6)


texts:
On trying to copy a feature class to a feature dataset,  I get this error message
(see the screen shot).

Any ideas how this is happening?

error copying from FeatureClass to Feature Dataset


texts: Extracting shapes from GeoTIFF using rasterio returns excessive number of polygons

texts:
I am using the shapes interface of rasterio to extract polygons from a GeoTIFF image. rasterio returns an excessive number of polygons which is not expected. It is taking a long time to extract a relatively very simple raster. I did additional processing of the resulting shapefiles, namely Dissolve and Multipart to a single part, and eventually, get the correct polygons.
Can any experts in rasterio can shed some light on what is happening? For the sample raster, I am expecting fewer polygons whereas rasterio shapes are 77562 in number.
File shared here
import pandas as pd
import geopandas
import matplotlib.pyplot as plt
import numpy as np
import os

import rasterio
from rasterio.features import shapes
mask = None
results=None
with rasterio.Env():
    with rasterio.open('/content/small_area.tif') as src:
        image = src.read(1) # first band
        results = (

        {'properties': {'raster_val': v}, 'geometry': s}
        for i, (s, v)
        in enumerate(
            shapes(image, mask=mask, transform=src.transform)))

geoms=list(results)

import geopandas as gp

gdf = geopandas.GeoDataFrame.from_features(geoms) #Convert to Geopandas dataframe

gdf.insert(0, 'New_ID', range(0, 0 + len(gdf)))

gdf.head()

gdf.set_crs(epsg=3857, inplace=True)
gdf = gdf.to_crs(epsg=3857)
gdf.set_geometry(col='geometry', inplace=True)
gdf.to_file("small_area.shp")


texts:
I am working on a distance model that creates distance rings around a given point and assigns those rings a probability. The point is in the center of a 25 x 25 km area, and the model fails to assign a probability to the area that is outside of the rings but inside the 25 x 25 km area. How can I build a simple model in model-builder where I can merge the two layers together and assign probability to the area that is not included in the model? The probability that I want to assign to the outside area is 5%.

Thank you


texts: Routes Consult with pgrouting / openlayers

texts:
I'm starting with pgrouting. After suffering a bit unable to put the data in osm postgis using osm2po with the excellent tutorial http://anitagraser.com/2011/12/15/an-osm2po-quickstart/ ran the sql generated by osm2po visualized data with http: / / localhost: 8888/Osm2poService routing is fantastic and has also insert the data in my town in postgis successfully.

Then I started reading the manual and pgrouting in http://docs.pgrouting.org/2.0/en/doc/index.html me questions arose:

1 - The data provided by osm2po are already topologically arranged just so I do consultations?

2 - The fields of my table are:

id
osm_id
osm_name
osm_meta
osm_source_id
osm_target_id
clazz
flags
source
target
km
kmh
cost
reverse_cost
x1
y1
x2
y2
geom_way

Can I get the total distance in miles doing a "sum" of the KM field, is this correct?

Where can I learn what each field, for example, do not know what the field clazz, cost, reverse_cost ....?

3 - The flow of my application the user is typing two addresses, I'll get the latitude and longitude of the point of origin and destination and select the launch in postgis, how do this if the source and target parameter settings are whole?

4- Does anyone have any examples of how to do this with openlayers?

Edited here

I'm getting the distance of the route like this:

SELECT

         sum (cost) cost AS
FROM pgr_dijkstra (
                 'SELECT id, source, target, the cost km FROM at_2po_4pgr'
                 50347, 32988, false, false
         );

Where 50347 and 32988 are my origin and destination. I do not understand what this format is, are coordinated? The coordinates of my geocode comes in decimal degrees are respectively 51.13, -29.77 and -51.21, -30.04 if I use them so do not run the sql.

Could you explain me I can pass the coordinates for the sql?


texts:
We have file geodatabase on a network drive, version 9.2, which locks every time a specific machine starts up ArcMap 10.0 or ArcCatalog 10.0.
This machine isn't actually reading anything from this geodatabase.  It is just opening up a blank map document or browsing other directories elsewhere on the network.  However, this machine has accessed this geodatabase in the past.
Has anybody ever come across this?

Things we have tried so far to stop this locking:

1 - Opened up enough map documents so that none of the mxd's in the recently opened list in the "File" menu in ArcMap have data from this database.

2 - Disconnected this network drive from the folder connections in ArcCatalog

3 - Deleted the normal templates for ArcCatalog and ArcMap.

4 - Re-started the machine

5 - Deleted the original database and made a new one in the same location.

None of the above worked.

The only thing that works is to remove the connection from this machine to the network share i.e. remove the connection to the "N" drive in MyComputer.
Unfortunately this isn't a feasible solution as the machine needs to have that network share mapped to that drive letter.

Any suggestions on how to prevent the lock?


texts: How to display places names when using Quantum GIS and shapefiles?

texts:
I am new to the world of geo systems. What I would like to do is displaying some information on a map for given regions.

I downloaded shape files from cloud made web site and load layers using Quantum GIS. Now I would like to display the places names but I do not know how to do.

Are these information already present in the file how can I do to display them ?

If so, I guess It should be possible to do joins with the data I want to display.

Can you please help me on this subject ?


texts: Ubuntu: Updating Mapnik from 2.2.0 to 3.x, complications?

texts:
I'm wanting to upgrade Mapnik on a production system from 2.2.0 to 3.x to take advantage of improvements to data-driven rendering. Fortunately the install instructions for Ubuntu have been updated very recently (11 days ago as of this post), however I'm wondering what happens if I run the installation on a system with an existing install. Has anyone tried this?

We're using TileStache to render several map tile endpoints, most importantly some UTFGrid json files, and I am concerned that I will pollute the system— maybe irreparably!—by running the install.

Can anyone comment on what might happen if I run the latest Mapnik installation on a system with an existing, properly functioning install?

[Edit 8/22/2018]

I got through the transition on a test server and incorporated my prior edits into an thorough answer below.


texts: Enable Python extension for GeoServer 2.16.x

texts:
I am using Windows 10 (64 bit) & QGIS 3.4 along with GeoServer 2.16.x in my machine

I am trying to enable 'scripting' in GeoServer (so that will develop Python scripts) but it gives me error (my GeoServer is crashing)

Tried following :

Followed https://docs.geoserver.org/stable/en/user/community/scripting/installation.html & nightly build https://build.geoserver.org/geoserver/

All my GeoServer folder has proper rights and permissions
Tried to downgrade to version 2.14, still getting same error(GeoServer is crashing)
Whenever I remove files from the  'lib' folder then GeoServer works properly

Update :-

Default Python is installed on my machine (version : 3.8)
In Logs not getting any specific error

Thinking to make custom build (it's required lots of time)

Checking alternatives on my side...


texts: Google bathymetry service with OpenLayers Mouse Position

texts:
After searching for some days I decided to post this question here, hope someone else can give me some hints about a doubt I have. The thing is that I would like to use the Google Bathymetry Service to provide bathymetry/elevation with OpenLayers, ie., as I hover the mouse I would like to have the water depth (negative) or elevation (positive) value close to the longitude, latitude position. I did a simple jsfiddle example showing the longitude/latitude position in OpenLayers, please find it here: http://jsfiddle.net/Gery/LbgzLxg3/13/ (or this one http://jsfiddle.net/Gery/cxf25mkt/2/, but it uses OSM as basemap).

Based on the Google Service, I can get the response as JSON, like here:

  http://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&sensor=true_or_false

{
   "results" : [
      {
         "elevation" : 1608.637939453125,
         "location" : {
            "lat" : 39.7391536,
            "lng" : -104.9847034
         },
         "resolution" : 4.771975994110107
      }
   ],
   "status" : "OK"
}

Any ideas how to implement this? is it possible using OL and Google Hybrid as basemap?

Any hints are welcomed,


texts:
I want to know how I use Google map in OpenLayers.

I already know, that some example codes exist, but it's too hard to understand them.

Also, I already use OSM, Bing, and ArcMap.

I found lots of information in Google, but almost all are too complicated.
I wonder if someone will help me.

ps. My English is not very good, so there are some grammar mistakes and something like rude. Forgive me.

Here is my codes....

<select id="baseType" name="baseType" class="lineStyle">
    <option value="google">Google</option>
    <option value="osm">OSM</option>
    <option value="bing">Bing</option>
    <option value="arc">ArcMap</option>
</select>

and then in js....

var bType = $("#baseType").val();
    switch (bType) {
        case "google":
            ??????
            source.SOURCE_TYPE = "google";
            break;
        case "osm":
            ....
        case "bing":
            ....
        case "arc":
            ....

Then I output in label.

I want to some simple codes in QuestionMarks(in Above Codes).

For example, in OSM

source = new ol.source.MapQuest({
    layer : "osm"
});
source.SOURCE_TYPE = "osm";

I apologize that I didn't write codes.


texts:
I need to run the following joins in my model but I can't find the same settings in the tool within ModelBuilder.

Is there something I am missing? the key is that I don't want to create lots of new data and just have virtual joins.

  Run model

  CREATE 4 JOINS

1
Target Table:   test_hcb_lines
Target Field:   FID

Join Table: test_hcb_lines_near
Join Field: IN_FID
Join Type:  Keep only matching records
Data Type:  Standalone Table
Database:   Z:\CCRC\Projects\2016\40_CCRC_Sewer Manhole-HCB Distance\Working\scratch\scratch.gdb

2.
Target Table:   test_hcb_lines
Target Field:   test_hcb_lines_near.IN_FID

Join Table: test_hcb_lines_joined
Join Field: FID
Join Type:  Keep only matching records
Data Type:  Shapefile Feature Class
Shapefile:  Z:\CCRC\Projects\2016\40_CCRC_Sewer Manhole-HCB Distance\Working\scratch\test_hcb_lines_joined.shp
Geometry Type:  Line
Coordinates have Z values:  No
Coordinates have measures:  No

3
Target Table:   test_main_lines_chainage
Target Field:   FID

Join Table: test_hcb_lines_near
Join Field: NEAR_FID
Join Type:  Keep only matching records
Data Type:  Standalone Table
Database:   Z:\CCRC\Projects\2016\40_CCRC_Sewer Manhole-HCB Distance\Working\scratch\scratch.gdb

4
Target Table:   test_main_lines_chainage
Target Field:   test_hcb_lines_near.IN_FID

Join Table: test_hcb_lines_joined
Join Field: FID
Join Type:  Keep only matching records
Data Type:  Shapefile Feature Class
Shapefile:  Z:\CCRC\Projects\2016\40_CCRC_Sewer Manhole-HCB Distance\Working\scratch\test_hcb_lines_joined.shp
Geometry Type:  Line
Coordinates have Z values:  No
Coordinates have measures:  No


texts: Can I convert an ISegmentCollection to an IEnumFeature?

texts:
I would like to try to call the function, IFeatureConstruction.SplitPolygonsWithLines( );

The 4th arg is a type IEnumFeature, I have an ISegmentCollection.  Can I convert ISegmentCollection to an IEnumFeature?


texts:
I'm trying to upload a vector layer to my Garmin GPS unit. I've saved it as GPX (WGS 84); opened the GPS Tools dialogue in QGIS 1.8; selected the "Upload to GPS" tab; and clicked on the "Data layer" dropdown arrow. However, the box just turns blue; nothing appears for me to navigate through. Nor can I enter anything into the  box. It just turns blue, but will not take any input.

Any idea how I select the layer to upload?


texts: Which coordinate system is data frame set to if first layer has no spatial reference?

texts:
I have added a layer without spatial reference to a Blank Map document.

Which coordinate system is the data frame set to?


texts: Finding boundary vertices from given set of coordinates?

texts:
How to find the the boundary co-ordinates from a given set of  co-ordiantes?

I understand that this question asked previously and answered here

Finding boundary co-ordinates from given set of point co-ordinates?

But the answers given here are about the estimates of the the convex hull of the set.

How could we get the boundary points only?


texts:
I am trying to convert MapINFO tabs to ESRI Shapefiles using FW Tools. I downloaded the tools and can run the FW Tools Shell and convert no problem:

ogr2ogr -f "ESRI Shapefile" E:\CABWorking\MapINFO2SHP\SHP\LincsBoundary.shp E:\CABWorking\MapINFO2SHP\MapINFOData\Lincolnshire.tab

In the shell you can type python and use the shell as a python interpreter. Awesome, but I need this to work as I want to convert a ton of MapINFO files at once.

My problem is: I can't figure out how to get the following code to work in a python environment. I've been searching all morning and just have no clue. Any help would be awesome!

Thanks!


texts: How to rectify the error while processing GFA tool?

texts:
We are civil engineering students from India. As part of our final year B.tech project based on preparing Floodplain Map , we use QGIS. The tool we came across was GFA (Geomorphic Flood Area) tool. But while running the tool using the required inputs, an error cropped up showing :

"Starting...
Opening F:/DEM.tif
Opening F:/DEM.tif
Opening F:/drainagedirection3419.tif
Opening F:/flow accumulation3419.tif
Opening C:/Users/hp/Desktop/project qgis/New folder/Capture.tif
Error : Input files have different cell size "

We checked the pixel sizes of all the input files but all were the same. Can you help us to identify and rectify the error?


texts: How to decode Magellan URL coordinates to lat/lon

texts:
Magellan uses this URL to designate a coordinate in New York:

mgn:///address/?coord=merwFvlqbM,name=Viva%20Herbals%20Pizzeria,number=179,street=2nd%20Avenue,city=New%20York,country=US

How can I decode the "coord" part (merwFvlqbM) of the URL? It looks like an encoded latitude longitude value. Other NY coords have similar values:

glp wF |fs bM

ubr wF r~p bM

(common characters bold)


texts: Dissolve (merge) polygons QGIS based on (non exact) attribute values

texts:
I am a fairly new user of QGIS having a question regarding dissolve functionality.

I am working with the NUTS-2 shapefiles provided by EU, which I have imported in QGIS. To ease the discussion, I have created a new layer with only Denmark and Netherlands as you can see in the picture below.

The corresponding attribute table is the following.

The fields describe the ID and name for each NUTS node, as well as the country code. I have introduced a new attribute field, called Merge_attr.

Based on the aforementioned, I have managed to dissolve the polygons with the same attribute value of Merge_attr. However, I would like to dissolve polygons based on the Merge_attr value only when they belong to the same country and potentially only when they are adjacent.

Is it possible to dissolve or merge polygons that have a "valued" attribute which is not exactly the same but similar (i.e. under some other condition). For example, would it be possible to merge polygons that belong to the same country and the difference of their "Merge_attr" values is smaller than 0.5?


texts: Rotate ENVI hyperspectral imagery with GDAL

texts:
I am developing an application with the GDAL library to combine georeferenced raster hyperspectral imagery in ENVI format from NASA's Airborne Visual/Infrared Imaging Spectrometer (AVIRIS) with other geographic data sets. When I import the imagery into a GIS application such as QGIS, I find that it is rotated incorrectly:

The flightline should go from southwest to northeast, but it is displayed from south to north. The map info field of the ENVI header file contains a rotation parameter of -66° which I assume is relative to the top left pixel:

$ grep "map info" ang20150422t163638_corr_v1e_img_zero.hdr
map info = { UTM , 1.000 , 1.000 , 736600.089 , 4078126.750 , 2.7000000000e+00 , 2.7000000000e+00 , 12 , North , WGS-84 , units=Meters , rotation=-66.00000000 }

However, this field is not documented and is apparently ignored by GDAL. Here is the current projection of the image:

$ gdalsrsinfo ang20150422t163638_corr_v1e_img_zero.img

PROJ.4 : '+proj=utm +zone=12 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '

OGC WKT :
PROJCS["UTM Zone 12, Northern Hemisphere",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-111],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

What I would like to do is rotate the image using either the GDAL utilities or preferably the GDAL Python API so that it is oriented north-up without changing anything else about the image.

I have read that rotations can be achieved with some combination of gdalwarp and gdal_translate, either by applying a geotransform or changing the +towgs84 parameters.

However, I am a GIS novice and seek specific guidance on what parameters to set to accomplish this.

You may find a single-band version of the image and its header here.

First Try

Based on lpdudley's suggestion, I made a copy of the image:

$ cp ang20150422t163638_corr_v1e_img_zero.hdr ang20150422t163638_corr_v1e_img_zero_rot.hdr
$ cp ang20150422t163638_corr_v1e_img_zero.img ang20150422t163638_corr_v1e_img_zero_rot.img

And then applied the geotransform in the Python shell:

>>> image_name = "ang20150422t163638_corr_v1e_img_zero_rot.img"
>>> dataset = gdal.Open(image_name, gdal.GA_Update)
>>> gt = dataset.GetGeoTransform()
>>> rotation = (math.pi/180) * -66
>>> new_geotransform = (gt[0],
                        math.cos(rotation) * gt[1],
                        -math.sin(rotation) * gt[1],
                        gt[3],
                        math.sin(rotation) * gt[5],
                        math.cos(rotation) * gt[5])
... ... ... ... ... >>> dataset.SetGeoTransform(new_geotransform)
0
>>> dataset = None

However, the image is scaled rather than rotated:

Bug

Rotating ENVI seems to be a bug in GDAL:

https://lists.osgeo.org/pipermail/gdal-dev/2013-January/035146.html
https://trac.osgeo.org/gdal/ticket/1778

The bug appears to come from the ENVI driver. If I find a solution I'll share it here.

Fix

I have posted a pull request and shared it on the GDAL mailing list using the values suggested by lpdudley. Now when I apply gdalwarp to the image:

$ gdalwarp -of envi ang20150422t163638_corr_v1e_img_zero.img ang20150422t163638_corr_v1e_img_zero_rot.img
Creating output file that is 4048P x 2461L.
Processing input file ang20150422t163638_corr_v1e_img_zero.img.
0...10...20...30...40...50...60...70...80...90...100 - done.

The rotation will be detected correctly:

Rotated ENVI files will be supported in GDAL version 2.2.0 or greater.


texts: How do I subtract a number of days from todays date using a value in another field?

texts:
I have an integer field named "Priority" with values ranging from 5 to 30 days. I want to use the now() function to subtract the integer to give a new date. The formula I tried is below but it just returns a null value.
now() - to_interval("Priority")


texts: Using ArcGIS to gain information about species locations

texts:
I am totally new to ArcGIS so I'm really sorry if this a stupid question.

I am a conservation biologist and I've got a GDB database, with a bunch of species ranges on it.

The output I desire from this, is a list of countries where the species live. So a list of countries that each ranges covers.

Can anyone tell me how I would go about getting this? I've been googling how to use ArcGIS guides and getting nowhere...


texts: Web tool Network Analysis (Service Area)

texts:
Has anyone tried publishing Network Analysis Service Area to create a Web Tool?
It works fine locally, but it cannot be published as Web Tool with Staging Failed.
While Portal only supports 1 network dataset at a time, I want to allow the user to select different network dataset in a local folder in the server as InputNetwork, I loop through the folder and check how many network dataset is present and create a dropdown list for selection, it works perfect in ArcGIS Pro.
We have project planning that requires network dataset comparison (before and after), does anyone have similar experience?
If this doesn't work, I will have to make this happen using JavaScript instead.
        facilities = parameters[0].value
        inputNetwork = parameters[1].valueAsText
        impedanceAttribute = parameters[2].valueAsText
        oType = parameters[3].valueAsText
        cutoffs = parameters[4].valueAsText
        spread = parameters[5].valueAsText
        outputLayer = parameters[6].valueAsText
        spread = spread + ' Meters'

        cutoffList = []
        cutoffSplit = cutoffs.split(',')
        for c in cutoffSplit:
            if c.strip().isdigit():
                cutoffList.append(int(c.strip()))

        output_type = {'POLYGONS':'POLYGONS',
                       'LINES':'LINES',
                       'POLYGONS and LINES':'POLYGONS_AND_LINES'}

        oType = output_type[oType]
        outNALayer=arcpy.na.MakeServiceAreaAnalysisLayer(inputNetwork, "output", impedanceAttribute, "FROM_FACILITIES", cutoffList, None, "LOCAL_TIME_AT_LOCATIONS", oType, "STANDARD", "OVERLAP", "RINGS", spread, None, None)
        outNALayer = outNALayer.getOutput(0)
        subLayerNames = arcpy.na.GetNAClassNames(outNALayer)
        facilitiesLayerName = subLayerNames["Facilities"]
        arcpy.na.AddLocations(outNALayer, facilitiesLayerName, facilities, "", "")
        arcpy.na.Solve(outNALayer)


texts: Add legend with ArcPy over my interpolated map

texts:
I have created an interpolated map with arcpy.IDW_ga and I am exporting it to PDF with arcpy.mapping.ExportToPDF. How can I add a legend to the map with ArcPy? In the end, I want to apply the code to create 100 maps, so manually is not a solution. I know I can just go to Insert>> Legend, but I need an automated solution.

arcpy.IDW_ga(in_features = in_features,
             z_field= z_field, out_ga_layer="",
             out_raster="Interpolation/year/" + name_save,
             cell_size="6.46298456489016E-03",
             power="2",
             search_neighborhood="NBRTYPE=Standard S_MAJOR=0.336780807796406 S_MINOR=0.336780807796406 ANGLE=0 NBR_MAX=15 NBR_MIN=10 SECTOR_TYPE=ONE_SECTOR",
             weight_field="")

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
arcpy.mapping.ExportToPDF(mxd,  "C:/Users/"mypdf.pdf")


texts: GDAL - creating tiles from TIFF with world file

texts:
Several years ago I created multiple tiles (xyz) from orthophotomaps using GDAL with success but now I'm getting this error and I don't know what I'm doing wrong.

This is the error:

Traceback (most recent call last):
File "gdal2tiles.py", line 2903, in <module>
main()
File "gdal2tiles.py", line 2897, in main
single_threaded_tiling(input_file, output_folder, options)
File "gdal2tiles.py", line 2831, in single_threaded_tiling
conf, tile_details = worker_tile_details(input_file, output_folder, options)
File "gdal2tiles.py", line 2751, in worker_tile_details
gdal2tiles.open_input()
File "gdal2tiles.py", line 1468, in open_input
in_srs, self.in_srs_wkt = setup_input_srs(input_dataset, self.options)
File "gdal2tiles.py", line 705, in setup_input_srs
input_srs.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER)
File "/usr/lib/python3/dist-packages/osgeo/osr.py", line 297, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, SpatialReference, name)
File "/usr/lib/python3/dist-packages/osgeo/osr.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'SpatialReference' object has no attribute 'SetAxisMappingStrategy'

I have approx 100 TIFF files with world file for each one. I tried to do the following:

Create VRT file from TIFF files:

gdalbuildvrt -addalpha -a_srs EPSG:5514 tiles.vrt *.tif

Use GDAL warp:

gdalwarp -srcnodata 255,255,255 -dstnodata 0,0,0 -t_srs EPSG:5514 tiles.vrt output.tif

Create tiles:

gdal2tiles -s EPSG:5514 -z 15-16 output.tif tile_folder/

I tried different commands with different settings but still the same error. What am I doing wrong?


texts: R error fortifying dataframe from shapefile

texts:
From a set of 420 files (monthly) containing three columns (longitude, latitude, cluster) I have extracted shapefiles defined by cluster value. To do this I have read some posts in StackOverflow and Gis.Stackechange and used this R code

Then I have tried to use this code to plot shapefiles in monthly panels with this code but had received an error message from one of the shapefiles in the fortify step

      datoshp <- readOGR(dsn=".", layer=shpname[cluster])

      #fortify for ggplot mapping
      datoshp@data$id <- rownames(datoshp@data)
      datoshp.f <- fortify(datoshp, region = "id")

Full R code available here

The code has run fine for a number of files but it has crashed when reading the shapefile corresponding to cluster 4 in January 1993 with this error code in the fortify step

  datoshp.f <- fortify(datoshp, region = "id") Error: TopologyException:
  Input geom 0 is invalid: Hole lies outside shell at or near point 11
  35 at 11 35

I have found some info in other posts about problems with intersecting shapefiles and projections. But as the first set of shapefiles have run fine, I assume there is no problem with projection (maybe I'm wrong) as they were created from the same code.

Original lon-lat data and the shapefiles can be found in a Dropbox folder at https://www.dropbox.com/sh/e95gjjxu2563zvy/AADDypr810i0p1W2S8xpre1Za?dl=0

These are my first attempts with R and spatial data so I am not an expert about shapefiles  or projections.