texts: Clipping over an ImageCollection using another ImageCollection (Adaptive Clipping)

texts:
I need to clip over a Landsat ImageCollection using another ImageCollection which contains yearly crop masks extracted from MODIS Landcover Type (2001 to 2016).

I need code that:

clips the Landsat image from 2001 with the Crop Mask in 2001
clips the Landsat image from 2002 with the Crop Mask in 2002

... and so on.

Here is the code for the yearly crop area and Landsat8 collection:

function cropmask (img){
  return img.updateMask(img.eq(12));//crop lands are pixels with value=12
}
var yearlyCrop = ee.ImageCollection('MODIS/006/MCD12Q1').select('LC_Type1').map(cropmask);
print(yearlyCrop);
var l8images = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA').filterBounds(roi);


texts: Where exactly is the GPS position located on a GPS device?

texts:
I have a very precise GPS which in theory when using RTK achieves 2cm accuracy when reporting its GPS position. But where exactly on the GPS device is this position? In other words, when the GPS device says it is at lat = X, lon = Y, where is this point? At the base of the antenna, the end of the cable, the middle of the antenna?

I have the GPS antenna mounted on a cart. The antenna is around 20 cm + 40 cm cable. In previous mapping scenarios I had to make the mapping with an accuracy of 1 meter, so there was no issue. At this moment I have to do the mapping with 5 cm accuracy and therefore the size of the antenna and the cables may be relevant.


texts: Tuning gdalwarp to match source cell size and alignment

texts:
I was hoping gdalwarp could merge and crop MODIS TIFF images such that the original cell size and alignment is maintained. I tried the command below, but cell size is off slightly and cell alignment is offset from 10 to 100 meters.
gdalwarp -cutline basins.shp -crop_to_cutline input1.tif input2.tif input3.tif outputmergeclip.tif

I tried setting -tr to the source cell size, -te to the extent of the shapefile snapped to the source grid cell alignment and -tap, but these didn't make any change in the result.  Am I interpreting the options incorrectly?  Am I on the wrong track with gdalwarp?
I'm scripting this in Python and relatively new to both Python(2.7) and GDAL(1.9.2).


texts: Distance from point to line with positive and negative values (near tool?)

texts: I am trying to calculate the distance between collected points and a generated shoreline, but I also need to know if the points are inside the shoreline or outside the shoreline. I have been using the near tool. As a polygon I only got distance values from the points outside the shoreline. I converted the polygon to a polyline so now I get distance values from all of the points, but they are absolute so I cant tell which side of the line they fall on.


texts: geometry modification by iterative ST_MinimumBoundingCircle use

texts:
ST_MinimumBoundingCircle returns the smallest circle polygon that can fully contain a geometry, but if you execute this function iteratively on a geometry, it increases more and more, whereas the same geometry should be maintained.
Here is an example where a circle is created using ST_buffer with quad_segs by default.
Then apply ST_MinimumBoundingCircle on it and then reapply on the same geometry.

As you can see, the area of the geometry starts to increase every time ST_MinimumBoundingCircle is applied.

with gen_circle as(
SELECT ST_Buffer(
ST_GeomFromText('POINT(100 90)'),50) as circle)
select postgis_liblwgeom_version(),
st_area(ST_MinimumBoundingCircle(circle)),
st_area(ST_MinimumBoundingCircle(ST_MinimumBoundingCircle(circle))),
st_area(ST_MinimumBoundingCircle(ST_MinimumBoundingCircle(ST_MinimumBoundingCircle(circle)))) from gen_circle

I'm using the last postgis version


texts:
I have a polygon layer (obtained from Raster to Polygon) with some invalid geometries. I would like to know how can I solve this without going one by one

This may be what answer is suggesting:

After trying solution from answer, the result is not correct.

Any idea?


texts:
I have some data in SQL Server 2016 which contains a field type of REAL, and I have no control over changing the underlying schema.  This is not in an Enterprise Geodatabase, but is a simple table containing a geometry field.

This is how it looks via SQL Server Management Studio:

We can see this appears similar to a float:

o via a Query Layer, it looks like this:
Flows through as a float but I have lost the scale

Looking at the help - SQL Server data types supported in ArcGIS – suggests REAL field type is supported for view only (which is what I need).

However, I can't see where I can change any settings to ensure the full scale flows through.

Hoping this might be an easy one to solve and something basic I may have overlooked.


texts: how can I calculate the share of each interval,for this(in QGis)Slope Map

texts: A geomorphological study for college, Slope Map


texts: Braun/Gall projection and pixel conversion

texts:
I am fairly new to projection mathematics and I usually manage to get things to work with copy-paste and trial-and-error but this time I'm lost ...

I am trying to map latitude (-90 to 90) and longitude (-180 to 180) coordinates onto pixel satellite images from Mappy, which uses a tiling system much the same as Google or Bing  (more info). Unlike Google, Mappy doesn't seem to use Mercator projection but Gall or Braun (I found out by pasting a Gall map on top and saw that it matched). To be precise, they actually put a rectangular Gall/Braun projection of the earth and add a white strip on top to get a square (necessary for the tiling).

So I have a Braun map of the earth (let's forget about the white strip) and I want to know which pixel are the coordinates 0.0, 0.0 (Gulf of Guinea), for example. Where should I start ?

This is how I proceeded so far:

From Wikipedia I got that Braun projection works as follows, with R radius, λ longitude, φ latitude

x = R.λ
y = 2.R.tan(φ/2)

I was previously working on a Mercator map (directly with the final equations lat-lon to pixel, as found here) and surprisingly the horizontal transformation from longitude to x-pixel was working perfectly with Braun as well. It appeared to be the inverse equation (plus the Greenwich offset) of the one presented on Wikipedia x = (λ+offset) / R instead of x = R * λ (as if was looking for λ and not x).

And so I tried to invert the vertical equation as well and finally got (with the parameters radius, offset and image size):

x = (λ+180 / 360) * width of image
y = 2*atan(φ+90 / 2*180) * height of image

Note: I used a horizontal radius from -180 to 180 = 360. Vertically, -90 to 90 = 180

This all sounds very illogical but the weirdest thing is that experimentally I get very nice results in x and not crazy ones in y. Actually quite near sometimes. I guess it's only by chance ...


texts: what is the relevance of cosine in determining map resolution?

texts:
"At any latitude and zoom level, you can determine the scale by using the following equation"

Map resolution = 156543.04 meters/pixel * cos(latitude) / (2 ^ zoomlevel)

is a quote from (http://msdn.microsoft.com/en-us/library/aa940990.aspx)

Can anyone explain to me the relevance of the cos(latitude) part? I am having difficulties visualising this.


texts: How can I use CQL in WFS layers in openlayers

texts: I've tried a lot of times to use the OpenLayers CQL example but nothing changes. Is there any way to use CQL or filter.


texts: Gdal_translate does not affect image when only using 2 points

texts:
I want to do a 2 point georeference because I don't want to warp the image. I just want to rotate and scale it. I tried using the below arguments, which runs with no errors. It imbedds the points into the new image and creates a geotiff correctly. Put when I add it to QGIS it doesn't show and zooms to south america. If I add a third point it works fine.

gdal_translate -of GTiff -a_nodata 0 -b 1 -a_srs "EPSG:4326" -gcp 969.861598523485 686.215904522596 -74.1084636189044 40.6942092010138 -gcp 5820.04006096547 3893.28866195693 -74.103665985167 40.6958183083443 "C:\InFile.tif" "C:\OutFile.tif"


texts: sub-querying 3 tables in definition query without join

texts:
I'm trying to select record from Table 1 which has more than one kind of 'Type' in Table 3. There is no common ID between Table 1 and Table 3. But Table 2 has LID that's common to LID in Table 1. Table 2 has SLID that's common to SLID in Table 3.

The query should only select A and C from Table 1 without joining any tables. I can easily do this with python but I need to be able to do this with definition query and without any join.

I know the following query is not correct but I tried variations of it using Group and Count but no luck so far.

LID in
(SELECT LID FROM Table1 WHERE LID in
(SELECT LID FROM Table2 WHERE SLID in
(SELECT SLID FROM Table3 WHERE Type in
(SELECT Type FROM Table3
)
GROUP BY LID HAVING COUNT(Distinct Type)>1)))


texts: How to assign Roads Name or Roads Number to Lighting Poles point Layer along the Road?

texts:
1)I have the Roads layer which contains the roads name and roads number
2)I have the Lighting Pole as a point layer contains the lighting pole voltage and power
3)I want to assign or link each roads name to its related lighting poles

I can do it manually but I need to do it in a faster way using ArcMap.


texts: Forcing FME to read a date column in Excel as a text-encoded attribute

texts:
I am reading an Excel spreadsheet which has a column containing date values using FME.
The problem is that all date value are encoded as normal text in Excel, except a few cells which are encoded as true date format. But when I open the .xlsx file, they all looks the same:

28.03.2010
11.05.2011
31.12.2020

Here for example, the format of the second cell is 'date', while the two others are encoded as 'text'.
I'm using an XLSXR reader in FME. For that column, the reader tells me it is has a 'Char' type:

But once the file is read, these data becomes:

28.03.2010
20110511
31.12.2020

which is causing me some troubles in some following transformer, e.g. the DateTimeConverter.
Is there a way to actually force the reading of that date column as 'text' everywhere? Because it seems that FME is taking into account the actual Excel encoding, even so it is saying its type is 'Char'...


texts: Opening ArcGIS Desktop layer package (.lpk) file using QGIS on Mac?

texts:
I downloaded an LPK file from the ESRI site that contains USPS defined zip codes. Because I'm working with QGIS on a Mac, I converted the file to a .zip. There's a .lyr file that opened up in the zip, but I'm not able to open that up on QGIS.

Is there a way to convert the contents of an ESRI layer package file (.lpk) into a shapefile with the associated data, and that I can open with QGIS on a Mac?

I looked into using utilities like 7-zip, but it doesn't seem to work on a Mac.

Apparently one of the .xml files in the layer package should contain a link to the actual data under the packagelocation tag, but I wasn't able to find that tag in the .xml files.

Does anyone know if that tag name might have switched?

I downloaded the layer package file from here.


texts: Spatial Join Loop gives ExecuteError: ERROR 000210: Cannot create output?

texts:
I have a series of buffer polygons that I need to perform a spatial join on to get overall counts within the buffers. I can do this by copy and pasting the spatial join script over and over and just swapping out the buffer layer/output file name.

However, I'd like to figure out a simple loop that will go through all the buffers at once. I attempted a code myself but I'm not versed enough to figure out the solution to the error I'm getting. Any tips?

Buffer_5mi = "G:\\Admissions\\GBD\\GBD\\Admissions.gdb\\Buffer_5mi"
Buffer_10mi = "G:\\Admissions\\GBD\\GBD\\Admissions.gdb\\Buffer_10mi"
Targets = [Buffer_5mi, Buffer_10mi]
Freshmen_Admitted = "Freshmen_Admitted"

for Target in Targets:
    output = "G:\\Admissions\\GBD\\GBD\\Admissions.gdb\\admitted%s" % Target
    arcpy.SpatialJoin_analysis(Target, Freshmen_Admitted, output, "JOIN_ONE_TO_ONE", "KEEP_ALL", "", "INTERSECT", "", "")

This is the error I'm getting. I understand why the error is popping up, what I dont know is the solution to it.

Runtime error  Traceback (most recent call last):   File "<string>", line 9, in <module>   File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\analysis.py", line 471, in SpatialJoin     raise e ExecuteError: ERROR 000210: Cannot create output G:\Admissions\GBD\GBD\Admissions.gdb\admittedG:\Admissions\GBD\GBD\Admissions.gdb\Buffer_5mi Failed to execute (SpatialJoin).


texts: Packaging a QGIS Project with vector and raster data for use on QField

texts:
Does anyone have a step by step guide on how to package a QGIS project in QField and successfully open the project on a tablet?

Currently I have a QGIS project with vector layers and Google Satellite base map.
I then package the project using the QField synch plugin and copy across to my device saving under the followuing directory, Galaxy Tab Active\Tablet\Android\data\ch.opengis.qfield\files\share\QGIS Projects.
When I open the project in QField the vector layers appear but the there is no Google Satellite base map visible, which I need to use offline.

Is there a key step I may be missing?


texts: vector file is used by two mapsets at a time in grass gis

texts: i want to study about vector processing.if a vector file is used by two mapsets at a time, which one will  be saved first and why.if a team want to work on the same set of shape files, what is the procedure. will it be saved in dbf format?


texts:
We want to have a offline Leaflet map on mobile. For this we want to use some kind of Android app which will serve as a tile provider when offline. The Leaflet will refer to this Android app as tile layer provider e.g. as

L.tileLayer('androidappservice/{z}/{x}/{y}.png',
                {    maxZoom: 16  }).addTo(mymap);

Do you know if there is such Android app?


texts: Pinning ArcMap Table of Contents but not Attribute table window?

texts: I have pinned by table of contents but I would like to view my attribute table as floating - i.e. I can make it much larger so I can view the data easily.


texts: Second grass algorithm in QGIS modeler cannot use output from first algorithm

texts:
I'm using QGIS 3.0.0 and I've created a model to delineate a watershed. The model has 3 steps:

Merge 4 SRTM tiles
Run r.watershed on the merged tiles
Run r.water.outlet on the flow direction output from step 2. This part also uses a string input representing the outlet position (x,y)

The first 2 steps (merge and r.watershed) run fine. But r.water.outlet complains that it could not find the input raster (flow direction). I noticed that between the two GRASS algorithm, a new grass section is being initialized. Could this cause QGIS not to find the input raster?

Log from the model run can be found here

The model I'm using is represented bellow.


texts: Keeping symbology and labels sync'd between data frames in ArcGIS Desktop?

texts:
ArcGIS 10.3.1 for Desktop

I have an mxd file with nine different frames of essentially the same data (just displaying different layers in each map). These maps all include hospitals (as a point file). I'd like the symbology and labels to be linked between the frames, so if I update a master, the rest gets updated.

The files do share a symbology layer (I created one called hospital.lyr), but if I update it, I have to manually go into each frame and reload hospital.lyr. With nine frames, it gets time consuming.

Same thing for the label. I have defined a label style (myhospital), but if I update it, I have to go reload it for all the different frames.

Can I have these somehow linked, similar to how I can lock the scale/extent of various data frames to a master data frame?  Just to be clear, I'm not asking for the symbology to be linked to the layer. I want the symbologies to be linked between the data frames; same thing for the labels.


texts: Check whether GML contains elevation info?

texts:
How can I check in QGIS whether a GML file has elevation information, or z coordinates?

It definitely has some overlapping polygons, but I'm not sure whether the ordering of the overlap is specified or not.


texts:
I need to create a layer with meteorological icons on it - about 100 of them. So. I define its source like this:

    mappingAPI.meteoIconLayerSource = new ol.source.Vector({});

I add icons as features like this:

    for(stan in meteo.meteoData)
    {
        var iconFeature = new ol.Feature({
            geometry: new ol.geom.Point(ol.proj.transform([parseFloat(meteo.meteoData[stan].lon), parseFloat(meteo.meteoData[stan].lat)], 'EPSG:4326',   'EPSG:3857')),
            obj_id: meteo.meteoData[stan].obj_id,
        });

        mappingAPI.meteoIconLayerSource.addFeature(iconFeature);
    }

Once I have the source, I create the layer like this:

    mappingAPI.meteoIconLayer = new ol.layer.Vector({
        source: mappingAPI.meteoIconLayerSource,
        style: mappingAPI.getMeteoIconStyle
    });

The style definition looks like this:

return [new ol.style.Style({
  image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
    anchor: [0.5, 0.5],
    anchorXUnits: 'fraction',
    anchorYUnits: 'fraction',
    opacity: 0.7,
    src: "data/meteo/icon" + feature.get('obj_id') + ".png"
})];

When the src is defined as stated above (using feature's property pointing to unique number), icons on my map start blinking as the style procedure is call non-stop for all the features on the layer again and again. In case, I replace the definition with reference to one picture like this:

src: "data/meteo/icon3898.png",

or even like this:

src: "data/meteo/icon" + feature.get('dummy') + ".png",

where dummy is same for all features, everything is fine - the style procedure is called once for each features and that's it until map needs redrawing.

Please, could anybody help to with this issue? Or is there any other way, how to place icons on the map without putting src definition in the style?

Marek


texts: Writing code to add calculated image to display in Google Earth Engine?

texts:
I wrote a code for Land Surface Temperature (LST) from Landsat 8 images in google earth engine.
I have successfully calculated the following steps,
NDVI, fractional vegetation (fv), emissivity (EM), Brightness temperature (BT) is already a calculated band in Landsat image.
I wrote an equation for LST. It was successfully executed. However, I can not add the image to display. It gives an error called "LST: Layer error: Parameter 'value' is required."
How to fix this error?
My code is,

//Take the landsat image
var bands=['B2', 'B3', 'B4', 'B5', 'B10']
var image= ee.Image(l8
    .filterBounds(point)
    .filterDate('2018-02-01', '2018-02-05')
    .sort('CLOUD_COVER')
    .first())
    .select(bands).multiply(0.0001);

//Display the image
//Map.addLayer(image, {bands: ['B5', 'B4', 'B3'], max:0.9}, 'image');

//NDVI
var red=image.select('B4');
var nir=image.select('B5');

var ndvi= nir.subtract(red).divide(nir.add(red)).rename('NDVI');
print(ndvi);

var ndviparas={min:-1, max:1, palette:['blue', 'white', 'green']};
//Map.addLayer(ndvi, ndviparas, 'NDVI image');

// clip the NDVI image
var ndviClip = ndvi.clip(table);
Map.addLayer(ndviClip, {min: -1, max: 1, palette: ['FF0000', '00FF00']});

/*Export the image to an Earth Engine asset.
Export.image.toAsset({
image: ndviClip,
description: 'imageToAssetExample',
 assetId: 'ndvi_kandy',
 scale: 30
 });
  */

 //select thermal band 10(with brightness tempereature), no BT calculation
 needed
 var thermal10= image.select('B10').multiply(1000);
 var thermal=thermal10.clip(table);

 Map.addLayer(thermal, {min: 270, max: 400, palette: ['FF0000', '00FF00']});

 // find the min of NDVI

 var min = ee.Number(ndviClip.reduceRegion({
   reducer: ee.Reducer.min(),
   geometry: box,
   scale: 30,
   maxPixels: 1e9
   }).values().get(0));

   print(min)

  var max = ee.Number(ndviClip.reduceRegion({
    reducer: ee.Reducer.max(),
    geometry: box,
   scale: 30,
   maxPixels: 1e9
   }).values().get(0));

   print(max)

   //fractional vegetation

  var fv = ndviClip.subtract(min).divide(max.subtract(min)).rename('FV');
  print(fv)
  Map.addLayer(fv, {min: 0, max: 1.5, palette: ['FF0000', '00FF00']},'FV');

  //Emissivity

  var a= Number('0.004');
  var b= Number('0.986');
  var EM=fv.multiply(a).add(b).rename('EMM');
  Map.addLayer(EM, {min: 0, max: 1.5, palette: ['FF0000', '00FF00']},'EMM');

  //LST c,d,f, p1, p2, p3 are assigned variables to write equaton easily
  var c=Number('1');
  var d=Number('0.00115');
  var f=Number('1.4388');

  var p1= thermal.multiply(d).divide(f);
  var p2= Math.log(EM);
  var p3= (p1.multiply(p2)).add(c);

  var LST= (thermal.divide(p3)).rename('LST');
  Map.addLayer(LST, {min: 0, max: 350, palette: ['FF0000',
  '00FF00']},'LST');

 /* R code
 LST=(BT/(1+(0.00115*BT/1.4388)*log(EM)))
 print(LST)
 plot(LST)


texts: Creating subfolders in ArcPy's 'in_memory'

texts:
Is there a way to create a subfolder in memory in ArcPy?

For example, instead of temporarily saving a dataset under:

r'in_memory/bufferOne'

I would like to save it under:

r'in_memory/buffers/bufferOne'

This spits out an error message, of course. But is there a way to still achieve the same effect?

Background: I am working on a tool that create a lot of intermediate data that does not need to be saved. Right now I am saving each intermediate output into separate folders, which makes it easier to check out the outputs during testing, and it avoids the annoyance of filtering when using things like arcpy.ListFeatureClasses() (that is actually the number one reason for using all these subfolders):

Now that I know that I am getting the correct results I would like to save most of these steps in_memory, to speed up the tool. It would be ideal if I could just adopt this structure and change a few paths in my script instead of adding a lot of filter logic.


texts: Data type doesn't match error in Sieve filter

texts: I classified some land cover types in aerial image with Erdas Imagine, now I want to remove classification errors showing very small areas. I tried to use Sieve filter, but getting error notification "Data type doesn't match". I tried to use files with TIF and IMG extension. Does anybody know the reason?


texts: How to merge single band chunked raster tiles with ST_Union in PostGIS

texts:
I have written the code below to select specific polygons and determine which grid tiles they intersect via a lookup table. Then depending on the grid tiles I want to merge the associated raster tiles from a single band chunked master raster file.

DROP TABLE dem_stats;
CREATE TABLE dem_stats AS
WITH
--  Select Features using lookup table and determine the raster tiles said features are intersecting
    feat AS
        (SELECT title_no,
                grid_tile_name || '.asc' AS tile_name,
                wkb_geometry
                FROM parcels_all_shapefile_building a, parcels_all_shapefile_lookup_osgb_grid_5km b
                    WHERE a.title_no = b.olp_title_no AND
                          a.title_no = 'AGL253216'
        ),
-- Merge rasters tiles from main raster file that intersect features
    merged_rast AS
        (SELECT filename, ST_Union(rast,1) AS rast
            FROM dem, feat
                WHERE filename
                    IN (tile_name)
                        GROUP BY filename
        ),
-- As the tiles are now merged duplicates are not required
    feat_temp AS
        (SELECT DISTINCT ON (title_no) * FROM feat
        ),
-- Clip merged raster and obtain pixel statistics
    b_stats AS
        (SELECT title_no, (stats).*
            FROM (SELECT title_no, ST_SummaryStats(ST_Clip(a.rast,1,b.wkb_geometry,-9999,true)) AS stats
                FROM merged_rast a
                    INNER JOIN feat_temp b
                ON ST_Intersects(b.wkb_geometry,a.rast)
            ) AS foo
        )
--  Summarise statistics for each title number
    SELECT title_no,
           count As pixel_val_count,
           min AS pixel_val_min,
           max AS pixel_val_max,
           mean AS pixel_val_mean,
           stddev AS pixel_val_stddev
            FROM b_stats
                WHERE count > 0;

Everything works except that instead of a single row result I am getting two as seen below:

So it looks like the raster tiles are not being merged correctly and the pixel statistics are being calculated for each raster tile. Does anyone know what I am doing incorrectly?


texts: Giving Google API key in Google street map used by Leaflet map?

texts:
I using google map as tilelayer in leaflet and its working good but i know after free view ends google will stop displaying of its map

       googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}',{
maxZoom: 20,
subdomains:['mt0','mt1','mt2','mt3']
});

Does anybody know where to put API key or is it free to use?


texts: I have downloaded this plugin rar file now i want to use it in QGIS. How can i do this? while i also search this plugin in qgis plugin search it didn't find.  Do all python plugin are not avaialbe in qgis plugin  search?


texts:
Is it possible to limit the records retrieved from a GeoJSON file?

I have a data file in GeoJSON format that my Leaflet page loads from a local text file and displays as a series of markers

But it's a lot of points, and I only want the few that should be displayed in the current bounding box


texts: How to join a layer once when toggling visibility?

texts:
I have a set of layers contained in several groups ("First group", "Second group" and "Third group"). I created a function where when a layer from any of these groups has its visibility toggled, it is joined by a 'parent' layer which shares the same name as the group the layer is in:

So in the example shown, if I click on Layer_1, it will be joined to the First Group layer. If I click on Layer_8, it will be joined to the Third group layer etc.

The problem is that when I click on a layer from the "First, Second or Third group", it is joined several times instead of just the once.

For example, if I click Layer_3 once and then check the Joins properties:

Here is the code:

from PyQt4.QtCore import *
root = QgsProject.instance().layerTreeRoot()
main_group = root.findGroup('Main group')
layerField = 'ID'

def update_joins():
    for group in main_group.children():
        layer = QgsMapLayerRegistry.instance().mapLayersByName( group.name() )[-1]
        for child in group.children():
            node = root.findLayer(child.layer().id())
            if node.isVisible() == Qt.Checked:
                childField = 'ID'
                joinObject = QgsVectorJoinInfo()
                joinObject.joinLayerId = child.layer().id()
                joinObject.joinFieldName = childField
                joinObject.targetFieldName = layerField
                joinObject.memoryCache = True
                layer.addJoin(joinObject)
            else:
                layer.removeJoin(child.layer().id())

root.visibilityChanged.connect(update_joins)

I'm not exactly sure why it is being joined several times, is there a way to make sure it is only joined once?

I checked QgsVectorJoinInfo and the QgsVectorLayer::vectorJoins to see if it is possible to do a check (i.e. if this layer has been joined then pass) but couldn't find much information.


texts: Change raster cell size while keeping attributes

texts:
I have a raster with a cell size of 1 and I want to increase the cell size to 5 so I use the Aggregate() function in ArcMap 10.4.

The problem I'm seeing is that after processing I lose the desired Attribute Column from my original raster and am left with only the Value field.  The output 'dg100' drops 'FEET_NUM' attribute from the input 'eba_100y' raster value attribute table.

Is there a way to modify the cell size of a raster while keeping all attributes?

Here are the parameters used for Aggregate():


texts: Cache does not work after authorization. Auto-generated cache is not used in Lizmap 3.4.0

texts:
I have 3.3.10 which works well in this regard.
I installed 3.4.0 and generate tiles by script PHP lizmap/scripts/script.php lizmap~wmts:seeding [-v] [-f] repository project layer TileMatrixSet TileMatrixMin TileMatrixMax into SQLite as before. But Lizmap 3.4.0 not use this cache and it regenerates the cache. If I open the 3.3.10 version this uses the same cache generated by the script.
And in 3.4.0 if I connect by guest and generate cache tiles I can reuse it next time. But if login, for example, as admin tiles start to regenerate.
Please help me solve my problems with version 3.4.0.

How can I get the script generated cache to be used (3.3.10 uses the generated cache correctly)?
How can I use a common cache for all users, and not generate for each user separately?


texts: Displaying 3D maps in ArcGIS JavaScript API 3?

texts:
We are going to create 3D maps in ArcGIS Desktop with the help of 3d analyst extension and then I want to integrate those maps with ArcGIS Java Script API 3.2/3.3 (after publishing maps on server 10.1)

I researched on Google and ESRI help regarding display 3d map in java script application but not get confirm information although we do not have ArcGIS extension for Bing maps.

So it is possible to display 3d maps in JSAPI 3.2/3.3??

Software platform: ArcGIS Desktop and Server 10.1

Links that I have referred  :

ESRI forum

ArcGIS Extension for Bing Maps


texts: ArcMap ObjectID seems to be getting changed, any ideas what might be doing it?

texts:
I am working with ArcMap10.0 and MDB's, often creating Definition Queries based off my ObjectID with the understanding that this unique identifier should not change over time.  ie. if I create features 1,2,3,4 and then delete #2 I should still have features 1,3,4 with 3 & 4 not renumbering themselves to fill in the gap, correct?  If, after deleting feature 2, I then add feature 5 it will not 'replace' feature 2 but will be 5, and 2 will never be used again.

Is this a correct understanding of how an ObjectID in a feature class works?

My issue is that my Definition Queries are often not working when I revisit an old MXD,and when i check the OID's being DQ'd off I find they are different from the ones in the FC's attribute table.

I suspect the only way this could happen would be if the FC was copied into a new FC, then the features would renumber, but otherwise the numbers should not change, correct?

I want to still use OID's to DQ as it's the easiest thing to use for my purposes, but if I can't be sure that a feature with OID #1 will not stay #1, this won't work.


texts: Parcel Fabric visible in ArcCatalog but not in Pro

texts: I'm new to Pro and very new to parcel fabrics.  I followed some instructions I found online and ran an Append on a feature class to create a parcel fabric.  It said it was successful, and in Arc Catalog I can see all of the new feature classes in the feature dataset.  However, when I try and add the parcel fabric to Pro it is not there to add.  I was able to drag the feature dataset from the Pro catalog into the table of contents but the parcel fabric isn't in it.


texts: Not able to check the correctness of the SDE connection file

texts: I have passed willingly wrong parameters while creating the SDE connection through "CreateDatabaseconnnection_management". How can I check if it is a correct workspace that is linked with my GDB, before using the workspace. I have googled it, but got the describe would work.


texts: KML too large for browser - can this be done in a server?

texts:
Please note, this question is similar to this question, which is 4 years old and has no accepted answer. The closest to an answer in that thread - using fusiontables - is not going to work for me because its answer to question #2 below is 'no'.

I have a large (~20 MB) KMZ file, which I need to display in a web browser.  Displaying even a small portion of it (~2000 markers) locally quickly overwhelms the browser, so I believe I need to use a server. I am very new to this, however, and have some fundamental questions regarding GIS server functionality.

Can a GIS server such as MapServer render thousands of polygons and placemarks from a KMZ to a tile in real-time? What is this process called?
Can the GIS server respond with additional information stored in the KML file when a user clicks on a placemark?
Can a GIS server execute arbitrary code or scripts, such as a routine to filter placemarks based upon a client-defined polygon?


texts:
Has anyone had any luck with getting QGIS working on Ubuntu 12.04? I have tried the stable and unstable versions and with not luck. I also get the following:

"Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
qgis : Depends: qgis-providers (= 1.8.0-1~precise1) but 1.9.90+git20120502+6229eec~precise1 is to be installed
    Depends: qgis-common (= 1.8.0-1~precise1) but 1.9.90+git20120502+6229eec~precise1 is to be installed
    Recommends: qgis-plugin-globe but it is not going to be installed
    Recommends: qgis-plugin-grass but it is not going to be installed
E: Unable to correct problems, you have held broken packages."


texts: I'm following anita Graser's process (https://anitagraser.com/2011/05/13/catchment-areas-with-pgrouting-driving_distance/) and I don't know how to add LANGUAGE C. When I try to execute  routing_dd.sql it says Language 'C' doesn't exist. I try the command CREATE LANGUAGE 'C' but it is not supported. How can I add this language?


texts:
I have one problem when i need get the response from wfs-t .
In my request have ;

<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns="http://www.opengis.net/wfs" xmlns:BLAC="blac.pbh.gov.br"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="blac.pbh.gov.br https://xx.xx.xxx.xx/blac/wfs?request=DescribeFeatureType&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;TYPENAME=blac:EDIF_CROQUI_IMOVEL_IPTU" version="1.0.0" service="WFS" lockAction="ALL"><Update typeName="blac:EDIF_CROQUI_IMOVEL_IPTU"><Property><Name>COD_EDIFICACAO</Name>
<Value>03</Value>
</Property>
<Property><Name>ID_TIPO_CONSTRUTIVO</Name>
<Value>3</Value>
</Property>
<Property><Name>ID_CROQUI_IMOVEL_IPTU</Name>
<Value>49661</Value>
</Property>
<Property><Name>NUM_PAVIMENTO</Name>
<Value>1</Value>
</Property>
<ogc:Filter><ogc:Filter><ogc:FeatureId fid="EDIF_CROQUI_IMOVEL_IPTU.236511"/>
</ogc:Filter>
</ogc:Filter>
</Update>
</Transaction>

This request return sucess, but the tag   always is equal "none".

<wfs:WFS_TransactionResponse version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/wfs https://blac-
hm.pbh.gov.br:443/schemas/wfs/1.0.0/WFS-transaction.xsd">
<wfs:InsertResult>        <ogc:FeatureId fid="none" />
</wfs:InsertResult>
<wfs:TransactionResult>
    <wfs:Status>            <wfs:SUCCESS />
</wfs:Status>
</wfs:TransactionResult>
</wfs:WFS_TransactionResponse>

Why does this value always come as "none", even the update being done correctly in the database?


texts: CMV (Configurable Map viewer) - Possible to use "Custom TiledMapServiceLayer" as a basemap?

texts:
Is it possible to use a "Custom TiledMapServiceLayer" as a Basemap?
Is it possible to show a "Custom TiledMapServiceLayer" in BasemapGallery?


texts:
Using QGIS 2.12, Qgiscloud version 1.1.14 (on OSX 10.11). When uploading a shape (with 427 lines), I get this error:

Aanmaken van velden mislukt

Traceback (most recent call last):
  File "/Users/joris/.qgis2/python/plugins/qgiscloud/qgiscloudplugindialog.py", line 729, in upload_data
    self.db_connections.db(db_name), data_sources_items, maxSize)
  File "/Users/joris/.qgis2/python/plugins/qgiscloud/data_upload.py", line 238, in upload
    raise RuntimeError(messages)
RuntimeError: Aanmaken van velden mislukt

How to solve this?


texts: High Resolution Terrain Data for the Philippines

texts: Where can i download Philippines terrain data that is better than the 30 m ASTER global dataset?


texts: Is there a way in QGIS to prioritize the layering order overlapping polygons. I have a shapefile with numbers in the attribute table from 1-20. Each number is associated with its own polygon. I want to layer the polygons from highest number to lowest. I would like to colour fill them as well. And it's basically a contour map.


texts: Loading data into file geodatabase without rebuilding relationship classes manually?

texts:
I have a file geodatabase with a few M-N composite relationships classes. Every few weeks or months I need to load new data into GDB tables; for this I need to delete the relationship classes, load the data and then rebuild the relationship classes using table to relationship classes GP tool.

Is there a way  to save Geoprocesing results so that processes will be simpler and I will not need to remember all the parameters of all the relationship classes?


texts: How to export ArcMap model parameters to an Excel file?

texts:
I have a model where the user inserts different model parameters like "Name", "Elevation", "Threshold A", "Threshold B" and so on. Based on this, features get selected, saved to .xls files where they feed a chart/diagram maker for a report.
To these charts, I need to include (or link) the model parameters the user inserted. I would like to write them to an Excel file, but any table is fine.

I thought of writing those variables to a newly created GeoDatabase table with the Calculate Field Tool (the table already had its field names and data types according to the variables), but I'm not good in Python. It also said that the table had no records. I tried with another table with existing records by calculating the fields I had added, but without success.

Is there any (easy) way to export my variables to a list or table I can then export to Excel format?


texts: Land cover classification algorithms in SEPAL

texts:
What is the algorithm for land cover classification employed by SEPAL in the  Classification recipe ?
I am not able to find any options to view the algorithm being used so I don't know if it's possible to choose between different ones.


texts:
I have created a directed graph from the nodes stored within my Postgres db but the resulting graph doesn't seem to be fully connected and as a result my shortest path algorithm is not able to find a path between start and end nodes.

When creating a graph, using networkx, from the nodes stored in my db (created by OSM2PO), I iterate through them adding edges to targets and their cost.

Am I along the correct lines, with using this graph creation algorithm? I have seen examples of converting OSM to graphs using the XML format and understand how they are iterating through the ways to populate the graph. What I don't understand is when using my implementation, there are multiple nodes of the same type referring to different 'edges' or paths to different target nodes, how is the algorithm just going through the database and connecting source to targets not working.


texts: Merge classes using Reclassify in python

texts:
When I run the Reclassify tool from arcmap 10.1 and assign a 1 to each of the crop types it combines them into one class. However, when I try to recreate this in python it does not merge the crop class types into one class. Below is the code:

These are the parameters and results when I run it directly from the arc tool box and not from python. Below is what I am trying to reproduce using python:


texts: Detecting last added feature for custom plugin using PyQGIS?

texts:
I made a custom plugin to create and delete features, but I need to detect the last added feature id.

When I recently added it to layer, the id is always 0.

I tried to use the QgsVectorLayer signal 'featureAdded' like this:

layer.featureAdded.connect(self.test)

def test(self, fId):
    print(fId)

The signal is not triggered when I create the feature using python code.


texts: Using Arc Objects to collapse a layer in the map TOC

texts:
I have the following snippit of code to perform this.  However, it doesn't do anything to the layer in the TOC on the map that gets generated from this code.  When the layer is created and the map shows up, the layer appears expanded.  I want it to collapse.  Am I doing something wrong?  Thanks.

        IMap aMap = axMapControl1.ActiveView.FocusMap;
        ILayer pLayer = aMap.get_Layer(0);
        INALayer2 anNALyr = (INALayer2)pLayer;
        anNALyr.Expanded = false;
        axTOCControl1.Refresh();

Also, how do I get a layer in the TOC to move to the bottom of the TOC?


texts: Where do those cloud data overlay images come from

texts:
Certain time-based (rain) cloud data appears on different sites and apps. This gives the impression that the rain and cloud data is available (for free or licensable), and that multiple sites make use of the same data.

Where do sat24, meteox, meteoradar, buienradar, rainydays and the likes get their cloud data from?


texts: QGIS create a new merged layer from selection on multiple layers

texts:
I have a big map with several layers. I want to extract a small area in the map and merge the layers.

I tried to merge the layers and than to select the zone I am interested, but the merging is impossible due to the size of the original map (the algorithm started and after 20 minutes it was at 1%)

Is it possible to select the same area from multiple layers and create a new merged layer (without extracting zone from the original layers one-by-one) ?


texts: Algorithm to determinate neighbor's position (N S E W) of parcels?

texts:
After my first publicaation Determinate Parcel Neighbors using PYTHON
Where i was looking for a faster way to calculate parcel neighbors and position, and after succeeding that, but the result was not full and reliable at 100%, view of complexity of your shapes, so Mr. Richard Fairhurst proposed me to start a new tread and search for a new algorith more efficient and giving more complete and reliable results !

So me i suggest as algorithm to calculate centroide of each polygon, then make a multiple projections of this point on the intersection between two polygons (target and neighbor polygon)

After calculate a bearing of each line, then associate bearings  to the compass points are [45-135] = North, [135-225] = West, [225-315] = South, [315-359.9..., 0-45] = East....

So My Question are :

what do you think about the algorithm is it strong or can stack...
Do you have any way or idea how  to make a projections explained before ?

for the rest i made it before as you can see on the last publication mentionned before !

I'am using Arcgis 10.1, and Python language.


texts: Expand Street Network passing through points using QGIS?

texts:
I have a road network (red) passing through some traffic data points (green):

I want to expand this network to include all of the points. I already have a bigger street network (blue) from which I can take the missing streets.

I am using QGIS.

It would be great if the traffic data of the points could be associated to the street passing through it.


texts:
I am trying to filter features within a shapefile for a specific date range. In the shapefile, one of the attributes is "date" and I would like to be able to filter it so it only shows a specific date range at all times. Basically I need it to show all features where the "date" is from the 22nd of the previous month to the 21st of the current month. I have worked out how to show the whole of the previous month or whole of current month but cannot seem to filter by day as well as month.

Something along the lines of:

"date" > year($now), month($now-'1'), day('21')
AND "date" < year($now), month($now), day('22')


texts: Web browser capacity to display maximum records on Map using ArcGIS JSAPI 3.3/3.4

texts:
I have created ArcGIS JSAPI application in which I am displaying almost 50 thousand records at specific point.

As usual, my browser hangs (until 30 thousand its showing but after 30 thousand it hangs) while displaying such large records so I want to know the browser capacity to display number of records.

I am using ESRI 10.1 suit (ArcGIS Desktop and ArcGIS Server). I have changed default setting in ArcGIS Server to display records (default was 1000 and now its 80,000)

In addition, I am searching on Google regarding the browser capacity to display number of records on map but it is not clearly mention plus ESRI support people also cannot given such article for ArcGIS JSAPI and I have search in the web help also unable to find any document.

So is there any standard document or article that explains the maximum capacity to display number of records on map using ESRI JSAPI??

Tested on following Web browser: Firefox, Chrome, IE (very bad) and Safari (using latest version for all browsers)

Thanks in advance : )


texts:
I want to convert a QGIS layer to Gephi. Im not sure what steps I need to take to make this happen. Currently I have a layer with numerous trials (edges). And I will be using water holes as nodes.

However I'm not sure how to set the data up to convert and import the data into Gephi software?


texts: How to get bounding box from a postgis database in terms of degrees?

texts: How do you obtain the bounding box for a postgis database in terms of degrees (latitude in degrees and longitude in degrees)?


texts:
I'd like to map the grid of SecondLife / OpenSim World.
This grid is composed by sims of 254 x 254 meters. This kind of world is flat. It has only two flat dimensions and the elevation of the sea and ground (normally the deeper point is elevation 0 while sea level is 20 meters of elevation). What kind of CRS have I to prepare to do this?


texts: Calculating area within buffer using ArcGIS Desktop?

texts:
I'm trying to calculate how much area of urban green areas are within a buffer of 20 meters from apartments. For this I use the buffer tool first and then try to use Intersect, as you can see in the image. So I only get the portion of the urban green areas who are within the buffer.
However, all my apartments are coded with a column that's named ID in the point dataset. How can I preserve the ID of the apartments when I use Intersect?

Since I want to import this information in an Excel sheet it's important that the information matches with the ID of the apartments.

Edit:

I tried using the Tabulate Intersection as suggested, with my buffer polygons and my urban green areas and I believe it worked quite all right. The only problem seems to be that the ID of apartments that aren't in the buffer are disregarded as you can see in the table it doesn't go in ID number order.


texts: Where should I create my network dataset in ArcGIS?

texts: I want to create a new network dataset from a street layer. Should I create it in a normal file or in a personal geodatabase?


texts: How do ESRI and QGIS calculate scale values of geographic projections?

texts:
Does anyone know how (from which location) scale values are calculated in ESRI products and QGIS for geographic projections?

The only thing I've noticed is that QGIS is changing scales when you pan for instance in WGS84 while ESRI scale is fixed and independent from the viewport.

I am guessing that ESRI takes the length of a degree on the equator and treats it as linear unit for scale calculation and QGIS is taking a point from the viewport (centre?) - but these are just my factless assumptions as I wasn't able to find anything on the net.


texts: How to perform transformations using ProjNet?

texts:
While writing some unit tests I thought it would be convenient/possible to use ProjNet to convert from EPSG:4326 into several other coordinate systems (3875,3395).  I figured it would be as easy as grabbing the WKT values from spatialreference.org:

http://spatialreference.org/ref/epsg/4326/ogcwkt/
http://spatialreference.org/ref/epsg/3395/ogcwkt/
http://spatialreference.org/ref/sr-org/6864/ogcwkt/

Add a reference to ProjNet and running the following code:

var cf = new ProjNet.CoordinateSystems.CoordinateSystemFactory ( );
var f = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory ( );
var sys4326 = cf.CreateFromWkt ( wkt4326 );
var sys3857 = cf.CreateFromWkt ( wkt3857 );
var sys3395 = cf.CreateFromWkt ( wkt3395 );
var transformTo3875 = f.CreateFromCoordinateSystems ( sys4326, sys3857 );
var transformTo3395 = f.CreateFromCoordinateSystems ( sys4326, sys3395 );

But 3857 and 3395 could not be parsed.  I googled around and found a workable 3857 though I haven't confirmed it produces a correct result.  I continue to get an error parsing 3395 (Expecting ('PROJECTION') but got a 'UNIT' at line 1 column 296.).

Perhaps the "OGC WKT" can be modified in a predicable way to work with ProjNet?  Or perhaps ProjNet is not the best .NET solution for re-projecting coordinates?

const string wkt4326 = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]";
const string wkt3857 = "PROJCS[\"Popular Visualisation CRS / Mercator\", GEOGCS[\"Popular Visualisation CRS\", DATUM[\"Popular Visualisation Datum\", SPHEROID[\"Popular Visualisation Sphere\", 6378137, 0, AUTHORITY[\"EPSG\",\"7059\"]], TOWGS84[0, 0, 0, 0, 0, 0, 0], AUTHORITY[\"EPSG\",\"6055\"] ], PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\", \"8901\"]], UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\", \"9102\"]], AXIS[\"E\", EAST], AXIS[\"N\", NORTH], AUTHORITY[\"EPSG\",\"4055\"] ], PROJECTION[\"Mercator\"], PARAMETER[\"False_Easting\", 0], PARAMETER[\"False_Northing\", 0], PARAMETER[\"Central_Meridian\", 0], PARAMETER[\"Latitude_of_origin\", 0], UNIT[\"metre\", 1, AUTHORITY[\"EPSG\", \"9001\"]], AXIS[\"East\", EAST], AXIS[\"North\", NORTH], AUTHORITY[\"EPSG\",\"3785\"]]";
const string wkt3395 = "PROJCS[\"WGS 84 / World Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],AUTHORITY[\"EPSG\",\"3395\"],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]";


texts: How to take all active layers as input for an iterative algorithm?

texts:
I have a whole list of different layers I want to do a iterative clipping algorithm on. (Batch processing is not an option as the 'iterate' button is gone.)

This is a follow up on my question here.

It's tedious having to make a new model every time I want to do this task. It'd be easier if there was a way to give an input of all active layers. I have no experience with pyqgis but it seems like a solid way to start if there is no easier way, but that's for another question.

My question, is there a way to take all active layers as an input for a iterative geoprocessing algorithm?


texts: REST End Point Still Showing Old Alias of Updated Field After Publishing

texts:
Using ArcGIS 10.6 and ArcGIS Server 10.6. I have changed the Alias of a Feature Class to ObjectID like

and it is showing in the attribute table like

(After Saving and even re-booting the MXD) but when I publish the map as Map Service the output still showing old alias (FID)  in the Service REST end point!

Can you please let me know why this is happening and how I can fix this?


texts: QGIS Value Map Edit Widget with properties dependent on another field

texts:
I'm having a problems with Edit Widgets in QGIS. I'm working on a GIS Database for archaeological data, where every site is represented by a polygon. In the attributes there is a field for the era which that site belongs to. I made this with Value Map, so as to make data processing easier and redundancy-free(er). My problem is that I'm trying to add a "sub-era" field as well to show if a site belongs to a certain period in a given era.

Naturally I want to use the same type of edit widget, but instead of listing every period for the whole database I thought I would make the period-field's value range dependent on the era selected in the previous field. For example: I have a site that belongs to the Roman Age, and I choose this at the era, so then in the period field only the periods for the Roman Age are shown (1st century, 2nd century, etc.), and the periods relevant to other eras are not.

Is this possible somehow in QGIS?

Thanks for the answers in advance!


texts: I have made a web map with ArcIMS 9.3, and now I want to publish it. How?


texts: How to get whole image exported from Google Earth Engine?

texts:
I used the LANDSAT 8 TOA data to create an NDVI image. I want to export the image to my Drive. I have most of the code and it works, but I can't get the whole image in the export. It should cover the state of North Carolina, but I only see about 2/3 in the exported TIF. Also, the colors are apparently missing. In Earth Engine, it draws with green, but the exported image is greyscale or similar.
var center_pt = /* color: #98ff00 */ee.Geometry.Point([-78.833013671875, 35.0]);

var cloudMNDVI = function(image) {
    var q = image.select('BQA');
    var c1 = q.eq(61440);
    var c2 = q.eq(53248);
    var c3 = q.eq(28672);
    var mask = c1.or(c2).or(c3).not();
    var imag_mask = image.updateMask(mask);
    var ndvi = imag_mask.normalizedDifference(['B5','B4']);
    return ndvi.set('system:time_start', image.get('system:time_start'));
};

var nc = ee.FeatureCollection('TIGER/2016/States').filter(ee.Filter.eq('STATEFP', '37')).geometry();
//var ncBase = ee.FeatureCollection('TIGER/2016/States').filter(ee.Filter.eq('STATEFP', '37'));
//print(ncBase)

var nc_l8toa = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA").filterBounds(nc);

var nc_NDVI = nc_l8toa.map(cloudMNDVI);
var nc_NDmax = nc_NDVI.reduce(ee.Reducer.max());
var landMask = ee.Image('CGIAR/SRTM90_V4').mask();
var nc_best_landmk = nc_NDmax.updateMask(landMask);

var ndviVisParam = {min: -0.8, max: 0.8, palette: ['65eaaf', 'c2f1ce', 'daf7e5', 'a6f79d', '44f35e']};

print(nc_best_landmk)
Map.centerObject(center_pt, 6);
Map.addLayer(nc_best_landmk.clip(nc), ndviVisParam);

Export.image.toDrive({
  image: nc_best_landmk,
  description: 'imageToDriveExample',
  scale: 30,
  region: nc
});

This is what the export looks like:

In the export script of the Tasks section, where it prompts for some export parameters, I've tried 30m, 300m, and 1000m. It wouldn't even start with 30m, but with 300m and 1000m, it's made the same image for export, one shown above, each time.
How do I get the image that covers all of N.C. and has the same colors as this into the export?

EDIT - I saw the answer from Madeleine and ran the process again. I made a screenshot of the Task and even though it's hard to see, you can see the image is completely drawn as I was completing the settings for Task. The exported image from this last process is also only partial, like the one I already included when I first wrote this question.


texts: Identify feature on feature layer (shapefile) automatically without mouse click event on ArcMap 10.2

texts:
With a longitude and latitude value, I am trying to identify feature (shapefile) on feature layer with no mouse click or user interaction.  On debugging mode with an attach process on ArcMap.exe, the code was executed successfully but on run time where I need to autorun a mxd report, the code failed at this lines:
pIdentify = CType(pFeatureLayer, IIdentify)
pArray = pIdentify.Identify(pPoint)

Error Message:  Object reference not set to an instance of an object.
I'm using VB.NET.  ArcMap Version is 10.2.  Why does my code works on debugging mode and not on run time when it runs a mxd report automatically?  Does identify feature on a layer works without a mouse click event?   What am I missing?
Below is my code example:
Dim strShapeFilePath As String = "C:\FolderName\Shape_File.shp"
Dim pFileInfo As FileInfo = New FileInfo(strShapeFilePath)
Dim pWorkspaceFactory As IWorkspaceFactory
Dim pFeatureWorkspace As IFeatureWorkspace
Dim pFeatureLayer As IFeatureLayer
Dim pMxDocument As IMxDocument
Dim pMap As IMap
Dim pLatY As Double = 38.540611
Dim pLonX As Double = -121.489388
Dim pFeature As IFeature
Dim pFeatureClass As IFeatureClass
Dim pActiveView As IActiveView
Dim pIdentify As IIdentify
Dim pArray As IArray
Dim pPoint As IPoint
Dim pGeom As IGeometry

pWorkspaceFactory = new ShapefileWorkspaceFactoryClass()
pFeatureWorkspace = TryCast(pWorkspaceFactory.OpenFromFile(pFileInfo.Directory.ToString(), 0),IFeatureWorkspace)
pFeatureClass = pFeatureWorkspace.OpenFeatureClass(pFileInfo.Name)

pFeatureLayer = New FeatureLayer
pFeatureLayer.FeatureClass = pFeatureClass
pFeatureLayer.Name = pFileInfo.Name
pFeatureLayer.Visible = True

pMxDocument = Me.mxDocument
pMap = pMxDocument.FocusMap

pActiveView = mxDocument.ActiveView
pActiveView.Refresh()
pMap.AddLayer(pFeatureLayer)

pPoint = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(pLonX, pLatY)
pGeom = pPoint
pIdentify = CType(pFeatureLayer, IIdentify)
pArray = pIdentify.Identify(pPoint)

Dim intOID As Integer = -1

If pArray IsNot Nothing Then
     Dim pObject As Object = pArray.Element(0)
     Dim pFeatureIdentifyObj As IFeatureIdentifyObj = TryCast(pObject, IFeatureIdentifyObj)
     Dim pRowIdentifyObject As IRowIdentifyObject = TryCast(pFeatureIdentifyObj, IRowIdentifyObject)
     pFeature = TryCast(pRowIdentifyObject.Row, IFeature)
     intOID = pFeature.OID
End If


texts: Panning point cloud model in CloudCompare

texts:
Im running CloudCompare on my Mac via the OSX build.

Is there a pan tool in CloudCompare so that i can pan model as opposed to just being able to just rotate it ?


texts:
I have a raster file I need to clip. I created a virtual raster which I used to "copy" the extent from in QGIS raster calculator. As a result, I get the raster with the extent I need, but pixel size changes and it looks fuzzy compared with the original raster...
Does anyone know how to avoid or correct this problem?

The first printscreen shows the original raster:

The second printscreen shows the raster after beeing clipped:


texts: While applying sen2cor correction in SNAP on sentinel-2 L1c product i receive this error "cannot find L2A data strip directory" how i solve this error


texts: Rendering specific z x y tiles using Tilemill?

texts:
I own a tilemill project executed in command line. I want to update an specific tiles in order to avoid to reload the entire mbtiles file. Too much CPU time.

I see in tilemill documentation the --scheme and --list params, but I don't know how it works.

Another user of this site  at Rendering specific tiles (by x,y,z) using TileMill posted a possible solution, but it does not work for me. I use a filescheme.json downloaded from github, and rewritten at my own tiles configuration, but it always returns
[0s] 100.0000% 10/10 @ 32/s | 0s left | V 0 ■ 0 ? 10 fail 0
[0s] 100.0000% 10/10 @ 30/s | 0s left | V 0 ■ 0 ? 10 fail 0
and a empty mbtiles (16KB) file. No error thrown.

This is my filescheme.json

{"z":13,"x":3961,"y":5199,"key":false}
{"z":14,"x":7922,"y":10398,"key":false}
{"z":15,"x":15844,"y":20797,"key":false}
{"z":16,"x":31689,"y":41594,"key":false}
{"z":17,"x":63379,"y":83188,"key":false}
{"z":18,"x":126759,"y":166376,"key":false}
{"z":19,"x":253519,"y":332753,"key":false}
{"z":20,"x":507039,"y":665507,"key":false}
{"z":21,"x":1014079,"y":1331014,"key":false}
{"z":22,"x":2028158,"y":2662029,"key":false}

If it is not possible, is there any other possible solution to update a specific zxy tile?


texts: Combining 3 shapefiles indices to a single index in a single shapefile in ArcGIS 10.1

texts:
I have different polygon shapefiles, each having an index of accessibility within an administrative region ranging from 0 to 1 as an attribute.  The suitability increases from 1 to 0. How can I combine the three in ArcGIS to get one indicator?
I have assigned each attributes within a shapefile a scale of 1 to 5 depending on increasing suitabilty then summed the three up and standardized. Is this logical
I have full licence with all extensions


texts: Editing/creating new Normal.mxt template in ArcGIS for Desktop?

texts:
I used to work with .mxt templates often back in version 9 and 8 but things seems to have changed since then.

I realized that my new documents are loading a style file I don't want to to be loaded in any of my new documents but I am unable to simply unchecked it in the style manager - it always comes back. (This is a style file somehow autimatically generated by Geosoft Target, a geological drillhole management software which I need to have installed on the machine.) Before I contact Geosoft I wanted to try if I can prevent ArmMap it from loading this custom style by removing it from the mxt template itself.

This is not as easy as I've envisioned since there is no Save As mxt option in version 10.1.

I saved my document as Normal.mxd into the \AppData\Roaming\ESRI\Desktop10.1\ArcMap\Templates  folder and deleted the Normal.mxt.  (As per ESRI: Any map document (.mxd) can be used as a map template.)

Starting ArcMap generated a new Normal.mxt in the "Templates" directory ignoring the Normal.mxd I saved there.

Changing the Normal.mxd extension to mxt results in ArcMap launching a completely blank document.

How can I edit the existing mxt or create a new mxt?


texts: assign text values to selected subset in the attribute table in QGIS

texts: I am using QGIS and I would like to generate a new string of text in the attribute table for a selected subset of features in a vector file. I cannot find an operator in the field calculator to perform this task.


texts: Verify PostGIS connection, username and password

texts:
I wrote the code below, but I need that the PostGIS connection to be verified, to be sure that the username and password are right.
I tried this: How to access user credentials in database connection?
 , but it didn't worked.

I am using QGIS 3.8.3

uri = QgsDataSourceUri()
uri.setConnection('LPOSTDES-CL2', '5432', 'ugpi', None, None)
connInfo = uri.connectionInfo()
(success ,user, passwd) = QgsCredentials.instance().get(connInfo, None, None)
if success:
    QgsCredentials.instance().put(connInfo, user, passwd)
uri.setConnection('LPOSTDES-CL2', '5432', 'ugpi', user, passwd)


texts:
I have a vector file containing contour with 2m accuracy, covering a large area (All Hong Kong).

I tried to generate an elevation raster map with the file, by first rasterized the  vector, using v.to.rast, and then generate the elevation map, by r.surf.contour.

The output file of step 1 (v.to.rast) is approximately 60GB. The resolution is 0.3m.

When I run the second step, I got the error: unable to allocate 808507328 bytes of memory at raster surf.contour

I guess it is because the file size is too large. I am using 64 bit version of QGIS 3.6.3. I am not sure whether  the Grass installed is also 64 bit.

My question: is there any better way to do this?
Currently, I am trying to separate the region into multiple pieces


texts: What is the difference between ST_BuildArea and ST_Polygonize?

texts:
The two functions ST_BuildArea and ST_Polygonize both take lines and produce polygons.

It seems that ST_BuildArea assumes that inner rings represent holes and omits them from the result, while ST_Polygonize includes them in the result.  And the mechanics of using the functions are a bit different: ST_Polygonize is an aggregate, while ST_BuildArea requires that you bundle up the inputs yourself using ST_Collect.

Beyond this, are there any differences between the two functions?


texts: How to remove vector grid cells that don't overlap with features from a certain layer in QGIS?

texts:
I am working on displaying a road network with QGIS (2.4). Doing this I have a couple of layers, including a base network of roads, and my modified layer. All in all they become a huge network. Therefore when exporting the map, I decided to use the atlas function in QGIS. The approach is to make a vector grid bound by my road map, and each cell in the grid of a reasonable size for the desired level of detail.

All in all this process works well, except for that my map is rather irregular and doesn't really fill the vector grid area. To prevent a lot of empty and useless pages in the generated atlas, I started deleting empty cells. This process was significantly improved when I figured out that I could select the cells by rectangle instead of one by one, but is still extremely tedious because of the amount of cells and map detail that has to be examined.

My question is therefore if there exists a way to (more easily) delete all cells in the vector layer that do not bound or intersect features from my main layer?


texts: arcpy pydev 3rd party toolbox intellisense

texts:
I am just newly started to look at arcpy and i see that it has good intellisense for system toolboxes by default and also if you import a custom toolbox - the intellisense gets update also - however this seems to only work in arcgis built-in python.

i am trying to setup this in pydev/eclipse - but even though i imported my toolbox stll pydev cannot recognise

toolsNameError: name 'Mytool' is not defined

but if you run it works fine. - i just want to work in pydev and to be able to see the custom tool references also ?

anybody can help

thanks

MJ


texts: Either GeoJson to TopoJson conversion problem, or projection-issue with D3.js

texts:
My 'handcrafted' cartogram (How to create contiguous area cartograms in QGIS or R?) is ready to embed in code - I want to present it online with D3.js.

Therefore I produced a topoJSON file of it - but all I get are weird shapes all around the globe.

Here is the (simplified) cartogram in geoJSON (file:removed) - it works perfectly with QGis. Also I checked the geometry in QGis and it doesn't display an error [Vector > Geometry Tools > Check geometry validity].

I tried both: From QGis > geoJSON > topoJSON (with topojson), and QGis > ESRI shapefile > geoJSON (with ogr2ogr) > topoJSON (with topojson).

Also I tried reprojection with ogr2ogr:

ogr2ogr "ESRI Shapefile" -t_srs EPSG:4326 outfile.shp infile.shp

And I did the whole thing with UTF-8 flag:

topojson --shapefile-encoding utf8 -o outfile.json infile.shp

Here is the (simplified) cartogram in topoJSON (file:removed), and it looks ok to me - even the json-validators are happy with it.

But my D3.js code just results in weird shapes and lines.

<head>
    <meta charset="utf-8">
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://d3js.org/topojson.v0.min.js"></script>
    <title></title>
    <style>

    .unit {
        fill: none;
        stroke: #111;
        stroke-linejoin: round;
    }

    </style>
</head>
<body>
<script>

    var width = 600,
        height = 600;

    var projection = d3.geo.albers() // also: orthographic & mercator wont work
        .rotate([0, 0])
        .center([8.43, 46.8]) // Switzerland
        .scale(100);

    var path = d3.geo.path()
        .projection(projection);

    var svg = d3.select("body").append("svg")
        .attr("width", width)
        .attr("height", height);

    d3.json("hexmap.json", function(error, hexm) {
        var units = topojson.object(hexm, hexm.objects.hexmap).geometries[25];

        svg.append("path")
           .datum(units)
           .attr("class", "unit")
           .attr("d", path);
    });

</script>
</body>

I just don't know where I am going wrong... Is it the projection? The conversion? Are the files ok?

EDIT - SOLUTION

use a transferable projection in the first place.
the correct ogr2ogr command:

 ogr2ogr "GEOJSON" -s_srs infile.prj -t_srs EPSG:4326 outfile.geojson infile.shp

alternative:

     ogr2ogr "GEOJSON" -s_srs EPSG:21781 -t_srs EPSG:4326 outfile.geojson infile.shp


texts: Loading components of shapefile in QGIS?

texts:
I have a zipped shapefile with all components in place. It has a .shp file, a .dbf file and a .shx file.Projection file (.prj) and .sbn and .sbx files are also in place. I have tried loading the zipped file directly, but this has resulted in only .shp rendered.

It is a shapefile describing Bus-Routes through a city centre. Currently, only the streets are showing and I can't see the data contained in the .dbf file when I open attribute table of the layer I have loaded (by loading the zip file).

Any ideas about loading the components individually in QGIS 2.18?


texts: How to Create Random Points Within a Polygon (Vector Layer)

texts:
I have a vector layer that covers a few acres of land, with the buildings cut out (so essentially just the soil in the area). I want to generate points within this defined area. Later, I will use my random point sampling plugin to do so. I can do that, but I cannot get the computer to make the points.

I go to Vector -> Research -> Random Points. From there, I select this layer and use it as the boundary. I want the result unstratified, but neither unstratified nor stratified seem to work. The program creates the corresponding files and new layer, but the points do not appear on the canvas. I have tried changing the appearance of the points to be more visible, but still cannot see them.

What have I done wrong? I am new to Quantum and trying to work out a few kinks.


texts: OpenLayers: Can I drag a feature between two maps?

texts:
Is it possible to drag the features between two different maps?

Now, I create feature on event mouseenter but I would like to insert the feature and at the same time start to drag this feature.


texts:
I am trying to get the first x-coordinates of a polygon. However I only get zero in return. What could cause that?

import os, sys, gdal, ogr
from gdalconst import *

driver = ogr.GetDriverByName('ESRI Shapefile')
testarea = driver.Open('testarea.shp', 0)
testarealyr = testarea.GetLayer()
testareafeature = testarealyr.GetNextFeature()

# get the x,y coordinates for the point
testareageom = testareafeature.GetGeometryRef()
print testareageom

x = testareageom.GetX()
print x

>>>
POLYGON ((-124.1963006330602 43.006410659375554,-124.1861022086067 43.006647759060762,-124.1858958821004 43.00274627515271,-124.19612378176909 43.002422936639086,-124.19612378176909 43.002422936639086,-124.1963006330602 43.006410659375554))
0.0
>>>


texts: How can I create a consistent  element in a QGIS project's layer?

texts:
From a standalone python script (i.e. not running within QGIS) I am manipulating QGIS a project file (*.qgs) to have its layers point to different geometry data.

That geometry data can be in different spatial reference systems (SRS), so I'd like to also adapt the <maplayer>'s <srs> child element, so that QGIS will know it and display it correctly in the layer properties dialog.

Unfortunately, (like many other things in the QGIS project files) this element seems to be unnecessarily redundant and QGIS seems to actually depend on redundant information for the display. The entry might look like this:

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis projectname="" version="2.18.10">
  <!-- ... -->
  <projectlayers>
    <maplayer <!-- ... --> >
      <!-- ... -->
      <srs>
        <spatialrefsys>
          <proj4>+proj=longlat +ellps=intl +towgs84=72.438,345.918,79.486,1.6045,0.8823,0.5565,1.3746 +no_defs</proj4>
          <srsid>3482</srsid>
          <srid>4629</srid>
          <authid>EPSG:4629</authid>
          <description>Tahaa 54</description>
          <projectionacronym>longlat</projectionacronym>
          <ellipsoidacronym>intl</ellipsoidacronym>
          <geographicflag>true</geographicflag>
        </spatialrefsys>
      </srs>
      <!-- ... -->
    </maplayer>
  </projectlayers>
  <!-- ... -->
</qgis>

Having just the PostGIS/EPSG SRID, how do I get the rest of the information needed to create such an entry consistently? The SRS can differ but is known (by its SRID) at runtime.

I tried giving only the PostGIS/EPSG SRID by shortening the entry to

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis projectname="" version="2.18.10">
  <!-- ... -->
  <projectlayers>
    <maplayer <!-- ... --> >
      <!-- ... -->
      <srs>
        <spatialrefsys>
          <srid>4629</srid>
        </spatialrefsys>
      </srs>
      <!-- ... -->
    </maplayer>
  </projectlayers>
  <!-- ... -->
</qgis>

but then QGIS will not display it correctly in the layer properties:

expected:

(Also, while the data is being displayed, I'm not sure whether it would be projected correctly with that partial information.)

Where does QGIS take this information from when creating a new layer?


texts: Retrieve FeatureMember Tags from geoserver that have certain value in one attribute

texts:
If I send this request to my geoserver (2.4.4):

http://mygeoserver.de?service=WFS&version=1.0.0&request=GetFeature&typeName=mytype:mylayer&maxFeatures=50

I get an xml document like this:

<wfs:FeatureCollection ...>
<gml:featureMember>....
<mytype:INDEX>0</mytype:INDEX>
</gml:featureMember>
<gml:featureMember>....
<mytype:INDEX>1</mytype:KINDEX>
</gml:featureMember>
<gml:featureMember>....
<mytype:INDEX>0</mytype:KINDEX>
</gml:featureMember>

I want to query my geoserver that I retrieve only those featureMembers that have a certain value in the tag mytype:INDEX, for example all featureMembers with the INDEX 1.

Can I do that and how?


texts: Why the integration of pygeoapi "OGC API Features" in QGIS 3.14 is not working?

texts:
I'm using pygeoapi as my server, and I'm having troubles with the connection of QGIS (3.14.0-Pi). I can see the list of layers available when I connect with my server from QGIS, but when I add to the project the layer is empty (no data, no geometry) and it gives me the follow warning.
2020-08-11T08:58:48     WARNING    Cannot create temporary SpatiaLite cache.: GDALCreate() failed: OGR was built without libspatialite support
             ... sorry, creating/writing any SpatiaLite DB is unsupported

I don't understand if this is a problem in pygeoapi or QGIS. The only mention between pygeoapi and libspatialite is in the pygeoapi documentation, but this is a configuration for OSX and my server is in Linux Machine, and I don't know how to translate this.
So basically, if anyone have experience with pygeoapi, and the integration with QGIS I will love to hear


texts: Adding $length on the fly when adding line feature

texts:
is there a simple way (without writing script or python skills) to auto calculate and auto populate length attribute in QGIS?
When I add a new line feature in my layer, I'd like the attribute length to be calculated and populated as I complete the task of adding the line. Right now, I create all my geometry and then update existing field with $length in the Field Calculator.


texts: How to get all traffic signals from a road segment using overpass turbo?

texts:
I'm working on this road segment 156810827:
https://www.openstreetmap.org/way/156810827#map=15/46.8009/-71.2404

So I need to get all traffic signals from it

Tried this:

[out:json];
way(156810827);
node[highway=traffic_signals];
out;

but its not working


texts: How to get QField to show vector layer categorized styles as shown in my QGIS project

texts:
I am using QGIS 2.18 (on Windows 7) to create a QField project on an Android Samsung Galaxy Tab S.  In QGIS I have a line and point vector file and each have different colors set depending on an attribute values.  In the QGIS layers panel I can see the categories.  When I transfer my project and open it in QField I see the layer names but no attribute styles.  I can digitize a point or line and assign the new feature a name based on my categories. QField renders the new feature with the correct style and all but I need to see on the tablet what the line or point colors represent in the field.

How do I get QField to show the shapefile style categories?


texts: Create polygons from points with rectangular buffer in Python

texts:
I want to create rectangular polygons from points. Actually I have a GeoPandas point DataFrame and the distance in X & Y direction to form the polygon. The distances are equal for every point. I know it is possible to use QGIS or ArcMap, but I look for a method in Python without using this software.

EDIT: it is not a duplicate as far as I can see because the other questions are looking for a square buffer I look for a rectangular buffer with a different size in x, y directions.

EDIT 2: Here is what I have so far

import shapely as spl
test_point = [(8.54253101348877, 49.53561782836914)]
distance_lon = 0.010373115539550781
distance_lat = 0.011997222900390625
spl_polygons = [spl.geometry.Polygon([(x - distance_lon, y - distance_lat), (x + distance_lon, y + distance_lat), (x - distance_lon, y + distance_lat), (x + distance_lon, y - distance_lat)]) for x,y in test_point]

The problem is the output looks like:

not like a rectangular polygon? What am I doing wrong?

Edit 3: The point which form the polygon have to be in the format of (lower left, lower right, upper right, upper left). Now I got the polygon in rectangular format.

Correction of last line:

spl_polygons = [spl.geometry.Polygon([(x - distance_lon, y - distance_lat), (x + distance_lon, y - distance_lat), (x + distance_lon, y + distance_lat), (x - distance_lon, y + distance_lat)]) for x,y in test_point]


texts: Whats wrong with the difference tool QGIS 2.14.1?

texts:
I want to get the difference between two poligons.

I compare the result from Arcgis erase tool and QGIS difference. ArcGIS give me that I want, but Qgis don't.

Why?

QGIS not only give wrong results,don't give me the holes that I want to fill.

Anyone knows why this don't works?.
I don't have selected polygons in QGIS.


texts: Convert xy Cartesian field in CSV file to shapefile with latitude and longitude field

texts: I am trying to convert the CSV file that I have for a shapefile.  The CSV file contains a Cartesian xy coordinate field that I wanted to convert to xy longitude and latitude field in the shapefile.  I have QGIS I succeeded in converting the CSV file to shapefile but the coordinate field is the same xy Cartesian. I am attaching the files I want to convert in the comment, two of them are point data and one is polygon data. All the files contain data for places in the UK.


texts:
I want to hide some layers when I click in a layer and restore the visibility back after clicking out. I tried with this code but it doesn't work - here is also the plunker code - Hide show layers

var layerVisibility = {};

var piky2 = new L.geoJson(pol01).addTo(map);
var piky3 = new L.geoJson(pick1).addTo(map);
var piky4 = new L.geoJson(pick2).addTo(map);

var piky1 = new L.geoJson(pol00, {
  style: function(feature) {
    return {
      fillOpacity: 0.55,
      weight: 7,
      color: '#eff682'
    };
  },
  onEachFeature: function(feature, layer) {
    layer.on({
      'mousemove': function(e) {
        e.target.setStyle({
          weight: 7,
          color: 'red'
        });
      },
      'mouseout': function(e) {
        //reset hiden layer to be shown
        layerVisibility[L.Util.stamp(pol01)] = true;
        piky1.resetStyle(e.target);
      },
      'click': function(e) {
        piky1.bindPopup(feature.properties.Name);
        //Hide some layers
        layerVisibility[L.Util.stamp(pol01)] = false;
      }
    });
  }
}).addTo(map);


texts: vb.net arcobjects spatial query get fields value of desired layer only

texts:
Currently I am using ArcObjects (10.2.1) in vb.net (vs 2012). What I intent to develop is a spatial query tool. There are 2 steps in the function:

(1) Use "Select Features" tool in ArcMap to select features in a certain area.

(2) List the several fields of features selected of a layer.

My question is how to get the field values only for a desired feature layer. My code is listed  below. It only works when only the desired layer is enabled on ArcMap.

    Dim pMxDoc As IMxDocument
    Dim pMap As IMap
    Dim pEnumFeature As IEnumFeature
    Dim pEnumFeatureSetup As IEnumFeatureSetup
    Dim pFeature As IFeature

    pMxDoc = My.ArcMap.Document
    pMap = pMxDoc.FocusMap
    pEnumFeature = pMap.FeatureSelection
    pEnumFeatureSetup = pEnumFeature
    pEnumFeatureSetup.AllFields = True
    pFeature = pEnumFeature.Next

    Dim layerNum = GetIndexNumberFromLayerName(pActiveView, "testdb.DBO.testTable")
    pFeatSel = pMap.Layer(layerNum)

    Dim tempArr As New List(Of String)
    Do While (Not pFeature Is Nothing)
        tempArr.Add(pFeature.Value(pFeature.Fields.FindField("Item_ID")).ToString)
        pFeature = pEnumFeature.Next
    Loop

    Dim message = String.Join(Environment.NewLine, tempArr.ToArray())
    Dim lstOfString As List(Of String) = New List(Of String)(tempArr)
    Dim selectedCount = lstOfString.Count

    End If

Public Function GetIndexNumberFromLayerName(ByVal activeView As ESRI.ArcGIS.Carto.IActiveView, ByVal layerName As System.String) As System.Int32

    If activeView Is Nothing OrElse layerName Is Nothing Then
        Return -1
    End If

    Dim map As ESRI.ArcGIS.Carto.IMap = activeView.FocusMap
    Dim numberOfLayers As System.Int32 = map.LayerCount
    Dim i As System.Int32 = 0
    Do While i < numberOfLayers
        If layerName = map.Layer(i).Name Then
            Return i
        End If
        i += 1
    Loop
    Return -1
    LayerNumber = i
End Function


texts: Where to create ArcGIS 10 Map Templates?

texts:
Sorry, I could not find the location: C:\Users\AppData\Roaming\ESRI\Desktop10.0\ArcMap\Templates

Do I create it or there is a specific funtionality for the location?

I would like to create different templates for the areas we mostly use the maps.


texts: How can I use SQL Server's spatial types from a .Net application?

texts:
For an upcoming project, one of the requirements is to store and use basic geogrpahic data as part of an existing SQL-Server/.Net application.

It seems obvious that we could use the SQL Spatial types, however, there doesn't seem to be any way to (say) read them from the result of a SQL query, or to save an updated POI/polygon.

Do developers really have to handle the conversion themselves at the Stored procedure level, or is there a way of using the types natively?


texts: Exporting kernel utilization distributions from R to be used in ArcGIS Pro scene view

texts:
I have used the "kde" function "ks" package to estimate 95% kernel utilization distributions (KUD) to visualize the 3D activity range of an arboreal snake.

Below is code that I modified from Simpfendorfer et al (2012) to accomplish this:

  Simpfendorfer, C. A., E. M. Olsen, M. R. Heupel, and E. Moland. 2012.
  Three-dimensional kernel utilization distributions improve estimates
  of space use in aquatic animals. Canadian Journal of Fisheries and
  Aquatic Sciences 69:565-572.

I generated KUDs in R and I can visualize them within the RGL environment. However, I would like to export KUDs so that I can import them into ArcGIS Pro and create 3D images in a scene view.

How do I accomplish this, perhaps using R-ArcGIS bridge?

R Script:

install.packages("ks")
install.packages("MASS")
install.packages("KernSmooth")

#Loads necessary libraries
library("ks")
library("MASS")
library("KernSmooth")

#Reads files for Animal A into R workspace, where ''Animal a.csv''
#is a file with X,Y,Z coordinates

a<-read.csv("Scott/R data/Snake3.csv")

#Runs the kernel density analysis
fhata<-kde(x=a, H=BandA, binned=FALSE, xmin=c(minX,minY,minZ), xmax=c(maxX,maxY,maxZ), gridsize = 250)

#Produce a 3D plot
plot(fhata,cont=95, bty='n', colors="red", drawpoints=FALSE, axes=FALSE, xaxt="n", yaxt="n", zlab="Meters", xlab="Easting", ylab="Northing", zlim=c(-1,6))

Example data set:

(Snake3; X=Easting, Y=Northing, Z=Height):
X   Y   Z
269010.1657 1504460.332 -1
269004.0495 1504503.546 0
268999.6519 1504495.838 -1
269004.001  1504498.013 -1
268997.5064 1504498.07  -1
268997.6713 1504516.882 -1
269009.5489 1504513.458 -1
269003.1223 1504521.261 -1
269003.1029 1504519.048 -1
269000.3075 1504447.138 -1
268956.3938 1504500.644 -1
268978.6825 1504573.49  -1
269019.8008 1504448.074 -1
269019.345  1504396.063 0
268978.5717 1504437.368 0
269044.4541 1504420.19  0
268959.8448 1504523.854 -1
269006.7438 1504440.441 0.5
269000.7925 1504502.468 -1
269031.9    1504466.4   0.5
268994.9051 1504448.292 3.5
269007.2773 1504501.304 0
269002.9282 1504499.129 -1
269013.6555 1504487.968 -1
269016.9512 1504493.473 -1
269010.5052 1504499.063 -1
269010.4373 1504491.317 -1
269009.3646 1504492.433 -1
269031.9209 1504472.315 2
269026.4215 1504462.403 2
269022.1597 1504470.187 2
269019.9657 1504466.886 2
269016.7475 1504470.234 3.5
269016.6214 1504455.848 1.5
268984.1681 1504458.346 0.25
268966.4558 1504537.076 -1
268988.0169 1504526.927 0
268999.9041 1504524.609 3
269006.7923 1504445.974 3
269016.5438 1504446.996 -1
269019.9657 1504466.886 1.8
269013.8107 1504505.674 3.7
268953.4861 1504539.403 -1
268966.3005 1504519.371 3
268972.8533 1504525.953 -1
268995.6714 1504535.713 -1
268991.3611 1504537.965 -1
268992.4533 1504539.062 -1
269000.3851 1504455.991 0.5
268997.3706 1504482.578 0
268985.4058 1504476.042 2.5
268985.0218 1504555.727 -1
268968.5721 1504531.524 0
269013.5391 1504474.689 2.5
269010.2336 1504468.078 2
269013.6555 1504487.968 -1
269028.6251 1504466.81  1.6


texts: How to show GeoStatistical Analyst Layer in web map using ArcGIS Javascript API?

texts:
I have created a "GeoStatistical Analyst Layer" with "Diffusion Interpolation with Barriers" tool and then I published it on the ArcGIS for Server.

How can I show this layer in my web map application using Javascript API?


texts:
I am having an issue with trying to use the extrude between tool in ArcScene. I had 8-9 geologic formations that I would like to create a 3d polygon of these formations. My workflow process went something like this:

Took top elevations of each geologic formation -> Natural Neighbor -> Raster to TIN -> and I believe I should be using the extrude between tool here. I cannot find any reference material to see exactly how the tool should work so I am turning here. I have been following this workflow explained in the thread to go by (http://forums.arcgis.com/threads/6973-Creating-Cross-Sections-in-ArcScene)

I also found this thread showing other people maybe having the same issue. Any help would be greatly appreciated! (http://forums.arcgis.com/threads/8883-No-output-quot-Extrude-Between-quot-two-TIN-surfaces-generated-from-two-3D-polygons?p=297214#post297214)


texts: QQIS Web Client max zoom set to 1:2257: How to zoom more?

texts:
A similar question was asked as Getting more details by zooming in web-client? but the answer did not work for me. Unfortunately, I can't comment there due to being new to GIS.SE.

Background: The QGIS project has a WMTS service layer of drone aerial imagery (from mbtiles). The Desktop QGIS displays this layer perfectly and lets me zoom in to see the higher resolution of the tiles.

The drone imagery displays OK in QWC but does not let me zoom any closer than 1:2257. The (original desktop) project CRS is EPSG::3857 and in the Desktop project settings>OWS Server>CRS Restrictions is set to EPSG::3857 as the first entry. This .qgs project file was copied to the server and displays OK.

I changed in GlobalOptions.js this

var MapOptions = {
  projection: new OpenLayers.Projection(authid),
  units: "m",
  maxScale:250,
  minScale:80000,
  numZoomLevels:ZOOM_LEVELS,
  fractionalZoom: !enableWmtsBaseLayers && !enableBGMaps,
  transitionEffect:"resize",
  controls: []
};

I cleared the browser cache and refreshed the QWC but the zoom function is still maxed at 1:2257.

I also tried changing in OpenLayers.js: numZoomLevels from 16 to 22.

None of these attempts has changed anything in the QWC.

How do I zoom in more (as there is more detail to see in the drone imagery)?


texts: Create a Robinson world map with grid and coordinate frame in QGIS Map Composer?

texts:
I am trying to create a world map in Robinson projection (ESRI:54030) from the Wikimedia World Map, using QGIS Map Composer. It should have a grid (spacing about 20°, not too bold/aggressive) and a zebra-style coordinate frame and look approximately like this (regarding number and boldness of lines and rounded sides):

If I follow the QGIS/MapComposer tutorials you can find online, the only thing I manage to achieve, however, is this:

You see: The coordinates at the frame are nonsense, the corners are not rounded, and the grid lines are hard-coded to 5cm or so, as "Map unit" didn't work. I'd rather have the grid lines follow the meridians and circles of latitude with something like a 20, 40 or 60° spacing. Also, the grid lines seem too bold. But my biggest concern is that the frame doesn't fit to the map but rather leave plenty of margins around the actual map. And though trying many different things, I have not yet found a way to have the actual map fill the map area completely.

Could somebody guide me through the composing process or refer to a good tutorial?


texts: I have a large mapnik xml file that I would like to convert to carto css to manage with tile-mill. What tools should I use on Ubuntu 14.04. I have tried to compile the cartogenerator from Dane but it fails to compile with errors. What other tools are available to convert this. I have also tried the mapcss-tools but it also fails with error.


texts: projection and coordinate system for non georeferenced archaeological site

texts:
I'm an archaeology student working on a recent project and I'm wondering how to set my arcGIS project. I'm used to work with geographical data in ArcGIS on a large scale, but the current project is different, let me explain.

I want to display and work with dispersion of artefacts on an archaeological site. This site is subdivided in 1 square meter units or parcels in which I want to display a point layer composed of each artefacts having x-y coordinates (from an arbitrary x0-y0 itself on the site). So all my coordinates make sense in the context of the site, but they are not georeferenced in any way on a geographical level.

What projection should I use to work with this kind of data, if I want my square meters units (which will be polygons) to be perfectly square without distortion (kind of a non-earth system if that's a thing).

My guess is that, on this geographical scale, distortion and error will be inexistant in any projection, but I want to make sure before starting the project in ArcGIS.


texts: Programmatically adding folders & layers to QgsComposerLegend

texts:
I've been building up QgsLayerTree object with a directory structure that reflects the desired legend.

Specifically, I'd like the Group(s) to be titles and their contained layers to legend items. However, only blank spaces appear where the Group's title would be.
You can see here:

The code I'm using is as follows:

    ### LEGEND
    composerLegend = QgsComposerLegend(c)
    composerLegend.setColumnCount(3)
    composerLegend.setEqualColumnWidth(True)
    composerLegend.setBackgroundEnabled(True)
    composerLegend.setBackgroundColor(QColor('white'))
    composerLegend.setFrameEnabled(True)
    composerLegend.setFrameOutlineColor(QColor('red'))
    composerLegend.setFrameOutlineWidth(1)
    composerLegend.setTitle('Land Uses')
    composerLegend.setStyleFont(QgsComposerLegendStyle.Title, QFont("Ubuntu", 60))
    composerLegend.setStyleFont(QgsComposerLegendStyle.Group, QFont("Ubuntu", 50))
    composerLegend.setStyleFont(QgsComposerLegendStyle.Subgroup, QFont("Ubuntu", 30))
    composerLegend.setStyleFont(QgsComposerLegendStyle.SymbolLabel, QFont("Ubuntu", 15))
    composerLegend.setSymbolHeight(5)
    composerLegend.setSymbolWidth(10)
    output_group = self.findGroup('Land Uses')
    composerLegend.modelV2().setRootGroup(output_group)
    #composerLegend.synchronizeWithModel()
    composerLegend.adjustBoxSize() # this is the last operation before adding
    c.addItem(composerLegend)
    self.setLegendPosition(composerLegend, 10, 10)


texts: How to improve drawn shapes in Quantum-GIS?

texts:
I have a polygon-shape in qgis-1.7.0 and want to fix overlays and gaps between the edges of adjacent polygons. See image below.

Is there any automated way to do this in quantum-gis? Or any other F/OSS that can do things like that?

Any hints appreciated! Thanks!


texts: Intersecting Line Features Style in QGIS?

texts:
I expect this has been asked before but I can't find it elsewhere.

I have a road layer which is styled based on the value in a particular field.
Where roads join or intersect, the styling at the intersection is darker then elsewhere in the feature.  See image below.

How do I make the intersections the same depth of colour as the adjacent lines?


texts: ArcGIS JS Api: Getting information by location from multiple layers

texts:
I have two layers published in my ArcGIS Server 10.1 server. One is a polygon layer representing the World map by country and the other is a point layer depicting cities.

Please, note that cities layer does NOT contain the information of the country they belong to, it is contained in the other world countries layer.

What I would like to do is creating a sample interface written in ESRI Javascript API to display those Feature Layers, so the user can click on a point representing a city and it appears a popup (or another widget) with the two features associated to this city: name of the city AND name of the country the city belongs to. But, if the user clicks on an area with no cities, only the name of the country should be displayed.

I know that it is a quite basic example, but I am not sure on how to tackle this problem: I see examples on retrieving information from a unique layer, but not about how to distinguish between information required from different layers and integrate it all together in a single widget.

EDIT: Of course, the problem is not building the JS interface but how to retrieve and integrate the information coming from different layers just having the coordinates where the user clicked.

Please, can anyone provide some information/concepts/ideas/links to tutorials about that?

Thanks for your help!


texts:
I'm trying to move text that is not aligned to the far left of the column due to programmer input.  I'm trying to figure out the VB coding for it, but nothing seems to happen in the Attributes table (shp file).

example:

PERMIT ID

1-ZUN

1-ZOR

   2-SUM

4-PBR

   2-SUN

1-ABC

and so on...

I can't seem to get the out of alignment text to move all the way over to the left.

Thank You,

Zoran


texts: Query list of layers an run code on each layer

texts:
I want to query all opened layers in my QGIS project and then run an algorithm on each of the opened layers.
layers_list = []
layers_list = QgsProject.instance().mapLayers().values()
name_field = 'Admin_name'

for layer in layers_list:
   name = [f[name_field] for f in layers_list.getFeatures()[0]
   .... do something smart ....

It always throws me an error: 'dict_value' object has no attribute 'getFeatures'
I m aware that the list only contains the names of the opened layers an no direct pointer to that layer - but how can i achieve that my for- loop goes through all the layers?


texts: Changes in synchronized replica not shown in ArcMap or ArcCatalog without refreshing

texts:
I am  synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the results. Here is a code snippet:

Connection_to_geoDBReplicationTest = "C:\Connection to geoDBReplicationTest.sde"

Connection_to_geoDBRepTest_2 = "C:\Connection to geoDBRepTest_2.sde"

arcpy.SynchronizeChanges_management(Connection_to_geoDBReplicationTest_sde,
 "GISUSER.timedTestReplica2", Connection_to_geoDBRepTest_2, "FROM_GEODATABASE1_TO_2",
 "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")

arcpy.RefreshCatalog(Connection_to_geoDBRepTest_2)

arcpy.RefreshActiveView()

Any thoughts? the code does work, but I would prefer the user did not need to refresh the database in ArcCatalog each time...


texts: GeoServer WMS XML request with NamedLayer filter

texts:
I need to draw a map with some custom features I don't have in database. I found SLD query that allows me to do that (https://github.com/geoserver/geoserver/blob/master/data/release/demo/WMS_getMap_inlineFeatureSmile.xml), but I also need to filter out some features from other layers I want to draw. Here is my XML:
<?xml version="1.0" encoding="UTF-8"?>
<ogc:GetMap xmlns:ogc="http://www.opengis.net/ows"
            xmlns:gml="http://www.opengis.net/gml"
            version="1.2.0"
            service="WMS">
    <StyledLayerDescriptor version="1.0.0"
                         xsi:schemaLocation="http://www.opengis.net/sld"
                         xmlns="http://www.opengis.net/sld"
                         xmlns:ogc="http://www.opengis.net/ogc"
                         xmlns:xlink="http://www.w3.org/1999/xlink"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <NamedLayer>
            <Name>pipes</Name>
            <LayerFeatureConstraints>
                <FeatureTypeConstraint>
                    <ogc:Filter>
                        <ogc:PropertyIsEqualTo>
                            <ogc:PropertyName>gid</ogc:PropertyName>
                            <ogc:Literal>100</ogc:Literal>
                        </ogc:PropertyIsEqualTo>
                    </ogc:Filter>
                </FeatureTypeConstraint>
            </LayerFeatureConstraints>
            <NamedStyle>
                <Name>pipes</Name>
            </NamedStyle>
        </NamedLayer>
    </StyledLayerDescrtiption>
    <!-- bbox & output -->
</ogc:GetMap>

but it still renders all features, not the one I need. It seems to not even parse this filter, because it doesn't react to typos. Primary keys are exposed in GeoServer settings.
I've done that using this schema description: https://www.mediamaps.ch/ogc/schemas-xsdoc/sld/1.0.0/StyledLayerDescriptor_xsd.html
GeoServer version: 2.17.0
//EDIT
I'm sending this XML as POST body on url: http://localhost:8080/geoserver/wms, I receive image with rendered map, but features are not filtered (should only one be rendered). I've tried also with other Filters and other layers, none works, doesn't even react on wrong property name (should throw exception) or invalid structure (wrong tag name, missing element). XML seems to be correct, according to https://www.mediamaps.ch/ogc/schemas-xsdoc/sld/1.0.0/StyledLayerDescriptor_xsd.html.