texts: Can't export GPX from RunKeeper in BaseCamp

texts:
I exported a GPX file from the Runkeeper website. The file itself seems to be valid and I was able to use it in GeoSetter. I was also able to open it using ITN Converter which was allegedly a recommended solution according to a post on gpsreview.net.
I tried to compare the file from RunKeeper to one generated by BaseCamp and the only difference I was able to identify was that BasCamp added gpxx:TrackExtension and gpxtrkx:TrackStatsExtension sections.
The structure of the RunKeeper file is
<?xml version="1.0" encoding="UTF-8"?>
<gpx
  version="1.1"
  creator="Runkeeper - http://www.runkeeper.com"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.topografix.com/GPX/1/1"
  xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
  xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1">
<trk>
  <name><![CDATA[Rowing 6/8/14 9:44 am]]></name>
  <time>2014-06-08T13:44:31Z</time>
<trkseg>
<trkpt lat="46.883792000" lon="-71.366407000"><ele>148.2</ele><time>2014-06-08T13:44:31Z</time></trkpt>
[...]
<trkpt lat="46.883627000" lon="-71.367274000"><ele>148.0</ele><time>2014-06-08T15:32:41Z</time></trkpt>
</trkseg>
</trk>
</gpx>

What is wrong with this file?


texts: Populate a combobox with vector layer name in QGIS 3.X plugin

texts:
I'm updating a QGIS 2.14 Python code plugin to QGIS 3.X.
I'm stuck in the attribution of vector name in combobox.
The problem is that I don't have any error message but the combobox aren't filled at all. I don't know how to progress since there is no error message.

Can someone spot the error or give me advice to pass 2.14 code to 3.X?
I'm using Python Builder


texts: Convert vector points to GPS waypoints and route

texts:
I have a shapefile with a series of points (around 300) using British National Grid.  I need to put them on my Garmin Etrex 10 as waypoints.

Can someone tell me how to convert this shapefile into GPX data?

It may also be helpful to know how to make this into a route.  The points are named 1 to 300 and would be visited in that order.


texts: Geomesa BBOX query provide result only for whole world BBOX

texts:
I am running command line query to get bounding box data. The geomesa query is returning result only if the bounding box is "BBOX(geom, -180, -90, 180, 90.0)". For any other parameter, it is returning 0 features.

I have tried the geomesa hbase guide. GDELT example is giving similar result where it is returning data only for "BBOX(geom, -180, -90, 180, 90.0)".

https://www.geomesa.org/documentation/tutorials/geomesa-hbase-s3-on-aws.html#ingest-public-gdelt-data

key                    | String
namespace              | String (Attribute indexed)
identifier             | String (Attribute indexed)
version                | String
payload                | String
payload_schema_version | String
geom                   | Point  (Spatially indexed)

User data:
  geomesa.indices | z2:5:3:geom,id:4:3:,attr:8:3:namespace:geom,attr:8:3:identifier:geom

Even below query is returning 0 result althought there is 100GB data for this bounding box exist.

geomesa-hbase export -c geospatial_data_version_1 -f geospatial_data-point-entity -m 10 -q "BBOX(geom, -179, -90, 180, 90)"

I am using Geomesa v 2.3.0 and Hbase 1.4.3 on S3.

Response:
id,key:String,namespace:String,identifier:String,version:String, payload:String,payload_schema_version:String, *geom:Point:srid=4326

INFO  Feature export complete to standard out in 6163ms for 0 features


texts: Select relevant bands from multiband raster?

texts:
I try to extract woodland areas from a greyscale orthophoto. I used the "Haralick Texture Extraction" from the Orfeo Tool Box to calculate texture properties of the greyscale orthophoto.
As output I get a raster with 10+ bands. Each band is representing a texture property like Contrast, Homogeneity, Dissimilarity and so on.
Calculating texture properties is parameterised. You need to state a specific radius.

For the differentiation of woodland and non-woodland areas, my idea was to create a stacked raster with the texture features for 5 different radiuses, this raster would have 50+ bands, followed by a supervised classification. I already created a training dataset for woodland and non-woodland areas.

My question is: How do I identify bands of this stacked image that are relevant for the differentiation of woodland and non-woodland areas prior to the classification?


texts: How to calculate the sum of virtual fields

texts:
I have a set of data on track creation in a large forest, my job is to explore the cost implications of various layouts. I have a virtual field for track length and one which multiplies length by cost per metre to give total cost for that track. What I then need is some means of checking the total cost of the entire track network (the whole layer).
Using Statist seems to come up with all zeros, Group Stats won't calculate virtual fields, I've tried creating real fields which mimic the virtual ones, but then they won't update when I alter the polylines.
I can't believe I'm the only one to encounter such a requirement, but I can't seem to find a solution. Can anyone help?


texts: What Python package to use to calculate midpoint?

texts: I asked a question earlier about how to calculate a midpoint. I was wondering if there is a Python library that does this alreay?


texts: How to use QGIS plugin "Rectangles, ovals digitizing tools"

texts:
I installed the Rectangles, ovals digitizing tools-plugin, found it on the toolbar, but it's inactive.
I made a layer to which I want to add rectangles, it's visible and editable...
The plugin bar is grey and inactive.

What to do?


texts: Update info on a div when map on touchend

texts:
I want to update a div with information when I touchend the map on my iPad or iPhone.
The information div run correctly with a click version but for a touchend I had to use map.on

map.on('touchend', function(e) {*...*}

What I can put on my map.on function to update information in my div using data of my JSON?

I used this for click version :

info.update = function(properties) {

document.getElementById("data1").innerHTML = properties.MUS_NM_MUN;
document.getElementById("data2").innerHTML = properties.MUS_NM_REG;
document.getElementById("data3").innerHTML = percentFormat(properties.POURCENTAG);
document.getElementById("data4").innerHTML = properties.VE_VHR_VBV;};


texts: arcpy.ListFields() displaying numerical field names instead of actual field names

texts: When I use the arcpy.ListFields() command, a bunch of random numbers and letters are returned instead of my actual field names. I created my data set in Excel, used XY Table to Point, and exported it into a geodatabase as a feature class. I'm trying to use an UpdateCursor on this dataset but can't as the field names are not right. I'm using ArcGIS Pro.


texts: Syntax error from Python parser of ArcGIS field calculator if then?

texts:
Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do this with Python, using:

Code Block:

def ReClass (Date_Class):
 if (MIN_YEAR_B >= 1600 and MIN_YEAR_B <= 1650):
  Date_Class = 1
 elif (MIN_YEAR_B > 1650 and MIN_YEAR_B <= 1700):
   Date_Class = 2
 elif (MIN_YEAR_B > 1700 and MIN_YEAR_B <= 1749):
    Date_Class = 3
 elif (MIN_YEAR_B < 1600):
    Date_Class = 0

And the argument is:

Date_Class=ReClass(!Date_Class!)

I a m getting a syntax error - not sure why


texts: How do you bring a DOQQ into your dataframe

texts: I have a DOQQ aerial photo that is orthorectified.  I would like to bring it into the dataframe to digitize building and streets and create feature layers.


texts: Google Earth Engine- Creating a Landsat NDVI time series across multiple satellites?

texts:
I have this code, which I use to plot an NDVI time series for a geometry with Landsat 8.  However, I would like to create a time series from 1985-2019, which requires Landsat 5 and 7.  How can I modify this code to create a timeseries across both of these satellites?
https://code.earthengine.google.com/45279499e5eda83d7321c9758fb70425
var rgb_vis = {min:0, max:0.3, bands:['B4','B3','B2']};
function addNDVI(image) {
  var ndvi = image.normalizedDifference(['B5', 'B4']);
  return image.addBands(ndvi);
}
var filtered = L8.filterDate('2016-01-01', '2019-10-30');
var with_ndvi = filtered.map(addNDVI);
var greenest = with_ndvi.qualityMosaic('nd');
Map.addLayer(filtered.median(), rgb_vis, 'RGB (median)');
Map.addLayer(greenest, rgb_vis, 'RGB (greenest pixel)');
print(Chart.image.series(with_ndvi.select('nd'), roi));


texts: Reducing resolution of NetCDF data with GDAL

texts:
I am downloading 0.05 Deg NASA MODIS CMG data in netCDF form (https://lpdaac.usgs.gov/products/vnp13c1v001/). The geographic coordinates of MODIS CMG data are such that the upper-left corner of the upper-left pixel are -180.00 degrees longitude, 90.00 degrees latitude, and the geographic coordinates of the lower-right corner of the lower right pixel are 180.00 degrees longitude, -90.00 degrees latitude. There are 7200 x 3600 data points in the data file, with each point landing in the center of a pixel. My purpose is to visualize this data in Web Mercator using OpenLayers, and I would like to greatly reduce the resolution of the data.

From the documentation of gdal_translate (https://gdal.org/programs/gdal_translate.html), it seems that if I use the flag -tr, I can set the target resolution of the output file, for example like so: -tr 360 180. But when I ran:

gdal_translate -of XYZ -tr 360 180 HDF5:"VNP13C1.A2020065.001.2020081184151.h5"://HDFEOS/GRIDS/NPP_Grid_16Day_VI_CMG/Data_Fields/CMG_0.05_Deg_16_days_EVI2 output.xyz

I got the error message:

The -tr option was used, but there's no geotransform or it is rotated.  This configuration is not supported.

How might I reduce the resolution of the data with gdal?

It would be great if the resolution reduction used interpolation to create data points as opposed to simply filtering out data points.


texts: Finding current map in ArcGIS Pro Project using ArcPy?

texts:
I try to do the following in ArcGIS Pro with ArcPy:
I want to select the current map in a project, in which the user is currently working.

So far I have just one map so I can do it like this:

aprx = arcpy.mp.ArcGISProject("CURRENT")
s = aprx.listMaps("Scene")[0]
layerList = s.listLayers()

And then I do something with the selected features...

Now I have multiple maps and I don't want to iterrate through all layers in all maps. Is there some way to do something like this:

s = aprx.currentMap()

Or to test if the Map is the current one?


texts: How to create multiple polylines using an external geoJSON file using Leaflet?

texts:
I'm starting with Leaflet and I'm using some georeferenced information collected from twitter. I already manage to load an external geoJSON with some points. But now I want to draw some connections between the points to show some relationships.

I have a list with users and each user has a list of points.
Here's a sample with two lines:

  {
      "type": "FeatureCollection",
      "features": [
              {
              "type": "LineString",
              "coordinates": [
              [
              -43.48283,
              -23.02487
              ],
              [
              -43.48391,
              -23.02475
              ],
              [
              -43.48233,
              -23.02486
              ],
              [
              -43.48212,
              -23.02443
              ],
              [
              -43.48243,
              -23.02429
              ],
              [
              -43.48245,
              -23.02477
              ]
      ]
      },
              {
              "type": "LineString",
              "coordinates": [
              [
              -46.65953,
              -23.55865
              ],
              [
              -46.65953,
              -23.55790
              ],
              [
              -46.65972,
              -23.55809
              ],
              [
              -46.65941,
              -23.55878
              ],
              [
              -46.65953,
              -23.55896
              ],
              [
              -46.65903,
              -23.55888
              ]
              ]
              }
      ]
 }

I don't know if this is the best structure to create multiple polylines, but that is easy to fix, my major problem is how to use this data with Leaflet.

Need some help.


texts: Geoprocessor cannot find input data, but only for some users

texts:
I am developing a stand alone application that at some point needs to run Dissolve on a subset of data in a feature class. This code works for me without issue, regardless of workstation. When another user tries to run the tool at their workstation they get an error. I've tried clearing out all their local ESRI files, but to no avail, so my inclination is that this is some difference in their user profile on our network, but I'm not sure since the error message doesn't appear helpful.

What I'm doing is creating a feature layer, selecting features on that layer, and then handing the layer to the Dissolve geoprocessor tool. For other users the geoprocessor will say that the input does not exist.

void doDissolve(IFeatureClass fc)
{
    string subtype_field = "subtype";

    //create selection query
    IQueryFilter filter = new QueryFilter();
    filter.WhereClause = $"{subtype_field}={Constants.BUILDING_SUBTYPE} AND {Constants.OTHER_SEARCH}";

    //create a layer where only the filtered features are selected
    IFeatureLayer fLayer = new FeatureLayer();
    (fLayer as IDataLayer).DataSourceName = (fc as IDataset).FullName;
    (fLayer as IDataLayer).Connect((fc as IDataset).FullName);
    (fLayer as IFeatureSelection).SelectFeatures(filter, esriSelectionResultEnum.esriSelectionResultNew, false);
    fLayer.Name = "Temp_Layer";

    //create dissolve output directory and file name
    string dissolve_dir = System.IO.Path.Combine(Environment.GetFolderPath(
                                      Environment.SpecialFolder.LocalApplicationData),
                                     "SomeUniqueName");
    string dissolve_name = $"dissolve_{DateTime.Now.ToString("yyyy_MM_dd")}";

    if (!Directory.Exists(dissolve_dir))
        Directory.CreateDirectory(dissolve_dir);

    //create and run Dissolve
    var dissolve = new Dissolve();
    dissolve.in_features = fLayer;
    dissolve.out_feature_class = System.IO.Path.Combine(dissolve_dir, dissolve_name + ".shp");
    dissolve.multi_part = "SINGLE_PART";
    runGP(dissolve);
}

void runGP(IGPProcess process)
{
    try { _gp.Execute(process, null); }
    catch(Exception e)
    {
        StringBuilder messages = new StringBuilder($"{process.ToolName} Messages:\r\n");
        for (int i = 0; i < _gp.MessageCount; i++)
            messages.AppendLine(_gp.GetMessage(i));
        throw new Exception(messages.ToString(), e);
    }
}

The error message is as follows:

ERROR 000732: Input Features: Dataset Temp_Layer does not exist or is not supported

Any ideas on what could be causing this issue?


texts: How to create a customized grid with two coordinate systems?

texts:
I need to put two grids on a map - one in NAD27 State Plane CA Zone 5, and the other in NAD83 State Plane CA Zone 5 (feet) and have the grids be formatted properly. If I go into the Data Frame Properties within ArcMap and create these two grids, I get the output below (I added the coordinate system name in a box on the map for reference).

The desired result will have both the NAD27 and NAD83 SPCS CA Zone 5 labels on either side of the same line, and have the E. or N. prefix to the values. The image below is a mockup of the desired grid layout.

Does anyone have suggestions on how to create a grid that contain the correct values for two coordinate systems? I wrote a Python script and am using Data Driven Pages to create ~1,900 maps formatted in this way, so it doesn't seem like an option to convert the grids to graphics.


texts: Alignment by expression is not working after using "wordwrap" instead of "wrap on character"

texts:
I'm using wordwrap in the expression dialog to wrap the field "name" after the 12th character (first line) and the 20th character (second line):

 wordwrap( wordwrap("name"),12),20)

So far so good. I could also use the "warp on character"-function in the Format-Dialog in the Layer-Properties. But the first way is the best solution in my case.

But there is one problem: if I use the wordwrap, I'm not able to use the "Alignment" by expression!

For me, it seems like a bug? Is there a other way to align my labels?


texts: What is Python equivalent of ModelBuilder's Iterate Feature Selection?

texts:
My data consists of two featureclasses:

Points = points representing trees
Polygons = Polygons representing % canopy area by area.  Each polygon in the FC has a % canopy measurement in the attributes.

I am trying to accomplish the following:

Select points underneath polygon features
For the points under each polygon, delete X% of the points based on
the polygon attribute

The screenshot (Figure 1) shows a ModelBuilder only tool called Iterate Feature Selection.  What is the correct Python scripting method to iterate through features in a feature class in order to pass the feature off to the SelectLayerByLocation_management command?

Figure 2 shows the output of the select by location.  All 4 layers are the same, which will be a problem when I try and delete points by the canopy % measurement.

This is what I have tried so far:

import arcpy
from arcpy import env

env.overwriteOutput = True
env.workspace = r'C:\temp_model_data\OutputData'
outWorkspace = env.workspace

# The polygons have canopy % data in attributes
polygons = r'C:\temp_model_data\CanopyPercentages.shp'
points = r'C:\temp_model_data\points_20_2012.shp'

if arcpy.Exists("pointsLayer"):
    print "pointsLayer exists already"
else:
    arcpy.MakeFeatureLayer_management (points, "pointsLayer")
    print "pointsLayer created"

count = 1

#Create a search cursor to step through the polygon features
polys = arcpy.da.SearchCursor(polygons, ["OID@", "SHAPE@"])

for poly in polys:

    # Create a name for the polygon features
    count = count + 1
    featureName = "polygon_" + str(count)
    print featureName

    # Select points that lie under polygons
    arcpy.SelectLayerByLocation_management('pointsLayer', 'intersect', polygons)
    arcpy.SaveToLayerFile_management('pointsLayer', outWorkspace + featureName + ".lyr", "ABSOLUTE")

    # Add the random point selection script here...

    # Delete selected points within each polygon based on the % canopy cover...

Figure 1

Figure 2


texts: Problem with ImageMosaic plugin of Geoserver - invalid shapefile/tif missing in GetCapabilities

texts:
I'm trying to use the ImageMosaic plugin of Geoserver for raster time-series data (I followed this tutorial: http://docs.geoserver.org/latest/en/user/tutorials/imagemosaic_timeseries/imagemosaic_timeseries.html) but it's not working.
I have a folder with several images (yyyymmddThhmm.tif) and the 3 files:

-timeregex.properties:
regex=[0-9]{8}T[0-9]{4}

-indexer.properties:
TimeAttribute=time
Schema= the_geom:Polygon,location:String,time:java.util.Date
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](time)

-store.properties:
Levels=0.010258701020382227,0.010258701020382227
Heterogeneous=false
TimeAttribute=time
AbsolutePath=false
Name=radar
TypeName=radar
Caching=false
ExpandToRGB=false
LocationAttribute=location
LevelsNum=1

but in the WMS GetCapabilities, there is only one date displayed in "Dimension" as you can see (and the hour is wrong, it always writes 00:00:00):

Moreover, something's also wrong with the shapefile created when I created my store cause I cannot open it with any software (QGIS for example tells me it's an invalid data source).

Does anyone have any idea as to what could be my problem? What I did wrong or forget?


texts: Union intersected polygons with python and save the result in a new shapefile

texts:
I'm trying to make an union with overlapping polygons and save the result in a new shapefile.
from osgeo import ogr
import os
test = ogr.Open(r"F:\Python\Shapefile\BuiltBuf7000.shp")
layer = test.GetLayer()
print layer.GetGeomType()
3 # -> polygons
union_poly = ogr.Geometry(ogr.wkbPolygon)
for feature in layer:
geom =feature.GetGeometryRef()
union_poly = union_poly.Union(geom)

print union_poly

When I run the code I got this result :
Now, I would like to save the result in a new shapefile,
Does someone know how to do it ?


texts:
I have set up a map file on Ubuntu 16.04 with SVG symbols created by Inkscape. Everything is fine. Now I have to port it to a windows server. I installed MS4W, but layers with SVG symbols can't be rendered, the error message is:

[Thu Jan 04 10:08:39 2018].979000 msPreloadSVGSymbol(): Renderer error. problem parsing svg symbol

The MapServer version:

MapServer version 7.0.7 (MS4W 3.2.3) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=SVGCAIRO
SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER
SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=POINT_Z_M INPUT=JPEG
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

The only difference on Ubuntu I have SUPPORTS=RSVG instead of SUPPORTS=SVGCAIRO. SVG symbols were made by Inkscape and saved as Plain SVG. Symbols opened by FireFox on Windows look OK. Here is a simple SVG file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   id="svg2"
   viewBox="0 0 180 180"
   height="180"
   width="180">
  <defs
     id="defs4" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     transform="translate(0,-872.36214)"
     id="layer1">
    <path
       transform="translate(0,872.36214)"
       id="path4144"
       d="m 82.285714,179.11476 c -0.982143,-0.14417 -4.196428,-0.61435 -7.142857,-1.04486 -7.668726,-1.12049 -17.827119,-4.51697 -25.982328,-8.68726 C 19.364974,154.14624 0.85714283,123.86576 0.85714283,90.35395 0.85714283,66.478971 8.9224485,45.858041 24.90582,28.867618 41.99479,10.701936 64.624359,0.85836043 89.428571,0.80103829 108.64989,0.75661829 124.28979,5.4729666 140.1904,16.108706 c 32.53115,21.759735 46.92422,63.414537 34.90397,101.015144 -4.43994,13.88862 -11.65498,25.67953 -22.05117,36.03633 -15.46643,15.40781 -34.36862,24.09937 -56.650343,26.04881 l -5.535714,0.48432 0,-4.59807 0,-4.59807 6.25,-0.42234 c 12.404687,-0.83824 27.313777,-6.07942 38.068117,-13.38254 5.85601,-3.97675 14.8594,-12.61031 19.30595,-18.51295 6.88492,-9.13948 12.46443,-21.85564 14.64848,-33.38506 1.3951,-7.364673 1.56565,-21.292808 0.34385,-28.079994 -4.05648,-22.53388 -17.01335,-42.086973 -36.04436,-54.394206 -7.54287,-4.877928 -14.44862,-7.891949 -23.94792,-10.452104 -6.15588,-1.659072 -8.12164,-1.843227 -19.695546,-1.845115 -11.811185,-0.0019 -13.438228,0.15735 -20,1.957874 C 24.080593,24.522034 -1.3071113,71.968793 13.93622,116.35714 c 10.160559,29.5874 38.020719,51.41021 68.528066,53.67791 l 6.25,0.46459 0,4.53589 0,4.5359 -2.321429,-0.0973 c -1.276786,-0.0535 -3.125,-0.21523 -4.107143,-0.3594 z"
       style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.71428573;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1" />
    <rect
       y="872.36212"
       x="85"
       height="180"
       width="10"
       id="rect4149"
       style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1" />
  </g>
</svg>

There is a separate symbolset file with SVG and MapServer vector symbols.

Should I change something  in the SVG file for SVGCAIRO?
Or any other tipps?


texts: Using ArcPy to Spatial Join (points to points)

texts:
How can I reproduce the same result of this tool using ArcPy?

Here are the tables I want to join:

Here's the result im getting from ArcMap tool:

I wrote Python code to reproduce the same result:

arcpy.SpatialJoin_analysis(gpsFC, hotspotFC, "test2.shp", join_operation="JOIN_ONE_TO_ONE",
    join_type = "KEEP_COMMON",
    match_option="CLOSEST_GEODESIC",
    search_radius=0.001729,
    distance_field_name="distance")

but I'm not getting the same result, instead I'm getting this one:


texts: "Browse" button returns python error in QGIS

texts:
I use the latest version of QGIS (2.8.2) in MAC and have se the default Python version 2.7. Moreover, I have installed all the required python modules and GDAL.

It was working before, but now, when I click on the "Browse" button in Vector-> Research tools->Vector Grid, it returns the following error (actually, it returns this error whenever I click on any "browse" button in QGIS):

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools/doVectorGrid.py", line 269, in outFile
    ( self.shapefileName, self.encoding ) = ftools_utils.saveDialog( self )
  File "/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools/ftools_utils.py", line 285, in saveDialog
    fileDialog = QgsEncodingFileDialog( parent, "Save output shapefile", dirName, filtering, encode )
TypeError: QgsEncodingFileDialog(QWidget parent=None, QString caption=QString(), QString directory=QString(), QString filter=QString(), QString encoding=QString()): argument 3 has unexpected type 'QPyNullVariant'

Python version:
2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]

QGIS version:
2.8.2-Wien Wien,

Python path: ['/Users/dimitriosefthymiou/.qgis2/python/plugins/processing', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', u'/Users/dimitriosefthymiou/.qgis2/python', u'/Users/dimitriosefthymiou/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/C/Python/2.7', '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/numpy-override', '/Library/Python/2.7/site-packages/matplotlib-override', '/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/singledispatch-3.4.0.3-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/PIL', u'/Users/dimitriosefthymiou/.qgis2//python', '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools']


texts:
Is there a way to create a spatial database from ArcCatalog that also creates the ArcSDE user, repository, and service.

Basically, I am trying to do everything that the ArcSDE Post Installation does, but from ArcCatalog.

I am using version 10 of ArcCatalog and ArcSDE and SQL Server 2008 R2.

Thanks,
Seth


texts: Field calculator - "and" + "or" operators not working in "If/Then" statement

texts:
The following Python code I'm trying to use isn't working, and I believe it's due to how I've integrated the "and" and "or" operators. Although I suspect my full code (below) is not ideally written/structured. I'm trying out new skills, so it's a bit rough. I appreciate any suggestions for fixing my problem and improving what I have written.

My goal is to assign specific Raster_code values to respective combinations of the fields "BGCLMTCLBL" and "STSRSLBLC1". For example, if "BGCLMTCLBL" = ESSFmwp and "STSRSLBLC1" = 00, 02, or 03, I want the Raster_code value to return 20.

Some combinations only have one "STSRSLBLC1" value eg. "BGCLMTCLBL" = CMA  and "STSRSLBLC1" = ' ', then I want Raster_code value to return 0

Below is the full pre-logic script code

def ifBlock(BGCLMTCLBL,STSRSLBLC1):
    if BGCLMTCLBL == 'CMA' and STSRSLBLC1 == ' ':
        return 0
    elif BGCLMTCLBL == 'CMA' and STSRSLBLC1 == '00':
        return 0
    elif BGCLMTCLBL == 'IMA' and STSRSLBLC1 == ' ':
        return 0
    elif BGCLMTCLBL == 'AT' and STSRSLBLC1 == ' ':
        return 10
    elif BGCLMTCLBL == 'AT' and STSRSLBLC1 == '00':
        return 10
    elif BGCLMTCLBL == 'ESSFxv1' and STSRSLBLC1 == ' ':
        return 20
    elif BGCLMTCLBL == 'ESSFxvp1' and STSRSLBLC1 == ' ':
        return 20
    elif BGCLMTCLBL == 'ESSFmwp' and STSRSLBLC1 == ' ':
        return 20
    elif BGCLMTCLBL == 'ESSFmwp' and STSRSLBLC1 == '00' or STSRSLBLC1 == '02' or STSRSLBLC1 == '03':
        return 20
    elif BGCLMTCLBL == 'ESSFmw' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '02' or STSRSLBLC1 == '03' or STSRSLBLC1 == '04' or STSRSLBLC1 == '05' or STSRSLBLC1 == '06' or STSRSLBLC1 == '07' or STSRSLBLC1 == '08':
        return 20
    elif BGCLMTCLBL == 'ESSFu' and STSRSLBLC1 == ' ':
        return 20
    elif BGCLMTCLBL == 'ESSFup' and STSRSLBLC1 == ' ':
        return 20
    elif BGCLMTCLBL == 'MHmmp' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '02':
        return 30
    elif BGCLMTCLBL == 'MHmmp2' and STSRSLBLC1 == ' ':
        return 30
    elif BGCLMTCLBL == 'MHmm2' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '01' or STSRSLBLC1 == '02' or STSRSLBLC1 == '03' or STSRSLBLC1 == '04' or STSRSLBLC1 == '05' or STSRSLBLC1 == '06' or STSRSLBLC1 == '07' or STSRSLBLC1 == '09' or STSRSLBLC1 == '31':
        return 30
    elif BGCLMTCLBL == 'CWHms' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '01' or STSRSLBLC1 == '06' or STSRSLBLC1 == '10' or STSRSLBLC1 == '11':
        return 40
    elif BGCLMTCLBL == 'CWHms' and STSRSLBLC1 == '02' or STSRSLBLC1 == '03':
        return 50
    elif BGCLMTCLBL == 'CWHms1' and STSRSLBLC1 == '02' or STSRSLBLC1 == '03':
        return 50
    elif BGCLMTCLBL == 'CWHms1' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '01' or STSRSLBLC1 == '04' or STSRSLBLC1 == '05' or STSRSLBLC1 == '06' or STSRSLBLC1 == '07' or STSRSLBLC1 == '08' or STSRSLBLC1 == '09' or STSRSLBLC1 == '10' or STSRSLBLC1 == '11':
        return 40
    elif BGCLMTCLBL == 'CWHds1' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '01' or STSRSLBLC1 == '04' or STSRSLBLC1 == '05' or STSRSLBLC1 == '06' or STSRSLBLC1 == '07' or STSRSLBLC1 == '08' or STSRSLBLC1 == '09' or STSRSLBLC1 == '10' or STSRSLBLC1 == '11' or STSRSLBLC1 == '12':
        return 40
    elif BGCLMTCLBL == 'CWHms1' and STSRSLBLC1 == '02' or STSRSLBLC1 == '03':
        return 50
    elif BGCLMTCLBL == 'IDFww' and STSRSLBLC1 == ' ' or STSRSLBLC1 == '00' or STSRSLBLC1 == '02' or STSRSLBLC1 == '04' or STSRSLBLC1 == '05' or STSRSLBLC1 == '06' or STSRSLBLC1 == '07':
        return 60
    elif BGCLMTCLBL == 'IDFww' and STSRSLBLC1 == '00' or STSRSLBLC1 == '01' or STSRSLBLC1 == '03':
        return 70
    else:
        return 9999

Script code is

ifBlock(!BGCLMTCLBL!,!STSRSLBLC1!)

Below is an image of the results I am getting.


texts: Relative path to the plugin folder for SVG file in QGIS3 .SLD file

texts:
I'm trying to update an old plugin to QGIS3 where we use default svg files (in the plugin folder) as markers. It is important that it is the plugin folder since I just to have the entire plugin in one location.

In QGIS2.18 I could specify the path to the svg marker as: :/PLUGIN_NAME/IMAGE_FOLDER/FILENAME.svg

Update:
I use an .sld file to specify the .svg path (and other attributes like name etc.) The
<se:OnlineResource xlink:type="simple" xlink:href=":/PLUGIN_NAME/IMAGE_FOLDER/FILENAME.svg"/>

When I try it now in QGIS3 I just gets ? instead of the svg symbol, unless I use absolute paths to the plugin and the image folder :(

Update:
I tried to add %AppData%/QGIS/QGIS3/profiles/default/python/plugins in front of PLUGIN_NAME, hence without success.

The .qgs file is used in multiple computers, so I want to specify a relative path in the .sld files to the svg file.

Any suggestions how to write it in QGIS3?


texts: How to migrate Network Dataset in WGS84 to Web Mercator projection using ArcGIS 10.1?

texts:
regards
I'm using Arcgis 10.1 I need to migrate a Network Dataset developed in WGS84 to Web Mercator projection, I could tell the steps to do this

I want to automate this process in model builder, but I need to know the steps to make the change from WGS84 to Web Mercator projection

could help me please


texts: How to speed up query through view in postgis?

texts:
I want to set up a postgis database that have some base tables, then the users interact with them through views (which restrict their viewable and acessible regions).

The server runs PostgreSQL 9.2 on Ubuntu 12.04 and has been configured as recommended here.
Result of SELECT PostGIS_full_version();

"POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.8.0""

I tested the above model with a road layer (polyline) with 6040 rows but the time it takes to select all rows through view is 13 seconds v.s. 2.2 seconds for selecting all rows on original table (nearly 6 times as much - this makes working with multiple postgis layer in Qgis at the same time terribly slow, except when zoomed in to a small region).

My create view sql:

CREATE VIEW user_1_road AS
SELECT pk_id, geom, name, type, importance, notes, label_x, label_y, label_angle
FROM road
WHERE st_contains(( SELECT geom FROM regions where user_id = '1'), road.geom);

Is there anyway to improve execution speed?


texts:
In a toolbox of mine I want to add a function to add several shapefiles by assigning the datatype to shapefile and enabling the multi-value function.

I have noticed however that ArcMap parses this data as a long string deliminated by a ';' of which I have made into a list by the following.

def main(inputs,...)
    shp_files = inputs.split(';')

However these are still strings in a list and therefore when I run a geoprocessing task the error I receive is that the shapefile has no table 'C'. C being my directory C:. What I need is either a more elegant approach to my current step or a way to add r' ' to surrond each of my list strings.

I assume there must be a way to append each string in a list and add the r '' to indicate that is a pathname.


texts: Geography ST_Intersects causes "Boom! Could not generate outside point!"

texts:
I'm trying to find where a user is based on their point and a table of multi polygons.

I currently have:

SELECT u.name l.name
FROM users u
INNER JOIN locations AS l
ON ST_Intersects(u.location, l.geog)

Where both u.location and l.geog are of type geography.

And I get the Error

  Boom! Could not generate outside point

I've created a new table with just one user in and one multi polygon in and it's still triggering the above error.

If I go back to the original location set and add ::geometry, the point seems to land in 23 out of the 28 possible multi polygons which is also incorrect.

Could you direct me in what I'm doing wrong?

I first moved to geom and the issue persisted (not the boom, but the random returning of polygons).

I discovered the issue.

The data I was using was in the format 27700 but it didn't have a set SRID of 27700.

So to make this work, I had to explicitly set it to the correct SRID before changing:

SELECT u.name l.name
FROM users u
INNER JOIN locations AS l
ON ST_Intersects(u.location, ST_Transform(ST_SetSRID(l.geom,27700),4326))


texts: Using Google BigQuery GIS table as a data source to QGIS

texts:
Google BigQuery recently added GIS functionality (still in beta), see here.

I have a dataset in BigQuery that I would like to use as a data source in QGIS - much the same way as I would do with a normal PostGIS database or a CSV file.

Is there a way to do this?

I guess I could export the data from bigquery into a PostGIS instance in GCS, and then I would be able to load it into QGIS. But that doesn't feel like the right way to do it.

Size of data is not a concern, and I'm using QGIS 3.4.2 (Madeira).


texts: Trimming decimal numbers for coordinates/heights in QGIS

texts:
I have a GeoPackage table with coordinates and heights. I only want 3 decimals for the coordinates and 2 decimals for the heights.
In the past I could easily define the precision in the field calculator, but the field is greyed out for GeoPackage layers. It only works for temporary layers.
I also tried "Refactor field" tools and defined the precision, but it gave me the table you are seeing in the screenshot.
If it was string I could use a the substr() function. But these are numeric fields. And copying to a new string field, using substr() function and copying back to numeric is too much manual work, as I run into this task frequently.


texts:
I keep receiving the following error whenever running the following code below, is it the pathname that is incorrect or is it the actual function MakeTableView?

Traceback (most recent call last):
  File "\ServerName\UserHome$\user.name\My Documents\Contacts Table Clean Up.py", line 23, in
    arcpy.MakeTableView_management(contacts,"Contacts_tbl")
  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 7047, in MakeTableView
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Table: Dataset C:\ServerName\UserHome$\user.name\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb\Contacts does not exist or is not supported
Failed to execute (MakeTableView).

import arcpy, os

contacts = r'C:\\ServerName\UserHome$\user.name\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb\Contacts'
comTrkr = r'C:\\ServerName\UserHome$\user.name\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb\ComTrkr'
GISTrkr = r'C:\\ServerName\UserHome$\user.name\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb\GISTrkr'
gdb = r'C:\\ServerName\UserHome$\user.name\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb'

arcpy.env.overwriteOutput=True

arcpy.MakeTableView_management(contacts,"Contacts_tbl")
contactsTblVw = "Contacts_tbl"
contactsTblVw = arcpy.MakeTableView_management(contacts,"Contacts_tbl")

#Update Contact_Status1 with'New' if value equals 'NULL'
arcpy.SelectLayerByAttribute_management(contactsTblVw, "NEW_SELECTION", "Contact_Status1 IS NULL" )
arcpy.CalculateField_management(contactsTblVw, "Contact_Status1", '"NEW"' )

#Create output table to edit in Arcmap for Both Email fields
Contact_Email_Output = os.path.join(gdb, 'Export_Contact_Email') # To produce output named \\My Documents\ArcGIS\Projects\Contact_Table_CleanUp\Test.gdb\Export_Contact_Email
arcpy.SelectLayerByAttribute_management(contactsTblVw, "NEW_SELECTION", "Contact_Email LIKE '%@%'" )
arcpy.CopyRows_management(contactsTblVw, Contact_Email_Output)
contactsTblVw = arcpy.MakeTableView_management(contacts,"Contacts_tbl")
#arcpy.AddField_management(Contact_Email_Output, "Editor", "TEXT")
#arcpy.EnableEditorTracking_management(Contact_Email_Output,'','','','ET_Date', "ADD_FIELDS")

arcpy.AddMessage("Contact_Email Table created, now on to Agency_Email")

Agency_Email_Output = os.path.join(gdb, 'Export_Agency_Email')
arcpy.SelectLayerByAttribute_management(contactsTblVw, "NEW_SELECTION", "FROM contacts WHERE Agency_Email LIKE %@% " )
arcpy.CopyRows_management(contactsTblVw, Agency_Email_Output)
#arcpy.AddField_management(Contact_Email_Output, "Editor", "TEXT")
#arcpy.EnableEditorTracking_management(Agency_Email_Output,'','','','ET_Date', "ADD_FIELDS")

#String length for phone number.
Contact_Phone_Work_Output = os.path.join(gdb, 'Export_Contact_Phone_Work_Email')
arcpy.SelectLayerByAttribute_management(contactsTblVw, "NEW_SELECTION", "FROM contacts WHERE LEN([Contact_Phone_Work]) = 12")
arcpy.SelectLayerByAttribute_management(contactsTblVw, "ADD_TO_SELECTION", "FROM contacts WHERE Contact_Phone_Work LIKE '%-%' ")
arcpy.CopyRows_management(contactsTblVw, Contact_Phone_Work_Output)

Agency_Phone_Output = os.path.join(gdb, 'Export_Agency_Phone_Email')
arcpy.SelectLayerByAttribute_management(contactsTblVw, "NEW_SELECTION", "FROM contacts WHERE LEN(Agency_Phone_Work) = 12")
arcpy.SelectLayerByAttribute_management(contactsTblVw, "ADD_TO_SELECTION", "FROM contacts WHERE Agency_Phone_Work LIKE '%-%' ")
arcpy.CopyRows_management(contactsTblVw, Agency_Phone_Output)


texts: Get round numbers using Natural Breaks (Jenks) classification

texts: In ArcMap, is there an easier way to get more round numbers when using the Natural Breaks (Jenks) classification in the symbology tab? For example, in the image below I'd want the classes to be 5-140, 141-340, 341-1500, etc. I know I can just go in and manually change the numbers to the closest round numbers, I was just wondering if there is a tool or more automated way to have the software do this for me, as it can be rather time consuming when trying to use >6 classes.


texts: ArcGIS 10.2.1 projection Issue - Everything shifted west 50 m

texts: I just completed hand-digitizing features on some NAIP (NAD83) imagery as a shapefile (NAD83...or that's what I thought I was doing). The coordinate system for the dataframe was NAD83, but now when I re-add the layer everything is shifted to the west by almost excactly 50 meters. I've tried projecting the data and redefining the projections between NAD83 and NAD27, but no luck. I'm used to seeing a N-S shift between NAD83 and NAD27, but can't for the life of me figure out what is causing the east-west shift. Anyone have any ideas...I tried making a new project and seeing if that could be the issue, but it still doesn't line up.


texts: Create street map with A-10 type grid & index

texts:
I need to create a printed map using QGIS with an arbitrary grid superimposed, such as is usually found on street maps.. say A to K on one axis and 1 to 10 on the other. Then I will need to create an index showing how to find each street.

I don't know how to do either part of this. Any suggestions?


texts: inconsistent types in google earth engine with Export.image.toDrive()

texts:
I have computed NDVI from Landsat7 image, but when I want to export the result in google drive with Export.image.toDrive() it failed with the message error : Fail with an error : Error: Exported bands must have compatible data types; found inconsistent types: Float32 and Float64.

How can I overpass this issue ?

/*-------------------------------------------------------------
                             FUNCTION
-------------------------------------------------------------*/

// This function adds a band representing the image timestamp.
var addTime = function(image) {
  return image.addBands(image.metadata('system:time_start')
    .divide(1000 * 60 * 60 * 24 * 365));
};

// COMPUTE NDVI OVER A COLLECTION FUNCTION
var addNDVI = function(image) {
  var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
  return image.addBands(ndvi);
};

/*-------------------------------------------------------------
                             END
-------------------------------------------------------------*/

//2001
var img2001 = ee.Image("LANDSAT/LE7_L1T/LE72040492001066EDC00").clip(zone_travail);

var withNDVI = addNDVI(img2001).select('NDVI');
var withNDVI = addTime(withNDVI);

print(withNDVI);

/*------------------------------------------------------------------------------------------
                                  SAVE DATA IN MY DRIVE
--------------------------------------------------------------------------------------------*/

Export.image.toDrive({
  image: withNDVI,
  description: 'ls7_ndvi_2001',
  scale: 30,
  region: zone_travail
});


texts:
I have a shapefile with points showing numbers of birds observed in different parts of the country.

As these were quite a lot of points with many of them very close together, I used the integrate-tool to combine points that are close to each other (e.g. within 2 km of each other). That all worked fine and the number of shown points was reduced.

Now I would like to label these new points, but can't figure out how it works with these integrated points. Because each of these integrated points actually belong to several original points, all values of these original points are shown as labels. E.g. if an integrated point consists of 5 original points, there are 5 labels.

But I would like to have only the maximum of these original values as the new labels. I already tried to use an expression for the labels e.g. max([Number_of_birds], but it doesn't work. Does anyone know how I can do that?

I have ArcGIS 10.2 for Desktop, Advanced license.

I added an example of the attribute table:

And here is an example of the map. The blue dots are three original dots, each with it's label. The red one is the integrated dot for these three ones. After integrating, the attribute table is still the same, containing the information of the three original dots and that's why, labels for all three entries are shown. But I would like to show only the maximum of the field "Number" in the label (in this case: 80).


texts:
I have about 20 different layers in my QGIS projects, all of which have the same properties.  I have been setting the properties as I create each layer, but that is time-consuming and error-prone.

Is it possible to set a properties default style for all the layers in a layer group?


texts: Integrate grid and polygon of municipalities keeping the biggest municipality per cell with QGIS (or another)

texts:
I have a 9x9 grid and a polygon of municipalities of an extensive area of Brazil. My goal is to have a field indicating the biggest municipality per grid cell.

I've been trying with intercept without good results. I know there are similar questions but I can't figure it out how to handle it in QGIS.

Here is a screenshot of what I'm talking about:

I was thinking that maybe with intersection and then spatial union joining with maximum but it didn't work.

I want to get the final grid with a field indicating the biggest municipality inside each grid cell.


texts: OpenLayers: Keep text style label in visible polygon area

texts:
I have a feature with a polygon and a text attribute. The text attribute is displayed via a text-style above the polygons center. Nothing special and so far so good.

The current behavior:
I can move the map so that a part of the polygon is still visible while the label is outside of the viewport (because the label stays at the center of the polygon).

The wanted behavior:
I can move the map so that a part of the polygon is still visible and the label stays inside the viewport (so it changes its position) until the polygon is fully outside of the viewport and not visible any more.

Is it possible to create such behavior?


texts: Combine KML overlays to find overlapping shapes and export to flat file

texts:
I have two KML files with many polygons each.

One has larger area polygons while the other has smaller areas. They overlap with each other and I would like to know which areas overlap with each other and export this data to CSV or a similar flat file.

Eg If KMLOne has a large polygon and KMLTwo has 5 polygons that overlap it then I would like to see which polygons overlap. Also if any polygons overlap but are not 100% overlapping with KMLOne then that should be marked as overlapping as well.

An example of how I would like this displayed is below where KMLOne has polygon with name 1 and KMLTwo has several polygons that overlap it.

+--------+--------+
| KMLOne | KMLTwo |
+--------+--------+
|      1 |      1 |
|      1 |      2 |
|      1 |      3 |
|      1 |      4 |
|      1 |      5 |
+--------+--------+

Is there a program that can perform this functionality?

Please let me know if you require any clarification.


texts: Is a WMS of vectors a stream of images or of data attributes?

texts:
I used to read that WMS is a stream of images, for example : image/png.
And that, if you need additional data about what is underlying, you have to send WFS requests aside.

But what about WMS streams of vectors (instead of rasters). I used to open a WMS layer with QGIS, and at that time I don't provide a WFS layer with it. QGIS is able to show me attributes content of what I am clicking on with my mouse.

What does the WMS stream carries to the client then ? Images ? It has to transfer data attributes too, isn't it ?


texts: Force St_split() to return geometries in specific pattern

texts:
I'm Using PostGIS st_split() to split a polygon geometry by a linestring. Then I use st_dump() to return each of the splitted geometry and it is working fine. But the issue is I want to force st_dump() to return in a specific pattern. For example if the line is vertical, return left geometry first and then right as shown below.

While if the linestring is horizantal, return upper geometry first then lower geometry.

Currently, it return geometry randomly.

Below is the snippet which return me splitted geometries

SELECT  ((ST_Dump(ST_Split(circle, line))).geom) As wkt
FROM (SELECT
ST_GeomFromText('LINESTRING(73.3864598921383 33.8985381624948,73.3962348946526 33.8646669883339)',4326) As line,
ST_GeomFromText('POLYGON((73.3733940124512 33.8850949267837,73.4058380126953 33.8936448555238,73.41313362121582 33.87818310806669,73.377857208252 33.8708431412792,73.3735656738281 33.8772567393002,73.3733940124512 33.8850949267837))',4326) As circle) As foo;


texts: Looking for working contour Layer as a WMS or WFS

texts:
I have had good success in the past with the following Contour layers but as of late neither seem to work:

https://carto.nationalmap.gov/arcgis/services/contours/MapServer/WMSServer?

https://services.nationalmap.gov/arcgis/services/WFS/Contours/MapServer/WFSServer?

Where can I find a working layer or how can I make this work?

Here is the error I am getting.


texts: Setting the extent for a QGIS map using python

texts:
I am writing a stand-alone application in Python/QGIS that simply creates maps.

I want to load vector/raster layers, set symbology, set extent

At the moment, that is all!

Currently I am just using the simple rendering technique outlined here: http://www.qgis.org/pyqgis-cookbook/composer.html#simple-rendering

I have failed, however, at adapting this code to define a specific extent. I provide the code below.

The only examples that I can find that show how to change extent involve creating a MapCanvas. ...But I am not certain that this is something I want to do considering I am just making very simple maps...and it seems to introduce a whole new set of complications.  Surely there is an easy way to define extent via the 'simple rendering' technique?

Becky

from qgis.core import *
from qgis.utils import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtCore import QFileInfo, QSettings

QgsApplication.setPrefixPath('/Applications/QGIS-1.9.app/Contents/MacOS', True)
QgsApplication.initQgis()

province = QgsVectorLayer('/filepath/Province_studyUTM36S.shp' , 'layer', 'ogr')
town = QgsVectorLayer('/filepath/TownPolygons_UTM36S.shp' , 'layer', 'ogr')
road = QgsVectorLayer('/filepath/Roads_UTM36S.shp' , 'layer', 'ogr')

QgsMapLayerRegistry.instance().addMapLayer(province)
QgsMapLayerRegistry.instance().addMapLayer(road)
QgsMapLayerRegistry.instance().addMapLayer(town)

rasterFile = '/filepath/Landsat.tif'
fileInfo = QFileInfo(rasterFile)
baseName = fileInfo.baseName()
rlayer = QgsRasterLayer(rasterFile, baseName)

QgsMapLayerRegistry.instance().addMapLayer(rlayer)

img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied)

color = QColor(255,255,255)
img.fill(color.rgb())

p = QPainter()
p.begin(img)
p.setRenderHint(QPainter.Antialiasing)
render = QgsMapRenderer()
ID = [  rlayer.getLayerID(), town.getLayerID(), road.getLayerID(), province.getLayerID()]
render.setLayerSet(ID)

rect = QgsRectangle(render.fullExtent())
rect.scale(1.1)
render.setExtent(rect)

render.setOutputSize(img.size(), img.logicalDpiX())

render.render(p)
p.end()

img.save("/filepath/first_render.png","png")


texts: Similar to Seeking examples of beautiful maps? is there any similar collection for 3D maps?


texts: .net Geoprocessing object: 000816: The tool is invalid

texts:
I am currently trying to build an ESRI Addin that supports multiple versions of ArcGIS (10.0 & 10.1). The project targets .net framework 3.5 and is built in the ArcGIS 10 environment. The referenced ESRI dlls are set to specific version false. The addin works correctly within both versions of ArcGIS.

With the addin we are also shipping geoprocessing tools created in the .net environment (KBFunctionFactory & IGPFunction2). The tool builds and functions correctly within the different versions of ArcGIS (once registered with ESRIRegAsm). However, when background processing is turned on the tool returns error “000816: The tool is invalid”

Looking in to the error it suggested that it could be related to 64 bit processing. I have experimented with building the dll for 64 bit but it makes no difference, the same error still occurs. I do not currently have 64 bit processing installed and to keep things simple let’s assume I am not looking to support 64 bit processing.

Edit: when compiling the dll any CPU following the above article and trying to register on the 10.1 machine it fails to create the registry file. No error, esriregasm.exe just says it failed. Creating the reg file on the 10.0 machine and adding this to the 64 bit registry does not work either.

I have tested building the dlls on a 10.1 machine with the .net 3.5 framework and the tool functions fine in 10.1. It does therefore not seem to be related to the .net 3.5 framework. As the tool works in foreground mode it would seem that it is not an ArcObjects version issue.

My questions are:

Should it be possible to create a .net geoprocessing object  to
target multiple versions of ArcGIS 10 with background processing?
What in the background processing framework makes the tool invalid
when moving from 10.0 to 10.1?
If it is not possible to target multiple versions how using ArcObjects could I disable background processing on the tool? See for example the “ESRI Metadata Translator” which runs in the foreground even if background processing is enabled

EDIT: Thanks to all that helped answer, in particular @KHibma. In review to these questions:

ESRI say this is not supported here. Our research seems to find that everything works so far except background processing
I still don't have an answer to this. It does not work with either 32bit or 64bit processing so it does not seemed to be related to this.
It is possible to disable background processing at 10.1 using the new interface. It is not possible to do this at 10.0


texts: How to create a mask from NLCD data in Earth Engine?

texts:
I'm trying to create a rangeland mask from 2016 NLCD data in Google Earth Engine. The basic approach I'm trying to take is to import the NLCD asset, filter to the 2016 data, and then use ee.ImageCollection.remap() function to create a mask. My code is as follows:

var nlcd = ee.ImageCollection('USGS/NLCD')
                          .filter(ee.Filter.eq('system:index', 'NLCD2016')) // Get 2016 Data
                          .select(0) // Get Landcover band integer
                          .aside(print,'2016 NLCD'); //Returns ImageCollection with 1 element

Next I invoke remap. I'm trying to map values 51:74 to 1 (these values correspond to range and shrubland classification).

var nlcdRange = nlcd.remap([51, 52, 71, 72, 73, 74],
                      [1, 1, 1, 1, 1, 1],
                      'landcover_class_values') // problem here?
                      .aside(print,'NLCD Range Mask'); // returns empty ImageCollection

nlcdRange is an empty ImageCollection object. I think I specified the columnName property incorrectly.


texts: QGIS 3.18 - Divide Polygons to smaller ones/clusters with each one having x number of points

texts:
I have a polygon-layer with the boundaries of a district. I want to divide this polygon into several smaller polygons with each polygon having x number of buildings.
To do so, I added another (background layer with bing/google maps) and I started adding points in another layer (each point represent a building with automatic numbering). Then in another line layer, I draw manually the lines (around every x points/buildings) so that I can use later Split with line with the original polygon-layer

The method is working but it is time consuming. Is there a way to speed up the process?
I found for example that OpenMaps can export the buildings shapes, but how can group each 30 buildings for example in a polygon?


texts:
I have some Well-known text (WKT) for representing geometry object such as Point, MultiPoint, LineString, Polygon, MultiPolygon etc. I have a multipolygon with in total 40000 Points.

I have found this plugin which convert svg to wkt
https://github.com/davidmcclure/svg-to-wkt

Is there any plugin which covert wkt to svg?


texts: Calculating percentage using QGIS Field Calculator?

texts:
I have a shapefile containing counties and their respective population for a given area. I woould like to use the Field Calculator to create a new field that contained the % of the total population in each county. I was looking for a way of doing it in one step inside the Field Calculator, i.e., how to build an expression that states something like "divide the population of each county by the sum of the population of all counties in this same column and multiply it by 100". I'm actually stuck in the "sum of all values" part...

Not sure if I'm demanding too much of a simple solution or if I'm just being blindsided and not seeing some obvious answer. Anyone?


texts: Calculate an intersection point of multiple spheres on the surface of earth

texts:
The question i am going to ask is very much similar to this question-How to calculate the intersection of 2 Circles?

But the problem here is, the radius of the spheres are too small (within 8 meter). I have used the Newton-Raphson method with Jackobian matrix to calculate a point which is exist in the intersection area of three spheres.
I have the (lat,long) and a radius for three spheres and may be more. But every time I am getting a matrix which is not invertible. To apply NR method I've first convert the lat,long to x,y,z by this

lat = toRadians(latitude);
lon = toRadians(longitude);
x = earthRadius * cos(lat) * cos(lon);
y= earthRadius * cos(lat) * sin(lon);
z = earthRadius * sin(lat);

and used this as a center of a sphere and use r/1000 as radius (converted to KM) of that sphere. Algorithm starts with an initial point which i have considered the centroid. I guess it is for the Bad Starting Point. The radius is calculated form the signal strength of the different wi-fi access points(AP). The number of spheres are dependent on how many APs are available. Any advice would be helpful for me.
EDIT
The story repeated many times in stack exchange. I have 3 wi-fi APs with known (lat,lng) and using RSSI, I am calculating the distance (i.e. radius) in meter. Now I need to calculate the location of the mobile user. Main problem is the RSSI is fluctuating and in result estimated distance can not be estimated correctly. That's why the spheres are not always intersecting.
But Newton-Raphson should try to find the intersection which is not happening. It throws an error that matrix is not invertible. Generated matrix may be or may not be square. If it is not square then used this.


texts:
I am trying to calculate the centroids of polygons using PyQGIS.

When I calculate the centroids with the interface (Vector --> Geometry Tools --> Polygon Centroids) everything works out.

However, I fail to reproduce the same using the python console in QGIS (version 2.18.16).

Following the history output after conducting the operation manually as well as the QGIS documentation, I use this line of code:

processing.runalg("qgis:polygoncentroids", shapefile, "memory:")

This produces the error:

NameError: name 'processing' is not defined

What am I doing wrong here?


texts: Allowing for Variable Inputs when Publishing Geoprocessing Tools to ArcGIS Server?

texts:
I have a Versioned Database reading and writing information from both the Desktop Environment and Collector for ArcGIS. I have a Server for ArcGIS, running an Advanced License. I would like users with a Basic License to be able to access published Advanced Geoprocessing (GP) Services / Tools and maintain the database using a series of my own Toolboxes.

As a test of the concept I have performed a Reconcile on my Database and published it to my Server as a Geoprocessing Service. The service runs as you would expect when run off the Server. The issue that I am having is the number of Versions of the Database will change as new users logon and create edit sessions (Primarily new devices connecting via the Collector App).

Is there a way to publish a GP Service that allows for a Dynamic input?

Allowing for the input versions list to be updated as the number of versions update. Running it off an Advanced License, this is accomplished by:

versionList = arcpy.ListVersions("Connection_To_Database")

If I try and run the Service using arcpy and updating the version list, I am presented an error:

  Traceback (most recent call last):
    File "", line 107, in execute
    File "https://linktomyserver ; Geoprocessing/GP_ReconcileVersions", line 93, in ReconcileVersions
  ExecuteError: Failed to execute. Parameters are not valid.
  ERROR 000800: The value is not a member of DBO.Esri_Anonymous_P_1517838606513.
  ERROR 000800: The value is not a member of DBO.Esri_Anonymous_P_1517838606513.
  Failed to execute (ReconcileVersions).

From what I can see here, the DBO.Esri_Anonymous_P_1517838606513 is a new version I created when I logged onto the Collector and created a new Offline Map. Which is a reasonable example of a real-world instance.

I have also created a Toolbox, which calls the published GP Service. My Toolbox is running the following code:

    Source = parameters[0].valueAsText

    arcpy.AddMessage(str(Source))

    Input = str(Source)
    arcpy.AddMessage(str(Input))

    read_lines = [line.rstrip('\n') for line in open(Input)]

    Conn = read_lines[1]

    InputText = Conn
    arcpy.AddMessage(Conn)
    arcpy.AddMessage("Connecting to Server Toolbox - GP Reconcile - Testing 1")
    arcpy.ImportToolbox("Link t to my server/rest/services;Geoprocessing/GP_ReconcileVersions","Reconcile Versions")
    arcpy.AddMessage("Toolbox Connection Established")
    versionList = arcpy.ListVersions(InputText)
    arcpy.AddMessage(str(versionList))
    #arcpy.ReconcileVersions_management(InputText, "ALL_VERSIONS", "sde.DEFAULT", versionList, "NO_LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION")
    #arcpy.ReconcileVersions_GPReconcileVersions(InputText, "ALL_VERSIONS", "sde.DEFAULT", versionList, "NO_LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION")

    result = arcpy.ReconcileVersions_GPReconcileVersions("ALL_VERSIONS", "sde.DEFAULT", versionList, "NO_LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION")

    while result.status < 4:
       arcpy.AddMessage(result.status)
       time.sleep(0.2)

    arcpy.AddMessage("Reconcile completed")
    return

I have a few lines of code in there which are just for my own debugging and will be removed. The code works if I am calling a "Local" reconcile tool, but fails with the error presented when I try and call the published GP Service. I used this example: ArcGIS: Using a service in python


texts: Object: Error in executing tool in arcpy address locator script

texts:
I have a python script I made into a tool that creates multiple address locators. I also have two separate machines that I access through citrix. Each machine has it's own instance of ArcMap installed. When I developed the tool on the first machine it ran fine. I then copied it over to the second machine which has the same architecture and now it's bombing. I pulled the script into PythonWin and hardcoded the inputs. I tried to get messages in try: except: clause but the program would just print the first print statement and then exit.

# Create street address locators using different street centerline feature classes

# Import system modules
import arcpy
import os
from arcpy import env

outPath = r"C:RS_Data\Common\Locators"

arcpy.env.workspace = outPath
arcpy.env.overwriteOutput = True

    # Get tool parameters from street centerline files
    mainRef = r"J:\Common\Map Clips\Street Layers\Features.gdb\CO_SF_2016_Q4_Merge" #arcpy.GetParameterAsText(0)
    aliasRef = r"J:\Common\Map Clips\Street Layers\Features.gdb\CO_SF_2016_q4_streets" #arcpy.GetParameterAsText(1)
    #aliasA_Ref = arcpy.GetParameterAsText(2)

    #No need for output name until create comp address locator code works
    """outCompAdd = arcpy.GetParameterAsText(3)"""

    # make a list of the street centerline files

    refData = [mainRef,aliasRef]

    # Create a loop that will create a separate address locator for each street centerline file
    for ref in refData:
        # create output name
        baseName = os.path.basename(ref)
        outName = os.path.join(outPath,baseName)
        print outName
        #create address locator
        arcpy.CreateAddressLocator_geocoding("RouteSmart - US Streets with Zone",ref,"'Street ID' link_id VISIBLE NONE;'*House From Left' L_REFADDR VISIBLE NONE;'*House To Left' L_NREFADDR VISIBLE NONE;'*House From Right' R_REFADDR VISIBLE NONE;'*House To Right' R_NREFADDR VISIBLE NONE;'Prefix Direction' ST_NM_PREF VISIBLE NONE;'Prefix Type' ST_TYP_BEF VISIBLE NONE;'*Street Name' ST_NM_BASE VISIBLE NONE;'Street Type' ST_TYP_AFT VISIBLE NONE;'Suffix Direction' ST_NM_SUFF VISIBLE NONE;'*Left Zone' L_POSTCODE VISIBLE NONE;'*Right Zone' R_POSTCODE VISIBLE NONE'",outName, "")
        message = "Created" + " " + outName
        arcpy.AddMessage(message)

This is the error I'm getting:

Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 323, in RunScript
    debugger.run(codeObject, __main__.__dict__, start_stepping=0)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", line 60, in run
    _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 654, in run
    exec cmd in globals, locals
  File "J:\Common\Script\Drivers\Create_Address_Locators.py", line 4, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\geocoding.py", line 93, in CreateAddressLocator
    raise e
RuntimeError: Object: Error in executing tool

I'm afraid I haven't been able to get anything more helpful in a message, as I stated earlier, try and except just forces the program to exit.


texts:
I have downloaded the Blue Marble dataset, and it consists of eight GeoTIFF images, labeled like this:
A1 B1 C1 D1

A2 B2 C2 D2

I would like to use these tiles for GeoServer to be served as WMS. Unfortunately, I don't know how to use multiple images as data source.

1) Can this be somehow done in GeoServer?

2) If not, what tool can be used to merge such images into single huge GeoTIFF file? IrfanView is out of question, it freezes trying to open a single image...


texts: Printing a table fro time series on google earth engine

texts:
I'm quite new to GEE.
I have code that prints a time series of my image collection.
I know that it is possible to download the data to a csv file but is there a way to view my time series data in a table in google earth engine?
I want the data in a table so i can do more analysis on it.
the code to the time series:
    //Export 3X3 mean EVI Time Series into a Scatter Chart and a CSV format
    var TimeSeries = Chart.image.seriesByRegion(
    S2_withEVI_mean, fc, ee.Reducer.mean(), 'EVI', 3, 'system:time_start', fc_ID)
    .setChartType('ScatterChart')
    .setOptions({
      title: 'EVI 3X3 mean Time Series For Shift 1-2 Argentina',
      vAxis: {title: 'EVI'},
      hAxis: {title: 'Date'},
      lineWidth: 1,
      pointSize: 4,
      series: {
      }});
// Display.
print(TimeSeries);


texts: Grass v.rast.stats returning null values

texts:
I have a vector layer (polygon) and a raster layer. The raster layer holds values for height above bald earth in a field called "value". I'd like the vector layer to inherit either the mean or the mode values from raster cells falling within the boundaries of each polygon.  I run this command in grass:

v.rast.stats nameofpolygon raster=nameofraster colprefix=height

The result is a polygon populated with all the fields you'd expect but containing all null values within these fields.

I did receive a warning that some polygons are missing centroids at the beginning of the output.
The raster and vector layers are within the same Grass Mapset and do occupy the same geographic space.
I did set the region to contain both features prior to running v.rast.stats

Thanks in advance for you help!

(2011/05/10)UPDATED DETAILS:
I created an entirely new GRASS Location & Mapset; Loaded both my raster and polygon features to the same Mapset; Ran v.centroids on the polygons; Ran g.region.raster; Calculated univariate statistics (v.rast.stats) from the raster based on the vector; Double checked that the raster does actually contain values, and it does in a field titled "value". The statistics are still returning NULL values.  I've tried this through GRASS, GRASS-gui, and QGIS gui.


texts:
I'm new on R.

I was listing .tif files from a folder to R. My final product is going to be a value mean of all the files in only one image. So I start stacking all of them, then brick the stack, and finally make a mean from the brick.

My problem starts when I stack the files, because the stack changes the original dimensions, extent and crs.

I need to maintain the values from the original files, so what can I do?

Example:

list160927<-list.files("D:/ImageR/160927", pattern=".tif", full.names=TRUE)
stack160927<-stack(list160927)
brick160927<-brick(stack160927)
mean160927<-mean(brick160927)

the original extent and csr from each file are:

dimensions  : 180, 360, 64800  (nrow, ncol, ncell)
resolution  : 1, 1  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0

when I stack all the files the

class       : RasterStack
dimensions  : 1006, 804, 808824, 5  (nrow, ncol, ncell, nlayers)
resolution  : 1, 1  (x, y)
extent      : 0, 804, 0, 1006  (xmin, xmax, ymin, ymax)
coord. ref. : NA

Also, I tried to set the extent (the same that are in the original files) to the result brick but that didn't respond, and the brick maintain the change extent and csr.


texts: python install rio-color could not load plugin rio -color

texts:
hello I have install python  rio plugin to add color ramp in some DEM datasets.
I have install using download from GitHub .

but if I run rio --help in cmd then :

C:\Windows\System32>rio --help
Usage: rio [OPTIONS] COMMAND [ARGS]...

  Rasterio command line interface.

Options:
  -v, --verbose       Increase verbosity.
  -q, --quiet         Decrease verbosity.
  --aws-profile TEXT  Selects a profile from your shared AWS credentials file
  --version           Show the version and exit.
  --gdal-version
  --help              Show this message and exit.

Commands:
  atmos      † Warning: could not load plugin. See `rio.exe atmos --help`.
  blocks     Write dataset blocks as GeoJSON features.
  bounds     Write bounding boxes to stdout as GeoJSON.
  calc       Raster data calculator.
  clip       Clip a raster to given bounds.
  color      † Warning: could not load plugin. See `rio.exe color --help`.
  convert    Copy and convert raster dataset.
  edit-info  Edit dataset metadata.
  env        Print information about the Rasterio environment.
  gcps       Print ground control points as GeoJSON.
  info       Print information about a data file.
  insp       Open a data file and start an interpreter.
  mask       Mask in raster using features.
  merge      Merge a stack of raster datasets.
  overview   Construct overviews in an existing dataset.
  rasterize  Rasterize features.
  sample     Sample a dataset.
  shapes     Write shapes extracted from bands or masks.
  stack      Stack a number of bands into a multiband dataset.
  transform  Transform coordinates.
  warp       Warp a raster dataset.

but in atmos and in color I take this message :

atmos      † Warning: could not load plugin. See `rio.exe atmos --help`.
color      † Warning: could not load plugin. See `rio.exe color --help`.

I need more setting or more install package to work ?


texts: Error in loading landsat 8 images using water package

texts:
i am working with water package and when i want to load the image from an specific working directory i am getting this error.

  amg<- loadImage(path = rawimgae, sat = "L8")

  Error in list.files(path = path, pattern =
  paste0("^L[EC]\d+\w+\d+_(b|B|band)",  :

  object 'rawimgae' not found


texts: I am pretty new in this topic and tried some codes and layers from ArcGIS site here and still don't understand meaning of extent: new Extent (xmin, ymin, xmax, ymax, spatial Reference). These are supposed to be coordinates for a square the layer will be working in, isn't it? If so, why there 2 types of them (Initial and Full) given, ex: US Rivers and Cities example here  and when I tried some other values, showing even another country it worked?


texts: FME - How to add an attribute when schema definition is dynamic?

texts:
I have an FME workspace which reads a folder of MapInfo TAB files and writes them to a File Geodatabase.  The reader and writers are both using dynamic schema as I need to run this workbench on multiple folders each containing several files.

What I would like to do is add an attribute to the feature class which contains the file path of the input TAB file.  I have exposed the fme_dataset attribute on the reader and I have added it to the writer as well.  That didn't work.  I've also tried copying the fme_dataset attribute to another attribute called File_Path.  That didn't work either.

I'm assuming that this isn't working because the schema definition is coming from the reader.  But, why won't it work even when I expose the fme_dataset attribute?

I've looked at this similar post on FMEPedia, but I don't see how I can use a schema mapper for this purpose.

EDIT 07/01/2014

I thought this might be relevant as well, so I'll add the following:

I have created a separate attribute called FeatureClassName which is just the source file name which has been validated (removes non-word characters such as brackets).  In the dynamic properties for the destination geodatabase, I have used a custom schema definition:

I am setting the Feature Type Name from that attribute:

The Schema definition is set to default (from Feature Type Name - above).  Is it possible that this could be the reason I'm not able to add the attribute?


texts: Calculate % agriculture and % forestry cover across each 10km square of the UK

texts:
I am working on investigating the relationship between agricultural intensity and the diversity of birds. I have a shapefile of a map that splits the UK into 10km squares and for each square I need to calculate the % that is used for agriculture and % that is natural forest.

I have the program QGIS as I have not used ARC much before. Can anyone simply explain and help me with how to do this? I have access to land cover and crop maps too.


texts: Importing MXD and/or CAD template into QGIS print composer?

texts:
ArcGIS is used very widely in Environmental consultancy and the print/map templates used for reports are usually passed around in an MXD  or CAD file format.  Unfortunately we cannot afford ArcGIS and to be honest I much prefer QGIS.

At the moment we use the CAD file to then create a copy of the print template in the print composer.  However this is a little time consuming and is pretty redundant work considering the MXD and CAD files are already at our disposal.

Is there a way to simply import the print composer template either from a CAD file or MXD?

I've seen the MXD2QGS plugin for ArcGIS discussed in the thread, does this also create the print composer template or does it just export the layers?

We could feasibly ask our clients and people we work with to install this and do the conversion, but really I'm looking for a solution on the QGIS side.


texts: Index for data driven page created atlas?

texts: We have a parcel atlas created from a data driven page document where each page represents a particular 16 mile square township.  I have created my own index of polygons instead of ArcGIS index creation because we are looking for a slight overlap.  I would like to create or tweak a python script to clip the area for each page and pull out owner name information for each township; better yet, would be each 1 square mile section in order to create a index of names/ area.  Anyone know of something similar or can point me in a direction of more information.  I am relatively new with python but understand the basics pretty well.


texts: I have an excel sheet of precipitation data of each month of some districts. I have also the shapefiles of these districts. How can I represent this data in these shapefiles.


texts: Setting up Eclipse for ArcGIS Engine Java development?

texts:
I'm trying to setup Eclipse for ArcGIS Engine 10.0 development. I've been reading for days and weeks through the documentation and through the forums here and elsewhere. It seems that no one has this same problem. My issue is that I'm stuck at the point of installing the ArcGIS plug-in for Eclipse. I'm going through the steps in the ArcGIS Resource Center here. It says to create an ArcGIS local update site at this directory:

%ARCGISHOME%/java/tools/eclipse_plugin/arcgis_update_site/engine

The problem is that my directory structure is missing the engine folder. Does anyone know how I can get the engine folder and its contents? Or any other solution?


texts: Why are detailed model processes and tools being shown in the progress window of Model Builder when it is double clicked / opened?

texts:
ArcGIS Desktop Advanced 10.1

The ESRI help notes state that when a model is run from"edit" in Model Builder all results are shown in the progress window - e.g. the progress of every tool and process.

The help notes also state that when the model tool is run from "open" or double clicked, only the overall progress of the model is shown in the progress window, not the progress of the individual tools or processes within the model.

http://resources.arcgis.com/en/help/main/10.1/index.html#/Running_a_model_tool/002w0000004q000000/GUID-17578415-7F89-4BD4-BB9C-33B8F2220FEF/

This is the behavior I normally see for my Models.

However I have some models that when they are double clicked in ArcCatalog / or "open" when they run they show the full progress of every tool and process in the dialogue box.

Any ideas or experience of this behavior?

thanks for any tips / insight


texts:
I used the following command to reproject a GeoJSON from lat/lon to 3857:

ogr2ogr -f "GeoJSON" results_3857.json -t_srs "EPSG:3857" results.json

Unexpectedly, the resulting file was 5 times larger than the original.

Turns out the resulting file contains all properties for each feature, while the original contained only those properties that were not null.

For example the original might have had a properties objects that look like this:

..."properties": { a: 1, d: 2, f: 1 }....
..."properties": { b: 1, c: 2, d: 2 }...

while the newly reprojected file has converted them to look like this:

..."properties": { a: 1, b: null, c: null, d: 2, e: null, f: 1 }...
..."properties": { a: null, b: 1, c: 2, d: 2, e: null, f: null }...

I don't want these extra null entries in my reprojected GeoJSON.

And so my question is this:

How can I remove those properties that have null values from the GeoJSON?

Is there some flag I can use in the ogr2ogr command?
Maybe there is a subsequent gdal command I can use to remove those attributes that have a null value?


texts: Error:getFeatureFromEvent is not a function - Openlayers Multiple layer selection

texts:
OpenLayers.Control.SelectFeature works well when I try to select single layer from map. But it throws error as getFeatureFromEvent is not a function when I pass a collection of layers to it.

Following is my detailed code.

var TapestryLayers = [];

fontColor = "#FF0000", fontSize = "13px", strokeColor = "#FF0000";
for(var i=0;i<data.tapestryShapes.length;i++){
 var geom = new penLayers.Geometry.fromWKT(data.tapestryShapes[i].the_geom).transform(geographicProj, sphericalMercatorProj);
 var fencefeature = new OpenLayers.Feature.Vector(geom, {}, {
                                            "strokeColor": strokeColor,
                                            "fillOpacity": 0.04,
                                            "strokeWidth": 1.5,
                                            "strokeOpacity": 0.3,
                                            "pointerEvents": "visiblePainted",
                                            'label': data.tapestryShapes[i].name,
                                            'fontColor': fontColor,
                                            //'fontSize': fontSize,
                                            'fontFamily': "arial, monospace",
                                            'fontWeight': "bolder",
                                        });

 fencefeature.attributes = {
                             name: 'tapestryDataLayer',
                             type: 'tapestry'
                            };
 var tapestryDataLayer = new OpenLayers.Layer.Vector(data.tapestryShapes[i].name,
                                                {'displayInLayerSwitcher':false}
                                                );
 map.addLayer(tapestryDataLayer);
 map.getLayersByName(data.tapestryShapes[i].name)[0].redraw();
 tapestryDataLayer.addFeatures([fencefeature]);
 TapestryLayers.push(map.getLayersByName(data.tapestryShapes[i].name));
  }
//select = new OpenLayers.Control.SelectFeature(tapestryDataLayer,{clickout: true, multiple:true}); //But only for single layer as expected!
 select = new OpenLayers.Control.SelectFeature(TapestryLayers,{clickout: true, multiple:true}); //Get error getFeatureFromEvent is not a function (but it still a vector layer!)
  map.addControl(select);
  select.activate();

  tapestryDataLayer.events.on({
           'featureselected': function(feature) {
                             alert("selected");
                                      },
            'featureunselected': function(feature) {
                              alert("unselected");
                                      }
                                  });

Any suggestions as why its giving that error. I have searched for same error and same functionality on stackexchange but that couldn't help.

Thanks


texts: Table to Table iterator - Include all fields (different fields for shapefiles)

texts:
I am using ArcGIS Desktop 10.5 and trying to convert a number of shapefiles into a CSV document.

Some shapefiles have different column names and the Table to Table tool reads in the first columns within the first shapefile and then applies those names to every shapefile, therefore missing some columns.

For example, shp 1 has columns A B C D, so the tool specifies to convert each column, but the next shp 2 has columns A B C D E F. The tool only prints about A B C D, leaving out E F from the shp 2.

I would like the tool to convert each column for every shapefile, not just the columns from the first shapefile being read in.


texts: How to check a set of points are inside a polygon or not in postgis?

texts:
I have a set of geometry values (point values). I have another distinct geometry value (polygon).  I want to find out which points are inside (contains) the polygon. Say, my polygon is B. And the set of points are: {A1, A2, A3...}. I want to check whether B contains A1 then A2 then A3 and so on. I can do it individually by ST_Contains. Such as:

select * from table1 where st_contains(B,A1)

But I don't want to check individually. I want to check for the whole set at a time, i.e {A1, A2, A3...} and want to find out the points (i.e A3 and/or A2) which are contained in B means which has given true value for ST_Contains. How to do it?


texts: SID and/or ECW support on QGIS for Linux

texts:
Running QGIS on Ubuntu 11.04 and QGIS for Android on Galaxy Tab 10.1 (which is an awesome project by the way)

NEED to figure out a way to get SID and/or ECW files loaded.

Saw some posts about compiling GDAL manually but haven't had any luck.

Has anyone successfully accomplished this?


texts: Extracting lat , long & numeric value of one pixel for all variables in NetCDF4 file using Python?

texts:
I have an application with wxpython in which I can read and show NetCDF4 file and some information like x y coordinates.

what I need is the numerical value or pixel value for the variable air dep which corresponds to the coordinates cursor  x y : x = col & y = row :(X 89.98774193548385, Y 35.8141935483871).

My NetCDF file has some variables and I need just this information for variable "air_dep".

The code is shown below:

In [1]: import numpy as np^M
   ...: import netCDF4^M
   ...: from netCDF4 import Dataset^M
   ...: ^M
   ...: fic='air.departure.sig995.2012.nc'^M
   ...: ^M
   ...: path='D:/data/'^M
   ...: ^M
   ...: nc = netCDF4.Dataset(path+fic,'r')

In [2]:

In [2]: nc
Out[2]:
<class 'netCDF4._netCDF4.Dataset'>
root group (NETCDF4 data model, file format HDF5):
    description: The departure of the NCEP/NCAR Reanalysis air temperature from its value at Darwin, Australia. Data is from NMC initialized reanalysis
(4x/day).  These are the 0.9950 sigma level values.
    dimensions(sizes): lat(73), lon(144), time(366)
    variables(dimensions): float32 lat(lat), float32 lon(lon), float64 time(time), float64 air_dep(time,lat,lon)
    groups:

In [3]: nc.variables.keys()
Out[3]: odict_keys(['lat', 'lon', 'time', 'air_dep'])

I know the code is  in wxpython but i just edit the code without GUI and ploting  python3.6.

That's what I have, I can just show the x y but what I need is the numeric value and lat-lon at this point!
i'm new in netCDF4


texts: Converting resolution to meter using ArcGIS for Desktop?

texts:
I have data in the following format:

Projection: Latitude-Longitude                                      |
 |            N:  46:08:44N    S: 45:54:50.666667N   Res: 0:00:00.333333      |
 |            E: 96:30:27.333333W    W: 96:50:23.666667W   Res: 0:00:00.33333 |
 |   Range of data:    min = 291.4953  max = 338.9827

I need the resolution like as follows:
 Projection: Latitude-Longitude                                      |

 |            N:        50N    S:        45N   Res:     5                     |
 |            E:        95W    W:       100W   Res:     5

How can I convert Res: 0:00:00.333333 to meters?


texts: Using ArcPy to identify Shapefiles instead of os.walk() via *.shp file extension?

texts:
I am trying to write a script that identifies all Shapefiles within my folder structure and write a list of the .shp files with their full path file name to a newly created .txt file.  I was able to get this code to work with PNG files but when i try to search for .shp files i get a RuntimeError.  I have every idea this is because there are multiple files that make up a shapefile.

Is there a way to do this using ArcPy?

His is my code so far:

import os, arcpy

StartDir = "C:/Temp/"
OutputFileName = "CarolinasSHPs"
tempName = StartDir + OutputFileName + ".txt"
outFile = open(tempName, 'w')

for root, dirs, files in os.walk(StartDir):
    for f in files:
        arcpy.env.workspace = root
        if f.endswith(".shp"):
            outFile.write( root + f + '\n' )

outFile.close()


texts: Remove Duplicate Polygons Using Open Source Tools

texts:
I have a shapefile containing features with duplicate geometries, but different attributes (e.g. a polygon with attribute XX, and an identical polygon with attribute XY).  I want to identify the duplicates, then pick the one with the correct attributes, deleting the other.

I've tried topology tools in OpenJump/Kosmo, but without success.  They have a 'delete duplicates' tool that does what I want, except seems to arbitrarily delete one of the features rather than letting me pick which one to keep.

I have access to QGIS, OpenJUMP, Kosmo, etc. and am able to install other open source/free tools if required.

Thoughts?


texts: Arcpy way to access underlying feature classes contained in a web map

texts:
I am building a stand alone arcpy script, and need to connect to the specific feature classes within a published web map, query/copy from those feature classes, then after some processing update those specific feature classes with new or modified data.

I have a GUID value to the specific web map I need to interact with (this is my only point of entry to the underlying feature classes), but I need to be able to find the database connections to the database and feature classes that make up the web map. The web map was constructed from 3 published web feature layers/feature services, each containing 1-many feature classes, and I ultimately need to obtain the database connection to a specific point feature and line feature, run my script (which makes copies of those feature classes then runs arcpy geo-processing steps-near_analysis, snap, SplitLineAtPoint, AddGeometryAttributes) then need to update/add features back to the respective database and feature classes.

My querying/geo-processing script is already working on hardcoded database connections, but now I need to loop through the various GUIDs I have to different web maps and dynamically connect to variable database connections within the web map (that I have a GUID ID for).

I have found documentation showing how to access webmaps:

from arcgis.gis import GIS
gis = GIS()
web_map = gis.content.get('<GUID value>')#where GUID value is the GUID I have in a list

and then accessing the web feature layers that make up the web map:

web_map_layers = webMap(web_map)
layers = web_map_layers.layers

but printing that out just seems to give me a list of dictionaries, not something that I can assign to a variable and treat as a real feature class within a database or even temporarily in memory.


texts:
I created an aspect raster form a DEM raster in QGIS 2.14, and got this results:

I know that the results refer to degree units , but still i don't understand how to read the map result- i mean to which direction the aspect turn.

In ESRI site http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/how-aspect-works.htm  , the spatial analyst doucumentation explain the aspect with this schem:

i seeked the same explanation in https://docs.qgis.org/2.2/en/docs/training_manual/rasters/terrain_analysis.html?highlight=aspect but didn't found anything like it.

How can i read and understand the aspect results?


texts: QGIS 3: How to set Print Layout Size above A4/Legal?

texts:
QGis Layout Manager does not show page size above A4
Menu Layout > Page Setup
Composition cannot be created for bigger format

Customize size is rejected
QGIS versions tested: 3.4, 3.10


texts: Hiding Output Direction Raster from Euclidean Distance in ArcGIS ModelBuilder

texts:
I am using ArcGIS Desktop 10.5.

Is there any way to hide (for aesthetic reasons) an empty Output Direction Raster resulting from an Euclidean Distance in ModelBuilder?

I currently have a ModelBuilder model for a project that contains quite a few Euclidean Distance tools, each with its distance raster and its direction raster. I don't need the latter for anything, actually i don't even chose to create it, so my model is full of white squares that give no output that end up bothering.


texts: ArcGIS Server Object Extensions: how do I deploy extra .dll's?

texts:
I am developing an ArcGIS Server Object Extensions in C# that makes calls into a C++ .dll.
How do I add this .dll to deployment?
By that I mean that I want it included in the .soe.


texts: Issue with Planet Labs API - scenes filtered by area of interest do not intersect AOI

texts:
I've obtained a list of item IDs that intersect my AOI using
api.filters.geom_filter(aoi) and this list has lots of scenes in it. However, when I attempt to download these scenes clipped to the exact same AOI, I get a returned message saying 'AOI does not intersect with PSScene3Band/20180815_163343_1043.

This error only happens for very few scenes, i.e. 2-5 out of 100 but it prevents me from doing a mass download. I am confused as to how a scene can pass the intersection filter and then fail to have an intersection during the clipping operation.

I am using the V1 API for searching and the V2 API for clipping and downloading. The request that I submit to the V2 API is the following:

{'name': 'farm_clipped',
 'products': [{'item_ids': ['20180821_165023_1105',
    '20180928_165956_1027',
    ...
    '20180815_163343_1043'],
   'item_type': 'PSScene3Band',
   'product_bundle': 'visual'}],
 'tools': [{'clip': {'aoi': {'coordinates': [[[-98.44, 46.29],
       [-98.38, 46.29],
       [-98.44, 46.25],
       [-98.38, 46.25],
       [-98.44, 46.29]]],
     'type': 'Polygon'}}}]}

I've abbreviated the list of item IDs, but have left in one of the IDs (20180815_163343_1043)that leads to a failure.


texts: How identify appropriate QGIS archive for given OS

texts:
I want to download version 3.10 on a Mac, but the archived versions in the "All Releases" tab of the download window are not named in a way that distinguishes a Mac version from W32 or W64.
For example, which of the following would I download for installing 3.10 on a Mac? (yes, I have reasons to need the most recently expired LTR)
[   ]   QGIS-OSGeo4W-3.10.14-1-Setup-x86.exe    16-Jan-2021 09:17   336M
[   ]   QGIS-OSGeo4W-3.10.14-1-Setup-x86.exe.sha256sum  16-Jan-2021 09:17   103
[   ]   QGIS-OSGeo4W-3.10.14-1-Setup-x86_64.exe 16-Jan-2021 09:24   386M
[   ]   QGIS-OSGeo4W-3.10.14-1-Setup-x86_64.exe.sha256sum   16-Jan-2021 09:24   106


texts: Choosing intervals for a map of race in the United States

texts:
I'm creating an open map layer of race in the United States using Census Data. This layer will be publicly available in the near future as "Justice Map".  The goal is to help others create maps using this data layer.  I'm generating tiles with TileMill. I will be creating tiles for Google Maps zoom levels 0-13 -- all the way down to the block level.

How should I choose my intervals for coloring the map?

The problem is that all the non-white racial groups are heavily concentrated in medium or small sized areas (notably Asians and Native Americans).  I don't want to distort the geography to make the size of a state proportional to its population, as that would make it hard for other people to use this open map layer.

The maps below are an example of percent black for each census tract.  However, I will be doing this for other races including Black, Asian, Native American, Hispanic, White Non-Hispanic, Multi-Racial, other race, and Hawaiian or Pacific Islander.

So far I'm planning on using a sequential color scheme from colorbrewer2.org and nine categories.

I'm going to create maps for counties, census tracts, block groups and blocks.

Categorization Methods

Equal Breaks: it makes the map look too empty for most racial groups.

Jenks Natural Breaks: also makes the map too empty.

Percentile: map looks nice, but emphasizes very small differences.  For percent Black and census tracts it has breaks at 0.4%, 0.8%, and 1.6% (so 33% of the census tracts have 1.6% or less blacks).

I want to give more emphasis to the tail distribution than the Jenks algorithm does, and less emphasis than percentile.

I made up my own distribution without using an algorithm.  Then  I tried to fit an algorithm to it.  I get an approximate fit using a 10% weight for equal breaks, and a 90% weight for percentile.  This makes the first break (percent black) be 0.4*0.9 + 10*0.1 = 1.36.  Next break is 2.8%. This example uses the algorithm (and a new color scheme):

Yet another idea is to use a Sliding Percentile method.  For instance, instead of using deciles (putting 10% of the data in each category) - you could use percentages like  18, 16, 14, 12, 10, 8, 6, 4, and 2.  Or you could use a geometric series with a ratio of 1.1 or 1.2 between the percentile in each category.  This method would balance the goals of having the data falls into different categories, and that the difference between the categories is significant.