texts: GDAL intersection returning NoneType in Python

texts:
I have two shapefiles, one for landuse and one for subbasin. I want to find out how much landuse area is present within 3rd feature of subbasin shapefile. I am using following code.

fillu = ogr.GetDriverByName('ESRI Shapefile').Open('landusen.shp')
LuLayers = fillu.GetLayer()

filsub = ogr.GetDriverByName('ESRI Shapefile').Open('subs1.shp')
SubLayers = filsub.GetLayer()

LuGeom = [None]*len(LuLayers)
for i in range(len(LuLayers)):   # getting a list of geometries for landuse shapefile
    luf = LuLayers[i]
    luwkt = luf.GetGeometryRef() #geometry type
    luwkt = luwkt.ExportToWkt()
    lugeom = ogr.CreateGeometryFromWkt(luwkt)
    LuGeom[i] = lugeom

SubGeom = [None]*len(SubLayers)   # getting a list of geometries for subbasin shapefile
for i in range(len(SubLayers)):
    Subf = SubLayers[i]            # getting a feature from layer
    Subwkt = Subf.GetGeometryRef() #geometry type
    Subwkt = Subwkt.ExportToWkt()
    Subgeom = ogr.CreateGeometryFromWkt(Subwkt)
    SubGeom[i] = Subgeom

IntArea = 0
for i in range(len(SubLayers)):
    Int = LuGeom[2].Intersection(SubGeom[i])
    print(type(Int)

This is giving me following output

<class 'osgeo.ogr.Geometry'>
<class 'osgeo.ogr.Geometry'>
<class 'osgeo.ogr.Geometry'>
<type 'NoneType'>
<class 'osgeo.ogr.Geometry'>
<type 'NoneType'>
<class 'osgeo.ogr.Geometry'>
<class 'osgeo.ogr.Geometry'>
<class 'osgeo.ogr.Geometry'>

I am wondering why intersection of LuGeom[2] with SubGeom[3] and SubGeom[5] is of 'NoneType' I could calculate individual area of these three features and I can see graphically on QGIS that these three features do intersect.


texts: Creating histogram for slope raster in QGIS?

texts:
I am looking at landslide distribution and I am wanting to look at the distribution of landslides on different slopes. Ideally, I am wanting to create a graph that displays the slope distribution for different landslide activity but also the slope distribution for the whole study region.

I know how to extract slope values for specific landslide points, however I'm confused as how I can use my slope raster to create a graph of slope distributions throughout the whole region.


texts: How to edit Item's Item Properties in a custom Template using Python?

texts:
I am trying to automate the process of creating Map Composers in qgis but I am running in to the problem of editing the contents of a Template that I am using.

For example, how would I edit Map 0, LEGEND, EXHIBIT NUMBER, and LOGO just using python? Is there a specific library I need to be able to process the template?


texts:
I am working with QGIS and I have two different polygons, one with municipalities and another with conservation units (from Brazil).

I need find out which Conservation units falls within 50 km from every municipality.

It would be great to create a new polygon layer only with municipalities that are close to a Conservation Unit and with an attribute called UCs that contains every Conservation Units within a 50 km distance (but also keeping the original municipalities attributes).

Have I made myself clear?

I'm using QGIS because it seems easier , but, latter on, I will read this data from R. If the calculations are performed better with R, it would be better for me.


texts: Determining Y coordinate for Create Fishnet from desired Angle of Rotation using ArcPy/Python?

texts:
In How Create Fishnet works from the ArcGIS Help it says:

Calculating a value for the y-axis coordinate
If you know the angle of rotation, you can compute a value for the Y-Axis Coordinate parameter as follows:

Tangent of angle = x-coordinate / y-coordinate

Fishnet Y-Axis point calculation
For example, the angle is 60 degrees. Assuming the y-coordinate to be 10, then

x-coordinate = tan(60) * 10 = 1.732 * 10 = 17.32

The y-axis coordinate point is (17.32,10).

In Python.

x-coordinate = (math.tan(math.radians(60) * 10) * 10)
print x-coordinate
>>>17.32

Perfect that's correct!

Now lets try using a real coordinate

Lat = 51.003757 Long, -114.09341083433694
or in NAD83 UTM Zone 11
x, y = 703919.581359, 5654264.1538 in UTM Zone 11

Using the same formula replacing 10 with the y-coordinate of the lat/long, and x,y of UTM as above none of the results make sense. What am I missing?


texts: How to remove spikes from grid in SAGA GIS?

texts:
I tried to get a grid by interpolating LAS file using Ordinary Kriging. But the product grid has many pixels which values strongly stands out from average surface - I mean one pixel sinks nad spikes. I know that sinks can be easily filled with preprocessing modules, but I found removing spikes more complicated.
Is there any automated way to remove them? For instance a module which could get rid of pixels with values that stands out from their neighborhood?


texts: Is it possible to use full network paths in QGIS rather than relative paths or drive paths?  I use a remote desktop connection to log in to a machine where some QGIS work is done, however when ting to open these projects on my local machine, I get the "handle bad layers" message due to the file paths being different for layers stored on different network drives. people map these drives to different letters around the different offices so to use the full network address in the file paths would get around this issue hopefully.


texts: QGIS Start and endpoint marker line and polyline

texts:
I have a DWG file with lines and polylines.

I would like to know how to make a point at each side of the line. Like a startpoint and a endpoint. I do not want any points in the middle just start and end.

I use Qgis


texts:
I have a map in shapefile format with buildings. I'd like extract the coordinates of this polygon. E.g. if a house has a polygon of four points, I'd like to know the coordinates of those points and how to know which points belong to the same building.

I'm very new with ArcGIS, so please bear with me. I can get centroids of this buildings in a table, but not boundary points. If I click on a single point on a boundary, the identity shows different X and Y points, but can't figure it out how to extract them in a single table.

I can't seem to find a similar example on this forum...


texts:
Dataset: English Regions boundaries, merged with those of Wales and Scotland, all from the ONS (UK stats body). Creates a multi-polygon layer because of the islands within each region.

Problem: Adding a column in the attribute table for $area, returns NULL for all areas except London (the smallest).

To try and narrow down the issue I converted the multi-polygon to singles, then ran $area again and it produced values for the smaller areas (islands), but not for the main areas (eg Scottish Mainland, West Midlands etc), it also didn't produce a value for the large Isle of Lewis, but it was still OK for London (which I think is smaller than Lewis), so I think this is possibly to do with the size of the areas, but why? And how do I work around it?

I have also converted the polygons to lines and back to polygons jut in case it highlighted a problem with the polygons, but still had the same result.

Any ideas?

In the image below: red highlighted areas are producing NULL for $area, green areas returning values for $area.


texts: Problem with st_clusterWithin and conditions

texts:
I need help because I am always in front of a problem in PostgreSQL since several weeks:

I have the following table (extract):

Id for the identifier
geom for the geometry of the polygon
burndate for the date of combustion of a surface (polygon)
year and month of the combustion

Here is my objective:

I wish to group polygons according to following both conditions:

they have to be distant from more than a certain fixed distance (this works with st_clusterwithin, I fix here the distance in 250m)
the difference between burndate values of groups polygons have to be inferior to 7 (that's the problem)
finally I would like to add to my generated table the minimum burn date of each polygons group

Here's my SQL Code:

DROP TABLE IF EXISTS view_eurasie;
CREATE TABLE view_eurasie AS
SELECT unnest(st_clusterWithin(tab.geom, 250)) AS cluster_field,
CAST (tab.annee AS integer) as annee,
tab.mois as mois,
FROM public."2003_08" as tab
GROUP BY ANNEE, MOIS, burndate;
ALTER TABLE public."view_eurasie" ADD COLUMN "identifiant" BIGSERIAL
PRIMARY KEY;

Here's the generated table (extract):


texts: Creating DateSlider for display GFS data in Earth Engine

texts:
I am trying to adapt script from Daniel Wiell on accessing GFS data and add the DateSlider on it. Unfortunately no success.
My goal is can access 24-hour forecast data from every date that I chosed from the slider. My code is below:
var region = ee.Geometry(Map.getBounds(true))

// Strip time off current date/time
var today = ee.Date(new Date().toISOString().split('T')[0])
var start_period = ee.Date('2015-07-01');

var collection = ee.ImageCollection('NOAA/GFS0P25')
  .select('total_precipitation_surface')
  // Might not have date for today, so include yesterday too
  .filterDate(today.advance(-1, 'day'), today.advance(1, 'day'))
  // Sort so latest can be picked by taking first
  .sort('system:time_start', false)

function forecast(hours) {
  var image = collection
    .filterMetadata('forecast_hours', 'equals', hours)
    // Since colleciton is sorted descending, if there are forecasts
    // for both yesterday and today, first() will give today.
    .first()
  var date = image.date().advance(hours, 'hours')
  return image
    .set('date', date.format())
}

// UI widgets needs client-side data. evaluate()
// to get client-side values of start and end period
ee.Dictionary({start: start_period, end: today.advance(1, 'day')})
  .evaluate(renderSlider)

function renderSlider(dates) {
  var slider = ui.DateSlider({
    start: dates.start.value,
    end: dates.end.value,
    period: 1, // Every 5 days
    onChange: renderDateRange
  })
  Map.add(slider)
}

function renderDateRange(dateRange) {
  var gfs1day = ee.ImageCollection([24].map(forecast))
      .filterDate(dateRange.start(), dateRange.end());

  var vis = {min: 0, max: 200, palette: [
      'cccccc','f9f3d5','dce2a8','a8c58d','77a87d','ace8f8',
      '4cafd9','1d5ede','001bc0','9131f1','e983f3','f6c7ec'
    ]}
  var layer = ui.Map.Layer(gfs1day, vis, 'GFS 1-day')
  Map.layers().reset([layer])
}

Link to GEE code
Any idea where my error is?


texts: Automated Importing of Landsat with new USGS MLT metadata file

texts:
Has anyone had any luck importing Landsat with the updated MLT files?

Besides ENVI 5 SP1 I see no software that can create images from these new files.

I can do a manual layer stack but then the band data is not embedded in the header and so I can't pan sharpen and manually updating the headers is a pain when I'm trying to import several dozen files.


texts: ArcGIS stops responding during Georeferencing Save?

texts:
Im using ArcGIS 10.2.  I had an ealier problem that I think I found an answer to here while georeferencing an aerial photo. My current issue is that whenever I go to rectify the georeference points, the program stops responding.

I've made sure I'm saving the .tiff file to where the original image is located so no issues there. After having this happen a couple times I realized the program was still saving the georeference points and I could force shut down ArcGIS, open it up, and reference the new .tiff file in.

I think it's strange that the program stops responding (to the point where I have to close it) but still saves the file I was trying to save in the first place? Does this happen to anyone else and/or does it indicate something about my computer or ArcGIS program?


texts: How to limit GEOjson data to specific area?

texts:
I am currently working with a shapefile from the United States Drought Monitor that countains all drought data from all of the states in the US. I am converting it to geojson with ogr2ogr and would like to filter the geojson output so that it only contains data within the bounds of California. How can I do this?

I am wondering if there are optional arguments I can pass in to something like ogr2ogr -f GeoJSON drought.json  USDM_20140617.shp

Or would I only be able to limit the results by doing a join between shapefiles (for example, a join with a shapefile that contained data for California's boundaries)?

Shapefiles are here

Thanks!


texts: How to make a different font and color of text in labels?

texts:
Is it possible to make a bold or italic, and change the color of individual words Label?
Example: the first line is bold in red text, font 12, second row 10 green italic font


texts: Is Javascript/AJAX still supported in ArcGIS 10?

texts:
A colleague of mine claims that the ArcGIS Javascript web API is not supported for ArcGIS 10+.  I searched their website but all the information seemed to indicate that it should still work.

Any insights?


texts:
I have a requirement to access WFS services (using Esri/WfsLayer) which are hosted in remote servers and I have to use Esri provided proxy code due to CORS policy issues.
My application is deployed in domain1.com and I am planning to deploy the proxy service in domain2.com.  I was trying with this approach, but couldn't achieve it using the codebase given here(jsp) . I am getting the same CORS issue with this.
Could anyone confirm if this is possible to do?
Because the proxy requests works if both application and proxy services are deployed in the same domain (I tested the same using sample application). But unfortunately I cannot deploy the proxy code in the same domain where my application is deployed.
My Proxy.config file is as follows
<ProxyConfig allowedReferers="*"
               logFile="proxy_log.log"
               logLevel="INFO"
               mustMatch="true"> <serverUrls>
<serverUrl url="https://xxxxxxx/arcgis/services/xxxxx/MapServer/WFSServer" matchAll="true"/>
</serverUrls> </ProxyConfig>


texts: How to find out Actual coordinate(pixel values) of chunk relative to the actual image?

texts:
I have an image of let say 500 X 500 px, I created tiles/chunks of size (10, 10). Now I want to find out actual chunk coordinate relative to the Original 500X500 px image.

Ex
I have first chunk of size (10, 10), the coordinates in this will be liks this

[0, 0][0, 1]..........[0, 10]
[10, 0][10, 1]........[10, 10]

Now for the each coordinate(x, y), How to find out the Actual coordinates in Original Image?


texts: How to merge raster scenes while maintaining small file size?

texts: I have 4 scenes of raster images that I need to merge. Average size of the scenes is only 60 MB, but the merged scene ended up at 6 GB in file size. Does anyone know why this happened?


texts: Popover displacing from position when zooming OpenLayers 3

texts:
I have some markers in position with OpenLayers 3, and now I am trying to get the Popover onto them.

The problem is that when zooming in/out, Popovers don't remain with the marker. I want to make it such that when I am zooming in/out the Popover remains with the marker.

To get coordinates I am using a click function and I fetch the pixel coordinates on the click.

  private markerBubble(ev:any){
   var _this=this;
    const marker_bubble: HTMLElement = document.createElement("div");
    marker_bubble.setAttribute("class", "marker-bubble");
    this.info_bubble.appendChild(marker_bubble);
    marker_bubble.innerHTML = "Test1 123";
    var pixel = _this.map.getEventPixel(ev.originalEvent);
    console.log(pixel,"markerbubble");

    $(marker_bubble).css({
        top: pixel[1] - UtilityConst.ENTITY_MOVEMENT_CONST.PlayControl_TOP_DELTA,
        left: pixel[0] + UtilityConst.ENTITY_MOVEMENT_CONST.PlayControl_LEFT_DELTA,
        position: "absolute",
        background:"white"
    });
    $('.marker-bubble').draggable();

}

Here is the click function I am using:

 private handleClickOnMap(ev: any) {
    var _this=this;
    if (this.canSelectMarkers()) {
        const evt: MouseEvent = ev.originalEvent;
        // process only if markers found on click
        const features = this.getFeatureListByEvent(ev); // GIS specific event object needs to be passed here
         this.checkAndExpandOverlappedMarkers(features, ev);
        if (features.length > 0) {
                //popup to be placed.

                var pixel = _this.map.getEventPixel(ev.originalEvent);
                this.markerBubble(ev);

         }
    }
}


texts: How to horizontally move polygon on top of the TIN or DEM?

texts:
I am wondering if there is any effective method to shifting the polygon (to right hand side) to above the ridge in ArcScene?

It shifts around 60 meters which make my analysis inaccurate. Do you know how to solve this? I also attached the image in order to make you easier understandable what happens.


texts: Creating coverage map in google maps using .tab file?

texts:
I used MapInfo Professional 11.5 to convert a .tab file to .kml file of google maps.

However, the converted .kml file has a great size(80Mb), so i cannot use this .kml file in google maps.


texts: how to determine drive times like those available in google maps

texts:
I'm very new to GIS but have played around a bit with postGIS and qGIS.

I'm wondering if there's a way to generate drive time estimates like those given by google maps using open source tools.

For a small number of routes I can query google maps, and scrape results but I'm sure there's a better way.

Thanks


texts: Are there any known issus opening a QGIS Desktop project on Android?

texts:
Does anyone else have trouble when they try to open a project which was worked on in the QGIS desktop version 1.8 (I understand this is the most up to date version for the desktop) and try and open it up and work on it in the Android version of QGIS (I understand the most up to date version is 1.9).

Is it possible to have projects that work in both the desktop and Android version or could the problem be that the original project is in an earlier version?


texts: Any Examples of D3.brush() used with Leaflet?

texts:
I have a leaflet map that I have placed an SVG "on top of" using the leaflet overlay pane. I want to add a D3 brush to the overlay pane that will then update a separate chart. I've looked around for any examples of simultaneous D3.brush() and leaflet examples but can't seem to find any.

The closest thing I found was this https://github.com/mbostock/d3/issues/1321 and this https://www.mapbox.com/mapbox.js/example/v1.0.0/timeline-scaled-markers/ (this is brushing the chart not the map).

I was wondering if:

  Anyone knew of any examples, OR
 Anyone knew if this was possible/reasonably straightforward, OR
 If possible, anyone had any tips on the sort of issues I might encounter.


texts: Adding new domain field for multiple feature classes?

texts: I want to add new domain field "Owner" in multiple feature class for one GDB


texts:
I am using following configuration of my server configured in VM with Domain “my.net.mil”.

I had created one Group named “GISADMINGROUP”  and a user “gisadmin” member of GISADMINGROUP and another user “gisuser” a simple user.

Now I am trying to establish Geoserver authentication provider using LDAP as setting  shown below: I think there is a problem with server url – http://sach/dc=my,dc=net.mil

With above setting I am getting following errors.

Can anyone help me with the issue?


texts: Parsing Geometry to Latitude, Longitude is failing

texts:
I have a table 'geocodes_raw' of locations with Latitude and Longitude values.

Loc_Nm || geocode_latitude || geocode_longitude
   A   ||    43.43044      ||    -80.0910793
   W   ||    43.9114523    ||    -80.0911329
   X   ||    43.9209011    ||    -80.091323
   Y   ||    43.9083203    ||    -80.0913039
   Z   ||    43.914577     ||    -80.091198

I have a geometry table with area names (shown below) which has been converted from Shapefile through ogr2ogr with following command.

ogr2ogr -f MSSQLSpatial "MSSQL:server=RBANSAL\SQLEXPRESS;database=MySpatial;trusted_connection=yes" "C:\Users\rbansal\Downloads\ELECTORAL_DISTRICT.shp" -nln "ELECTORAL_DISTRICT_NEW" -lco PRECISION=NO -progress

I need to group the Table1 locations into specific regions as per Table2. I am using a query utilizing below-mentioned snippet.

select * from MyDB.dbo.Spatial_Data s, MyDB.dbo.geocodes_raw g
where ogr_geometry.STContains(geometry::Parse('POINT(' + CAST(g.geocode_longitude AS VARCHAR(20)) + ' ' + CAST(g.geocode_latitude AS VARCHAR(20)) + ')'))=1;

It returns zero records.

Question Updated:

But, when I load the same shapefile through shp2sql.exe tool. I get the following table. Please, note the difference in the beginning text under the geom column.

This time, the same query works and gives me correct results.

select * from MyDB.dbo.Spatial_Data s, MyDB.dbo.geocodes_raw g
where ogr_geometry.STContains(geometry::Parse('POINT(' + CAST(g.geocode_longitude AS VARCHAR(20)) + ' ' + CAST(g.geocode_latitude AS VARCHAR(20)) + ')'))=1;

What's going wrong when I am loading the shapefile through ogr2ogr


texts: Serve bathymetry layers on a map according to zoom level

texts: I have geometry type records in PostGIS database - arrays of water bodies coordinates and depths. I want to display water body polygons on the map. When a website loads up, it should show more abstract layers to avoid excessive loading and get more detailed ones while zooming in. What tools would recommend to use to serve water body layers according to zoom level? How to implement it?


texts: QGIS explode line function fails with OSM file

texts:
I am exporting a small extract from OSM. I load the lines(layer 1) into QGIS and apply the function Explode lines. I get the error:

Algorithm Explode lines starting...
__len__() should return >= 0 See log for more details

Can anybody reproduce that? Is there a workaround that?


texts: Projection problem shapefile / layer created with LAS tools

texts:
I am a beginner with QGIS and I have been working on creating layers with LAStools and shapefiles of the city of Rio de Janeiro.

Both data are provided by the city, so shouldn't contain any error. My two first layers ("cobertura4618" & "Regiao Metropolitana") are aligning perfectly when I project them on the same system EPSG 4618 - SAD 69. But the last layer "output vector file" (created through lastools and projected on the same system) doesn't overlap with the others even if I have projected it on the same system like the others.

The on-the-fly CRS tranformation is disabled. "Prompt for crs" is selected.
I have used always the same method to project the layer on EPSG 4618 - SAD 69 : right click on the layer "save as" > "selected CRS" > ok.

I have read a lot of posts about projection problem but none of them helped to solve my problem.


texts: Automate attribute table changes in QGIS

texts:
I have several line Shapefiles, each displays a hiking trails and they all have a disastrous chaos in their attribute table (let us call the fields A,B, C,D and they are not equal in the tables). The name of the shapefile is the name of trail (nameA.shp etc.).

I'd like to clean the attribute table automatically to have the name of the shapefile as a new field "name" and if there are more than one object, the should be named like "nameA1; nameA2; and so on).

I started to this by hand but it takes hours. Any ideas?

I need this step to finally merge all shapefiles to a single one without losing the name of the trails.

I use QGIS las palma on a Mac.

edit 01.06.2017
This is the script after I ran it:

Python Console
Use iface to access QGIS API interface or Type help(iface) for more info
import os
from glob import glob
from PyQt4.QtCore import QVariant
files = []
#CHANGE NR1 --> THE PATH
start_dir = r"/Users/Kevin_privat/Desktop/Shapedateien Test"
pattern = "*.shp"
for dirpath, dirnames, filenames in os.walk(start_dir):
    files.extend(glob(os.path.join(dirpath,pattern)))
#CHANGE NR2 --> THE COORDINATE SYSTEM AND LAYER NAME
all_lines = QgsVectorLayer('LineString?crs=EPSG:4326‘, "all_my_lines", "memory")
  File "<input>", line 1
    all_lines = QgsVectorLayer('LineString?crs=EPSG:4326â, "all_my_lines", "memory")
                                                                                ^
SyntaxError: EOL while scanning string literal
all_lines_pr = all_lines.dataProvider()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'all_lines' is not defined
all_lines_pr.addAttributes([QgsField('new_id', QVariant.Double)])
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'all_lines_pr' is not defined
all_lines.updateFields()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'all_lines' is not defined
for i in files:
    os.path.basename(i)
    linelayer = QgsVectorLayer(i, os.path.basename(i), "ogr")
    features_linelayer = linelayer.getFeatures()
    lines_list = []
    for feature in features_linelayer:
        new_feature = QgsFeature()
        new_feature.setGeometry(feature.geometry())
        new_feature.setAttributes([os.path.basename(i)+'_'+str(feature.id())])
        lines_list.append(new_feature)
    all_lines_pr.addFeatures(lines_list)
QgsMapLayerRegistry.instance().addMapLayer(all_lines)
  File "<input>", line 12
    QgsMapLayerRegistry.instance().addMapLayer(all_lines)
                      ^
SyntaxError: invalid syntax


texts: How can I prevent Leaflet from moving my marker while zooming into the map?

texts:
If I use the leaflet code described in the documentation, use another marker url AND change the iconSize, the marker moves when zoomed in/out.

It doesn't move if I keep the iconSize as it is. But than the marker looks like crap.

This is the original Leaflet code:

var myIcon = L.icon({
    iconUrl: 'my-icon.png',
    iconSize: [38, 95],
    iconAnchor: [22, 94],
    popupAnchor: [-3, -76],
    shadowUrl: 'my-icon-shadow.png',
    shadowSize: [68, 95],
    shadowAnchor: [22, 94]
});
L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);

This is how I manipulated it (only coordinated, image url and size are changed):

var myIcon = L.icon({
    iconUrl: 'https://raw.githubusercontent.com/iconic/open-iconic/master/png/map-marker-8x.png',
    iconSize: [32, 32],
    iconAnchor: [32, 32],
    popupAnchor: [-3, -76],
    shadowUrl: 'my-icon-shadow.png',
    shadowSize: [68, 95],
    shadowAnchor: [22, 94]
});

L.marker([52.55, 13.47], {icon: myIcon}).addTo(map);


texts:
I was wondering if it is possible to get ArcMap 10.5 layouts to have frames similar to the one in this image (produced in Matlab),

rather than the default square/rectangle that my data is currently being framed in?


texts:
I have this function:

def my_function(self):
    layers = self.iface.legendInterface().layers()
    indexz = self.dlg.comboBox.currentIndex()
    layer=layers[indexz]

    Field_list = []
    self.dlg.comboBox_2.clear()
    for field in layer.pendingFields():
        Field_list.append(field.name())
    self.dlg.comboBox_2.addItems(Field_list)

When I run it I get this error:

TypeError: QComboBox.addItems(QStringList): argument 1 has unexpected type 'type'

Can somone explain what it means?


texts: Has anyone had any success using the Stack Profile tool in ArcGIS with a terrain dataset as a profile target?

texts:
Has anyone had any success using the Stack Profile tool in ArcGIS for Desktop [Advanced] with a terrain dataset as a profile target?

I have successfully used this tool with a raster dataset as a profile target but when I use a terrain dataset the tool fails. It writes out an empty table and returns

  Error 999999

with the message:

  table not found


texts:
krig_Gaussian<-krige(formula=(B)~1, locations=Amb_m, newdata=gd_m, model=model_Gaussian.variog_m)
[using ordinary kriging]
Warning messages:
1: In proj4string(d$data) :
  CRS object has comment, which is lost in output
2: In proj4string(newdata) :
  CRS object has comment, which is lost in output
3: In proj4string(newdata) :
  CRS object has comment, which is lost in output

This is my code. Can someone help me on this?
#variogram
Boron.var_m <- variogram(log(B)~1, Amb_m)
plot(Boron.var_m)

#models
model_Gaussian.variog_m<-vgm(psill=1.35, model="Gau", nugget=1, range=0.065)

fit.variog6_m<-fit.variogram(Boron.var_m, model_Gaussian.variog_m)
plot(Boron.var_m, fit.variog6_m)

krig_Gaussian<-krige(formula=(B)~1, locations=Amb_m, newdata=gd_m, model=model_Gaussian.variog_m)

where Amb_m is spatialpointdataframe, gd_m is the grid for newdata, B is the observations on boron samples.


texts: Postgresql - Snap intersecting and broken MultiLineString

texts:
Im trying to use Postgresql to fix a few thousand hiking trails that i have in a map source. Now i have all of the trail parts as MultiLineString but my issue is that each of the trails are broken into multiple MultiLineStrings. Some of them seme to intersect at the point between the lines but some are broken so that there might be a few meters between the lines, i would like to set a tolerance for what distance is allowed between the end of the lines for them to be joined. In total i now have 57000 lines that i need to process. How can i solve this with Postgresql?
Example of intersecting line that is broken:

Example of line that is broken with space between the lines:


texts: Geoserver WMS layer is hiding the basemap in a Leaflet map

texts:
When I add two layers to a Leaflet map (a basemap and a Geoserver WMS), the basemap disappers. But when its tiling, it can be seen for a moment.

What's the problem? Maybe it's due to the transparency or to the zIndex?

This is the basemap (OSM)

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
        attribution: '&copy; OpenStreetMap contributors',
        zIndex: 2
    }).addTo(map);

and this is the Geoserver WMS

var wmsLayer = L.tileLayer.wms('http://188.213.174.15:8080/geoserver/wms?', {
    layers: 'varymaps:badacstur',
    transparent: true,
    zIndex: 1
}).addTo(map);


texts: Is it ok to replace "#" in address with "Suite" for millions of addresses of businesses?

texts:
I have a big list of addresses of businesses that I am trying to "normalize".

What keeps happening is that, every now and then I verify the address of the place by going to their website and all too often, what is within my database as "100 Forest Park Drive # 100" is really "100 Forest Park Drive Suite 100"

I have not yet come across any entry where I have it written as Suite which is in reality #

I am not an expert, but it seems to me, that the # sign is interchangeable with "Suite".

Maybe the experts can chime in, and help me. In your experience, are there are any places where I better leave the # sign intact, instead of running a sql replace function to # to Suite.

Some research I have conducted in google suggests to me, that even USPS suggest that I only use # in absense of an Apartment, or Suite. And it just seems to be that Suite is more likely in a business environment, since if a business leases a space within a building, it would be more likely called a "Suite".

As an evidence, when I used to live in an apartment, if I used Suite instead of 123 SW apartment drive suite 20 the mail was delivered correctly to me 100% of the time.

As an added bonus, Suite looks much cleaner.

EDITS

I should have added that I already have all of these addresses geocoded, and the use case is not to be used as a mailer of any form. Simply as search.

And I did not intent to purely use find a replace. Running regular expressions on my address strings is how I discovered the issue in the first place when I started to discover many variations.

Take for example:
5619 DTC Parkway, Greenwood Village, CO

I have three businesses on this address in my database and the format that they use.

Podoll & Podoll (Suite 400)
EPS Settlements Group (Suite 600)
Frank Patternson and Associates. (# 1100)

The data in the parenthesis is a exact copy of the information on their website and my database. (Suite & #)


texts: How to add meters to EPSG:4326 coordinates?

texts:
I've some lat/long in EPSG:4326 coordinate system like Eiffel Tower position : ["lat" : 48.858274,"lon" : 2.2944]

For automated tests I would like to get, for every points of my dataset, the x and y coordinate of the location 100 meters Eastern of my dataset's point.

How can I calulate it?

PS : it'll be implemented in Java


texts: How to link two rows in attribute table to the same polygon?

texts: There are two rows in an attribute table. I want to link both rows to the same polygon. How can I do this?


texts: Transform/Align Census 2000 Blocks to Census 2010 Blocks

texts:
I would like to align census tabulation blocks from the 2000 and 2010 censuses. I have the relationship file, so I know which blocks are suppose to the same and which were split or consolidated. However, when overladed, the geometries don't match up. More over, the number of points can be different. (The Census 2010 blocks have more detail in them.)

(Red is the 2000 census boundaries, black are the 2010 boundaries)

I was thinking that the bounding boxes of the blocks that should be "identical" could be used as a better (but still rough?) proxy and GCP points could be generated for the bounding boxes and used to better align the blocks.  The problem is that I'm not sure what to do once I were to create said bounding boxes.

I'm also open to any other methods of trying to align these geometries.

(For reference, I'm attempting to compute the % overlap for the blocks so that I can do something similar to the Brown University Longitudinal Tract Database and project the 2000 data into the 2010 geometries.)

Unfortunately, the ids for each block changed significantly. (Although, for posterity, it seems as if the tract ids were better preserved, probably since there were many fewer changes made.)


texts: Viewing downloaded .tif file from planet labs?

texts:
I am trying to download a specific area of interest using planet API.
I've activated the image containing my area, which seems successful.
Then I'm downloading the tif file, which also gives a result, though not expected.   My implementation is in python.

Here is my activation.py file

import os
import requests

item_id = "20161015_204133_1_0c0b"
item_type = "PSScene3Band"
asset_type = "visual"

PL_API_KEY='your key'

session = requests.Session()
session.auth = (PL_API_KEY, '')
# request an item
item = \
session.get(
("https://api.planet.com/data/v1/item-types/" +
"{}/items/{}/assets/").format(item_type, item_id))

# extract the activation url from the item for the desired asset
item_activation_url = item.json()[asset_type]["_links"]["activate"]

print("Activation URL: ",item_activation_url)

# request activation
response = session.post(item_activation_url)
print(response.status_code)

This is my response.

Activation URL:  (removed api url)
204

And my area of interest file, subarea.geojson

{
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "properties": {},
          "geometry": {
            "type":"Polygon",
            "coordinates":[
               [
                [
                  -121.92309379577637,
                  37.720983558420585
                ],
                [
                  -121.92190825939177,
                  37.71960024532617
                ],
                [
                  -121.92086756229399,
                  37.720139146443614
                ],
                [
                  -121.92214965820311,
                  37.72150547658797
                ],
                [
                  -121.92309379577637,
                  37.720983558420585
                ]
              ]

            ]
          }
        }
      ]
    }

Here is my download.py file

    from osgeo import gdal
    from requests.auth import HTTPBasicAuth
    import os
    import requests

    item_id = "20161015_204133_1_0c0b"
    item_type = "PSScene3Band"
    asset_type = "visual"
    item_url = 'https://api.planet.com/data/v1/item-types/{}/items/{}/assets'.format(item_type, item_id)

    PLANET_API_KEY= 'xxxxxxxx'
    # Request a new download URL
    result = requests.get(item_url, auth=HTTPBasicAuth(PLANET_API_KEY, ''))
    download_url = result.json()[asset_type]['location']

    vsicurl_url = '/vsicurl/' + download_url
    output_file = item_id + '_subarea.tif'

    # GDAL Warp crops the image by our AOI, and saves it
    gdal.Warp(output_file, vsicurl_url, dstSRS = 'EPSG:4326', cutlineDSName
    = 'subarea2.geojson', cropToCutline = True)

Note: I did make sure the area of interest is present inside the subarea(refer item_id).

Result file here.
My result Image .tif file

Im opening the file using qgis,  I got nothing.


texts: On line shapefile, how to compare attribute between consecutives edges

texts:
I have a line shapefile with speed restriction attribute on each edge.
I like to verify differences between two consecutive edges for all shapefile edges.

Example: One line has speed restriction set to 120 and the next consecutive edge has speed restriction set to 50.

I want these differences selected, or highlighted.

My problem is that I have major differences between edges that isn't according to reality, and I need to verify each one of those.

My shapefile is dissolved using speed restriction attribute, I'm using ArcMAP 10.1.

Anyone has a clue on that?


texts: GCS and PCS data misalignment in ArcMap when zoomed in

texts:
I have a shapefile in NAD83 UTM18 which I need to get into GCS NAD83. I tried both loading it into an empty GCS NAD83 feature class directly and the "project" tool. The results are the same - the source and the converted line up perfectly until zoomed in to a large scale (such as 1:3) when misalignment between the two can be seen consistently. This happens regardless of whether the data frame is set to GCS or PCS.

Is this a display issue, or due to insufficient accuracy of the on the fly conversion? Or maybe there are more complex reasons?


texts: Clipping and merging tiles using GDAL based on bounding box from PostGIS?

texts:
I have a set of polygons in PostGIS DB.

I also have a set of GeoTIFF files.

I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.

I found method here:
Merging GDAL tiles and crop via bounding box?

So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?


texts:
First of all:
Windows 8.1
QGIS 2.8.2 Wien

I used the GRASS module r.watershed to delineate watersheds and get flows with a DEM. It worked fine so everything is OK so far. But now what I want to do is to export these new GRASS raster layers to Geotiff, and later to vector polygons or lines, in case of flows.
On the one hand, I tried to use the GRASS module r.out.gdal.gtiff (Export raster to GeoTiff) but the problem is that the file format it exports is NOT Geotiff! (I don't know why?) And on the other hand, I try to right-click on the  GRASS raster file and choose "save as" then I choos Geotiff format, ok, and.... Crash... Finally, I chose to do the same "save as" only the view area, and it works, but the Geotiff I get is totally grey, can't find the way to see the polygons I got when it was the GRASS raster. I don't know what am I doing wrong... :( (Screenshot: "basinsmoshi" is the new .tiff file, completely grey).

I wish anyone could tell me how to save this GRASS raster file into a Tiff and then into a vector file, so I can edit the polygons, etc...

The answer by @xunilk didn't work. Let me try to explain with more detail.
First: I already did the watershed delineation with GRASS using r.watershed:

Second: I tried what you said, r.out.gdal with the same parameters.

Finally, I ran it, successfully finished, but... when I load the new raster, it simply has no content (values are "nan nan"):

So again, I am sure I am doing something wrong :( but I don't know what it is. The only thing I want is to have these watersheds as polygons in a .shp file, if you know about any other method?


texts: How to resample a raster layer to match a specific raster layer's cell size?

texts:
I would like to resample the cell size of a GeoTIFF raster layer with dimensions equal to the reference file (a Sentinel-2 B12 band with 20 m resolution to 10 m resolution).
I use the following code but doesn't work because the new raster created remains the same with 20 m resolution of cell size. Can someone help me with this?


texts: How to compress ecw when gdal_translate from tiff to ecw?

texts:
I wish to translate geotiff 16gb to ecw, cause current size is so big. but when I run

 sudo gdal_translate  ppp_2020.tif ppp_compr.ecw -co "COMPRESSION_RATE_TARGET =80"
0...70...80...90...100 - done.

I have .ecw = 84 gb!!!

terminal throws this:

Input file size is 432000, 48803
Warning 6: driver GTiff does not support creation option COMPRESSION_RATE_TARGET
0...10...20...30...40...50...6

How to compress target ecw from geotiff?


texts: Atmospheric effects on extracting soil from BSI index?

texts:
I need to extract soil from Bare Soil Index (BSI) using Landsat 8 and Sentinel 2 images in QGIS or IDRISI.

I was told to start with basic atmospheric correction of bands by finding in the histogram the first value that isn't 0, subtracting it from the whole raster band and reclassify any negative values to 0.

I did that, calculated BSI and there's no way of extracting soil using a threshold without urban areas. They have the same values.

I also calculated BSI using non-corrected bands and it worked out much better, soil pixels are easier to extract without getting urban areas as well.

Is this simple atmospheric correction based on histogram values necessary for ALL spectral indices, or maybe only for vegetation indices like NDVI, SAVI etc. but not for BSI?


texts: Getting attachments with token in a map service

texts:
I have successfully built the functionality to load an image stored as an attachment in Silverlight by retrieving the URL of the attachment and binding to it:
(http://Server/ArcGISServer/rest/services/PublishedMap/MapServer/0/3/attachments/4)

However I have implemented token authentication and I was wondering if it's still possible to retrieve the attachment. I can't seem to get it now.

Do I need to embed the token to the URL or something?

(https://Server/ArcGISServer/rest/services/PublishedMap/MapServer/0/3/attachments/4?token=WCQfGMQZ7SmTProN6fX4SZRBr_0pRFDCvYGzkO2I9BlY2vdsKtQRXoHj8pVoFL_izGuLKiBzd3zZlqFv5U767Q..)


texts: Creating bathymetric contours using shoreline point data and transect point data in ArcGIS Desktop?

texts: I have been given a set of depth points for a waterbody that were taken along the shoreline and along linear transects. What is the best way to use these points to interpolate/extrapolate bathymetric contours for the entire waterbody? Previous attempts result in contours that are "pinched" around the transect points and don't appear to be interpolated fully for an accurate depiction of depth (see images below).


texts: Iterative Processing for make NetCDF table View in ArcGIS Desktop?

texts:
I am trying to process NetCDF file using Make NetCDF view table but do not understand where it stores output?

I have 32 nc file for which I am using ModelBuilder.


texts: How to adjust the resolution of one raster to the resolution of another raster

texts:
I have two rasters, both showing forest cover. I eventually want to use one to mask the other, so I'm trying to get them to the same extent and resolution. I matched the extent by simply cropping one raster to the extent of the other using extent() and crop().
So now I have these two rasters
mang2000crop and loss
> mang2000crop
class      : RasterLayer
dimensions : 144000, 144000, 2.0736e+10  (nrow, ncol, ncell)
resolution : 0.000277778, 0.000277778  (x, y)
extent     : -20, 20.00003, -19.99992, 20.00011  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs
source     : C:/Users/user/Documents/r_files/mang2000crop.tif
names      : mang2000crop
values     : 0, 955  (min, max)

> loss
class      : RasterLayer
dimensions : 160000, 160000, 2.56e+10  (nrow, ncol, ncell)
resolution : 0.00025, 0.00025  (x, y)
extent     : -20, 20, -20, 20  (xmin, xmax, ymin, ymax)
crs        : +proj=longlat +datum=WGS84 +no_defs
source     : C:/Users/user/Documents/r_files/Hansen_loss_total.tif
names      : Hansen_loss_total
values     : 0, 19  (min, max)

How can I adjust the resolution of mang2000crop to the resolution of loss? (so from 0.000277778, 0.000277778 to 0.00025, 0.00025)
Also, is there a quick way to adjust the very slight difference in extent?


texts: Extracting image attachments from geodatabase with image names according to attributes in certain field using ArcPy?

texts:
I have data from the field survey using Survey123 for ArcGIS in the geodatabase format. I want to extract all attachments from the geodatabase. I want the name of the image in the extraction to follow the name of the attribute in the "Nama Rupabumi" field as you can see in the following attachment.

Data Survey

I had tried this script from ESRI Support

import arcpy
from arcpy import da
import os

inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)

with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID']) as cursor:
for item in cursor:
    attachment = item[0]
    filenum = "ATT" + str(item[2]) + "_"
    filename = filenum + str(item[1])
    open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
    del item
    del filenum
    del filename
    del attachment

but the image name is not what I want

I don't understand coding like in the python above.


texts: QGIS, Buffer, and Land Use around coordinate points

texts:
I have a large data set with many columns of data where each row has data from a different lat/lon coordinate.

I would like to add land use at each site to this data set. I was thinking of using this data set (https://www.mrlc.gov/viewerjs/), but am open to others.

In QGIS, I would like to record the land use within a certain radius of each lat/lon coordinate, and have the proportion of each land use type at that point automatically go to the csv, which I will then use in R as a variable for a liner mixed model.

How might I do this in QGIS?

So far, I'm thinking it would be useful to create  buffer around all the data points. I found the Fixed distance buffer command in geoprocessing tools, but am having a little bit of trouble because I want each buffer to be the same width across all latitudes, and I'd like that width to be in meters. All of my data is in the US and Canada.


texts: Getting Lat, Long of clicked location using Leaflet API?

texts:
I am using OSM with Leaflet API. Now I want to get the lat and long of a clicked location. I meant something similar to this. ex: http://openlayers.org/dev/examples/click.html

map.events.register("click", map, function(e) {
            var position = map.getLonLatFromPixel(e.xy);
                alert("Lat, Lon : "+position.lon.toFixed(3),position.lat.toFixed(3));

        });

This code in OpenLayers helps to get the lat ,long values... looking for something similar using Leaflet...


texts: Combining two conditions in one filter expression

texts:
I have a Shapefile that shows local municipalities and ward boundaries for South Africa. I would like to filter this layer to only show the wards I am interested in.

For example, my first query finds two wards in a local municipality:

"LocalMun_1" = 'Alfred Duma' AND "WardNumber" IN ('28', '17')

I would now like to add two more wards from a different local municipality:

"LocalMun_1" = 'Mpofana' AND "WardNumber" IN ('2', '4')

How would I combine the two queries into the same filter expression?


texts: Convert coordinates to differnt Spatial Reference System in Python

texts:
I am trying to convert co-ordinates (-33.75, 150) from epsg:3857 to epsg:28356 in Python.

Using both of the examples in post How to convert projected coordinates to lat/lon using Python?, I get the following errors.

With ogr, osr:

"ERROR 1: latitude or longitude exceeded limits"

with projpy:

"RuntimeError: latitude or longitude exceeded limits"

What am I doing wrong?

EDIT: changing to epsg:4326 fixed the issue.


texts: Behaviour ST_Intersection of 3D LINESTRING and 3D POLYGON - Z value with GEOS backend

texts:
I do not quite understand the behaviour of ST_Intersection applied to 3D geomerties when using the GEOS backend. Take this example:

SELECT ST_AsText(ST_Intersection('POLYGON((1 1 1, 6 1 3, 6 4 3, 1 4 1, 1 1 1))'::geometry
, 'LINESTRING(-1 0.5 2, 0 1 1, 2 2 2, 3 3 3, 6 5 2)'::geometry));

This gives me the result:

st_asewkt
---------------
LINESTRING(1 1.5 1.25,2 2 2,3 3 3,4.5 4 2.45)

Visualizing this in 3D gives me:

I have read in another post that for two linestrings crossing it takes the average Z-Value of the linestrings on the intersection point.

But it seems in this case the behaviour is a bit different. Only the edge nodes of the intersection line seem to show the average-Z value behaviour.


texts: How to use ArcGIS Server JavaScript API inside a  tag?

texts:
I need to embed an ArcGIS Server JavaScript API (version 4) map in a client's Content Management System. For reasons unknown to me, the CMS developers said this results in the map's entire DOM being placed inside a <form> tag.

Doing so prevents the map from loading and displaying, although the JS appears to run correctly.

I've put together a simple demonstration at https://codepen.io/slead/pen/QWWedvd - if you comment/uncomment the <form> tag you can see that placing the map inside the form results in the map not displaying, even though the console logs show that the JS has run.

  <form>

  </form>

// JavaScript
require(["esri/Map", "esri/views/MapView"], function(Map, MapView) {
  console.log("Before");
  var map = new Map({basemap: "streets"});
  var view = new MapView({
    container: "viewDiv",
    map: map,
    zoom: 4,
    center: [15, 65]
  });
  console.log("After");
});

How can I enable the map functionality when the map's elements are located inside a <form>?


texts: Changing different multi values based on the FID field using ArcPy?

texts:
Continually to

Changing 1000 values in attribute table using ArcPy?

Change specific rows in attribute table using Arcpy in ArcGIS 10.3

I try to change 850 different values in attribute table of point layer into value "red use" (the total features in this layer is 1300).

I need to change FID start from 300 til FID 1150 and using this code:

import arcpy

lyrName = r"G:\desktop\Project\lyr\point1.shp"
with arcpy.da.UpdateCursor(lyrName, ["name", "FID"]) as cursor:
    for row in cursor:
        if row[1] in (0, 1, 2):
            row[0] = 'no land use'
            cursor.updateRow(row)
            print """Updated row {}""".format(row[1])

Line number 6 is the rows that should be changed. I understand that row

 if row[1] in (0, 1, 2):

should be change- but i don't how.
How can i changed those 850 row with python code, based on FID field?


texts: Calculation of land price based on area and type of land

texts:
I'm new in ArcGIS and I'm working on a evaluation of land value would like to create a calculation routine of land value from the area and the type of area. I would be grateful for help.

I have a shapefile and in my attribute table have 3 columns: TYPE, AREA and PRICE.
The PRICE column would have to be calculated automatically if possible like Shape_Area field in geodatabase.

if TYPE is PLANE -> PRICE = AREA x 100000

if TYPE is PASTURE ROUGH -> PRICE = AREA x 60000

if TYPE is VEGETATION -> PRICE = AREA x 15000

Is it possible to do this in ArcGIS?
If it is not possible to do it automatically then it's not a problem since I have to run the routine once and not three times.


texts: Error reprojecting Landsat with rasterio

texts:
I am trying to reproject on python 2.7 a Landsat8 image from UTM 19N to UTM 18S using rasterio, reading the docs I found and example on the documentation and just change the input, output file and dst_CRS:

import numpy as np
import rasterio
from rasterio.warp import calculate_default_transform, reproject, RESAMPLING

INPUT_raster_1 = "D:\Minam\LC08_L1TP_005063_20170528_20170528_01_RT\LC08_L1TP_005063_20170528_20170528_01_RT_B5.tif"
dst_crs ='EPSG:32718' #output reprojection

with rasterio.open("D:\Minam\LC08_L1TP_005063_20170528_20170528_01_RT\LC08_L1TP_005063_20170528_20170528_01_RT_B5.tif") as src:
    affine, width, height = calculate_default_transform(
        src.crs, dst_crs, src.width, src.height, *src.bounds)
    kwargs = src.meta.copy()
    kwargs.update({
        'crs': dst_crs,
        'transform': affine,
        'affine': affine,
        'width': width,
        'height': height
    })

    with rasterio.open('D:\Minam\wgs84.tif', 'w', **kwargs) as dst:
        for i in range(1, src.count + 1):
            reproject(
                source=rasterio.band(src, i),
                destination=rasterio.band(dst, i),
                src_transform=src.affine,
                src_crs=src.crs,
                dst_transform=affine,
                dst_crs=dst_crs,
                resampling=RESAMPLING.nearest)

The first problem is that there is no module RESAMPLING on library, then this when reading the dst_crs:

rasterio.errors.CRSError: Invalid CRS: 'EPSG:32718'

But that is the epsg to utm 18S. How do I fix it?


texts: Changing to Historical version using ArcPy?

texts:
I am having an issue trying to change to a historical version on an SDE feature class using Python and arcpy.ChangeVersion_management.

I am able to manually change the version to a specific date and time using ArcMap.
I am also able to fully automate the process using ModelBuilder.

When I export the ModelBuilder model to a python script the script runs without error but the version that is selected is the historical version with todays date and not the date selected as the date parameter.

Using Arcmap and the Python window (Geoprocessing -> Python) I can also run the python code without error and the result is the same.  The historical layer is selected with the current date and not the date selected as the date parameter.

Here is the Python syntax I am executing:

arcpy.ChangeVersion_management("Parcels", "HISTORICAL", "", "7/1/2013 4:30:00 PM")

I also get the same results using:

historyDate = datetime.datetime(2011, 7, 1)
arcpy.ChangeVersion_management("Parcels", "HISTORICAL", "", historyDate)

while the following throws a RuntimeError:

historyDate = datetime.date(2011, 7, 1)
arcpy.ChangeVersion_management("Parcel", "HISTORICAL", "", historyDate)

Is this a known bug or am I just going about this the wrong way?


texts: "Add button in toolbar" checkbox: which toolbar?

texts:
When I go in the Processing Settings, under Menus, select an item, check "Add button in toolbar" and click OK, I don't see anything happening. I enabled all toolbars under View > Toolbar and still can't find the item I just added.

Where is it ?

I'm on QGIS 3.6.2


texts: Changing CRS units from meters to kilometers in QGIS

texts:
I have shape files with CRS of SWEREF99  with

+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

The units are all in meters  but I prefer to make a map with coordinates in kilometers.
How can I define a new CRS based on the current one but with kilometers unit?


texts: Trying to cross-reference data in a CSV with a property title layer in ArcGIS

texts:
I have a layer loaded in ArcGIS that contains all property titles in New Zealand:
https://data.linz.govt.nz/layer/50804-nz-property-titles/
Each property in that layer is a polygon with a bunch of meta-data, including a property title number e.g.: SA1C/1381
I also have a CSV with this format (example only):
WKT, id, title_no, status
MULTIPOLYGON (((174.8392348 -36.8863553333, ... ,174.8392348 -36.8863553333))), 4455227, 375631, SOLD

I would like to cross reference the two - i.e. I would like the properties listed in the CSV to overlay and/or highlight the properties in the LINZ properties layer (so I can see all properties sold in a particular area as colour coded red for example).
My questions are:

Is this possible in ArcGIS online (or any other low-cost or free GIS platform)?
If so, how could this be achieved? Can I somehow add the CSV as a layer above and will the WKT polygons be drawn? Or is there some way of performing a filter/search or a logical AND operation between the two data sets?
Is it possible to achieve this purely in the UI + Excel or Google Sheets or would it require someone with Python skills or similar?


texts: Override "ERROR: Operation on mixed SRID geometries" and force PostGIS to do the query

texts:
I'm trying to do an st_intersects query in postgis for two shapes (a point and buffer zone) which are of the same projected coordinate system.

Unfortunately, one of the tables seems to have its table-srid value set to 4326. And yes, the first spatial column added to that table (airports) was of the geographic type (srid=4326). However, that same table has a column in it (added later) which is of the projected coordinate system (srid=2264) that I'm working with.

When I try to run this query:

a = Airport.first
WakeCountyParcel.where{st_intersects(proj_shape, st_buffer(a.cary_proj_point, 5280))}

where cary_proj_point is the projected coordinate point (srid=2264) as is WakeCountyParcel's proj_shape, I get the SRID error:

ActiveRecord::StatementInvalid: PG::InternalError: ERROR:  Operation on mixed SRID geometries

To get around this I simply reconstruct Airport's cary_proj_point to divorce its association from the tainted Airport model

cary_proj_point = RGeo::Geos.factory(:srid => 2264).parse_wkt(a.cary_proj_point.as_text)
WakeCountyParcel.where{st_intersects(proj_shape, st_buffer(cary_proj_point, 5280))}

and all is well. In fact, rails being what it is, I could abstract out all of this code and, say, create a model method for Airport that would return the reconstructed projected point without me ever even having to look at the string-based reconstruction again.

But its a hack and forcing PostGIS to do it anyway without having to trick it would be nice. I furthermore disagree with the concept of having one table per SRID value. I want my database to have geographic and projected spatial objects in different columns of the same table(s) for convenience. How do I over-ride PostGIS's pedagogic error of forcing one-SRID per table here?

Thanks


texts: Retrieve MapBox tiles in vector format rather than raster

texts:
I am using MapBox and I would like to render my tiles directly from vector format but I was not able to find how to retrieve the tiles in vector format rather than bitmap.

So, when I use this url:

  http://api.mapbox.com/v4/mystyle/9/152/191.png?access_token=mytoken

I get a PNG image with my tile 9/152/191 rendered. What I would like is to retrieve this tile in vector format rather than the rendered image, exactly as I can do it with Mapzen for instance:

  http://vector.mapzen.com/osm/all/9/152/191.json?api_key=mykey

But when I use .json instead of .png in the MapBox api, it doesn't work and I was not able to find how to do that in their documentation.

Is there any way to retrieve a MapBox tile in vector format ?


texts: .Net Solution Structure for ArcObjects and Geodatabase programming

texts:
OK - I understand that this is a bit subjective - but you're the best community forum I've got!

So, we are talking about starting a fresh customisation for ArcGIS or a Windows app using Engine.
I often become a little perplexed when trying to create nice clean layers of abstraction between my GUI, business objects and data access layer (geodatabase access).

It often works out like something below:

The PresentationLayer makes calls in BusinessLayer to get data from
database and give back wrapped up in some form of business object -
it is never a ValueObject straight fresh from the database.
In BusinessLayer - I have all my business logic that accesses
DataLayer for data from the geodatabase (it gets back data from the geodatabase via
ValueObjects - DataLayer also uses this assembly).
In ValueObjects assembly, this is just a set of objects that map directly to SDE tables and do nothing else.
Core is where the program starts and shows forms etc.
Common is just a place to put things that are useful to use here and
there, usually static methods etc.

Does this look sane? How do you structure your solutions?


texts:
I have this map

and I want to put these red circles in the legend of the map according to this form:

Is there a way to do that in QGIS?


texts: Extracting QA Bits for Mask for Landsat Surface Reflectance?

texts:
I am trying to create a mask that I can map over an image collection using the QA band from Surface Reflectance data in Google Earth Engine. Here are the indicator bits for the QA band:

0:unused
1:valid data (0=yes, 1=no)
2:ACCA cloud bit (1=cloudy, 0=clear)
3:unused
4:ACCA snow mask
5:land mask based on DEM (1=land, 0=water)
6:DDV (Dense Dark Vegetation)

Here is my code I keep getting the error 'getQAbits' is not defined within this scope.

//filter

var sr1984 = ee.ImageCollection('LEDAPS/LT5_L1T_SR')
.filterDate('1984-06-20', '1984-08-31')
.filter(ee.Filter.or(
ee.Filter.and(ee.Filter.eq('WRS_PATH', 59),
              ee.Filter.eq('WRS_ROW', 18)),
ee.Filter.and(ee.Filter.eq('WRS_PATH', 58),
              ee.Filter.eq('WRS_ROW', 18))))

//addimage

var image = ee.Image(
  sr1984.filterBounds(region)
    .filterDate('1984-06-20', '1984-08-31')
    .sort('CLOUD_COVER')
    .first()
);

// helper function to extract the QA bits
function getQABits(image, start, end, newName) {
 // Compute the bits we need to extract.
 var pattern = 0;
 for (var i = start; i <= end; i++) {
 pattern += Math.pow(2, i);
 }
 // Return a single band image of the extracted QA bits, giving the     band a new name.
 return image.select([0], [newName])
 .bitwiseAnd(pattern)
 .rightShift(start);
}

// A function to mask out cloudy pixels.
var maskQuality = function(image) {
 // Select the QA band.
 var QA = image.select('QA');
 // Get the internal_cloud_algorithm_flag bit.
 var internalQuality = getQAbits(QA,2,4,  'internal_quality_flag');
 // Return an image masking out cloudy areas.
 return image.updateMask(internalQuality.eq(0));
}

maskQuality(image);
Map.addLayer(image);
sr1984masked = sr1984.map(maskQuality)


texts: Should I split MultiPolygons into Polygons?

texts:
In the system I'm implementing I have a table T1 with an associated geometry. Most of the geometries are a set of n polygons, with 10 < n < 100.
At the moment in the table T1 I have a geometry column of type MultiPolygon, having a GiST index.

As the table T1 is going to be large, I'm afraid that it would be better to create a one-to-many relation with a second table T2, having a column of type Polygon, and split each MultiPolygon in several Polygons.

But I have to implement searches on the table T1, therefore with the second approach the drawback is that I have an additional join to handle. Furthermore it would be more complicated to insert a geometry for a single record of the table T1.

I am wondering if anyone has any experience with such an issue and if that person could shed some light.


texts: Irreparable polygon feature -unable to repair a polygon with arcs

texts:
I have a very funny polygon feature appeared as a result of union of many buffers and cannot repair without manipulating its true shape. Without fixing it, I cannot run subsequent overlay operations. I think the repair geometry tool fixes self-intersecting edges iteratively and consecutive arc edge fixation procedure reproduces the same error again. No matter how many times I try, it reports it is fixed (i.e., 10 times WARNING 000461: Repaired feature 1 because of self intersections) but it returns the same unfixed shape.

UPDATE

Having heard that others have had no issues in repairing this geometry (a proper tail attached to the main part with a 0.03m width), I decided to add a bit more how I came to this point. I have a point feature class with 40.000 features that I need to buffer based on a field and they are pretty close at some locations. These close features tend to produce a large number of slivers. My previous attempts led me to Out of memory or Topoengine errors, and I decided to set the resolution of a copy of this point feature class to 1m (i.e., move points to the closest meter resolution, which might be the source of the problem). I then changed the resolution and tolerance values to their defaults before undertaking any Overlay analysis.

The feature looks like as follows:

For you to replicate the problem in ArcMap, the below is the code snippet including the JSON of this feature considering it is a lossless approximation to the original geometry, which I tested and confirm that it produces the same shape. A word advice, arcpy.AsShape's second argument to process esri_json introduced to this function after the version 10.3, prior versions may complain.

CODE FOR REPRODUCTION

import arcpy

esri_json='{"curveRings":[[[529148.74270000029,6944432.6705999998],{"c":[[529028.58660000004,6943589.9435000001],[529263.99277247302,6943986.3085154826]]},{"c":[[528910,6943597],[528969.39818470867,6943595.2343159467]]},{"c":[[528746.50389999989,6943583.5437000003],[528827.97553651361,6943593.6302468004]]},{"c":[[528172.48149999976,6944406.3706999999],[528570.14691326348,6944072.1521290326]]},{"c":[[528667.5120000001,6944670.9944000002],[528387.14309098024,6944600.1415246446]]},{"c":[[528553.22709999979,6945125.6616000002],[528548.82282015553,6944975.0661100438]]},{"c":[[529145.82980000041,6944433.0010000002],[528546.0329174581,6945033.0851077382]]},{"c":[[529148.74270000029,6944432.6705999998],[529147.28603573283,6944432.8339088196]]}]],"spatialReference":{"wkid":28356,"latestWkid":28356}}'

shape=arcpy.AsShape(esri_json,True)
arcpy.CopyFeatures_management(shape,'in_memory\\repair_me')

Please feel free to put forward any suggestions other than manipulating the shape, e.g., removing vertices, cutting into pieces, generalisation -densification, etc.?


texts: Join shapefile and csv when identification uses two or more attributes

texts:
I have a shapefile and a csv file that I want to join. The csv file has:

MSA identifiers
County identifiers within MSA (so, across MSAs the county_id is not unique)
a series of attributes (each column with zeros and ones) that I want to add to the shapefile.

The shapefile has the MSA identifier and the county identifier (again, unique within MSA, not across MSAs).

How can I join the shapefile and csv file, when the join operation has to be based on two attributes of the shapefile and csv file? Both "Add vector join" and "Attributes join from csv" (mmQGIS) seem to allow for joins with a single attribute as identifier.


texts:
I am creating point data for Drainage using ArcGIS online. But I accidentally created a few points that  I do not require.

Is there any way that I can delete the record from the attribute table in the ArcGIS Online environment?


texts: GeoTools : Zoom, Pan, Move custom action (setState not working)

texts:
I'm using geotools v14.3. Until now I've been using ZoomInAction() to add a zoom in button to my loaded map. Now I want to add a custom toolbar for zooming, panning, resetting and other general functions.

I checked this note and check the mapPane setState() function. But unfortunately I found that my version of geotools doesn't support setState() on mapPane (JMapPane). I'm asking this as I've been unable to find another tutorial to achieve custom actions.

Is there any other way to achieve zoom in, zoom out, pan, reset, zoom to region, zoom selected area... etc, in a custom action?

My current custom action class is like this.

    private class MessageAction extends AbstractAction {

    private Component parentComponent;
    private String message;
    private String name;

    public MessageAction(Component parentComponent, String name, Icon icon, String message) {
        super(null, icon);
        putValue(Action.SHORT_DESCRIPTION, name);
        this.message = message;
        this.name = name;
        this.parentComponent = parentComponent;
    }

    public void actionPerformed(ActionEvent actionEvent) {
        // map zooming, resetting, panning ... etc
        // mapPane.setState(...) doesn't work here.
    }

}


texts: Python toolbox - keep parameter value updated after re-altering parameters

texts:
I am writing a Python toolbox with (among other) 3 parameters: 2 boolean (check boxes) and 1 string. The string parameter's properties depends on the 2 booleans' value:

If at least the first boolean is true (box checked), the string (defined initially as disabled and optional) must be set to enabled and required.
If only the second boolean is true, the string must remain disabled and optional.

The following code works when opening the tool's interface (string parameter is disabled and optional) and checking the first boolean (string becomes enabled and required). But if I then uncheck it, the string parameter remains enabled and required. How do I make sure my tool checks the state of the boolean parameters at all times?

Working the other way round (string initially enabled and required and changing its state if the booleans are altered) would be fine too.

def updateParameters(self, params):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parameter
    has been changed."""

    if params[1].altered:                            # first boolean parameter
        if params[1].value == 1:
            params[8].enabled = 1                    # string parameter
            params[8].parameterType = "Optional"


texts:
I have an I7 quad-core processor in my laptop. I use QGIS 3.8 to do dissolve jobs on large polygonsets.
The biggest set takes 131 minutes.
If I look a the load monitor I see my system on a constant load balancing cycle over the 4 cores. (It alternates over the 4 cores, 1 core on 100% whilst the rest idle)

I have an, untested, idea to chop the sets into 3 subsets and then run 3 dissolve jobs on 3 cores. After that is done I only have to merge and dissolve the edges of the three subsets.

Does anybody have experience on this or a better method to speed up the process. Is there any news on multi-thread processing in QGIS ?


texts: Insert.da.Cursor, Error - Sequence size must match size of row

texts:
I'm working on this script which creates a table within a geodatabase. It then grabs the unique values from a list and attempts to insert them into the table using an Insert Cursor.

I get the Error

Runtime error
Traceback (most recent call last):
File "<string>", line 25, in <module>
TypeError: sequence size must match size of the row

My code is as follows:

import arcpy
from arcpy import env
env.workspace = "C:\Users\USER\Desktop\BaseLayer\UniqueValue.gdb"

## Designate the input layer.
featureclass = "Q:\Admin\IP_AnnoTools\Intermediates\Intersects\Output_Hydro_Line_Intersect.shp"## Parameter
field = "FEATURE_TY"## Parameter
valueList = []
rows = arcpy.SearchCursor(featureclass)
for row in rows:
    valueList.append(row.getValue(field))

uniqueSet = set(valueList)
uniqueList = list(uniqueSet)
uniqueList.sort()

arcpy.CreateTable_management("C:\Users\USER\Desktop\BaseLayer\UniqueValue.gdb", "unique")
arcpy.AddField_management("C:\Users\USER\Desktop\BaseLayer\UniqueValue.gdb\unique","UNIQUE_VAL","TEXT","","","100")
unique = "C:\Users\USER\Desktop\BaseLayer\UniqueValue.gdb\unique"

cursor = arcpy.da.InsertCursor(unique,("UNIQUE_VAL"))

for uv in uniqueList:
    cursor.insertRow(uv)

del cursor
print uniqueList
del rows
del row

My output when I print my list is:

[u'FLOW-ARB-MANUAL', u'LAKE-REP-PRI', u'RIV-MAJ-REP-PRI', u'STR-INDEF', u'STR-PER', u'STR-RECUR']


texts: Listening for Map Click in ArcMap using ArcObjects?

texts:
I have a seemingly simple requirement that is causing me all types of headaches - listening for a map click event in ArcMap via ArcObjects.  Simple as that, just tell me when the map is clicked (and x,y location obviously).

After some research, it appears that creating a custom tool that implements ITool was the way to go.  Well it turns out that approach gets ugly due to some 'bugs' in ArcGIS Desktop (v10 at least).  I don't want to add my custom tool to a toolbar, as it doesn't do anything and is irrelevant for a traditional ArcMap user.  So, I thought I would just create a 'hidden' toolbar containing my custom tool.  Well it turns out hiding a toolbar doesn't work so well (see Activating custom ITool from form without adding it to ArcMap AddIn toolbar?).

The only other thing I can think of to do is add my custom tool to a 'standard' toolbar.  The problem with this approach is that if the user then hides or removes whatever standard toolbar I put the custom tool in from ArcMap, the tool is no longer accessible.

Can someone tell me how to listen for a map click event without all the aforementioned complications?


texts: How to search the folder's items in ArcGIS On Line using the ArcGIS API for Python

texts:
I want to have a list of the items inside a folder created by my user in AGOL, I want to use the ArcGIS API for Python.

so far I have found this:

import sys
from arcgis import gis
import os

sourceURL="https://yourAGOL.maps.arcgis.com"
sourceAdmin="adminUser"
sourcePassword="thisIsNotMyPassword"

clientAcronym = "Sales"
source = gis.GIS(sourceURL, sourceAdmin, sourcePassword)
existingItems = source.content.search('title:"{0}*" '.format(clientAcronym))

this code list all the items where their title start with Sales, but I know there is a folder called "Sales-Test" and it has some of those items, i want to know which items are inside of that folder:

if I get the list of my folders

me = source.users.me
me.folders
for folder in me.folders:
    print(folder['title'])
    me.items(folder['title'])

I can see the folder "Sales-Test" but not he items inside it

In the Item documentation i cannot see how to get the folder information.
Is there a way to relate the information of existingItems with me.folders?


texts: using module leaflet-tilelayer-wmts in a angular-cli

texts:
I am trying to use the module leaflet-tilelayer-wmts to have wmts support in leaflet .  "leaflet-tilelayer-wmts" is available in npm.
The module is in a javasccript and does not contain the setting for a module .

I already inlude it in my package.json, successfulley, it download in mu node_module directory..

But I still cannot import it  using the command :

import * as Wmts from '../node_modules/leaflet-tilelayer-wmts/src/leaflet-tilelayer-wmts';

I also copy the javascript files in directory  assets   and then use :

import * as wmts  from 'assets/LeafletWMTS';

But from that I don`t known how to use it since

 L.tileLayer.wmts

give an error when trying to create the tileLayer :   WMTS property does not exist on type  "typeof tilelayer"


texts: Setting Default Nodata burn value with GDAL Rasterize Layer

texts:
I am trying to rasterize a layer as follows:

attr = 'N_CT'

tif_driver = gdal.GetDriverByName('MEM')
raster = tif_driver.Create(path, x_res, y_res, num_bands, gdal.GDT_UInt16)

shp_driver = ogr.GetDriverByName('ESRI Shapefile')
shp_mem = shp_driver .Open('x.shp')

# loop through each layer in shapefile, add to raster band(s)
for idx in len(shp_mem.GetLayerCount()):
  lyr = shp_mem.GetLayer(i)
  gdal.RasterizeLayer(raster, [i+1], lyr, options=['ATTRIBUTE=' + attr])

*Do some raster computations*

# create .TIF
raster = createRaster(shp,'GTiff', path)

# configure band
band = raster.GetRasterBand(1)
band.Fill(NO_DATA_VALUE)
band.SetNoDataValue(NO_DATA_VALUE)

# write band
band.WriteArray(arr)

raster = None

What happens above is I rasterize a shapefile called 'x.shp' based on a field called N_CT (integers)

However, the output contains what I desire but surrounding it is what I imagine is no data (with value 0 - in black).

  I could set my band no_data value to 0. However, is there a way I can
  change this default (0) to something that I don't need?


texts: Interpolation of survey travel data for transport modelling

texts:
I am looking for a way to interpolate survey travel data (in VKT) for transport modelling.  I have the dataset of VISTA residential transport survey at meshblock level, but I need to get VKT (Vehicle Kilometers Travel) values for the meshblocks that were not survey.

I tried to use IDW and Spline but it is showing logical results in the missing areas. Any suggestions on how to achieve this?


texts:
I don't know why since yesterday Google Streets baselayer is not displayed if Google Hybrid is not selected first. I thought it was my fault but the same happens with the example: http://dev.openlayers.org/examples/google.html
Anybody knows?. Regards, Ramiro.


texts: Python Toolbox - Only update parameter when specific parameter changes

texts:
I'm creating a Python Toolbox. One input is a workspace and the second is a list of feature classes and tables. The list of feature classes and tables is generated once the workspace is input by the user, using a series of ListFeatureClasses and ListTables. Annoyingly, once the workspace is input the tool will re-run this code when the user updates ANY of the parameters. This can freeze up ArcGIS for minutes if the workspace contains lots of feature classes/tables and is located on a network. Is there a way to only run code when a specifc parameter is altered? You'd think parameter.altered == True would do the trick but this seems no different than if parameter.valueAsText returns True in a logic test (has a value).

Making the feature class/tables parameter dependent of the workspace doesn't work because feature classes in datasets are ignored.

Code:

class Tool(object):
    def __init__(self):
        self.label = "Copy Feature Classes And Relationship Classes"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        inGdb = arcpy.Parameter(
            displayName = "Input Geodatabase",
            name = "ingdb",
            datatype = "Workspace",
            parameterType = "Required",
            direction = "Input")

        outGdb = arcpy.Parameter(
            displayName = "Output Geodatabase",
            name = "outgdb",
            datatype = "Workspace",
            parameterType = "Required",
            direction = "Input")

        inFcs = arcpy.Parameter (
            displayName = "Feature Classes And Tables",
            name = "infcs",
            datatype = "GPString",
            parameterType = "Required",
            direction = "Input",
            multiValue = True)

        return [inGdb, outGdb, inFcs]

    def updateParameters(self, parameters):
        if not parameters [0].valueAsText:
            parameters [2].enabled = False
        ###below code runs whenever any new input is input!!!
        if parameters [0].valueAsText and parameters [0].altered: ##altered doesn't work! :(
            try: wst = arcpy.Describe (parameters [0].valueAsText).workspaceType
            except:
                parameters [2].filter.list = []
                parameters [2].value = None
                return
            if  wst == "LocalDatabase":
                parameters [2].enabled = True
                gdb = parameters [0].valueAsText
                arcpy.env.workspace = gdb
                fcs = []
                for typ in ["Point", "Polygon", "Polyline", "Multipoint"]:
                    fcs += ["{} (Feature Class)".format (fc) for fc in arcpy.ListFeatureClasses (feature_type = typ)]
                fcs += ["{} (Table)".format (tab) for tab in arcpy.ListTables ()]
                datasets = arcpy.ListDatasets ()
                for dataset in datasets:
                    for typ in ["Point", "Polygon", "Polyline", "Multipoint"]:
                        dsFcs = arcpy.ListFeatureClasses (None, typ, dataset)
                        for dsFc in dsFcs:
                            fc = os.path.join (dataset, dsFc)
                            fcs += [fc]
                parameters [2].filter.list = fcs
            else:
                parameters [2].filter.list = []
                parameters [2].value = None


texts: Out of Server Memory when reconciling a large edit session in ArcObjects

texts:
One of our users has been periodically experiencing Out of Server Memory errors with ArcSDE 10.0 when trying to reconcile a large edit session.

VMware ESX Instance:

Windows Server 2008 R2 Datacenter
Service Pack 1
Intel Xeon E5-2660 @ 2.20GHz
8 GB RAM

I've set up a performance monitor to track memory usage but I'm curious if this is a problem anybody else has experienced with versioned editing?

Our RDBMS is Oracle and I have found this page by ESRI:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002n00000026000000

However, this seems to assume that ArcSDE and Oracle are on the same machine (for us they are not). Should I remove the 'unlimited' table space associated with the editing user?

Also, we make direct connections to your database using the Oracle client. Does this mean that I'm perhaps looking at the wrong server (ArcSDE) and should be speaking with the DBAs ? I'm thinking ArcObjects error means ArcSDE problem but perhaps somebody can correct me on this?

Solution seemed to be to enable 64-bit background GP on the desktop who was responsible for editing. Large edit sessions seemed to cause problems with our Oracle Geodatabase. Likely could have been resolved at the RDBMS level but DBAs were unavailable at the time to troubleshoot.


texts: WebSocket connection error with OpenLayers

texts:
I am new to OpenLayers and NodeJS. I have installed OpenLayers on my EC2 instance following exactly the instructions found on the OpenLayers website (https://openlayers.org/en/latest/doc/tutorials/bundle.html). This includes first installing NPM (using NVM) and then using Parcel to bundle my application.

I am able to render a map on the default port of 1234 on my EC2 instance, but after a few seconds I get the following error message:

  WebSocket connection to
  'ws://ec2-18-234-227-160.compute-1.amazonaws.com:46141/' failed: Error
  in connection establishment: net::ERR_CONNECTION_TIMED_OUT NOTE that I
  am using Chrome.

Looking at the the specific line of code that is specified (found here: parcelRequire.node_modules/parcel-bundler/src/builtins/hmr-runtime.js), you will see the following code:

  var ws = new WebSocket(protocol + '://' + hostname + ':' +
  process.env.HMR_PORT + '/');

This process.env.HMR_PORT variable created by Parcel is what is generating an error message on my EC2 instance (I believe), but I am not sure how best to fix this without introducing new errors.

Any thoughts about how to fix this? I tried the following command which someone suggested to avoid this error but it did not work:

  npm start --no-hmr


texts: Allow GeoServer WFS request by featureID

texts:
I'm not able to use the featureID parameter in a WFS URL request for my dataset on GeoServer.

Example:

http://demo.opengeo.org/geoserver/wfs?version=1.1.0&service=WFS&request=GetFeature&typeName=topp:tasmania_roads&maxFeatures=10&featureID=tasmania_roads.2

The above URL returns ONE feature because I have appended the &featureID=tasmania_roads.2

The featureID paramter works great with the topp:tasmania_roads dataset on the demo.opengeo.org geoserver and on my GeoServer as well.

However, It does NOT work on the layer I have published. And I cannot see any differences. My GeoServer is internal so I regret that I cannot provide a URL. But this is how I'm constructing my URL (same way I did for Tasmania_roads):

From the GetCapabilities:

...
<FeatureType xmlns:catalog="http://mydomain.com/catalog">
  <Name>catalog:myData</Name>
  <Title>myData</Title>
...

From the GetFeature:

...
<gml:featureMembers>
  <catalog:myData gml:id="myData.fid--57bd457b_134ae684781_8989">
    <catalog:id>190004</catalog:id>
    <catalog:type>SICD</catalog:type>
...

So based on the above information my url should be:

http://myDomain.com/geoserver/wfs?version=1.1.0&service=WFS&request=GetFeature&typeName=catalog:myData&maxFeatures=10&featureID=myData.fid--57bd457b_134ae684781_8989&

But I get ZERO results.

I tried URLencoding, republishing and different namespace/feature type naming configurations, with no luck.

I'm thinking there must be a setting on GeoServer when publishing the dataset that I'm overlooking?


texts: Joining two tables by selection from one table in MapInfo?

texts:
I have 2 MapInfo tables that have a corresponding unique ID number field.
I'd like to be able to manually select some objects from one table and join the 2 tables based on a matching unique ID number for the selected objects only.

Is this possible?


texts:
I'm trying to create a buffer around a feature in a polygon in QGIS. Trying to do 100m buffer, but when I run it, I just get a huge circle around what my shapefile was showing originally.

I have tried changing CRSs on the layer, and the project a million times. I always try to find one that uses meters (+vunits=m right?). I've saved the layer and opened it fresh to make sure the project  had the same CRS and it keeps doing the same thing. Is there something obvious I'm doing wrong?


texts: ArcGIS Pro Layer to KML With Multiple Images Per Feature Only Displays One Image in Google Earth

texts:
Question: Why is it that when I use Layer to KML in ArcGIS Pro 2.4.1 I can only view one image per feature on Google Earth Pro? All the attachments are listed inside the popup on GE, but the links for the additional images do nothing.

These data are from Collector with a 1:Many cardinality for the photo attachments. So far I have tried everything I can think of in the Configure Popups window for the layer. The "Show First Image Only" box is NOT checked. I went through all the menus in GE too, but I don't see anything relevant. I have read through ESRI help for the Layer to KML tool and Configure Popups. I have been Googling for a couple hours and found other people have had this problem, but no solution is given.


texts: Appending Point Shapefile Location by GPS values in text file using ArcPy?

texts:
In my industry it is common to create preliminary design maps for point locations that have a unique identifier. Upon the actual construction on the design, points change location based on construction.

Is there any way in ArcGIS 10.0 Editor license to append the new XY information (update the geometry) for those points? Python is preferred.


texts: Merge lines with the same 'name' attribute on QGIS?

texts:
I have a shapefile with a few thousand lines, each is a street segment. I'd like to merge all features with the same 'streetName' attribute into a single attribute. I only really care about the name of the street and it's geometry.

What would be the query necessary to do such a thing?

I'm new to GIS in general and have run into a problem I can't figure out how to fix. Excuse my noobness.
Thanks in advance.


texts: I need to perform an anomaly analysis in both space and time. I have 4 data parameters: latitude, longitude, time and temperature. What I’m trying to do is to find temperature anomalies that are present at different locations and time. Are there any readily available methods in MATLAB or commercial solutions that could do such Space-time analysis? I noticed that the software SaTScan does Space-Time analysis, but it is mostly implemented on medical related fields. Would it be possible to use it here?


texts: QGIS Export Map as Image with fixed DPI resolution

texts:
I use the following option:
Exporting map canvas to PNG file using custom plugin created by Plugin Builder
in order to get my Map canvas from QGIS straight to PNG format.
The problem is, that default images aren't as big as I would like to have.
I found some similar issue here:
How to export the map in very high resolution
although I know how to change the resolution of my image.
The problem is, that it goes back to the default every time when I use this option.

Is there an option to make my value of DPI fixed?
I tried to check it in Settings, but I couldn't find stuff, that would match it.


texts: NameError when running script QGIS Python 3

texts:
I'm trying to run a script that loops through a series of point layers and interpolates using the TIN interpollation method using python on QGIS.  The script worked in the past, but now it fails with the following error:

NameError: name 'QgsProcessingFeedback' is not defined

import qgis.analysis
import qgis.core
import processing
import os
import fnmatch
from qgis.core import QgsProcessingFeedback #added based on [post 194737][1]

use_cols = [6,9,10,11]
col_names = ["Depth","Velocity","Froude","Stress"]
source_geopackage = "D:/GIS/TRF2/PC3_hydropts.gpkg"
interim_path = "D:/GIS/TRF2/Raster_output/"
export_path = "D:/GIS/TRF2/PC3_rasters/"
layers = qgis.utils.iface.mapCanvas().layers() #using canvas layers
for layer in layers:
layerType = layer.type()
if layerType == QgsMapLayer.VectorLayer:
    for i in range(0,len(use_cols)):
        col = use_cols[i]
        output_file_name = layer.name()+"_"+col_names[i]
        export_file_name = interim_path + output_file_name+".tif"
        vlayer = source_geopackage+"|layername="+layer.name()+"::~::0::~::"+str(col)+"::~::0"
        processing.run("qgis:tininterpolation", {
        'INTERPOLATION_DATA':vlayer,
        'METHOD':0,'COLUMNS':2487,'ROWS':929,
        'EXTENT':'1793310.0,1801470.0,498942.0,501991.0 [EPSG:2285]',
        'OUTPUT': export_file_name})

  Traceback (most recent call last):
    File "C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\code.py", line 91, in runcode
      exec(code, self.locals)
    File "", line 13, in
    File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\processing\tools\general.py", line 84, in run
      return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
    File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\processing\core\Processing.py", line 119, in runAlgorithm
      feedback = QgsProcessingFeedback()
  NameError: name 'QgsProcessingFeedback' is not defined

I'm running QGIS v3.0.2 on Windows, and accessing Python through the QGIS console.

When I wrote the loop, I ran TIN interpolation through the processing framework and copied the settings from the history.  I tried to repeat that process, but I get the same error.  The algorithm runs fine through processing.


texts:
How can I calculate the min of other fields. For example I have 3 field: a, b and c.
I want to have a filed that show me the minimum value of the 3 field. Finally I want to know the minimum value is of a or b or c. Thank you.


texts: Querying a shapefile and returning values?

texts:
I have a lot of experience making maps in ArcMap. I don't have much experience programming or working with APIs.

Here's the (simple) problem: I create a shapefile of a region and then load the shapefile into one of many possible web mapping services (Leaflet, CartoDB, Mango Maps). How do I go about querying the shapefile to see whether a location (coded in lat/long) fell in the region's boundary? Or, say, within 'x' miles of the region. Need to eventually batch process the query. Is this just a matter of getting the syntax right with whatever REST API the web mapping service provides?


texts: Recent Projects List missing when opening QGIS

texts:
When opening QGIS 3.10 on Windows 10 after a recent fresh install to a new computer  using OSGeo4W I seem to be missing the recent Projects Tab. I have News and Project Templates appearing but no recent projects although ones have been opened and worked on since the new install.

Is there an option to turn this on somewhere that I'm missing?


texts:
A cartography question: you open an atlas and usually at the beginning of it there are some world maps showing various thematics. Let's say the world map uses Robinson projection and it says it has a scale of 1 : 120,000,000.

How is this scale determined? Are there any standard practices (measuring scale ratio of 10° longitude on equator or something similar)? Or is this an imprecise science left to each cartographer to figure out?


texts:
I have a GeoTiff that has been supplied to me with non square pixels (I suspect due to reprojection to lat lon at some point). However the next step in my processing chain requires a Arc ASCII grid as input and so I need square pixels.

To save me trying to guess the original projection can any one tell me how to use GDAL to resample my image so the pixels become square?


texts: How to add architectural plan to arcgis javascript 2D map

texts:
I would like to know if there is a way to add an architectural plan to my 2D map with a fixed position.
Somewhat similar to BuildingSceneLayer , but for a 2d map.
Note that I am working on an Angular 11 project having ArcGIS javascript version 4.17


texts: ArcGIS Server simple link with SQL Server database

texts:
I am using ArcGIS Server 10 to create Rich Internet Application with embeded Maps.
Basicaly, I created an Optimized Map Service on ArcGIS Server, from an MXD file (produced with Arc Map). I have different layers of data from shapefile, but what I want is to add XY data from a database (SQL Server).

I create a Database Connection through "Add OLE DB Connection" in ArcCatalog, and added my data with "Add XY Data" in ArcMap.
(My Table that I am querying is very simple: Id, latitude, longitude)
After that I can see my data (dots) on the map within ArcMap.
But when I publish the Map Service from the MXD, I have an error saying that the layer's data source is not supported.

Is there any way to create a layer from a (Non spatial) table (from database) that just contains basic coordinates (XY data)? I want to directly link the Map Services with the database, to ensure that the map is automatically updated when the table changes.


texts: Calculation difference between a pre- and postimage in Google Earth Engine

texts:
I am looking for a way to filter images from an ImageCollection 5 days before a specific date as Previous and 5 days after the specific date as Postimage. But it doesn't work.
Background: due to an existing FIRM alarm the NBR before the event should be compared with the NBR after the event as dNBR.
Here is my code:

function addNBR(image) {
// Compute the Normalized Difference Vegetation Index (NDVI).
var nir = image.select('B8A');
var swir = image.select('B12');
var nbr = nir.subtract(swir).divide(nir.add(swir)).rename('NBR');
return image.addBands(nbr)
}

var S2collection = Sentinel2.map(addNBR);
print('S2_Collection: ', S2collection );

// Create and print a histogram chart
var S2collection_NBR = S2collection.select('NBR')
.map(function(image) {
var date = ee.Date(image.get('system:time_start')).format("YYYY-MM-dd");
return image.set('date', ee.Date(date));
  })
  .map(function(image) {
  var ID = ee.String(image.get('system:index'));
  return image.set('ID', ID);
  })
  .map(function(image) {
  var date = ee.Date(image.get('system:time_start'));
  return image.set('date_time', date);
 });

print ('S2collection_NBR: ', S2collection_NBR);

// Create a list of start days
var dayOfYearList = ee.List.sequence(1, 365, 5)
print('dayOfYearList: ', dayOfYearList)

// Function to convert day to date
var dateFromDayOfYear = function(day) {
  var dateString = ee.String('2018').cat(ee.String(ee.Number(day).toInt()))
 return ee.Date.parse('YYYYD', dateString)
}
// Create a list of start dates
var startDateList = dayOfYearList.map(dateFromDayOfYear)
print ('startDateList: ', startDateList)

// Function to return an image consisting of count of valid pixels in the         date range
var checkDateRange = function(start) {
var end = ee.Date(start).advance(5, 'day')
var dateRangeFiltered = S2collection_NBR.filter(ee.Filter.date(start, end))
var pixelCount = dateRangeFiltered.reduce(ee.Reducer.count())
// return the image with a new property for start date, so we can retrieve   it   later
return pixelCount.set({start_date: start})
}
// rangesWithFires is the date for an alarm in the StudyArea
var reference = rangesWithFires.sort('date', false);

var time0 = reference.first().get('date');

var NBRimage = ee.List([
  // Rename the first band 'NBR'.
  ee.Image(0).set('date', time0).select([0], ['NBR'])
]);
print ('NBRimage: ', NBRimage);

var dNBRimage = ee.List([
// Rename the first band 'dNBR'.
ee.Image(0).set('date', time0).select([0], ['dNBR'])
]);
print ('dNBRimage ', dNBRimage);

var pairwisediff= function(image){
var index = NBRlist.indexOf(image);
if (index !== 0) {
var previousimage=NBRlist.get(index.add(-1));
var diff = image.subtract(previousimage);
return diff;}
};

var S2_collection_dNBR = S2collection_NBR.map(pairwisediff);

print('S2_collection_dNBR= ', S2_collection_dNBR);


texts:
Reinstalling QGIS on Linux Mint?

Most of my recent troubles are documented in the thread above, and I wasn't sure if I should just post this there. But here I am.

It just stopped working. It won't start. I hadn't used it in a few months and when I tried, nothing. I don't have a clue where to begin

Mint Cinnamon 17.3 64-bi
kernel 3.13.0-37-generic x86_64 (64 bit)

When I run it from command line I get:

ThinkPad-T410 ~ $ qgis
/usr/bin/qgis.bin: error while loading shared libraries: libltidsdk.so: cannot open shared object file: No such file or directory

Edit 2: OK, I'm not sure I quite understand this but this is what I did and this is what I got:

$ ls /usr/lib/*libltidsdk*
ls: cannot access /usr/lib/*libltidsdk*: No such file or directory


texts: After Polyline to Raster conversion empty attribute table in ArcMap10.2

texts: I have a line feature class (displaying different types of roads) and want to convert this into a raster. For this I used the Polyline to Raster conversion tool, using "type" in the Value field in ArcMap 10.2. I actually get a new rasterlayer, but it is not displayed in the map and when I look at the attribute table it is empty. Only the headings of the coloums are displayed, but no rows. If I use a different Value field for the conversion it is the same. So how do I get all my data in the attribute table after the conversion?


texts: Getting all vertex lat, long coordinates every 1 meter between two known points using PHP?

texts:
I am currently using php to try and write code that will take a start point and end point latitude and longitude coordinate pair in decimal degrees and calculate the latitude and longitude of every vertex at a given interval in meters along the path between the two points.

For example:

I have start coordinates of latitude 43.97076 and longitude 12.72543 and I have an endpoint of latitude 43.969730 and longitude 12.728291.  Using mathematical calculations (e.g. haversine formula) written in php, I would retrieve the coordinates between those two points at every 1 meter interval starting at the first coordinate and ending at the end coordinate.  I welcome a solution written in any language like python, javascript, etc for an example.