texts: How to integrate external image processing programs within ModelBuilder

texts:
I want to use python libraries to do image processing for very large files (over 2GB), but the current python libraries can not read 16 or 32 bit image correctly. At least, I tried Python Image library, GDAL etc. which gave me 8 bit images or 2/3 correct images.

I want to try ArcGIS as the platform through ModelBuilder for image input. Does anyone know how to integrate ArcGIS raster input with external image processing programs? My basic idea is to convert ArcGIS raster input as an array for python libraries, but I do not know how to do. Any hint or suggestion to let me continue?

The primary works I did are just install python libraries within python 2.6 for ArcGIS and some codes as following.

import arcpy
import os, sys
import numpy as num
from scipy import ndimage
from skimage.morphology import watershed, is_local_maximum

def setupParameters():

    #local variables for input and output
    input_rater=str(arcpy.GetParameterAsText(0))
    output_raster=arcpy.GetParameterAsText(1)
    local_array=int(arcpy.GetParameterAsText(2))

    #Image segmentation using scikit-image
    distance = ndimage.distance_transform_edt(Input_Raster)
    local_maxi = is_local_maximum(distance, Input_Raster, num.ones((3, 3)))
    markers = ndimage.label(local_maxi)[0]
    labels = watershed(-distance, markers, mask=Input_Raster)

if __name__ == '__main__':
    setupParameters()


texts: ArcGIS Network Analysis Find Shortest Route with Large Number of Data

texts:
I am trying to find the shortest distance and shortest travel time from one point to another point. However, I have a large number of data (140 000s). I break my data to smaller feature classes of 10 000 and run the model. However, it took more than 12 hours to run one model, since I have broken down my data to 15 sets, it will take a long time for me to run the model. I also need to find the straight distance between the points thus, i have three model running for the data. It takes a lot of time and I have to do this quite frequent. I am wondering if there is a better ways of doing this. there are probably other ways of doing this but I am not sure about it.

Currently, this is how my model looks like:

I used iterator to iterate through each records (there are 10 000 records).
Each point will have destination.

I am finding the shortest route and the shortest travel time thus I will run this model twice with different impedance (Minute and Km).

After the network route is solved, it will append to a holding file (I think the whole model take a long time to run due to the append).


texts: QGIS "not responding" as reaction to every type of action

texts:
I just newly installed QGIS 3.16 because I got a new Laptop (Lenovo ThinkPad T490s, i5-8265, 8 GB RAM, 256 GB SSD). But when I try to use the program, it always goes into the "not responding" mode. It happens when I click on whatever part of QGIS (whether it be the task bar, starting a new project or the browser window), it even happens when I try to enlargen the window.
I already tried it with reinstalling, restarting the computer and installing the 3.10 version but for days now nothing has changed. Because I have to wait for about a minute after every click/action I make I'm practically unable to work with QGIS.. Does anyone know how I can fix it so I'll be able to use QGIS again?


texts: Creating a Polyline from a list of QgsPoints using PyQGIS when working in PyCharm

texts:
So I have a .csv of points that I've cleaned up using pandas, and appended to a list with each item being Type: QgsPoint, with it's correct X and Y coordinate. I'm trying to find the correct operation that can handle this now that it is in a QgsPoint type.
import pandas as pd
from qgis.core import *
import iface

# Read in .cas with Transects
df = pd.read_csv("csv link here")
# Delete top row with RTC data
dato = df.iloc[1:]
# Rename column headers
dato.columns = ['Transect', 'Point Number', 'Subclass', 'Northing', 'Easting', 'Altitude', 'Notes']
print(dato.head())
# Create empty list to store point data
PointList = []

# Create point for each row based on Northing and Easting data
for index, row in dato.iterrows():
    termino = QgsPoint(float(row['Easting']), float(row['Northing']))

    PointList.append(termino)

print(PointList)

Here is where I have gotten to. I've tried a few forms of iface.addVectorLayer (which appears to be outdated because iface does not have addVectorLayer apparently), QgsGeometry.fromPolyLine/fromMultipoint both have no worked due to lack of documentation about what each argument is for. I've tried the following:
line = QgsGeometry.fromPolyline(PointList)
QgsGeometry.fromMultiPointXY(PointList)
feat = QgsFeature()
feat.setGeometry(QgsGeometry.fromPoint(PointList[]))

The last attempt says QgsGeometry had no module named fromPoint.
I'm mostly just looking for someone to point me towards a module I should use to get a list of QgsPoints to a shapefile, so I can eventually run Points to Path. All of it will eventually be transferred to Jupyter Notebooks so data can be input and these polygons we need can be spit back out.


texts: Where would a perfectly vertical tunnel through the Earth come out?

texts:
I am a programmer.  I have a point P1 (lat,lon) given by GPS (WGS84) and I want to know the location of a point P2 if I make a straight line from P1 to the other side of the earth.

How can I achieve this if it is possible ?


texts: Feature to polygon tool not recognizing closed contour lines

texts:
I am using the Feature to Polygon data management tool in ArcMap (v.10.7.1) to convert contour lines (above 1200m) to polygons. The contour lines are closed (beyond the extent of the picture which is just a crop of a small section) and I have done this successfully for other elevations with the same contour layer.

When I run the tool, the output only captures a few of the polygons. I would like to know why these contours are not recognized as being closed and what to do about this.


texts: What would cause lat/longs from Google Maps to be displayed offset in CartoDB?

texts:
any ideas what's going on here?

The lat/longs in this map have been manually picked up from Google Maps and loaded into the data table. I understand that CartDB and Google Maps both use WGS84 so this should "just work", right?

It looks like there's some kind of standard offset to the coordinates as they look roughly in the right positions relative to each other, but wrong absolute positions.


texts:
I'm trying to use photogrammetry and Structure from Motion to record buildings, and I'm looking for a way to bring these into a format usable in GIS, in particular pointclouds and models of terrain, buildings, and objects.

I would like to be able to import the pointcloud, model or rectified photographs into QGIS and manipulate it in terms of georeferencing and fixing axis (for creating rectified, scaled views of vertical walls/ objects). The software I'm using is QGIS, Agisoft Photoscan and Meshlab.

Does anybody have any suggestions regarding file formats, alternative (preferably opensource) software and workflow, or whether GIS is the proper format to do this in?


texts: Finding lowest elevation in multiple polygons using DEM?

texts:
I have a polygon layer with six polygons. I need to have the lowest elevation point in each polygon using a DEM. The following explanation https://support.esri.com/en/technical-article/000011761 (Zonal Statistics, raster calc, raster to point) really helped me.

I have managed to do it, but the problem is that the shapefile with the lowest point for each polygon does not match with the original polygons. I mean, lowest point A belongs to polygon B and lowest point F belongs to polygon C, ... I cannot manage to have a unique identifier so that I can see that the lowest point of polygon A is point A. I have tried to make a new ID for each polygon (1 till 6) and I have tried the original ID's (which were non-consecutive, such as 1,3,4,12) but then I only get the lowest point of all polygons, so only one point remains ...

Someone who knows how to fix this?


texts: Resample a raster to the grid of another unaligned raster using GDAL/pktools


texts: How to style geojson polygon using L.mapbox.featureLayer()

texts:
I have this code:

    var SupIncend = L.mapbox.featureLayer().addTo(map);
    var ArbolesAntes = L.mapbox.featureLayer().addTo(map);
    var ArbolesX = L.mapbox.featureLayer().addTo(map);
    var ArbolesDespues = L.mapbox.featureLayer().addTo(map);

    L.control.layers({
        'Superficie incendiada': SupIncend.loadURL('http://www.mapatraslasierra.com.ar/ProyectoForestal/geojson/zona_incendio_unida.geojson')
    },{
        'Superficie arbolada Agosto 2013': ArbolesAntes.loadURL('http://www.mapatraslasierra.com.ar/ProyectoForestal/geojson/ArbolesPerennes_AntesIncendio.geojson'),
        'Superficie arbolada Octubre 2013': ArbolesX.loadURL('http://www.mapatraslasierra.com.ar/ProyectoForestal/geojson/ArbolesPerennes_Sobrevivantes.geojson'),
        'Superficie arbolada Julio 2014': ArbolesDespues.loadURL('http://www.mapatraslasierra.com.ar/ProyectoForestal/geojson/ArbolesPerennes_Rebrote.geojson')
        }).addTo(map);

It is working but I need to give differents colors and opacity to each layers (geojson representing polygons).


texts: How to merge several tables/feature classes into single geodatabase object in ArcObejcts?

texts:
My project is ArcGis extension, which uses a specific set of tables and feature classes. I want that this structure to behave like single geodatabase object, so user cannot delete part of it's schema.
In ArcGis this functionality is present in Cadastral Fabric. It contains several feature classes and tables that are not visible to user. This is clearly seen in "New Relationship Class dialog".

What ArcObjects interfaces/Workspace extensions do I need to implement to achive such behavior?


texts: How successful are current metadata implementations in achieving its objectives

texts:
Metadata infrastructure is well established as an essential practice within the GIS community.  Quoting from the FGDC:

  Metadata helps people who use geospatial data find the data they need and determine how best to use it. Metadata supports producers in locating and using their own data resources and data consumers in locating and using data resources produced by others.

In your experience how effectively do current standards actually help to achieve these objectives?  I am particularly interested in analysis of ISO 19115:2003 and how it compares to over methods of capturing this kind of information.


texts:
I want to use osmconvert to parse down the size of my diff files for just the area I'm interested in because osmconvert is way faster than osm2pgsql, which loads the data.

When I call the command using os.system() like such:

cmd = r"""c:\temp\osmconvert.exe 770.osc.gz -b=1,1,3,3 -o=extract.o5m"""
os.system(cmd)

I get osmconvert error: cannot open file

When I run the same exact command from my command prompt in Windows 7, it runs fine. What is python doing to prevent this function from running? The 770.osc.gz file lives in the same directory as osmconvert.exe and the output extract.05m should populate in the same directory as the osmconvert.exe exists.

If I put the command in a batch file, it works, but I want to use python to download the file from the server so I can automate the updates of the database.


texts: How to set the nodata of Clip raster in postgis to export as tif

texts:
I'm trying to crop a raster by polygon and export as TIFF data. The problem is how to set the nodata around the polygon in the raster using psycopg2 in python, because the default value is -3.4028234663852886e+38.

I use the code:

 import psycopg2
 conn = psycopg2.connect(database="mydatabase",
                        user="postgres",
                        host="localhost",
                        password="postgresPass")
 cursor = conn.cursor()

 callSaveRaster = "SELECT ST_AsTIFF(ST_UNION(ST_Clip(rast, the_geom))) as img
            from rasterSchema.rasterTable, polySchema.polyTable
            where ST_Intersects(the_geom, rast) and polyTable.gid=1";

cursor.execute(callSaveRaster)

rasterData = cursor.fetchone()

with open("raster.tif", 'wb') as f_out:
    f_out.write((rasterData[0]))


texts:
I need help with clustering algorithm. I have a mysql database with lat, lng, geohash(12 chars).

I am usign this query to select all records for zoom level 2 (2 chars)

SELECT COUNT( id ) , LEFT(  `geohash` , 2 )
FROM server_cluster
GROUP BY LEFT(  `geohash` , 2 )

But how to select all records for bounding box?

mymap.getBounds()._northEast
M {lat: 42.51665075361143, lng: -87.95448303222658} (dp93yect2n0n)
mymap.getBounds()._southWest
M {lat: 42.313877566161864, lng: -88.36647033691406} (dp90tpj80n86)

UPD: here is how I use it now:

$bounds = explode(",", $bounds);
$NE = substr(GeoHash3::encode($bounds[0],$bounds[1]),0,$zoom);
$SW = substr(GeoHash3::encode($bounds[2],$bounds[3]),0,$zoom);
$sql = ' SELECT count(id) as count, LEFT(`geohash`, '.$zoom.') AS geo
            FROM server_cluster
            WHERE
                LEFT(  `geohash` , '.$zoom.' ) <=  "'.$NE.'"
            AND
                LEFT(  `geohash` , '.$zoom.' ) >=  "'.$SW.'"
            group by geo
            ORDER BY  `geohash`
            ';

But it is not ok.

Or is there any simple server side clustering algorithm with php and mysql that can handle 60k markers on the 0 zoom level?


texts:
I have several shapefiels that i have to turn into raster.
    Here's the coastline

coastline<-readShapeSpatial("shp")
r <- raster(ncols=90, nrows=45)
jd<-rasterize(coastline,r)
plot(jd)

it  gives an empty thing with no map, a blank thing.


texts:
I am trying to create points (new layer) at specific distance along the road (existing layer) in QGIS. Creating Regular points every meter at county level using ArcGIS Desktop?
 gives solution for ArcGIS. How to achieve this in QGIS? Adding points to point vector layer using QGIS? explains how to create points but does not do anything about the distance.

(I applied the proposed solutions with different measures of lengths for I did not know the conversion)
@Nathans's solution worked to some extent, I got...

.
Here, the projection of these equidistant points is different from the original line.

With @underdark's suggestion, I got

 where the points does not seem to be equidistant. I guess there is some projection issue with both of these which I am not understanding.


texts: Calculating geometry in longitude and latitude using ArcGIS Desktop?

texts:
In ArcMap, I have some point features and I extract the coordinates in the attribute table

For Person 1 , I extract them in unit "metres"
For Persn 2, I extract them in unit "Decimal degree"
For the third, I extract them in "degree min sec"

After they bring in their editing back, I have to merge them. Should I do any conversion between them?

If so can you tell me the science behind them?


texts: How can I remove incorrectly selected images from collection to eliminate gaps in Google Earth Engine time series chart?

texts:
I am working on creating a tool that computes a number of different vegetation indices from Landsat across the state of Montana in order to allow users to examine time series charts for user-specified regions of interest. The time series charts that I produce will sometimes contain gaps depending on the area of interest. I finally discovered that the root of the problem is that the scene footprints for Landsat 8 scenes seem to have a buffer, such that when using filterBounds() on the Landsat Collection, scenes are selected that do not actually intersect the ROI.
I know that I could ask the time series chart to interpolateNulls and resolve the gap issue but I am looking for a different solution that will filter the image collection correctly. Is there a way to adapt the filterBounds() or something else, or is my only option to use interploateNulls in the time series chart, and add a disclaimer that the number of items in the filtered collection may not be the number of items used to create the chart, as some scenes were incorrectly selected?
The code below should provide two example scenes (not shown) and footprints (shown) that were selected incorrectly from the same path/row but are not in the exact same position.

var focal = ee.Geometry.Point([-113.73000021508153,47.74518351973251])

var ROI = ee.Geometry.Polygon([
  [[-113.87208186611228,47.745204340758626],
  [-113.73097621425681,47.745204340758626],
  [-113.73097621425681,47.91023776436756],
  [-113.87208186611228,47.91023776436756],
  [-113.87208186611228,47.745204340758626]]
]);

Map.addLayer(ROI)
Map.centerObject(focal, 14)
// // to download imagery with this script simply create an ROI using the GEE geometry tools and rename it 'ROI'

var startDate = '2017-01-01' // set start date
var endDate = '2018-12-31' // set end date
var cloudMax = 15 // set max percentage of clouds per scene

var addNDVI = function(image) {
  var ndvi = image.normalizedDifference(['B5', 'B4']).rename('NDVI');
  return image.addBands(ndvi);
};

var ndvi_toa = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
  .filter(ee.Filter.lt('CLOUD_COVER', cloudMax))
  .filterBounds(ee.Geometry(ROI))
  .filterDate(startDate,endDate)
  .sort('system:time_start')
  .map(addNDVI)
  .select('NDVI');

print(ndvi_toa);

var chart_toa = ui.Chart.image
                      .series({
                        imageCollection:ndvi_toa,
                        region: ROI,
                        reducer: ee.Reducer.mean(),
                        scale: 30,
                        xProperty: 'system:time_start'
                      })
                      .setOptions({
                        titlePostion: 'none',
                        legend: {position: 'middle-right'},
                        hAxis: {title: 'Date'},
                        vAxis: {title: 'TOA'},
                        series: {0: {color: '23cba7'}},
                        interpolateNulls: false
                      });

print(chart_toa);

// incorrectly selected image from 2018-07-07
var badImage = ndvi_toa.filterDate('2018-07-07','2018-07-08').first()
print(badImage)
Map.addLayer({eeObject: badImage, name: 'badImage 2018-07-07', shown: false});
// image footprint which shows the reason for selection
var fp = ee.Geometry(badImage.get('system:footprint'))
Map.addLayer({eeObject: fp, name: 'fp 2018-07-07'})

var badImage2 = ndvi_toa.filterDate('2017-07-20','2017-07-21').first()
print(badImage2)
Map.addLayer({eeObject: badImage2, name: 'badImage2 2017-07-20', shown: false})

var fp2 = ee.Geometry(badImage2.get('system:footprint'))
Map.addLayer({eeObject: fp2, name: 'fp2 2017-07-20'})


texts: GeoServer WMS time dimension multiple attributes getting data by default

texts:
I have WMS layer from PostGIS data source with two temporal attributes (start and end attribute). I want to get by default (without adding any temporal filters) the latest data. Because of that I chose option for default value "Use biggest domain value". But I'm always getting two records. Because one feature has start_time = T1, End_time = T2, and other has start_time = T2 and end_time T3 (where T1 < T2 < T3).

With option "biggest domain value" I get two records because (if I understood correctly) this option returns biggest domain value for start and end time. If I include temporal filter time=T2 I get only feature 2. With biggest domain value I get both feature 1 and 2.

Then, I tried to use "Use the domain value nearest to the reference value". Reference value is MAX(start_time). I also tried to set reference value as MAX(end_time). But, again I get two values.

If I set temporal filter like this: &time=T2-1/T2+1 then I get also two features because filter is being compared to both start and end time. If I set temporal filter as &time=T3/T3+1, then I get only the latest feature.

Question: 1. When specifying filter for time dimension, this is compared to both time attributes. Is there a way to get (by default, without specifying temporal filter) only newest data by start_time attribute?


texts: arcpy.sa.CostDistance from Python gives error about number of args but executes fine through Toolbox

texts:
I am attemping to call arcpy.sa.CostDistance to calculate the cost distance to a source point as well as generate the optional Cost Back link raster:

arcpy.sa.CostDistance("input", cost, "costDist", "", "costBackLink")

Which yields this error when executed within the Python Windows of ArcGIS:

>>> arcpy.sa.CostDistance("input", cost, "costDist", "", "costBackLink")
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: CostDistance() takes at most 4 arguments (5 given)

Oddly though, the exact same processing when executed via the Toolbox executes fine. The inline help that appears next to the Python Window when entering a function name also references the 5 arguments.

Why is this happening?


texts: Is it possible to convert ArcGIS .mxd to QGIS .qgs without having ArcGIS installed?

texts:
I was reading Converting ArcGIS (*.mxd) file to QGIS (*.qgs) file?.

It looks as though this only works with ArcGIS 10.

I would like to do this, but am unable to install things on the computer that has ArcGIS.

Is there a way to import to QGIS without using mxd2qgis (that requires ArcGIS 10)?


texts: Is there a way to keep toll_booth nodes in osm2po's output?

texts:
I am writing a code that performs a custom routing on the sql relation generated by osm2po. Amongst several other things, I need to detect if the selected route (list of ids) passes through one or more toll booths, and then display them on the map.

I have a table that contains the list of nodes that are toll booths with their corresponding osm id, and I would like to go through the list of ways in the generated route while matching the start and end nodes.

Unfortunately, this doesn't work in all cases since some toll nodes are removed (joined) by osm2po. Therefore, is there a way to prevent osm2po from joining ways, at least in the case of toll nodes?


texts:
I am working with 3 tables with 3 x 500 000 rows. There is one column that gives each object a unique ID (UIDN), there also is a column with the geom data (the_geom). There also are some other columns but the 2 above are the most important.

When I run my code, it takes a very long time, beceause these 3 tables are so big (I tested the same code with smaller columns and there it runs much faster, so I know for sure that the problem is the size of these columns).

PostGIS automatically made a GIST index for the 'the_geom' columns. Beceause it was real slow, I added a btree index for the 'uidn' column. I hoped this would speed things up, but it doesn't.

What do I need to do? Do I need another type of index?

EDIT:

Here is an example of a real query found in my function

            SELECT wbn.uidn, wgo.uidn
            FROM wbn, wgo
            WHERE ST_Intersects (wgo.the_geom, wbn.the_geom) = 't'
              AND ST_Length (ST_Intersection (wgo.the_geom, wbn.the_geom)) > 2
              AND wbn.uidn = f_uidn
              AND wgo.type = f_type

wbn and wgo are two of the big tables I was talking about


texts: Display a popup (getFeatureInfo) with Leaflet

texts:
I want to display WMS layers in a webmapping application built with Leaflet (version 0.7). Layers (ArcGIS shape format) are stored in GeoServer (version 2.10.0) in a public domain workspace. I got it and I can visualize the layers in my application.

I also want to display a custom popup with information about each layer when I click on the layer in the webmapping application. This information I want to show is what is stored in the attribute table of each shape layer. I am not able to display this information in the application.

Can someone tell me an example code or how to do it?


texts: Automating calculation of cumulative elevation for multiple line segments (not the profile graph)

texts:
I'm using ArcGIS and am trying to figure out how to calculate the cumulative elevation gain (in feet or meters) for over 1,000 line segments representing separate, often unconnected trails.  I have a DEM raster and the polylines, so it seems there should be a way without too much headache or expertise, but I'm getting stuck!  I've seen the answer to this question if you want to create a profile graph for a line segment, but I don't want to create 1,000 graphs to calculate the amount of cumulative elevation gain for each of these trails.

In the Profile Graph in 3D analyst I can select all my line segments and put them all on one graph so that I can download them in one table for excel, but then the table doesn't identify which trail they belonged to.   Stack Profile seems to do the same thing.

Any ideas or hints how to get cumulative elevation gain for each of my 1,000 line segments in an easier way?


texts: Selecting the correct projection for an imported .csv file

texts:
I am trying to import a .csv file into a QGIS project and cannot get it to be correctly positioned.
The data is the output from a series of sound recordings (bat calls) that were automatically georeferenced when recorded (on a GPS eneabled bat detector). The recorder GPS is set to WGS84 (I am in the UK).

The projection of the QGIS project is EPSG:3857 WGS 84/Pseudo Mercator with “On The Fly” CRS Transformation enabled. This is the default that was prompted when I added the raster base tiles to the project at the start (Ordnance survey data)

When I import the csv file it plots but way, way off the correct location.
I have tried selecting the following as the Projection for the imported .csv file during import but none work.
EPSG:3857 WGS 84/Pseudo Mercator [whihc I assumed would be correct]
OSGB 1936.British National Grid
EPSG 102013: Europe_Albers_Equal_Area(Conic)

If I import and plot the gpsx file from the recorder as a track it plots in the correct place (so I know that the data location was correctly recorded in the field) but the .csv file of the point data (the recordings taken at various points on the track) plots the individual points for each recording in the correct general pattern but miles away.

Can anyone suggest where I am going wrong?

QGIS version is:

QGIS version
2.18.3
QGIS code revision
77b8c3d
Compiled against Qt
4.8.5
Running against Qt
4.8.5
Compiled against GDAL/OGR
2.1.2
Running against GDAL/OGR
2.1.2
Compiled against GEOS
3.5.0-CAPI-1.9.0
Running against GEOS
3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version
9.2.4
SpatiaLite Version
4.3.0
QWT Version
5.2.3
PROJ.4 Version
493
QScintilla2 Version
2.7.2


texts: Encountering error message when trying to load shapefile to Google Earth Engine

texts:
I have been trying to import a shapefile I have created in QGIS based on features from a boundary database I downloaded for forest conservancy boundaries in Scotland. The error message is:
Layer error: Description length exceeds maximum.
Here is my code.
var hg = ee.FeatureCollection("users/annaelizabethk97/Highland3");

// Import my shape file of the NR
hg = hg.geometry();
Map.centerObject(hg);
Map.addLayer(hg, {color: 'red'}, 'hg');

I have tried reuploading everything multiple times, but always get the same message. The CRS in QGIS has been set to EPSG:27700 as it has 'performed a ballpark transform from EPSG:4326'. However, I set the CRS in the polygons that I created the shapefile with to EPSG:4326. I am very new to both Google Earth Engine and QGIS, so I have a very limited knowledge.
Could having the wrong CRS cause this error? Are there any other things I could try?
I found one other question asking about this error but they were trying to merge features
(Google Earth Engine: Layer error: Description length exceeds maximum).


texts:
I've done this tasks several times but my focus area has only been limited to the state of Mississippi.  I wish to put a 50 mile buffer radius around points that fall in the city of DC, Philadelphia PA,  and Detroit.

What coordinate system should my data frame be set to in order to accomplish this task?

In my daily operations I've only had to use NAD 83 Mississippi East or West.  I have never had to venture out in other areas of the country.

I am using ArcGIS Desktop 10.5.


texts: Automate raster polygon area extraction from GeoTIFF files

texts:
I am trying to automate the extraction of all bands from single multipolygon into separate single raster file containing all bands of a single polygon. The GeoTIFF file is exported from Google Earth Engine API (landsat8).

var geometry = ee.Geometry.Polygon([[[37.24154695,  8.01665693],
                                     [37.26876315,  8.01665693],
                                     [37.26876315,  8.04378808],
                                     [37.24154695 , 8.04378808],
                                     [37.24154695,  8.01665693]],
                                     [[37.34154695,  8.11665693],
                                      [37.36876315,  8.11665693],
                                      [37.36876315,  8.14378808],
                                      [37.34154695 , 8.14378808],
                                      [37.34154695,  8.11665693]]]);

var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
                .filterBounds(geometry)
                .filterDate('2016-01-01', '2016-12-31')

var images = dataset.reduce(ee.Reducer.median());

Export.image.toDrive({
  image: images.clip(geometry),
  folder: "test",
  description: 'imageToCOGeoTiffExample2',
  scale: 30,
  region: geometry,
  fileFormat: 'geotiff',
  skipEmptyTiles: true
});

I know that it is possible to achieve that with QGIS manually by selecting each polygon manually. But since I have a large amount of single polygons to extract, this method is not viable.

The picture simply depicts a raster file containing 13 bands and two polygons. It is a simple GeoTIFF file but in practice this file contains hundreds of polygons like that. The result would be two separate GeoTIFF files each one describing a polygon area from the input GeoTIFF file and thus the 13 bands for this polygon area.

Thus I would like to know if it is possible to achieve that task or if it is not.

Note: I am not a specialist of GeoTIFF files thus probably there are some tools or methodologies that I do not know to manage these type of files.


texts: Does a graphic or graphicsLayer support time-awareness?

texts:
In the ArcGIS Server JavaScript API 2.6 I'm looking to implement map graphics. I can't see whether they support time-awareness.

The help entry for graphicsLayer doesn't mention timeInfo, which is mentioned for featureLayer.

A featureLayer is a type of graphicsLayer - but does this mean that time-awareness is only implemented at the featureLayer level?

Do I need to generate a featureLayer on-the-fly using a featureCollectionObject in order to access time-awareness and use the TimeSlider toolbar?

Thanks


texts: Extracation spatial features from one layer from geopakage file and applying to data file

texts:
I have a GeoPackage file (OGC gpkg) which contains one main polygon layer representing forest stands with some unique keys.

The other layers are just tables and none of them are directly related to the polygon layer with unique key.
It is possible to connect to connect the files by creating relations with multiple layers.

I have a chart containing the relation using PK and FK.
I don't know how to extract the geometry of the polygons with the data I need.


texts:
I'm encoutering a problem when connecting a MySQL database to QGIS. When the connection is established and a layer is imported, the layer itself will not render and thus isn't visible. The layer becomes visible when i export/save it as a .shp file.

I've tried different CRS-systems, encoding systems, i've checked style properties but nothing works. When zooming to map layer the extends are located correctly, this means the coordinates are set according to the given coordinate system. It appears only the rendering of the live database objects is going wrong. Did someone encounter this issue before or knows a solution or workaround to this problem?


texts:
How to set transparency per polygon in a shapefile in QGIS?

For example:

a polygon with field "value" = 1 should be fully transparent whereas field with field "value" = 0.4 should have a 40% transparency value. The color of the polygons should depend on another field.  Preferable I would do this using one layer but using two layers with some blending modes is OK as well.


texts: can not delete file after using runalg function

texts:
I my plugin I use the runalg function:

processing.runalg("qgis:clip",filepath + "/temp2.shp", Layer, filepath + '/' + layerName)
vlayer = QgsVectorLayer(filepath + '/' + layerName + '.shp',layerName, "ogr")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

Afterwards I want to delete temp2.shp with

os.remove(filepath + "/temp2.shp")

but I get the error WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'C:/Users/toke.nielsen/Desktop/temp/temp2.shp'

Is there a way to unlock temp2.shp after using runalg? And is there a way to clear all variables and memory when the plugin is done?

I have tried this, but it is not working with QGIS 2.2:

Releasing PyQGIS file locks?


texts: Splitting linestrings based on their curvature

texts:
I'm looking for a method to split linestrings based on their curvature, more precisely if part of them could be considered a street corner. For example in the screenshot below, I'd need to split the two red linestrings in half, roughly at their middle:

At the same time, I'd like to preserve linestrings such as the ones around Starr King Way (to the east) as they're smoother.

The idea I have in mind is to check each subpart of the linestrings for important azimuth changes over a short distance, but I'm afraid it might be tedious or slow. Are there different, more straightforward approaches for this?


texts: Determining if point on boundary using ArcPy?

texts:
From comments at Determining if point on boundary using shapely? I am creating an ArcPy equivalent Q&A to that one which was answered for shapely.  Quoting the asker of the original question:

  I'm new to Python, and I want to test if a certain point lies ON the
  (boundary) of a polygon - not inside, not outside, just if it's on the
  boundary. The points and polygon already defined

polygon = [(3, 2), (5, 1), (7, 2), (8, 6), (9, 7), (11, 6), (10, 4), (12, 2), (15, 2), (16, 5), (19, 7), (18, 11), (14, 12), (11, 9), (5, 9), (2, 6)]
Point_X = 14
Point_Y = 12

  this point should be a boundary. How can I do that?


texts: Is it possible to use RPy/RPy2 in a Geoprocessing Script that is exposed as a GP Task on ArcGIS Server?

texts: Is it possible to publish a Script tool that uses the RPy/RPy2 module (or more generally any Python-to-R link) to ArcGIS Server 10 SP2? If so, what specifically do I need to do, i.e. Install R on the server machine(s). Thanks.


texts: Converting OpenStreetMap (OSM) file to shapefile?

texts:
I am trying to convert an ".osm" file to a shapefile. I want to display roads mainly.

I am using qgis (on Debian Linux) ..

EDIT (as recommended):
O.k, here is the problem ... I want to create a shapefile for an Amateur Radio application ... the current shapefiles they have really sucks big time ... so I downloaded qGis (which I regret wasting data on) and it is one BIG confusing hole of misery ...

Eventually after reading 2 hours of uninformative badly written examples on the net I finally figured out myself how to get OpenStreetMaps loaded into bloatware qGis ...

I select the area I wanted to work with ... after freezing up 4 times I eventually got evilware qGis NOT to break anything and download the info ... now I have an .osm file ... there is only one export option, something called epx? ... there is no option to save or export it as a shapefile ...

I hope that gives more clarity ...


texts: Drawing concentric circles that correspond to free space loss formula?

texts:
I want to be able to draw a circle with 50km radius and then fill the circle with values corresponding to the free space loss formula below:

FSPL(db)=20 log10(d)+20log10(f)+32.44

for example:

a circle of 50km around the "west Myara site" and then for every pixel(I guess) I would like to know its corresponding FSPL value and have it colored accordingly.

would I have to convert the polygon to a raster and then use the raster calculator to produce the values of each cell/pixel? if thats the case I would need to find the distance of the pixel/cell from the center point (in this case "west of Myara site" point) and how would I do that ?


texts:
I am in need for a Distance matrix(driving directions) for multiple locations ~1000 for a web application i am building.

The allToall attribute is what i am looking at in the Mapquest API http://www.mapquestapi.com/directions/#matrix and then tried to read their TOS.
I would need to batch my request so that i don't over do the request part.

that being said after reading their Terms of service, i am not sure if i am allowed to store this data in my database. Not sure if i am reading this right, can someone tell me if it is OK to store the data locally and then use it ?


texts: QGIS 2.16 Creating virtual field with aggregate expressions

texts:
With QGIS >=2.16, it is possible to use aggregates in expressions, such as sum, average... etc.

But when I use it to create a new virtual field using the field calculator,
the newly created field value is null for all of the layer's entities.

An example here :

Am I doing it wrong ? Or it is a bug ?

I tried to change the field type with no effect.
Note that it works when you create a non-virtual field.


texts: Convert a SQL Server table to a shapefile with projection info

texts: I've been using ogr2ogr to write out shapefiles from my SQL Server spatial map layers.  When I run the command it delivers the .shp, .shx, and the .dbf but no prj file.  Is there a way to get ogr2ogr to write out the project file from the table?  The projection is just standard SRID = 4326.


texts: How do I find the resolution of a scale range from the Arcgis Server REST services?

texts:
What's the best way to determine a LOD's resolution from the esri REST API?

Currently, I make a request for a specific extent to the server from the flex api, and from that I divide the width of the image in pixels by the width of the map it represents in map units, but aside from feeling like a bit of a hack, it has trouble when dealing with services that are represented in degrees rather than meters.


texts: QGIS - Layer Rendering Opacity not being kept when exporting atlas

texts:
I have changed the layer opacity of a polygon layer to 50% (works in both project and layout views) but when I regenerate and export an atlas, those polygons are at 100% opacity again. Is there an option I haven't selected for it to keep the opacity settings?
Using 3.10


texts: Getting 403 after logging in to GeoServer through keycloak

texts:
I have been following this guide to secure my GeoServer with keycloak. After completing that tutorial I am still getting a 403 error after I login. I took care to follow the instructions at the bottom of the page that specifically mentions a 403 error.

Here are my configurations (with some sensitive information censored):

My keycloak is hosted at auth.testing.xxx.xxx/auth

Keycloak user mntest and the role mappings:

Keycloak geoserver-client config:

Keycloak fine grain details:

Geoserver keycloak_adapter config:

Geoserver user:

Geoserver web filter chain:

When I go to my GeoServer URL (geoservermn.testing.xxx.xxx) I get the login page:

After I login I expect to be redirected the GeoServer home. Instead, I get this 403:

Does anyone know why I still get a 403? And what do I need to do to be redirected as expected?


texts: Create a line from an array and measure its length with PostGIS (ST_MakeLine, ST_Length)

texts:
do I understand it correctly that it is possible to create a line out of an array with the function ST_MakeLine()? I would like to create a line from several points (more than two) and then calculate the length of this line. So the idea is to use ST_Length(ST_MakeLine()). But I wouldn't mind to use something else if it works better. And I don't need a line if it is possible to calculate the distance without creating the line. So I need actually the distance between several points.
I will have many different arrays calculated for 3-15 points from the database, so the 'geom' array further down is just an example.

I am trying the following code:

   try:
        conn = psycopg2.connect("dbname='postgis_22_sample' user='postgres'                         password='db_postgres'")
        print "connected"
    except:
        print "I am unable to connect to the database"

    cur = conn.cursor()

    geom = ['0101000020E61000002073602DC48B02C08A97E9353F434B40', '0101000020E610000052F1834C1F0706C0E5F623C767554B40', '0101000020E6100000786C0C11DBEA02C002893F6561444B40', '0101000020E6100000CB67791EDCDD03C04963B48EAA4A4B40']

    cur.execute("""SELECT ST_Length(ST_MakeLine(geom));""")

Error: the column 'geom' does not exist

I thought that theoretically I can insert any possible array in there. Or is there something wrong with the syntax?

If I read the values from the table it gives the error that the function is not compatible with these arguments.

    cur.execute("""SELECT ST_Length(ST_MakeLine(geom)) FROM table;""")

(I have the version 2.2 of PostGIS and here (http://postgis.net/docs/ST_MakeLine.html) it is written that since 1.4 the arrays are supported)


texts: How to insert a GIS online service in QGIS?

texts:
I want to download or digitize some data from an online GIS server(http://gis.chania.gr/).

Is there any way to insert that site or download data from it?


texts: Can I put a JMapFrame In my main JFrame?

texts: I use Geotools, I have a main Jframe and i want to put in it a map content(JMapFrame). Is there a way to add JMapFrame in JFrame?


texts: Avoiding grids when transforming between SRS using ogr2ogr?

texts:
I'm trying to use ogr2ogr to transform from NAD27 (EPSG:4267) to WGS84 with my custom "towgs84" Bursa-Wolf parameters.
However, I think the ogr2ogr uses grids which are part of the GDAL installation and always uses them instead of the towgs84 parameters.

For instance, if I run this gdalsrsinfo command in a projection with testing parameters:

gdalsrsinfo "+proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs +towgs84=1,2,3,0,0,0,0"

I receive this response:

PROJ.4 : '+proj=longlat +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat +no_defs '

...

So I assume the ogr2ogr avoids the custom parameters and uses nadgrids instead (conus, alaska...) from the share/proj folder.

Do you know, how can I tell ogr2ogr to not use grids? (even though I know they should be more precise)

Or perhaps I can set the path to some other folder?


texts: Adding GeoJSON properties when creating marker in Leaflet

texts:
I used a manual marker input development under Leaflet found on this website : http://www.gistechsolutions.com/leaflet/DEMO/basic/addmarker.html
I have added two properties to the markers: name and description and the possibility to register these markers.

<title>Saisie waypoints</title>
<meta charset="utf-8" />
 <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />

<input type="text" id="a">Lat
<input type="text" id="b">Long
<input type="text" id="c">Name
<input type="text" id="d">Description
<button type="button" onclick="clickme()">Create</button>

<div id="map"

Delete
Export Geojson

I would like to be able to export in geojson format these markers with their names and descriptions. In the current export I only have the latitude and longitude coordinates of the registered markers.
What changes do I need to make in order to get these complete registrations?


texts: Configuring ArcMap applications to display WMS from PostGIS/GeoServer

texts:
I'm afraid I'm quite new to GeoServer and I have been set the task of configuring ArcMap applications to display data from PostGIS/GeoServer.  I  realize that I will need to set up a WMS service in GeoServer but I'm not really sure how one goes about doing this.

If any one can give me some pointers or step by step guide it would be much appreciated.  I have tried Googling it but haven't had much luck.


texts: How do I use QGIS python console to iterate through simple layer queries and png outputs?

texts:
I'm really new to QGIS coding and I'm having a hard time finding (especially) the api classes/functions to carry out actions of the Query Builder window.

I'm basically trying to do this:

Iterate from n=1 to 200...
Query layerA where field_id = n
Query layerB where field_id = n
Query layerC where field_id = n
Save as img_n.png

Pretty simple, I think, but it has become a real pain to do by hand in the GUI.


texts: Making callout lines follow feature offset

texts:
I'm looking for a solution to the following problem: Using QGIS 3.16 I'd like to display two point features with the same coordinates. So I set an offset to the symbology of one of them (see attached picture, brown square). This feature also has a label with a callout line. When using the offset, the callout line still starts at the original feature's place.
How can I apply the offset to the callout line starting point as well?
(brown square with offset, line still starts at original coordinates, as shown below)


texts: I'm trying to create a geojson file with a few shapes of roads from OSM. Now, I've been able to get shapefiles of the greater region (province) these roads are in from http://download.geofabrik.de/ . I've also been able to convert a shape file to geojson using ogr2ogr. My problem is that it contains way too much data. Is there a way to filter a shapefile or geojson file by name, type or ID?


texts:
I am new with using WFS layers.
My issue is the following :
I have a local shapefile which contains a column with a unique id for each entity. I would like to download from a WFS only the vectors that have these same id.
Is it possible?


texts: Vector topology cleaning of shapefiles not showing cleaned results QGIS(2.8.6) and GRASS

texts:
I tried to do some topology cleaning with GRASS v.clean (snap tool)but the cleaned result is not showing. Using the break tool works But for some reason i have not been able to run the snap tool and get the result again. Any ideas on how to go about this issue?

The blue line is a shapefile layer which represents road network. I need to snap all the intersecting nodes of the lines.


texts: Problem in Print Composser in Q-GIS+Google Earth_Vector lines

texts:
I am facing problem in map making using Qgis with Google earth view and overlapping vector layers, please see the attachment and help to solved this problem.

Actually, during take any output with google earth image and vector lines, vectors lines are distorted from its original position.


texts: Geoserver - Key Authentication against a MySql Database

texts:
I am trying to implement a token based security scheme with Geoserver.

What we need to do is send the client a license key when they log into our primary application. This license key is generated by another application and is stored in a MySql Database along with the User name and password, Ip Address form login, etc.

We would like to be able to pass this License key as part of the WMS Request to ensure that only logged in and validated users obtain access to the data.

Has anyone implemented anything similar before, any help, suggestions or code would be appreciated.

Edit ..

I Think I may have answered my own question, we use Classic ASP Still (Dinasour) and something like the following from here might do the trick.

<%
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
strURL = Request("url")"
objHttp.open "GET", strURL, False
objHttp.Send
If objHttp.status = 200 Then
Response.Expires = 90
Response.ContentType = Request("mimeType")
Response.BinaryWrite objHttp.responseBody
set objHttp = Nothing
End If %>


texts: Changing polygon color with external link GeoJSON file

texts:
I've done various ways to change the polygon color with external links, but only one color can be displayed, so I need help with changing and displaying more than one polygon color in the source code Leaflet with an external GeoJSON file link.
Code:
fetch("https://testapp.my.id/batas_wilayah_sumbar.geojson")

    .then(function(response){
        return response.json();
    })
    .then(function(data1){

       L.geoJson(data1, {
        style:function(feature){
         return{

                style:myStyle

        },
          onEachFeature:onEachFeature
       })
    .addTo(myMap);
    });


texts: arcgis 10.0 od matrix only solves A-A, B-B, C-C, not A-B, A-C, etc

texts:
I think I have a very noob question here. Using ArcGIS 10.0 and Network Analyst extension to create Origin-Destination Matrix. I have a shapefile of 120 points, and I want to create a matrix of shortest road network distances between all 120 points (120x120 matrix). I've tried using network datasets that (a) include the road network + points and (b) include road network only.

Using the OD tool, I load the points as both origins and destinations, so both read (120) once loaded. I set impedance to length, no cutoff value, and destinations to find <All>.

When I solve, I get lines (120), and the attribute table shows only 120 pairs: each point with itself. So all distances are 0. In other words, I get A-A, B-B, C-C, etc, not A-A, A-B, A-C, B-B, B-C, etc.

Update
Here are links to the road network dataset and origins-destinations.


texts:
I have created tiles of raster datasets using TileStache. After creating those tiles i have uploaded them in S3 Bucket, and now serving them in my web application as TiledLayer ({z}/{x}/{y}.png)

I have built CORS on the S3 Bucket as well. But the problem is QGIS does not take CORS headers into account, and i can simply create XYZ Tiled Layer with the bucket URL  of the Network from application.

How can i prevent QGIS to add my TiledLayer service. We can build the username and password on it, but that will be exposed in the network as well.


texts: KmlLayer with Schema in ArcGIS API for Silverlight?

texts:
I have a KML file I'd like to load with the KmlLayer in my Silverlight application. The problem is that the markup seems more complicated than the class wants to handle. I have a  element at the top of the Document that adds custom elements () and for some reason changes the  element name to a custom one.

I've been searching for a couple days but no one seems to have covered this issue. Has anyone here come across a option or somesuch you can set so that the KmlLayer notices and adheres to the  elements customizations?


texts: How to use FindLabel function programmatically using ArcPy?

texts:
I want to set the FindLabel function to the labelclass expression using ArcPy. My code is like How To: Label a related table. I don't want to load the function into the expression editor of the label tab but in the toolbox.

I try to load function programmatically but it's not working. What's wrong in the code?

Another problem is using brackets "[]" for field names. In the expression editor the users can write [field name] but in Python I must use string characters. Also FindLabel mainly uses an advanced expression in expression editor but I could not set the advanced expression and parser.

How can I use FindLabel Function programmatically?

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
layer = arcpy.mapping.ListLayers(mxd, "fc")[0]
def FindLabel ([keyField], [FirstLabel]):
    key1 = [keyField] # Key field in feature class
    key2 = "ID"   # Key field in related table
    L = [FirstLabel] # Label field in feature class
    L2 = "Label2"   # Label field in related table
    myDataTable = r"<path-to-related-table>"   # Path to related table
    cur = arcpy.da.SearchCursor(myDataTable, [key2, L2])
    for row in cur:
        if str(key1) == str(row[0]):
            L = L + " " + str(row[1])
    return L

layer.labelClasses[0].expression = .... ?
print layer.labelClasses[0].expression
layer.labelClasses[0].showClassLabels = True
layer.showLabels = True
arcpy.RefreshActiveView()

del mxd


texts: How to efficiently use a Postgres DB with Python

texts:
I have a Postgres DB with a lot of lines that are too long and so now I want to split those lines into smaller ones.

This is why I started writing a little python script for that job. Basically it fetches my lines like this:

cursor.execute("SELECT ogc_fid, id, ST_AsGeoJSON(wkb_geometry) as geometry, ST_Length(wkb_geometry) as length, height FROM cont OFFSET " + str(offset) + " LIMIT " + str(limit) )

Here's my first problem. In order to further work with the data I have to select the geometry as JSON. I'll come to that later.

Now I iterate over the lines and make something like this:

sqlCommand = "INSERT INTO " + table + " (ogc_fid, id, wkb_geometry, height) VALUES(" + ogc_fid + ", " + row_id + ", ST_Line_Substring(ST_GeomFromGeoJSON(\'" + geometry + "\'), " + str(rangeFrom) + ", " + str(min(rangeFrom + stepWidth, 1)) + "), " + str(height) + ");"
cursor.execute(sqlCommand)

So if I didn't use ST_AsGeoJSON in the select, I couldn't append it to my command cause it can only append a string.

That way my whole script is very slow. It always has to convert my geometries into JSON and then back from JSON.

Is there a datatype that python can handle?

Is there a more efficient way of dealing with geometry fields?

I heard of GeoDjango. Could that help here?


texts: Testing for spatial autocorrelation in residuals of OLS regression

texts:
I'm currently working on a dataset that is most likely to have spatial autocorrelation issues.
In particular, I have observations at the region level and I'm trying to run a regression to check whether x has an effect on y. Moreover, I also have control variables regarding the socio-economic characteristics of the regions, w.
I want to check whether, after controlling for w there is still spatial autocorrelation in the residuals of the regression of x on y.
I understand that Moran's I is the standard to check for autocorrelation, but it already implies assuming a particular spatial correlation structure through the weights.
I know two of the standard tests for autocorrelation are the Mantel test and the Durbin-Watson statistic but they both have issues if the data is indeed spatially autocorrelation.
To sum up, I'd like to know if there is a way to test for the spatial autocorrelation of the OLS residuals without assuming any spatial structure between the observations.
Finally, I'm using python for this project so any suggestion as to how to perform such a test with this program would be great.


texts: How to convert map scale 1:10000 to nearest zoom level 16 scale 1:9028

texts:
I am making tile map service port for this map http://mapserver.geology.sk/sbd/.
When you max zoom this map, you will get scale 1:10000. Tile size is 256px.
You can check it here http://mapserver.geology.sk/sbd/proxy.jsp?http://hparc:8399/arcgis/rest/services/Podklady/Podklad3/MapServer/tile/10/51622/48898

This tile map system is custom only for this web map so I need make port to match TMS standard. My question is how to convert this image map tile 256px 1:100000 to match scale 1:9028 which correspond to zoom level 16 and has tile size 256px.


texts: Creating and populating a visibility preset with pyQGIS

texts:
I'm trying to create some layer visibility preset in QGIS 2.18 using its API. But, for some reason, when I try to add layers that are visible in legend interface, it simply doesn't work.

Here is the piece of the code that I'm refering to:

# Creating a preset
root = QgsProject.instance().layerTreeRoot()
clPreset = QgsProject.instance().visibilityPresetCollection()
clPreset.insert('MapaPrincipal', QgsVisibilityPresetCollection.PresetRecord())

# Adding visible layers to created preset
root = QgsProject.instance().layerTreeRoot()

for l in root.findLayers():
    if not l.isVisible():
        iface.legendInterface().setLayerVisible(root.findLayer(l).layer(), True)

clPreset.addVisibleLayersToPreset(root, clPreset.presetState('MapaPrincipal'))

When I check for the visible layers added to the visibility preset, it returns an empty list. What am I doing wrong?


texts: What do you recommend for coding using an open source software that is similar to ArcGIS runtime java SDK ?


texts: osmosis merge: second input file being ignored, output is duplicate of first input file

texts:
I am trying to merge some .osm files.  After looking at various examples online, I'm still having trouble.  The command completes without error and there is an output file.  However, the output file is a duplicate of the first input file while the second input file seems to be ignored.  I tried adding some bounding box information (since the input files do not overlap, but are spatially adjacent), but had the same result.

Here is the command:

osmosis --rx Lat60Lon-150Lat61Lon-149.osm.sorted --rx Lat60Lon-151Lat61Lon-150.osm.sorted --merge --wx test.osm

Afterward, a diff confirms that test.osm and Lat60Lon-150Lat61Lon-149.osm.sorted are the same.  And, again, there are no errors when running this command.

What could I be missing?  Happy to provide more details if helpful.


texts: Esri ST_Geometry function to make line from points

texts: I'm attempting to write a SQL statement that joins two point feature classes, both in an Oracle ArcSDE geodatabase using ST_Geometry, and selects a line geometry connecting the points of each resulting row. In PostGIS I would use the function ST_MakeLine(pt1, pt2), but I haven't been able to find this in the Esri docs. Is there such a thing?


texts:
I am using GeoServer 2.6.2.

I have a problem with the WMS service.

to authenticate the service wms configure the following rule in " List of access to services"

wms.GetMap  ROLE_AUTHENTICATED

but the response this url

http://localhost/geoserver/xxxx/wms?service=WMS&version=1.1.0&request=GetMap&layers=xxxx:clientes&styles=&bbox=.......&width=378&height=512&srs=EPSG:4326&format=application/openlayers

is

Estado HTTP 500 - Request processing failed; nested exception is org.springframework.security.authentication.InsufficientAuthenticationException: Cannot access WMS.GetMap as anonymous


texts: set values in feature class attribute table to null

texts:
I've created a point-data featureclass (fc) containing data from a simple .txt file using Arcpy as follows:

arcpy.CreateFeatureclass_management(out_path= outPath, out_name= 'fcTest', geometry_type= "POINT", spatial_reference= spatRef, has_m= m, has_z= z)

I've read the text file to create fields and fill each field with data:

#lstFields= data from the text file
#fNames= list of fieldnames
#fClass= list of datatypes
for i in range(len(fNames)):
    arcpy.AddField_management(fcTest, fieldN, fieldT)

Let's say the .txt file contains the xy coordinates and two fields: fA and fB

with arcpy.da.InsertCursor('fcTest', ("SHAPE@XY", "fA", "fB")) as cursor:
    for point in lstFields:
        vals= point.split(";")
        x= float(vals[0])
        y= float(vals[1])
        a= int(vals[2])
        b= float(vals[3])
        rowValue= [(x, y), a, b]
        cursor.insertRow(rowValue)

So far so good. However, some values of fA and fB have value 9999, which actually means 'no data'. My question is: how do I convert the 9999 values to a 'real' NoData value? I thought

setNull(field_name)

might be it, but I can't get it to work. See ArcGIS help here. I tried something like:

with arcpy.da.UpdateCursor('fcTest', ("fA", "fB")) as cursor:
    for row in cursor:
        for i in range(len(row)):
            if row[i] == 9999:
                row.setNull(row[i])
                cursor.updateRow(row)
except Exception as e:
    print e.message

Which gives:

'list' object has no attribute 'setNull'

I would appreciate any help. I'm new to arcpy and have based most of the above on the Programming ArcGIS10.1 with Python Cookbook by E. Pimpler. Many thanks!

UPDATE! This works flawlessly:

with arcpy.da.UpdateCursor('fcTest', ("fA", "fB")) as cursor:
    for row in cursor:
        for i in range(len(row)):
            if row[i] == 9999:
                row[i] = None
                cursor.updateRow(row)
except Exception as e:
    print e.message

Thanks @Artwork21


texts:
Installed Sentinel Snap from official site on a Windows 10 virtual machine. Snap version 6.0.

Checked that I have administrative privileges before install, and asked to install "As an Administrator" to ensure everything runs fine.

After installation, updated SNAP using Tools / Plug-Ins window and selected all available plugins as per next image:

Restarted SNAP and noticed a "update is in progress..." message.

Opened Tools / Plugins menu again, and noticed that the system was not updated. I can see the full available updates on the list available to update.

I had no errors during update process.

Also noticed that when I close SNAP (File / Exit), the SNAP application open again and enters a loop. I close SNAP, and it opens again and no updates are made.


texts: Adding 3x4 table in popup template using ArcGIS API for JavaScript 4?

texts:
I'm building an arcgis application rendering a csvLayer. I've added a popup template like so:

 var template = {
        title: "{SensorTitle}",
        content:
            [
                {
                    type: "fields",
                    fieldInfos: [
                        {
                            fieldName: "DateTime",
                            label: "Date",
                        },
                        {
                            fieldName: "Temp",
                            label: "Temperature (°F)",
                        },
                        {
                            fieldName: "Humidity",
                            label: "Humidity (%)"
                        },
                        {
                            fieldName: "DewPoint",
                            label: "Dew Point (°F)"
                        },
                        {
                            fieldName: "PM10",
                            label: "PM 1.0 (µg/m3)"
                        },
                        {
                            fieldName: "PM25",
                            label: "PM 2.5 (µg/m3)"
                        },
                        {
                            fieldName: "PM100",
                            label: "PM 10.0 (µg/m3)"
                        },
                        {
                            fieldName: "PollutantId",
                            label: "PollutantID"
                        },
                  ]
              },
         ],
  },

 var csvLayer = new CSVLayer({
     url: numberLayers[0].Url,
     popupTemplate: template,
     featureReduction: {
           type: "selection"
     }
 });

Ok so now, I've tried making this filedInfos into a 2 dimensional array, but for some reason I get an error as such:

[esri.views.3d.layers.FeatureLayerView3D] #resolve() Failed to resolve layer view (layer title: 'Csv', id: '16b836936eb-layer-0') TypeError: Cannot read property 'indexOf' of null
at dojo.js:1865
at Array.filter (<anonymous>)
at Object.e._getFieldInfoFields (dojo.js:1864)
at Object.e._getContentElementFields (dojo.js:1862)
at dojo.js:1864
at Array.reduce (<anonymous>)
at Object.e._getContentFields (dojo.js:1864)
at Object.e.collectRequiredFields (dojo.js:1862)
at Object.get (dojo.js:1861)
at b.get (dojo.js:295)

Now im pretty sure this isnt the proper way to do this. Does anyone have a suggestion on what I may be doing wrong here? Is this even possible with field types?


texts: How to solve problems with leftover borders when combining multiple counties?

texts:
I have a problem with the borders of counties. I  have a shp file with counties and I want to combine them into one large district. Unfortunately, after I chose 'connect the selected objects' one object is not combine with rest. But when I select the object, QGIS 'sees it' as a single object. Has anyone had a similar problem or know how to solve it?

Edit:

@Joseph - I did it. But still I have this same problem.


texts: Assigning values to empty field in attribute table

texts:
In my attribute table, I have a field with empty slots. Though, I want to add Christchurch to fill all of these empty slots for this one particular column. I have thousands of rows, and wish not to manually include the name. How would I go about this on ArcMap?
I have tried using the field calculator and adding this syntax:
Replace(chr('Christchurch'))

Though it does not work.


texts: How to compile an ArcGIS Desktop add-in in Visual Studio 2013

texts:
I have several projects made in Visual Studio 2010, those projects are ArcGIS Desktop Add-in's. I have been change of computer, and my new one only have Visual Studio 2013 due to some company politics I'm not allowed to install VS2010.

I tried to open this projects in VS2013, and they open with no problem, but when i try to compile it, it get me the following issue:

  ESRI.ArcGIS.AddIns.SDK, Version=10.2.0.0, Culture=neutral,
  PublicKeyToken=8fc3cc631e44ad86. Could not load file or assembly
  'Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0, Culture=neutral,
  PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
  system cannot find the file specified. Confirm that the declaration is
  correct, that the assembly and all its dependencies are available, and
  that the task contains a public class that implements
  Microsoft.Build.Framework.ITask.

my research so far has get me to install the VS SDK, but I'm not quite sure about which one(2008...2013)

Any one has any possible solution for this?


texts:
Is there any way to tell, via the SOAP or REST APIs, if an ArcGIS Server map service requires an authenticated user?

I have set an application to use a token service for accessing secured map services, but I am trying to find if there is a quick way to tell whether or not the service requires a user to be logged-in.


texts: Split feature from polygon that's entirely within all other features' boundaries in QGIS

texts:
I'm splitting a polygon into various features for small-scale land cover delineation. One area I need to delineate into its own feature shares no boundaries with other features, it is an irregular polygon contained entirely within another feature of the shapefile I'm working on.

Because the feature shares no boundary with other features, the Split Features Tool I've been using doesn't seem to work. If I use the Add Circular String tool, it delineates the feature of interest fine but it does not also subtract from the area of the feature it's contained within. How can I get the same functionality of the Split Features tool but for an isolated area? See screenshot below, feature of interest has red X over it.


texts: Tried running a script, kept getting "AttributeError: DescribeData: Method spatialReference does not exist"

texts:
Anyone know how i can fix this problem below?

I am trying to merge all the layers under the same name in different subfolders.

import arcpy
import os

# parameters
input_folder = arcpy.GetParameterAsText(0)
output_geodatabase = arcpy.GetParameterAsText(1)

# validate output geodatabase name
output_geodatabase = os.path.join(os.path.dirname(output_geodatabase),
os.path.basename(output_geodatabase).split('.')[0] + '.gdb')

# turn overwrite on
arcpy.env.overwriteOutput = True

# make output geodatabase if it doesn't exist
if not os.path.exists(output_geodatabase):
    arcpy.AddMessage("Creating output geodatabase...")
    # make sure name is valid
    arcpy.CreateFileGDB_management(os.path.dirname(output_geodatabase),
os.path.basename(output_geodatabase))

# Making an empty list to put filepaths to feature classes in
arcpy.AddMessage("Scanning input directory...")
merge_dict = {}
# Walking workspace recursively checking type, and appending filepath to list
for dirpath, dirnames, filenames in arcpy.da.Walk(input_folder,
datatype="FeatureClass"):
    for filename in filenames:
        desc = arcpy.Describe(os.path.join(dirpath, filename))
        if not filename in merge_dict:
            merge_dict[filename] = [os.path.join(dirpath, filename)]
        else:
            cur = merge_dict[filename]
            cur.append(os.path.join(dirpath, filename))
            merge_dict[filename] = cur
arcpy.AddMessage(" -> Found {} different file groups to
merge".format(len(merge_dict.keys())))

arcpy.AddMessage("Starting merge processes...")
i = 1
tot = len(merge_dict.keys())
for k in merge_dict.keys():
    arcpy.AddMessage(' -> {}/{} {}'.format(i, tot, k))
    # get dataset name
    datasetName = os.path.basename(os.path.dirname(merge_dict[k][0]))
    # if output dataset with same name doesn't exist, make it
    if not arcpy.Exists(os.path.join(output_geodatabase, datasetName)):
        # get spatial reference
        sr = arcpy.Describe(os.path.dirname(merge_dict[k][0])).spatialReference
        arcpy.CreateFeatureDataset_management(output_geodatabase, datasetName, sr)
    # now merge files
    outputMergedFile = os.path.join(output_geodatabase, datasetName, k)
    arcpy.Merge_management(merge_dict[k], outputMergedFile)

    i += 1

arcpy.AddMessage('Done!')

Below is the error from ArcGIS Pro:

Failed script Merge Data...
 Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\Python Script\merge_data.py", line 48, in <module>
    sr = arcpy.Describe(os.path.dirname(merge_dict[k][0])).spatialReference
AttributeError: DescribeData: Method spatialReference does not exist
 Failed to execute (MergeData).


texts: A column was specified that does not exist error - ArcGIS

texts:
I have some code that ran just fine on ArcMap 10.7 in May, but is now giving me an error when trying to create a new shapefile. The join that precedes the code that throws an error succeeds, and when I look at the attribute table the column exists as it should. I've reviewed other questions here but cannot seem to figure out the issue.
import arcpy
import time

beginningTime = time.time()
arcpy.env.overwriteOutput = True
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
excel_file = "C:\\Users\\SSchreier\\Desktop\\ArcGIS Maps\\MTW\\MTW_Map.xlsx"
county = "C:\\Users\\SSchreier\\Desktop\\ArcGIS Maps\\County_Projected_AEAC"
arcpy.AddJoin_management("County_Projected_AEAC", "ID", "C:/Users/SSchreier/Desktop/ArcGIS Maps/MTW/MTW_Map.xlsx/Sheet1$", "modified_FIPS", "KEEP_ALL")

arcpy.Select_analysis("County_Projected_AEAC", "C:/Users/SSchreier/Desktop/ArcGIS Maps/MTW/Beef_Cattle.shp", '"Sheet1$.Flag_Beef_Cattle" = 1')

The last line throws the error that the column does not exist. However, it is in the attribute table, and capitalization and underscores and everything have been verified. I also verified the SQL formula outside of the Python script and it verified successfully. The error is below:

Runtime error  Traceback (most recent call last):   File "",
line 12, in    File "c:\program files
(x86)\arcgis\desktop10.7\arcpy\arcpy\analysis.py", line 90, in Select
raise e ExecuteError: ERROR 000358: Invalid expression
"Sheet1$.Flag_Beef_Cattle" = 1 Failed to execute (Select).

I also tried the following code because this is the script the ModelBuilder output, but still receive an error, albeit a different error.
arcpy.Select_analysis("County_Projected_AEAC", "C:/Users/SSchreier/Desktop/ArcGIS Maps/MTW/Beef_Cattle.shp", "\"Sheet1$.Flag_Beef_Cattle\" = 1")

Runtime error  Traceback (most recent call last):   File "",
line 17, in    File "c:\program files
(x86)\arcgis\desktop10.7\arcpy\arcpy\analysis.py", line 90, in Select
raise e ExecuteError: ERROR 000358: Invalid expression
"Sheet1$.Flag_Beef_Cattle" = 1 Failed to execute (Select).


texts: Split a polygon every time a new centerline line segment begins?

texts:
I'm trying to sample out a road into equal parts. It was easy to do this with a line segment using the split tool because I couldn't figure out a way to break the polygon in the photo every 150ft but was able to easily with a line segment.

Would it be possible to break the polygon to match the extent of the line segments shown below? Each different color is a new 150ft segment. I have QGIS and Arcmap 10.5.1


texts: How to convert real altitude and longitude values to GeometryTransform.TransformBox values

texts:
I have  a running program which has a point  but its values are not dynamic .

Current code for the point is

 var mathTransform = LayerTools.Wgs84toGoogleMercator.MathTransform;
            GeoAPI.Geometries.Envelope geom = GeometryTransform.TransformBox(
                new Envelope(-9.205626, 300.123736, -31.690993, 100.740837),
                mathTransform);

Now I want to make a point from altitude and longitude  values to this format how can i  convert.


texts: Query geodatabase with PostgreSQL to show - schema, table, column, domain name

texts:
How to query geodatabase system tables using PostgreSQL to result this:
schema, table, column, domain name
I found this, but nothing for PostgreSQL
https://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/query-system-tables-with-sql.htm
Does anyone have an idea?


texts: Automating non-trivial workflow in SAGA-GIS

texts:
My problem: I have two DEMs, one rectangular and containing the other. Both are given in grid formats and the outer one has gridsize 50m, the inner one 10m. I want to 'embed' the smaller one in the larger one, merge them and export the whole merged grid as .xyz files with grid size 50m.

All this I can do manually in SAGA-GIS, using the following steps:

Import the outer grid using the module "io_grid" - "Import Surfer Grid" (ID 3)
Import the inner grid using "io_gdal" - "GDAL: Import Raster" (ID 0)
Use the splendid mosaicking tool "grid_tools" - "Mosaicking" (ID 3)
Export the resulting grid using "io_grid" - "Export Grid to XYZ" (ID 5)

Now I want to automate all this using saga_cmd. I managed to turn the first two steps into a script quite easily:

io_grid 3 -FILE=G:\path_to_file\foo.grd -NODATA=0 -NODATA_VAL=-99999.000000
io_gdal 0 -FILES=G:\path_to_file\bar.adf

Step 3 is tricky though. The SAGA-generated example for the module grid_tools 3 suggests to do something like that:

grid_tools "Mosaicking" -GRIDS=memory;memory -TYPE=7 -INTERPOL=0 -OVERLAP=1 -BLEND_DIST=10.000000 -TARGET=1 -USER_XMIN=0.000000 -USER_XMAX=0.000000 -USER_YMIN=0.000000 -USER_YMAX=0.000000 -USER_SIZE=1.000000 -USER_COLS=0 -USER_ROWS=0 -USER_GRID=NULL -GRID_GRID=

In the SAGA GUI, I simply choose the input grids manually in this step (with a drop-down menu - interactively). But it seems to me that I have to name the imported grids, which I did not do in the script. But how do name them. And how can I tell grid_tools "Mosaicking" to use the two before-loaded grids?


texts: Can the CMV Identify Widget work with an Elevation Image Service?

texts:
I am using the CMV template but I have not been able to figure out if it is possible to configure the identify widget to return a pixel value (in this case an elevation value from a local image service).

Can anyone point me in the right direction?


texts: Counting how many buffers cover centroid in QGIS?

texts:
I try my best to explain my problem in english:

We use QGIS.
We have a shapefile that shows a city divided in 277 areas. We have computed the centroids of each of these areas. Next step we have georeferenced adresses of general practitioners. Then we made a buffer around each general practitioners.

Now we'd like to have a new column in our attribute table that shows, for each area centroid, by how many buffers it is covered.
We have tried to solve it with the field calculator to use "sum" without success.


texts: Is there any alternative for TypeBrewer, since the website is down due to converstion from Flash to HTML 5?

texts:
I was reading the post Choice of Cartographic Font and the answer is suggesting the Typebrewer website. This website is also mentioned in the 26 point (i.e., Carefully Select Typeface) mentioned in 33 Map Elements to Include in Cartographic Design: A ‘How to’ Guide to Map Making .

But, now the Typebrewer website is having down time due to their conversion from Flash to HTML5.

Does anyone know about any other alternative websites for Typebrewer?


texts: Download data via a ftp server using polygon features

texts:
The attached script loops through the features of a polygon featureclass and uses that attribute information to download particular files via a ftp server.  The script works great for downloading files as long as all of the files on the ftp server are contained within one folder (example).

Now, I need to download imagery via a ftp server with a different file structure (example) where files are contained within multiple folders.  How can I tweak the code so that the following actions occur?:

Use polygon features to identify the necessary file to download (completed)
Access the correct folder and download the imagery

I suspect that I need to utilize the os.path module, however, I cannot seem to put the pieces together.

# Download data via a ftp server

import arcpy, ftplib, os, socket

HOST = 'ftp.agrc.utah.gov'
DIRN = '/Imagery/NAIP2011_4-band/'
#FILE = ''     # Defined later in for loop
workspace = r'F:\my\workspace'  # This is where the downloads go
quads = r'F:\path\to\polygon\shapefile' # Used to define which files to download

# Get current working directory
print 'The current working directory is %s' % os.getcwd()

# Change the current working directory to a download folder
os.chdir(workspace)
print 'The workspace has been changed to %s' % workspace

try:
    f = ftplib.FTP(HOST)
except (socket.error, socket.gaierror), e:
    print 'ERROR: cannot reach "%s"' % HOST
print '*** Connected to host "%s"' % HOST

try:
    f.login()
except ftplib.error_perm:
    print 'Error: cannot login anonymously'
    f.quit()
print '*** Logged in as "anonymous"'

try:
    f.cwd(DIRN)
except ftplib.error_perm:
    print 'ERROR: cannot CD to "%s"' % DIRN
    f.quit()
print '*** Changed to "%s" folder' % DIRN

# Use search cursor to loop through download polygons,
# get the name of the required file and use that name to download file on ftp site
with arcpy.da.SearchCursor(quads, ("TILE_NAME", "QUADID")) as cursor:
    for row in cursor:
        print row[0]
        FILE = row[0] + ".tif"
        name = row[1]

        try:
            f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write)
            arcpy.Rename_management(os.path.join(workspace, FILE), os.path.join(workspace, name + ".tif"))
        except ftplib.error_perm:
            print 'ERROR: cannot read file "%s"' % FILE
            os.unlink(FILE)
        else:
            print '*** Downloaded "%s" to CWD' % FILE
f.quit()


texts: problem with WFS Data, GDAL, Python, ArcGIS, & Defining Projection

texts:
I'm pulling in data in gml2 format with a EPSG#4267 from a wfs.

I create a datastream in python and then run the following from the python window in ArcMap:

data = datastream.read()

#write the gml data to a gml file
rasterdata = open("E:\\Melo\\USGS" + "\\Roads.gml", 'w')
rasterdata.write(data)
rasterdata.close()

#Run the ogr2ogr to convert to shp
cmd = ["ogr2ogr", "-f", "ESRI Shapefile", "E:\\Roads.shp", "E:\\Roads.gml"]
subprocess.call(cmd)

#Define the projection
infc ="E:\\Roads.shp"
prjfile = "E:\\4267.prj"
arcpy.DefineProjection_management(infc, prjfile)

Unfortunately, when i try to add the layer in ArcMap 10.1 it "appears" blank.  Typically, I've only seen this happen when their was something wrong with the projection.  I know there is data in the file because I've converted it successfully using alternate methods.

I installd GDAL according to these instructions exactly (1500/32 bit/2.7).

I did NOT download and install the ArcGIS bindings.  Do I need them?

Any ideas on what could be causing the layer to appear blank in ArcMap?


texts: Why is matplotlib installed with ArcGIS?

texts:
Today I upgraded to ArcGIS Desktop 10.2.2 as well as the 64-bit background processing tool and noticed that both numpy and matplotlib were installed with Python.  In fact, in the "What's New?" section for 10.2.1, it states:

  ArcGIS 10.2.1 has been upgraded to include Python 2.7.5. Third-party
  Python libraries have also been upgraded: NumPy has been upgraded to
  1.7.1 and matplotlib to 1.3.0.

I understand that there are a number of tools in ArcGIS which use numpy such as:

NumpyArrayToRaster
RasterToNumpyArray

as well as a number of tools in the Data Access Module.

Do any of the tools in ArcGIS directly utilise the matplotlib module, and if so, which ones? Or is it installed just in case people want to make better looking charts and graphs, etc. than are possible in ArcMap?


texts: Direct DBMS sql queries and ArcSDE geodatabase

texts:
i want to make updates from Arcobjects on several tables stored on a ArcSDE 10.1 versionned geodatabase based on Postgresql 9.0.5 , none of these update require spatial data , and making these updates through ArcSDE is not easy, but i think to make a direct Postgresql connection to make these sql updates.

Question : what are the consequences and the problems that could happen from this queries , knowing that i wanna change just attribute data , actually i'm using just the DEFAULT version of the geodatabase, making several versions could make a problem toward the use of direct sql queries ?


texts: Apply and Cancel snapping buttons missing in QGIS?

texts: In QGIS 2.14 I can't apply or cancel snapping options, these buttons are missing. I haven't got any idea, what's the problem. The system is Win 7.


texts:
I'm using Leaflet 1.7.1. I call function refreshLine(); (see below). I get map with layer line, everything OK. Also with option onEachFeature: tooltipLine.
Function for load lines returns GeoJSON with table line and all attributes:
function refreshLine() {
            $.ajax({
                url: 'load_data.php',

                data: {
                    table: 'line',
                    attribute: "*"
                },
                type: 'POST',
                success: function(response) {
                    arLineIDs = []; //move
                    jsnLine = JSON.parse(response);

                    lyrLine = L.geoJSON(jsnLine, {
                        onEachFeature: tooltipLine
                    }).addTo(mymap);

                },
                error: function(xhr, status, error) {
                    alert("ERROR: " + error);

                }
            });

            function tooltipLine(json, lyr) {
                var att = json.properties;
                lyr.bindTooltip("
Type: " + att.type + "
DN: " + att.dn + "
Material: " + att.material);

                 lyr.on('click', function (e) {

                     //need to fill some inputs with this attributes on click
                     var dn = e.target.feature.properties.dn;
                     var material = e.target.feature.properties.material;

                     var dn = document.getElementById('dn').value = dn || "unknown";
                     var material = document.getElementById('material').value = material || "unknown";

                 })
            }
        }

So, this works.
I want in other part of my app get some info on click, all data attributes from clicked Line and push them to another div element. This code below also works. But I can't use both of them combined.
lyr.on('click', function (e) {

    if ($('input').length) {
        $('input').remove(); //removes previous if exist
    }

    var $container = $("#container");
    var attributes = [];
    for (var prop in e.target.feature.properties) {
        var $input = $("<input/>" + prop);
        $input.attr("id", prop);
        $input.val(e.target.feature.properties[prop] || "missing data");
        $container.append($input);

        attributes.push(prop + ": " + e.target.feature.properties[prop]);
        document.getElementById("Select").hidden = true;
        document.getElementById("attEdit").hidden = false;
    }
    return;
})

How can I include both code lyr.on('click'), because they mix with each other and don't want to load refreshLine() again or refreshLineWithAllAttributes(), if you now what I mean.
I can't use both at same time.


texts: Shapefile layer no longer editable (toggle edit option greyed out) in QGIS?

texts:
I am using QGIS 2.16 / Windows 10.

I have a point shapefile which I have been using for a little while that has always been editable.

Today I was editing the layer, saved my edits and left my computer for a few hours. When I came back I was not able to toggle the editing button on the toolbar and when I right click on the layer it longer has toggle editing as an option.

I have googled the problem every way I can think of and have not been able to find an answer to why the layer is suddenly un-editable or how to fix this.


texts:
I want to user geoserver rest api in netbeans. i create new Maven Web Application project:

and then edit pom.xml like following:

add repository:

<dependency>
     <groupId>it.geosolutions</groupId>
     <artifactId>geoserver-manager</artifactId>
     <version>1.5.1</version>
     <scope>provided</scope>
</dependency>

add dependency:

<dependency>
    <groupId>it.geosolutions</groupId>
    <artifactId>geoserver-manager</artifactId>
    <version>1.5.2</version>
</dependency>

and then create new index.jsp file and then add to body tag following code:

<%
    String RESTURL  = "http://localhost:1234/geoserver/rest";
    String RESTUSER = "admin";
    String RESTPW   = "geoserver";
    GeoServerRESTReader reader = new GeoServerRESTReader(RESTURL, RESTUSER, RESTPW);
    GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(RESTURL, RESTUSER, RESTPW);
    boolean created = publisher.createWorkspace("myWorkspace");
%>

and then add to top of the file:

<%@ page import="it.geosolutions.geoserver.rest.GeoServerRESTPublisher" %>
<%@ page import="it.geosolutions.geoserver.rest.GeoServerRESTReader"%>

when i run this file occur following:

where is problem? how can i solve it?


texts: Reason for error when saving shapefile in a new projection

texts:
I tried to save a WG84 shapefile as a UTM 16N projection and got the following error: "Export to vector file failed.
Error: creation of layer failed (OGR error:Failed to open Shapefile `HF patients who are not 30 day readmissions in UTM 16N.shp'.


texts: Formatting tags break stacked feature-linked annotations with Maplex

texts:
I have a stacked feature-linked annotation, with one of the fields using a formatting tag. The annotation is fine when it is created, however all the lines collapse onto one line when a change is made to the linked feature. A related bug is logged on Esri's website (http://support.esri.com/en/bugs/nimbus/TklNMDc4OTQ4), but the stacked label collapses with any formatting text. Here is an example of the annotation expression:

def FindLabel ( [field1], [field2], [field3], [field4] ):
  return [field1] + " " + "<FNT size='6'>" + [field2] + "</FNT>" + " " + [field3] + " " + [field4]

edit: Esri support has recognized this as a bug.


texts: Using gdal_translate to round pixel values in raster - I'm getting an error

texts:
I tried to follow along at question: Rounding raster pixel values to one decimal place in QGIS

but my python script throws a syntax error at GTiff. I do have one that works for ArcGIS but my end users need the Spatial Analyst extension and does not have budget to buy it. So here I am trying this way.

What is going wrong?

I am a rookie.

# Import required modules
# Python modules

import sys
import time
import os
# Qgis modules
from qgis.core import *
import qgis.utils
from PyQt4.QtCore import QFileInfo, QSettings

gdal_translate -of GTiff -ot Int32 H:/test/ytest1.tif H:/test/output/int.tif

#done
print("done")


texts:
I have several geojsons which contain polygons. But the polygons are reaching over other geojsons. When I import them into lets say Qgis, the polygons, which are distributed among several geojsons are dissected.
I need to merge these geojsons into one geojson and the polygons must be recognized and and merged correctly too. I would be happy about a java-solution (like geotools)


texts:
I need add new Controls to GeoExplorer. I seen geoexplorer.js inside OpenGeo Suite and I will want to view the coordinates of points. But If I add map.addControl(new OpenLayers.Control.MousePosition());

I see a error because the MousePosition method no exist. I seen that events as Navigation is as a Object but I don't know as do it to MousePosition


texts: Performing linear trend analysis within shapefile using ArcGIS Desktop?

texts:
I have a shapefile (or several shapefiles, one per year, that I was going to join together to get all of the data in one attribute table) with an attribute for surface water area for each year. So like this:
area_2000, area_2001, ..., area_2015; each year with about 2 million objects/rows.

I was hoping to do a linear trend time series analysis in ArcGIS Desktop to get the slope, p-value, etc. as additional attributes for each object. I have used ArcGIS Desktop before to do regression analysis, but this time I want to do time series to get the trend in area for each object.

Is there a tool that would support this?


texts: Editing shared boundary of two polygons at same time using ArcGIS Desktop?

texts: If there are two square polygons next to each other, sharing a boundary is it then possible to adjust the shared boundary so that the size of both squares change as opposed to making one square bigger and then make the other square smaller?


texts: ArcGIS Server Setting proxy.ashx with ArcGIS API for JavaScript gives Error 403?

texts:
I am trying to set up the proxy for my web application because the request exceeds 2000 characters. I set up the proxy as described in ESRI site. When I run my application I get the error as shown below

**"Unable to load http://localhost/proxy.ashx?http://T...nction/execute Status:403"**

I put my web application (one HTML page with javascript api code) and the two proxy files to my development machine's root folder. This machine is XP.

I have Geoprocessing service running on another machine (TestServer). When the length of GP request exceeds the limit, the application tries to use proxy and that is when I see the error above. This machine is Win 2008.

Status 403 is Forbidden page error.


texts: How to troubleshoot "Ident authentication failed" errors connecting to PostGIS with Geoserver?

texts:
In my production Geoserver (v2.11) instance, accessing layers that were working fine yesterday are now throwing the following error:

<ServiceException>
      Error occurred getting featuresUnable to obtain connection: Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "dpsdata")
Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "dpsdata")
FATAL: Ident authentication failed for user "dpsdata"
</ServiceException>

The connection to the PostGIS database both in PGAdmin and QGIS are working just fine.

Trying to connect to the data store yields the following error:

Error creating data store, check the parameters. Error message: Unable to obtain connection:

Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "dpsdata")

However: Using my Dev Geoserver instance (v2.10) I can successfully connect to the same production PostGIS instance that throws errors in Prod - no errors are thrown, no users Ident authentication, and I can edit the data in QGIS, and see the new data showing up in an openlayers preview map.

What is going on with my Production Geoserver instance preventing me from connecting to and publishing maps my Dev Geoserver instance can do just fine? Also wondering what changed overnight that would have affected this, but my systems staff says nothing has happened on their end.

Any thoughts on what further to troubleshoot given the PostGIS database seems to be functioning just fine, and this looks to be some kind of Geoserver-only issue?

PostGIS version 2.3.3
PostgreSQL version 9.5
Apache Tomcat
CentOS 6
Geoserver Dev v 2.10
Geoserver Prod v 2.11

(I also tried using my QA instance, also Geoserver v2.11, and the same issue is happening)


texts: I generally have an doubt about QGIS. Is it possible to Trace the feature in QGIS?  As in the case like ArcGIS for Desktop which has a tool called "Trace" in its Editor Toolbar? If yes, how we can do  it?


texts: I have a map which has one data point per zip code. I would like to change those points to zip code polygons. Any ideas on how to go about it?


texts: Merging polygons for rendering with Geoserver

texts:
For my application, I need to merge the polygons of different records into one polygon, but only for the rendering (WMS Map).

If it's not clear, here's the goal: a PostGIS table contains the buffers around linear structures (roads, railways,...). Each element of each the structure has its own buffer and I'd like to show on the map only the union of the buffers grouped by type (one for the rails, one for the roads,...).

I've tried the following:

having only one buffer object per kind in the table (multipolygon): very slow, since it requires to load the entire polygon each time it is accessed, and not very flexible when the source data is modified
creating a view in the PostGIS table that groups every thing using the following query:

SELECT min(restriction.id) AS gid, st_multi(st_union(restriction.geom)) AS geom, restriction.type
    FROM public.restriction
    GROUP BY restriction.type

Also very slow, since the union is done each time the view is accessed

Using Geoserver SQL View's feature. According to the following post, a where statement is added to the view to limit the request to the queried bounding box, but is even slower than the PostGIS view: https://getsatisfaction.com/opengeo/topics/postgis_parameterized_view_dynamic_bounding_box

It is not possible to it with SLDs.

Is there any way to improve the query or to achieve the desired result, but faster?

I'm using the latest version of OpenGeo (3.1).


texts:
I calculate volume of lake from rasters with cut fill tools. I got a result and I don't know what is right result. In the table are two columns  COUNT and VOLUME  maybe I have to count multiply volume or volume is the final volume of lake?

https://scontent-vie1-1.xx.fbcdn.net/hphotos-xft1/v/t34.0-12/1058703_1021925644496509_333857375_n.jpg?oh=ee2b652172d28e4dc92986b5a3c46b20&oe=56763999


texts: How to detetmine county of GPS coordinate?

texts:
I have a SHP file that contains all counties in the USA. I also have roughly 100 million GPS locations. I need to tally the number of GPS locations per county.

A linear search through the counties for each coordinate is obviously a bad idea. I'm guessing I need some sort of spatial data structure that will prune candidate counties drastically and was hoping this was a common enough query that canned solutions were already available. In other words, I pass in SHP records for the counties and then query the resultant data structure for some unique identifier (FIPS code) of the county from a GPS coordinate (represented as some Point object).

My toolset is Python, shapely, fiona, etc.


texts: Updating ArcMap links to ArcSDE Geodatabase feature classes?

texts:
I've seen questions about attemting to repair a .mxd file with broken links. What I would like to do is get ahead of this issue and "fix" it before it becomes a problem.

I have my data in an ArcSDE geodatabase. The SDE is being navigated to a new machine in the near future so the database connection properties will change. Is there anything I can do ahead of time to avoid broken links and slow loading maps?

Here is a similar but different question:
How do you deal with (repair/avoid) broken MXD\LYR paths?


texts: OpenStreetMap - Overpass API; geometry disappears from node when using convert

texts:
I'm using the Overpass API of OpenStreetMap. I'm pretty new to this and I'm struggling to find a solution here since hours.

I have two different sets of nodes, .a1 and .a2. I add a certain tag to each of them using convert and print them out afterwards. Here is my code:

[out:json][timeout:250];
//gather results
(

  (node["place"="city"](47.8,5.6,50.6,11.2);)->.a1;
  (node["place"="ocean"](0,-180,90,0);)->.a2;

  foreach.a1(

    convert node ::=::, ::id = id(), tileId = 0;
    out;
  );

  foreach.a2(

    convert node ::=::, ::id = id(), tileId = 1;
    out;
  );

   );

My big problem is, that the returning data from the API is suddenly missing the values for "lat" and "lon" of the nodes. So the coordinates of the nodes are missing. If I print the nodes out, without using convert before, the coordinates are still there.

I tried doing something like:

convert node ::=::, ::id = id(), ::geometry = geometry(), tileId = 0;
out;

but it failed.


texts:
I can't connect to any of the Web Map Services (WMS/WMTS/WFS) in QGIS.
I don't think its a problem with the servers I'm using, but more about QGIS not being connected to the internet maybe?

The pop-up error is: "Host could not be found."

Examples of servers I am using:

(WFS) https://wxs.ign.fr/choisirgeoportail/geoportail/wfs?
(WMS/WMTS) https://wxs.ign.fr/choisirgeoportail/geoportail/wmts? SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities
(WMS/WMTS) https://portal.opentopography.org/dataCatalog?listAll=true&group=global

Version: QGIS Desktop 3.10.2

Any ideas why it is not working I will highly appreciate it.


texts: Finding path where add-ins are installed for ArcGIS Desktop?

texts:
I see that my add-ins are installed to
C:\Users\Me\AppData\Local\ESRI\Desktop10.0\AssemblyCache{6C90269B-D233-4122-3747-C2AE1131E22C}

Is it possible to find that file path from within the Add-in itself?  e.g., someone would click a button and it would tell them the path where the add-in is located.

I want to use this location to store user-defined configuration info.


texts: Merging OnTheMap's point jobs data with Census Block Groups shapefile using ArcGIS Desktop?

texts:
I'm trying to figure out an easy way to take county level jobs point data (exported from the Census bureau's OnTheMap) and merge it with census block groups in order to give each block group a total amount of jobs.

The idea would be to visualize total jobs in a similar way as you can visualize total population on the block group level.

So far I have my block groups from TIGER block group shapefiles and I have my jobs point shapefile, but combining them is proving difficult as OnTheMap is pretty rough. I could, I believe, select each census block group in OnTheMap and export the data, add it up myself into a spreadsheet and combine them all manually to join by way of block group number, but that would take so long.

There has to be a better way, right?

I figure I should be able to run an anaysis of which points are falling in which blockgroup polygon and intersect them via that, but it doesn't work.