texts: GRASS: strange classification output and reject map from "i.maxlik"

texts:
I am trying to perform a supervised classification with "i.maxlik".

I have three bands: 1) elevation (a dem); 2) reflectance (derived from Landsat ETM+ band4); 3) cumulative solar radiation (derived using "r.sun"). I am using rock glacier outlines (polygonal vectors) as my region of interest (ROI). I want to find which area is similar to my ROIs over the image in the three above bands. The image was previously masked to remove all regions other than bare soil (e.g. water bodies, vegetation, etc.), so I cannot define other classes for my classification easily.

My workflow was:

I grouped the three bands with "i.group" into perma_max;
I added a new column to the rock glacier vector, giving a common value of 1 (int)
I converted the vector to raster with v.to.rast in=rg_visible out=rg_visible use=attr attribute_column=IDmaxlik
I used "i.gensig" to generate the signature file (i.gensig trainingmap=rg_visible group=perma_max subgroup=perma_max
signaturefile=rg_sig)
I run i.maxlik (i.maxlik group=perma_max subgroup=perma_max signaturefile=rg_sig
output=classification01 reject=classification01_reject)

Each pixel of the output map ("classification01") is 1, as if the
everything was classified as "rock glacier". Moreover, the reject map
("classification01_reject"), has higher values (closer to 16, or 100%)
over the same rock glaciers used as ROI than elsewhere.

I already post this question here, and they suggest me to add classes to my classification, but this is not quite possible, as in my case I have no idea what is around the rock glaciers. Considering the pixels of my RGB image within the rock glaciers as a proxy of permafrost presence, the final aim would be to classify teh pixels of bare soil outside the rockglaciers with the supervised classification. Those which are similar to the rock glaciers would be my "high permafrost probability" pixels.


texts:
I need to put government data into a shape-file (right now I have points locating schools, and have the census tract layout in QGIS (outline of NYC) I just need the poverty data mapped onto this) - if this requires a tutorial I'm fine with being directed to one as well but I am lost overall.

This is not for homework, I am just finally tying to figure out how to visually map onto the screen poverty around certain points so I can see this visually through QGIS the way you can do it with PolicyMap or something else.

(this is my second question)


texts:
I have some shapefiles for which I need to generate an index(int) field.

I tried using this function:

def add_index_to_layer(layer):
    fieldindex = layer.fieldNameIndex("index")
    if fieldindex >= 0:
        print "Layer " + layer.name() + " already has an index field"
        return False
    layer.dataProvider().addAttributes([QgsField("index", QVariant.Int)])
    layer.updateFields() # no idea if this is actually needed?
    fieldindex = layer.fieldNameIndex("index")
    i = 0
    layer.startEditing()
    for field in layer.fields():
        print field.name() # this shows the field "index" indeed exists
    for feature in layer.getFeatures():
        print feature.id(), feature["index"]
        feature.setAttribute("index", i)
        # this shows the value is being correctly set at this point
        print feature.id(), feature["index"]
        i +=1
    layer.commitChanges()

The function runs just fine, the various print functions also show everything works as expected (values being set correctly).

However, when verifiyng by looking at the attribute table, the index field is created, but it always is empty/NULL.

Does anyone have an idea about what is going on? Are some of the changes pending where I expect them to be commited already? I thought layer.startEditing() and layer.commitChanges() would properly encapsulate feature field changes?

I am working with QGIS 2.18.0, and the script is created as a processing script.


texts: Trouble when Dissolving Geopandas Polygons

texts:
I have dissolved polygons with geopandas. However, the head of attribute table became values of this table.

How can I fix this trouble?

See:


texts: purchase oblique / 45 degrees imagery of european cities

texts:
I am looking to purchase oblique / 45 degrees imagery of some european cities but I am not able to find a supplier that cover most countries.

Does anybody know any or have expirience with this kind of product?


texts: Meaning of "Elevation above surface of ellipsoid"?

texts:
I'm using implementation of Vincenty's algorithms, and I have their class called "position" that requires lat, lon, and elevation defined by: "Elevation above the surface of the ellipsoid".

What is the meaning in such applications? Is it just simple "Elevation above MSL"?


texts:
I have tried to used gdalwarp to project set of images(from hdf4 files to tif) before merging them using gdal_merge. But then the merge output has spaces/blanks. They're not merge properly, and I don't know why'd it happened like that. So I thought of merging first before projecting, when I tried to project the merge hdf files an error like this always appears:

ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for merge.tif.
There is no affine transformation and no GCPs.

Command line code:
gdalwarp -te 109.975 3.475 135.025 25.025 merge.tif new.tif

Here is the gdalinfo:

Driver: HDF4Image/HDF4 Dataset
Files: A2014348055000.L2_LAC.SeAHABS.hdf
Size is 1160, 1990
Coordinate System is `'
Metadata:
  bad_value_scaled=-32767
  bad_value_unscaled=-32767
  Calibration Data=A2014348055000.L1A_LAC.eAHAB.hdf, MYD02_Reflective_LUTs.V6.1.17.24_OC.hdf, MYD02_Emissive_LUTs.V6.1.1
7.24_OC.hdf, MYD02_QA_LUTs.V6.1.17.24_OC.hdf
  cdm_data_type=swath
  Conventions=CF-1.6
  creator email=data@oceancolor.gsfc.nasa.gov
  creator name=NASA/GSFC/OBPG
  creator url=http://oceandata.sci.gsfc.nasa.gov
  date_created=20141214T092342Z
  Day or Night=Day
  Earth-Sun Distance Correction=1.03201282024384
  Easternmost Longitude=125.8173065
  End Center Latitude=25.38609505
  End Center Longitude=112.290802
  End Day=348
  End Millisec=21301577
  End Node=Ascending
  End Time=2014348055501577
  End Year=2014
  Flag Percentages=0.0001732801902, 22.30172539, 0.001126321382, 15.12727451, 80.96486664, 3.97266531, 5.644948959, 0, 1
5.79899502, 81.37419891, 0.1860162914, 0.8686535954, 0, 0, 0.2047305405, 0.01342921611, 0, 0, 0, 0.08087852597, 43.33668
518, 0.0002599202853, 0.1081701592, 0, 0, 0, 0, 68.54501343, 22.30384445, 0.1022786349, 94.91210175, 0
  geospatial_lat_max=26.48568916
  geospatial_lat_min=6.694877148
  geospatial_lat_units=degrees_north
  geospatial_lon_max=125.8173065
  geospatial_lon_min=105.5096741
  geospatial_lon_units=degrees_east
  Input Files=A2014348055000.L1B_LAC.SeAHABS.hdf,S201434718_NCEP.MET,S201434718_NCEP.MET,S201434718_NCEP.MET,N201434500_
O3_AURAOMI_24h.hdf,N201434500_O3_AURAOMI_24h.hdf,N201434500_O3_AURAOMI_24h.hdf,,xcal_modisa_axc26f,polcor_modisa_2010b,m
odisa_ocr_vc_nn,,landmask.dat,watermask.dat,digital_elevation_map.hdf,ETOPO1_ocssw.nc,,N201434600_SEAICE_NSIDC_24h.hdf,s
st_climatology.hdf,sss_climatology_woa2009.hdf,no2_climatology.hdf,alpha510_climatology.hdf,taua865_climatology.hdf,A201
4348055000.GEO,owmc_lut.hdf,

Geolocation:
  LINE_OFFSET=0
  LINE_STEP=1
  PIXEL_OFFSET=0
  PIXEL_STEP=1
  SRS=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0
,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHOR
ITY["EPSG","9108"]],AUTHORITY["EPSG","4326"]]


texts:
To locate any vertex, it is spatially described with x and y coordinates - of course. You can also add Z and M values - but what is the advantage to use the Z in the vector instead of a attribute Z in attribute table?

In which cases should I use the Z values instead of just a attribute: "Z"? For me it seams easier to use a Z-attribute field because I can use it in expression dialog like any other attribute. Also if I want to make a 3D-looking map, the 2,5 D symbol style asks for a attribute field not the Z-value (screenshot). Also qgis2threejs is asking for an attribute to draw the height of a building...

Screenshot: The Identify window shows, that my buildings already have a Z value. It's written from the "_mean" attribute by using the tool: 'Set Z value'. The "_mean" attribute was created with 'Zonal Statistics' from a DSM (LiDAR). The "2.5 D" symbol needs a height but can't uses the z value, so I have to use the attribute "_mean".

I would like to have some cases or examples where the Z value is needed.

What are the advantages of the Z value?


texts: How can I include "live" OSM points of interest on a cartoDB map?

texts:
I know how to export OpenStreetMap data using http://overpass-turbo.eu/
and build a thematic map in CartoDB.  For example see the toilet map with CartoDB identifier 8385ca6a-49a1-11e4-ad81-0e4fddd5de28

But how can I get live data, or at least something that pulls in new data periodically?

For example if I want to make a map for a hotel, but pull in all area restaurants from OSM?


texts: I am calibrating my landsat data to reflectance with correction for sun angle. I just want to know if sun angle is computed as such θsin(sun_elev), where sun_elev is the sun elevation value specified in the landsat 8 metadata.


texts: Making selected lines thicker to see overlapped features in QGIS?

texts:
I have a bunch of overlapped lines. Some of the shorter ones are covered by others and are difficult to see. I am trying to see those lines by highlighting them via selection in the attribute table. However, the line in selection isn't wide enough to be visible from beneath. I can only see the selection if the selected feature is on the top.

My Question:

Is there a way to make the selected line thicker in QGIS (QGIS3)?

Related questions/answers here at GIS either do not address the thickness issue, or evolve coding and/or changing the line shape, which seems to be an overkill here:

Is there anyway to modify thickness & color of a selected polygon?

Representing overlapping polylines in QGIS

Shifting display of overlapping lines in QGIS?


texts: Storing GeoJSON FeatureCollection to PostgreSQL with PostGIS?


texts:
I am looking for a way to automatically save and open an .mxd file, be in in ModelBuilder (with ArcMap tools) or Arcpy, but I can't find any functions to support this.

I basically want to save the .mxd in a predefined location and open it from the same location. For example C:\ArcGIS\%Project number%, where the "Project number" is filled in when the model is run. After saving the mxd, it should be able to open by using another model, which would require just the Project number as well.

I have found some posts that discuss this, but no solutions are given. My knowledge of Arcpy/Python is beginner at most, but I am willing to learn. I have not found a tutorial adressing this issue. How can I do this?

I have found the following to open an MXD:

import os

Project_nummer = arcpy.GetParameterAsText(0)

os.startfile(r"G:\\zn\\NM\\GGB\\Applicaties-Admin\\Kerngis\\ExpImp\\{}\\{}.mxd".format(Project_number, Project_number))

The reason I want to achieve this is the following:
I have source data which I want to export to a different user, while I do this export I want to create a "project" folder, with the project .mxd inside it (Based on the project number).

After this user makes some changes to the export and sends it back, I want to be able to start a model, fill in a project number and have it open the .mxd and "import" the changes into my source data.


texts: semi automatic plugin v value in automatic threshold calculation

texts: what does the 'v' defined value stands for in automatic threshold calculation in semi automatic plugin in QGIS


texts: customizing QGIS Layers Panel to show layer CRS next to layer name

texts:
Is there a way to customize the Layers Panel so that the layer CRS is showed next to the layer name?

A little bit more context why this would be handy:
I am writing some instructions to use (Q)GIS in particular situations.  Some of the people are familiar with projections, but the most of them not.

Normaly you check the CRS by opening the layer properties, but it would be very handy for those 'unfamiliar' people to see directly in which CRS a layer is loaded into QGIS.


texts: Effective use and control of ModelBuilder sub-models and super-models

texts:
Is there an existing guide on effective use of ArcGIS ModelBuilder sub-models and super-models?
I'm finding myself unnecessarily running and re-running whole models, when I test-run a model. I'm testing model elements for an iterator. I know I can remove those elements, and place them in a super-model, and then just run my 'testing' super-model. But I also know ModelBuilder has unlovely quirks like always running the first model added, except when something is 'downstream' in the tool-flow. Rather than discover more of such unlovely quirks, I'd like a guide.


texts:
I keep on missing some polygons while clipping a gdb file with a circle (shape file).
I guess it comes from the "invalid geometry" error I get but do not know how to get rid of it.


texts: How to get all the LineStrings of a street using PostGIS with OSM

texts:
I want to get all parts of a given street.

I use a query like:
    Select * from  planet_osm_lines where name = 'mystreet'

As a result I get all the LineStrings that are part of a street with the given name, but somehow I have to group the LineStrings to form the correct MultiLinestrings, because there could be other streets with the name "mystreet".

Does someone know how to get this information?


texts: QGIS Convert Shapefile to MSSQL as geography type

texts:
I am using QGIS 3.16 and SQL Server 2019.
I have a shapefile loaded into the project.  I have been able to successfully convert the Shapefile to a spatial dataset in SQL Server.  My method for doing this is to just drag and drop the layer into the chosen SQL Server schema, works like a charm.
The problem is that it appears in the database as Geometry instead of Geography.  I really need it to be of Geography type for the subsequent calculations that I need to do.  I thought it might be related to my project or layer CRS so I set both of those to a CRS that I knew was compatible with SQL Servers list of reference systems from sys.spatial_reference_systems, however trying that it seems nothing I do can make it appear as geography type in the table after the export.
Has anyone encountered this problem?


texts: Debugging ERROR 000732 Cannot create table from feature class in file geodatabase?

texts: I am unable to create table  from feature class in file geodatabase. below is the screen of shot of the tool with error message ERROR 000732


texts: Calculating intersection between WFS layer and PostGIS table?

texts:
I need to calculate the intersections betweek a WFS layer and the geometries stored in PostGIS table.
Then I should save the geometries of the intersections in a separate PostGIS table.

How can I do this?


texts: Do the same as File>>Export Map>>Save as PDF with a Python command in ArcGIS

texts:
I have a Python script to apply IDW interpolation over different datasets, so that the results are several rasters in format .aux.

How can I save automatically in the Python script what appears in the page layout (in my case, the GPS points and the raster map) to a PDF directly, as I would manually do going to the File section and clicking in Export Map?

It has to be easy but I am not finding the command.


texts: GeoServer REST API: Creating Database Data Store does not persist password

texts:
I'm passing the XML created by the method below to a GeoServer REST API request that successfully creates a postGIS data store. However, password is not persisted. I have to update the password manually in the data store. I need the password to be saved for subsequent requests using the data store to be successful. Any suggestions on what I can do for the password to be saved?

    private string getDbXml(string dsName)
    {
        string dbHost = "localhost";
        string dbPort = "5432";
        string dbName = "testgis";
        string dbUser = "mydbuser";
        string dbPassword = "mydbpassword";
        string dbType = "postgis";
        string exposePKsParameter = "<entry key=\"Expose primary keys\">true</entry>";

        string xml = "<dataStore>" +
                        "<name>" + dsName + "</name>" +
                        "<enabled>true</enabled>" +
                        "<connectionParameters>" +
                            "<host>" + dbHost + "</host>" +
                            "<port>" + dbPort + "</port>" +
                            "<database>" + dbName + "</database>" +
                            "<user>" + dbUser + "</user>" +
                            "<password>" + dbPassword + "</password>" +
                            "<dbtype>" + dbType + "</dbtype>" +
                            "<namespace>" + dsName + "_NS</namespace>" +
                            exposePKsParameter +
                         "</connectionParameters>" +
                      "</dataStore>";

        return xml;

    }

I'm using GeoServer 2.1.3 and PostGIS 1.5.


texts: How to get data from MS SQL Server 2008 into Mapserver?

texts:
I need to create some layers in my map from a Microsoft SQL 2008 database.  I am using Openlayers and Mapserver.  The Mapserver instance is running on SUSE linux, so the Mapserver documentation on MSSQL that discusses the plugin for Windows is not very helpful.
I know it is possible because I have in the past gotten it to work, however I scrapped that project in favor for something else.  I now have a need for it once again and have been unsuccessful finding any clear and concise examples.
Any help or direction would be greatly appreciated.


texts:
I'm using PostGIS 1.5.2, with geometries in SRID:900913.
I need create a circles using a list of points as centre, with a radius of 600 kilometers.
I'm using this query:

INSERT INTO circles (geom) (
   SELECT ST_Buffer(point, 600000, 'quad_segs=8')
   FROM points
);

But circles created have not 600 kilometers of radius (radius is near this length, but not exactly).

Are there other methods to create circles in PostGIS?

NOTE: Information represented is from Spain. Correct projection is 4326, but client use Google rasters, so I am storing data in 900913 to avoid reprojections and increase performance.


texts: PyQGIS: draw layer/feature's bounding box

texts: I want to display a vector layer's bounding box in a print layout (or possibly a single feature's bounding box). Does QGIS have anything built-in to achieve this in the renderer/style? Or will I have to load a style/add a symbol layer with bounds($geometry)?


texts: Can I use a GeocodeServer on AGS in a python script tool?

texts:
I'd like to write a script that will call out to 3 separate Geocode Services online and run a user defined CSV through them...

The CSV will contain records in three states and each state has a GeocodeServer:

VA: https://gismaps.vita.virginia.gov/arcgis/rest/services/Geocoding/VGIN_Composite_Locator/GeocodeServer

DE: https://firstmap.delaware.gov/arcgis/rest/services/Location/DE_CompositeLocator/GeocodeServer

MD: http://geodata.md.gov/imap/rest/services/GeocodeServices/MD_CompositeLocator/GeocodeServer

When I run a test I get an error saying the Geocode Service does not exist...

inputCSV = "//nas/geog/esrgc/projects_inprocess/esrgc/carbon_footprint/2017/fall/processing/fall2016students.csv"
addrLocator = "http://geodata.md.gov/imap/rest/services/GeocodeServices/MD_CompositeLocator/GeocodeServer"
addrFields =  "Address1; City; State; Zip Code"
outClass = "//nas/geog/esrgc/projects_inprocess/esrgc/carbon_footprint/2017/fall/processing/fall2016students.shp"
arcpy.GeocodeAddresses_geocoding(inputCSV, addrLocator, addrFields, outClass, 'STATIC')

Is it even possible to use a Geocode Service on ArcServer as an input? arcpy.GeocodeAddresses_geocoding

I could just geocode these in ArcMap and continue the script from there for the rest of the analysis, but if I could get this to work it would be pretty cool.


texts: Iterate rasters > create bounds > truncate names

texts:
I'm using ArcGIS Pro 2.2 ModelBuilder.

I'd like to Iterate a large number of rasters (.tifs)  and create boundary files (polygons) for each of the rasters.   I'm using ModelBuilder and running into issues trying to use Raster Domain.  Names can't start with numbers or they are too long.   I've tried truncating the inline variable %Name% using the tool "calculate value", which worked, but I don't know how to pass the result to the 'Raster Domain' tool


texts: Unable to find either renderd.py or generate_tiles.py?

texts:
We created a Ubuntu 14.04.1 LTS x64 OSM tile server from packages using the excellent instructions provided by
http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/

The tile server is running well and serving tiles of Kansas USA.

We now would like to set the scale_factor for MAPNIK in order to improve the appearance of tiles on displays with high DPI.

Following various instructions, we located renderd.conf (i.e. /etc/renderd.conf) but cannot locate renderd.py or generate_tiles.py

Are either of these files included with an install using the repository ppa:kakrueger/openstreetmap?

If so, let us know where. If not, tell us if it is possible to add them, and how it might be done.


texts: Which UTM zone 32N with prefix should I use in Rhineland-Palatinate (Germany)?

texts:
I would like to store and use GIS-Data in Rhineland-Palatinate (Germany). The coordinate System should be UTM 32N with 32 as prefix (false easting = 32,500,000; not 500,000).
I looked at EPSG 4647 [ETRS89 / UTM zone 32N (zE-N)].
But I'm confused because EPSG says:

Scope:  Used in Schleswig-Holstein.
Information Source: Landesvermessungsamt Schleswig-Holstein.

Which UTM 32N coordinate system (EPSG-code) should use in Rhineland-Palatinate?
EDIT:
I will convert a large database from Gauss-Krueger to UTM. The database (and the new coordinate system) will be used for many years. We will exchange data with other (UTM with and without prefix, Gauss-Kueger).
Since 4647 to refers to Schleswig-Holstein I am not sure whether 4647 is good for us. But there are no  other EPSG codes with zone prefix.


texts:
Using ArcGIS Runtime SDK for .NET, how can I display the legend or symbology of an image, along with the image, on a map?
I have an ArcGIS runtime program written in C#, which generates a series of rasters, and displays them on a map using the following code snippit . . .

private void AddRasterLayer(string rasterPath, string id, bool isVisible, double[,] rasterArray)
{
    var newRaster = new Raster(rasterPath);             //  create the raster object from the image file
    var newRasterLayer = new RasterLayer(newRaster);    //  create the raster layer object from the raster
    newRasterLayer.Id = id;
    if (id == "DEMMosaic")// if the image is the DEM
    {
        double max = SoilMoisturePreprocessing.Max2d(rasterArray);  // get the maximum value in the array
        double min = SoilMoisturePreprocessing.Min2d(rasterArray);  // get the minimum value in the array
        double[] minVals = { min }; // minimum value for stretch parameters input
        double[] maxVals = { max }; // maximum value for stretch parameters input
        MinMaxStretchParameters minMaxParams = new MinMaxStretchParameters(minVals, maxVals);   // create stretch parameters object
        ColorRamp elevationColorRamp = ColorRamp.Create(PresetColorRampType.Elevation); // create the color ramp

        var rendrr = new StretchRenderer(minMaxParams, null, true, elevationColorRamp); // create the renderer from the above
        newRasterLayer.Renderer = rendrr;   // apply the renderer to the raster layer
    }

    newRasterLayer.Opacity = 0.6;           // set the opacity
    newRasterLayer.IsVisible = isVisible;   // visibility setting

    var mapViewModel = ServiceLocator.Current.GetInstance<MapViewModel>();  // get the map view model
    mapViewModel.Map.OperationalLayers.Add(newRasterLayer);                 // add the raster layer to the map

}

Is there a way that I could incorporate into the above code, a method that would display a legend for the raster along with the raster?


texts: Google Earth Engine, Landsat scene extraction?

texts:
I would like to ask if someone knows how to extract collection of scenes (equal to the exact size of the Landsat 7 scene) from image collection I need an area around Bangalore, India? So I would have the stack of scenes.
For now I have this code where I have added area corners manually (and while editing the number of images was changing. The largest one I got was 168):

var l7r = ee.ImageCollection("LANDSAT/LE7_L1T"),
real = {"opacity":1,"bands":["B3","B2","B1"],"min":76,"gamma":2.07};//real
Map.setCenter(77.40, 13.14,7);
//input study regionr
var LL=[76.48, 12.31];   //Lower left corner
var UR=[78.15, 13.69];   //Upper right corner
var l7rf=l7r.filterBounds(ee.Geometry.Point(LL)).filterBounds(ee.Geometry.Point(UR));
Map.addLayer(ee.Image(l7rf.first()),real,'raw');

But I am not sure if all images available from the 1999 till nowadays are included.


texts: Can't connect to internet after installing ArcGIS Server 10.2.2

texts: I set up a new Administrator User Account then install ArcGis Server 10.2.2 on it. The installation is successful and i can access to ArcGis Server Manager, but after that i realize i can't connect to internet (both main and secondary User Account). As you can see i already connected to my wifi but in Network and Sharing Center nothing be there. I tried to use the internet cable but have the same result. My other laptop can still access internet normally.


texts: Using GeoPandas to generate shapefile from GeoJSON for opening in ArcGIS Pro

texts:
I got from an API a layer of parcels in format GeoJSON, just like the file in this .zip

https://www.dropbox.com/s/5eqi8bbqt6ej6lc/json_data.rar?dl=0

I need to convert this to a shapefile that  could be open for the ArcGIS Pro  desktop app
I used Geopandas to generate this shapefile.
import geopandas as gpd

gdf = gpd.read_file("data.json")
gdf.to_file("data.shp", encoding='utf-8')

This generates the shapefile
.
├── data.cpg
├── data.dbf
├── data.prj
├── data.shp
└── data.shx

I check with QGIS and works OK.
But when trying to open with ArcGIS Pro I got this issue

I also checking other questions here I change the way  to save the field, in order to fix that, but I still  got the same issue.
gdf.to_file("data.shp", encoding='utf-8',  crs = {'proj': 'latlong', 'ellps': 'WGS84', 'datum': 'WGS84', 'no_defs': True},  driver="ESRI Shapefile")

Here the shape generated by my code:

https://www.dropbox.com/s/a95wk8oywoyb5om/data_shp.zip?dl=0


texts: Problem with addιtion abstraction in Field Calculator

texts:
I want a bit analytical respond for the mistakes I have done in my code cause I am new to programming. I am using ArcGis 10.2. and I must process a field with distances in an attribute table I have. Through my python code I am trying to put my field (MO) in a list so as to use it as list. But as much as I tried I didn't get anything.

My field MO is like: 2367 2356 2352 2347 2345 2337 2331 2304

And here is my code:

MO = [MOBIL]
L = len(MO) - 1
    MO[0] = MO[0] - 10
    for i in range(M):
    MO[i] = MO[i] - MO[i+1]


texts: How to see print commands through Python Script while programming plugin for QGIS?

texts: Is there a way that from running a custom plugin made for QGIS that a Python Shell can appear along when the plugin is run, like a debug screen? I'm asking this to know if there is a way to see print commands through a Python Script while programming a plugin for QGIS.


texts: How can I speed up slow-loading, template-generated MXDs?

texts:
I have an ArcMap template (.mxt) file which causes .mxd documents created with it to take 5-10 minutes to load (if it ever loads).  Even after stripping out all the data sources and tables, the issue still persists.

Once it loads, it handles fine.  Any general speculation of what could be causing this?

Thanks


texts: QGIS classified raster - compare surrounding pixel classes

texts:
I have a classified raster where one class represents tree and around tree can be busches as another class and there is the third classes grass. I don't know how to analyse:

I have to compare the tree and busch surrounding class area (pixels)

if tree area is greater as busch area - is ok
if busch area is bigger as tree area - set for every pixel in tree area if surrounding 3x3pixels area has more trees/buschesand set this pixel by that either positive or negative value


texts: Making Table data available to a map service

texts:
I am trying to make a non geographic table available to a map service.  I thought you simply added the table to the MXD and publish it with a relate to the field they were linked and then publish the service, where the data would be available as a table layer.  I have done this, and only the geographic data is shown as an available layer.  Am I missing a step?

I now know, I do not want a Join or relate; I want the table to available via a query on the table.

edit

OK, there seems to be a few issues here.

We are using a direct connect, and this needs Oracle Client installed on the ArcGIS Server. The SOC and SOM accounts were a red herring. If we're going straight through the SDE connection port, then you don't need the client, but as we're going through to the db, i.e. using 2 tier architecture, rather than 3 tier, then we need the client.

So we're installing the client on the server, as we've never directly connected before, and I'll post the results. But now, looking back on it, it all seems logical really, as we're bypassing the SDE layer

This is for a Web application, so the data is exposed via REST on the 'net

I am actually not too sure it is possible, which is very odd...

edit

Just to ensure I am not going mad, and am doing this all the right way; I am creating an MXD, adding a featurelayer to it, then adding a 'flat' table (no geo data), saving it and serving it up on the ArcGIS server.  when I do, all of the features display, but querying the Rest interface tells me there are no tables, just this one polygon layer.

That's all cool isn't it?  I am not insane?


texts: How to represents multiple layers in QGIS using time slider?

texts:
Conecting QGIS to a WMS server I obtain a multiple layers representing windspeed calculated by a meteo model.

The values are into a netCDS file. The WMS capacity permits me obtain and visualize the values in some diferents barb or arrow representation.

How can I use a time-slider to move the pngs by the time step of the "time variable" ? Is there any plugin to do that ?


texts: All latitude and longitude within 1 mile circle area

texts: I am trying to generate pins over the map of my database coordinates by using fusion table and I want to generate only within 1 mile area circle around the specific location. To get 1 mile area's coordinates similar to my db coordinates I've to put condition of < and > to fusion table but I don't know how to get all the coordinates within 1 mile area circle or what should be the value for condition in query. Can any one please help me to figure out, it'll really appreciable.


texts: Show feature count of layer via Python console / PyQGIS

texts:
When working with vector layers in QGIS, I can display the feature count of a layer and, if applicable, the feature count per attribute category (e.g. when using categorized or graduated styling) via the context menu of the layer. The counts are added to the layer title that is displayed in the layer widget.

How can I set activate this feature via the Python console/running a script? Looking through the API docs, I found a method to get the feature counts and further use them in your script. However, how can I display them as they would show when using the GUI?

It is probably possible somehow by retrieving the feature count as described above and then changing the layer widget symbology, adding the count to the title. However, this is rather cumbersome, so I wonder if there is a direct way to achieve this? If not, how would this best be done manually?


texts: I have a kml network link (parent) that loads a second kml file (child) that contains a set of polygons.  Currently the style of the polygons is set to a url within the child kml file.  I would like to be able to modify the style of the polygons at the level of the network link, without having to change the childs xml.  Is this possible?


texts: Synchronize Coordinate System in ArcGIS Pro

texts:
I have a map created in ArcGIS Pro ver 2, on the map the area of interest on the Layout Frame has a coordinate system of GDA94 MGA Zone 56.

On the Content Pane, the Map Grid is in MGA Zone 55 and the Map Frame is in MGA Zone 55.

How do I dynamically change or synchronize the MAP GRID MGA Zone 55 and the Map Frame Zone 55 to Layout Frame which has coordinate of MGA Zone 56?


texts: Graphically depict statistical difference between thematic rasters

texts:
The graph shows a regression between two raster datasets with classified tree canopy cover: class 1 = 0-10%, class 2 = 10 - 20% ...class 6 = >60% (Figure 1, Figure 2).  The spatial resolution for raster 1 is 1m while the spatial resolution for raster 2 is 30m.  Note that raster 2 was resampled to 1m for analysis purposes in the script (Appendix A).

I am looking for an elegant, graphical approach to statistically describe the difference between two thematic rasters at different spatial scales.  My first attempt was to 1) create a raster stack, 2) randomly sample the stack, 3) run a regression and descriptive statistics, 4) graph the results (Appendix A).  What other graphical methods exist for statistically comparing thematic raster data?  I usually use R, Python and MATLAB, although I would be happy with generic solutions too.

Figure 1

Figure 2

Appendix A

require(raster)
require(spatstat)
require(ggplot2)
require(gridExtra)
require(hexbin)
require(rgdal)

# Read the TIF data
file = 'C:/path/raster1.tif'
file2 = 'C:/path/raster2.tif'

# Create raster objects from the single band canopy products
r = raster(file)
r2 = raster(file2)

# Resample r2 to 1m for analysis purposes
r2 = resample(r2, r, method = "ngb")

# Stack the two raster layers for analysis
raster <- stack(r, r2)

# sample random locations in raster stack and report values in a dataframe
df = data.frame(sampleRandom(raster, size=1000, cells=TRUE, sp=TRUE))

## Do the regression and plot the results
new = df$X3711203_ne
old = df$X3711203_ne_30m

# Calculate RMSE and other values
fit <- lm(old ~ new)
rmse <- round(sqrt(mean(resid(fit)^2)), 2)
coefs <- coef(fit)
b0 <- round(coefs[1], 2)
b1 <- round(coefs[2],2)
r <- round(sqrt(summary(fit)$r.squared), 2)

# Build equation see ?plotmath
eqn <- bquote(italic(y) == .(b0) + .(b1)*
                italic(x) * "," ~~ r == .(r) * "," ~~ RMSE == .(rmse))

eqn_text = as.character(as.expression(eqn))

# Get max range to automatically update plot size
li = c(range(new)[2], range(old)[2])
range = tail(sort(li),1) + 0.05

# Plot results
p1 = ggplot(df, aes(new, old))  +
  geom_point() +
  geom_smooth(method = lm) +
  stat_sum(aes(size = ..n..)) +
  xlab("Cover Class (1m)") +
  ylab("Cover Class (30m)") +
  annotate("text", x= 0, y= range, label=eqn_text, hjust=0, size=4, face="italic", parse=TRUE) +
  xlim(0, range) +
  ylim(0, range) +
  ggtitle("Tree Canopy Cover Class")

p1


texts: Writing vector layer to CSV file with geometry using PyQGIS?

texts:
I use Python try to write vector layer file to csv file with this code:

QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV")

It can export to xyz.csv but only attributes show in the csv, not the geometry column.

How can I export both attribute and spatial data into csv file?


texts:
I want to split some line strings using ST_Line_Substring.
My basic query works:
SELECT
  ST_LineLocatePoint(b.geom_way,ST_ClosestPoint(a.geom,b.geom_way)) as Loc_Point
 FROM splitpoints a

CROSS JOIN LATERAL
  (SELECT
      id, geom_way
      FROM osm_2po_4pgr
      ORDER BY a.geom <-> osm_2po_4pgr.geom_way
     LIMIT 1
   ) AS b

If I try do add ST_Line_Substring(b.geom_way,0,1) in line 3, it doesn't work anymore:
ERROR:  function st_line_substring(geometry, integer, integer) does not exist
LINE 6:   ST_Line_Substring(b.geom_way,0,1) as test2
          ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 143

I already tried to CAST the arguments (0 and 1) to float explicitly (ST_Line_Substring(b.geom_way,0::float,1::float)). b.geom_way is a simple linestring:
SELECT ST_astext(b.geom_way)....

LINESTRING(10.0349278 52.08885,10.0350045 52.0883998,10.0349549 52.0875119)

Everything looks like it should be according to the docs (https://postgis.net/docs/manual-1.5/ST_Line_Substring.html):

geometry ST_Line_Substring(geometry a_linestring, float startfraction,
float endfraction);

What's wrong?


texts: Problems displaying reprojected WMS in QGIS 2.0.1

texts:
I'm loading a WMS layer in QGIS 2.0.1 using the coordinate reference system SWEREF99 TM EPSG:3006, a Swedish crs. The layer displays in the map but when I zoom in to Sweden using the Zoom in-button I end up somewhere in the Arabian Sea. The server (a GeoServer-instance) supports and serves the layer in EPSG:3006. I've tried different settings for reprojecting but no differnces. In QGIS 1.8 this works perfect on the same layer.

URL: http://geodata.havochvatten.se/geoservices/hav-bakgrundskartor/ows
Layer: hav-grundkarta


texts: ArcGIS Pro equivalent to QGIS Print Composer/Print Layout?

texts:
In QGIS, I load all the layers I need for a project and then create print composers/print layouts which can have different layer visibility settings to each other.

Is it possible to achieve a similar effect using a single project file in ArcGIS Pro? If I turn a layer off in the layout, it is turned off in the map and any other layouts using that map. To me, this defeats the purpose of creating different layouts.

One workaround I had investigated was to create a series of basemaps with my layers and add these to maps and have a map per layout. However, when you add a basemap to a normal map it loses its connection to the basemap, so changes to data sources in the basemap are no longer reflected in the maps (and therefore layouts). Which means having to remove and then add back in the basemap to every other map. Worse still, there is no way of telling whether a basemap in a basemap matches the basemap in the project's Map folder. This is madness!
If I add a mapframe to a Layout in ARcGIS Pro, the map in the frame does not maintain a link to the original (so if I change a layer source in the map, it does not update in the layout).

In summary, I would like to know if ArcGIS Pro can achieve the following solution (which is fully achievable in QQIS):

1 project file containing all layers needed
Multiple layouts with different layer visibilities (independence of layout view states)
Changing a layer's data source etc ripples through to all layouts (data
consistency between layouts)

Previously, our organisation has used the following approaches in ArcMap:

Create separate mxd files for each layout
Create one mxd for the project, turn layers on an off to achieve the desired view state, and then export to PDF. Then bringing the resulting PDF into Adobe InDesign to add a title box for each map.

Both of these solutions are far inferior to QGIS.

Unfortunately, my organisation is determined to stick with ESRI (it cost lots of money, therefore, it must be a better solution type logic). So I do need a sane solution using ArcGIS Pro. Please tell me I'm missing something obvious!


texts:
I know that a similar question has been asked multiple times here (a great answer can be found here: How can I get the geometry length in meters?), but in contrast I want to get the length of the reversed  edge in meters.

I know that this is quite easy to achieve using ST_Length(ST_Reverse(geometry)), but look at the following queries (including their results as SQL comment; do not care about the id 1484 - it's just for getting a unique edge):

SELECT ST_Length(edge_geometry) FROM bolzano_street_edges WHERE edge_id = 1484;
--0.0007624185038570938 (length in SRID units... not meters)
SELECT ST_Length(ST_Reverse(edge_geometry)) FROM bolzano_street_edges WHERE edge_id = 1484;
--0.0007624185038570938 (length in SRID units... not meters)

This one works (meaning delivers the same length for the edge and it's reversed counterpart) and delivers the length in SRID units.
Since my SRID is already EPSG:4326 getting the length in meters is easy using the geography type of PostGIS, right? Let's see...

SELECT ST_Length(edge_geometry::geography, true) FROM bolzano_street_edges WHERE edge_id = 1484;
--84.58170640981749 (length in meters)
SELECT ST_Length(ST_Reverse(edge_geometry)::geography, true) FROM bolzano_street_edges WHERE edge_id = 1484;
--84.58170640981747 (length in meters.... with 747 at the end; not 749)

Hmm... now that's something unexpected (at least to me).
The length of the edge is not the same as the length of its reverse. I know that the difference is very small, but for me that's a problem since I want to find edges with the same length by using their hash code. Even with this small difference this won't work.

Another approach that might work, is to use ST_LengthSperoid instead of the geometry type. According to the accepted solution from the question linked at the beginning of my question this should give the same result...

SELECT ST_LengthSpheroid(edge_geometry, 'SPHEROID["WGS 84",6378137,298.257223563]') FROM bolzano_street_edges WHERE edge_id = 1484;
-- 84.58170640981679 (length in meters... however, a bit different to the above)
SELECT ST_LengthSpheroid(ST_Reverse(edge_geometry), 'SPHEROID["WGS 84",6378137,298.257223563]') FROM bolzano_street_edges WHERE edge_id = 1484;
-- 84.58170640981679 (length in meters... same result for the reversed edge.. great)

I do have several questions regarding my obervations:

Is there a reason why the length of an edge is not the same as the length of its reversed counterpart when using the geography type? Is this a rounding error (or even a bug) in PostGIS or is this something expected?
Why is the result of ST_LengthSpheroid not exactly the same as the one of ST_Length(geography)?
Which result is the most accurate one??


texts:
I have a PostgreSQL table containing some point of interest data. I have a second table with overlapping continent polygons. The following code splits the POI into the continents, but instead of extracting them, the continent ID gets written into a column of the POI data. The query is working so far.

select t3.*, array_to_string(array_cont, '') as conts from
(select ogc_fid, array_agg(conts) as array_cont from
(SELECT t1.*, cont.id AS conts
    FROM continents cont, poi t1
    WHERE st_contains(cont.geom, t1.wkb_geometry)
    order by conts)t1
    group by ogc_fid)t2, poi t3
where t2.ogc_fid = t3.ogc_fid
order by conts;

But when I run this query inside a CREATE VIEW statement, I get the following error:

CREATE OR REPLACE VIEW poi_split AS
select t3.*, array_to_string(array_cont, '') as conts from
(select ogc_fid, array_agg(conts) as array_cont from
(SELECT t1.*, cont.id AS conts
    FROM continents cont, poi t1
    WHERE st_contains(cont.geom, t1.wkb_geometry)
    order by conts)t1
    group by ogc_fid)t2, poi t3
where t2.ogc_fid = t3.ogc_fid
order by conts;

ERROR:  syntax error at or near "create"
LINE 1: create or replace view poi_split as
        ^

Sorry for the bad formatting, but as far as I can see, it is no syntax error involved, as the query runs perfect without CREATE VIEW AS.
It's even possible to run

CREATE OR REPLACE VIEW poi_split AS SELECT * FROM poi;

What am I doing wrong?


texts: How do I project a Azimuthal Equidistant global map into a circle in QGIS?

texts:
I'm fairly new to QGIS/GIS stuff in general, so I apologize if this is too simple of a question, and I'm just bad at finding my answer.

I have a shapefile of all the countries in the globe I downloaded from Natural Earth. I'm needing to create two hemisphere maps (similar to these guys I found on Wikimedia) in a azimuthal equidistant projection:

However, I need the western hemisphere to have most of Europe and the US and the Eastern projection to include Asia and Australia. Basically, the center of the map would be the middle of the Atlantic.

I narrowed down the problem to it's my proj language in the CRS, but I'm not sure how to pair the project to a circle.

Any insights for a newb?


texts:
How can we apply more than 2 reducers to an Image?

The following link shows for 2 reducers
https://developers.google.com/earth-engine/reducers_intro

But the following won't work:

// Load a Landsat 8 image.
var image = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318');

// Combine the mean and standard deviation reducers.
var reducers = ee.Reducer.mean().combine({
  reducer2: ee.Reducer.stdDev(),
  reducer3: ee.Reducer.max(),
  sharedInputs: true
});

// Use the combined reducer to get
var stats = image.reduceRegion({
  reducer: reducers,
  bestEffort: true,
});

print(stats);


texts: Which method is better for accurate area measurement?

texts:
Input : I have my original data in 4326. This data spans across the globe. This data is collected from DGPS so its accurate to 1 inch. The data is in geometry as geography is costly and functions are limited and  in 2D.  I am using postgis.

Need: I need to calculate accurate area, length of each geometry.

My conclusion so far : while calculating area either i can dynamically convert the 4326 to respective UTM zones and then calculate area  or i can convert it to EPSG:54009 projection to calculate area.

Major question : so which of above method is better ? is there any third better method you can suggest ?

Supportive/minor/Dependent question : how can i cross check the accuracy of both without going to ground ? which one will be accurate. pros and cons if any for each of above methods ?

References:

https://en.wikipedia.org/wiki/Mollweide_projection

https://blogs.esri.com/esri/arcgis/2010/03/05/measuring-distances-and-areas-when-your-map-uses-the-mercator-projection/

Calculating area of an EPSG:4326 Polygon


texts:
I'm trying to interpolate with the algorithm "v.surf.idw" in Qgis version 2.18 Las Palmas.

The data that i'm using are points whose coordinates were loaded by a CSV file, these the guade as a new shape type layer. From the attributes of the points I am interested in interpolating with respect to "Rendimiento".

the formats of the attributes are the following:

When I run the algorithm the result is as follows.

When reviewing the registration message this is what it throws.


texts: Should i use cell registered or grid registered bathymetric data in QGIS?

texts:
I am planning on calculating habitat volume over great ocean distances and have the choice to use either Grid or cell registered data, downloadable from this link.

http://ngdc.noaa.gov/mgg/global/global.html

Does QGIS prefer one system? I will most likely be using WGS84 coordinate system to calculate by volumes in the case this has an impact as well.


texts: Editing start vertex of multiple elements synchronously using QGIS?

texts:
I have 20 or so sight line elements (2-vertex lines) which have their start vertex at a single point - a point element in another layer.

If I move that start point, how can I move all 20 concurrent start vertices with it, leaving the end vertices in the their original place?

I am using QGIS 3.


texts:
While adding OSM Mapquest satellite map to the openlayers3 i'm getting an error as follow "ol.source.MapQuest is not a constructor".
The sample code is as follows

    <title>Satellite Map</title>

  <link rel="stylesheet" href="../ccs/layer_switcher.css" />

If i remove sat layer the osm map is comming. Please help me to resolve..


texts: How does bilinear resampling work when converting a 10 meter raster to 30 meter?

texts:
There is a 10 meter resolution land cover raster. An analyst wishes to resample 10 meter raster to 30 meter raster. The analyst selects the Bilinear Resampling technique in the Resample tool of the Raster Processing toolset of ArcGIS 10.3.

ArcGIS 10.3 help defines the Bilinear Resampling technique as:

  Performs a bilinear interpolation and determines the new value of a cell based on a weighted distance average of the four nearest input cell centers. It is useful for continuous data and will cause some smoothing of the data.

A 30 meter output cell will contain nine cells from the input 10 meter raster. The closest input cell center will be the one that perfectly overlaps the output cell center. That leaves three remaining input cell center values for inclusion in the bilinear interpolation. In the resample of 10 m to 30 m there are eight remaining values that are equidistant to the output cell center.

Which 3 values of the 8 equidistant values are utilized to create the output?


texts: Accepting shape as input parameter in web application that calls ArcGIS geoprocessing service?

texts:
I am writing a geoprocessing script that will need to accept a shape as an input parameter.  This shape will be obtained by a user drawing the shape in a web application.  The web application will execute the geoprocessing service, providing the coordinate string of the shape as an input parameter.

In the geoprocessing script tool's definition, I would assume that this input parameter would be of type FeatureSet and that within the script you would use arcpy.GetParameter to access this input parameter.  Where I know that the input parameter will always be exactly one feature (string of coordinates), is there a better alternative than using a FeatureSet as the input parameter type?


texts: Conflicts in ArcMap editing with multiple users

texts:
There are multiple users of ArcMap using their own versions for uploading edits to our Master database. We are not live editing, these edits are reconciled and posted each day, sometimes twice in one day to the parent version.

There is debate within my team of why we are consistently getting conflicts in ArcMap between users - more often than not the conflict version is a later edit version than the pre-reconciled edit therefore some right click on the conflict and click replace with conflict version.

Others right click on the conflict and select Mark as visited.

We are wondering whether both of these options are correct and that we are just destined to always have conflicts or just the one option is correct and would prevent many of the conflicts we are having with others and ourselves?

We are also receiving conflicts with ourselves from previous day edits - could this just be user error when reconciling and posting or could it be influenced by the time the servers are set to as we have been told the servers are set to UTC time as opposed to NZ standard time.

Conflicts from others that are no where near our area also happens often and results from marking these conflicts as visited are producing weird copy's of previously edited polygons.


texts: selectionChanged connection is being called twice

texts:
I have this function with:
self.iface.mapCanvas().selectionChanged.connect(self.openThePano)

which waits for a feature selection change to connect to the function openThePano the issue is that once a single feature is selected the function is called twice and there is only one line that has this signal.

example code:

def actualapp(self):
    #waits for the signal
    self.iface.mapCanvas().selectionChanged.connect(self.openThePano)

def openThePano(self,fId):
    #gets the feature's attributes
    featget = fId.selectedFeatures()
    atributos = [i.attributes() for i in featget]

    source = ogr.Open(self.shproute)
    layer = source.GetLayer()
    schema = []
    ldef = layer.GetLayerDefn()
    for n in range(ldef.GetFieldCount()): # gets the attributes' names
        fdef = ldef.GetFieldDefn(n)
        schema.append(fdef.name)

    # This loop prints attributes of the selected feature and is being printed twice.
    for i in range(len(atributos[0])):
        print('{}: {}'.format(str(schema[i]),str(atributos[0][i])))

    self.iface.actionZoomToSelected().trigger()

I expect it to only print once the list of attributes but for some reason I ignore it does it twice, any ideas?


texts: QGIS: creating a grid over a canvas with 50m by 50m edges

texts:
I know I can overlay a grid on my canvas by going to view -> decorations -> grid.

However, I want to overlay a box grid that is 50 by 50 meters. Is there a way to specify this?

CRS: WGS 84 zone 47 N
EPSG: 32647

It is a map of Thailand.

I looked at create points at 50m and creating fishnet grid.

SAGA -> vector general -> create polygons

From creating fishnet grid answer, does division width and division height correspond to meters? Is it capable of being set to a certain unit?


texts: Add a date (day of year) band to each image in a collection using Google Earth Engine

texts:
I would like to add a date (day of year)band to each image in a collection. This will be used as a variable in supervised classification of sentinel-2 imagery along with peak NDVI.

I built a function to add the date band that makes sense to me but doesn't work when I map it. The error reads "Image.constant: Invalid Image.constant type". I think my hang up is converting the date (string) to a number  (e.g., '123' -> 123). Seems like it should be simple but I've been stuck for quite some time now.

GEE CODE HERE

I think the 'num' variable isn't actually a number even though I cast it as such...

//filter collection by range, day of year, and bounds
var collection = ee.ImageCollection('COPERNICUS/S2')
  .filterDate('2015-05-01', '2017-05-31')
  .filter(ee.Filter.dayOfYear(121, 151))
  .filterBounds(GP);

//create date band (day of  year) for each image in collection
var addDate = function(image){
var doy = ee.Date(image.get('system:time_start')).format('D');
var num = ee.Number(doy);
var banddate = image.select('B8').multiply(0).eq(0).multiply(num).rename('date');
return image.addBands(banddate);
};
//map it
var withDate = collection.map(addDate);
print(withDate);

I think I figured it out...I needed "ee.Number.parse(doy)" instead of "ee.Number(doy)". And I needed ".toUint16()" to cast banddate as an unsigned 16bit image.


texts:
For the following request, how would I produce a single PNG image highlighting just one feature? For example GMUID=84

Here is the base map image

https://maps.huntscore.com/geoserver/colorado/wms?service=WMS&version=1.1.0&request=GetMap&layers=colorado:BigGameGMUBoundaries12092014&styles=MiniMap_Outlines&bbox=139992.54690000042,4094064.75,763240.4375,4546735.0&width=768&height=557&srs=EPSG:26913&format=image%2Fpng

Here is the highlighted feature

http://maps.huntscore.com:8080/geoserver/colorado/wms?service=WMS&version=1.1.0&request=GetMap&layers=colorado:BigGameGMUBoundaries12092014&CQL_FILTER=GMUID=84&styles=MiniMap_Polygon&bbox=139992.54690000042,4094064.75,763240.4375,4546735.0&width=768&height=557&srs=EPSG:26913&format=image%2Fpng


texts: How to get the Area of a Polygon with a known SpatialReference in arcobjects?

texts:
This is what I tried so far:

IGeoGraphicCoordinateSystem gcs= _spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
ISpatialReference standardRef = gcs as ISpatialRef;
double GcsConversionFactor = gcs.CoordinateUnit.ConversionFactor;

void myFunc(IPolygon poly)
{
poly.Project(standardRef);
IArea area = poly as IArea.
double areaCoords = area.Area ;

double AreaKM = areaCoords * (GcsConversionFactor * GcsConversionFactor ); //this is giving me nonsense answers

}


texts: I made a contour model of a specific area and named it by its height. I need this Data to import into AutoCAD, so I saved it as .dfx with Information about its Z-dimension, by choosing "include z-dimension" in the saving options. when I now open it with AutoCAD there is no more information about the height. What is the way to keep the information in the dfx data?


texts: Adding up variables where some areas have null entries in QGIS GroupStats?

texts:
What I have is:

Output Area Polygon layer,
Building Polygon layer, with Area stat appended,
Union layer between the two above

The end goal is to be able to colour the Output Areas based on what amount of building area there is in each.

I've been trying to us GroupStats to try build that, but I've been getting errors that look like: "AttributeError:'NoneType' object has no attribute 'area'"

I take this to mean, the Output Areas that contain no buildings have Null entries in that field, and GroupStats can't handle that? I don't know though.

Does anyone know what I'm getting wrong here?


texts: ArcPy Update Cursor Not Populating Field?

texts:
I recognize similar questions have been asked but I have yet to see what my code is lacking in any of their answers.

I am trying to use the code below to periodically update attributes in a Feature Class that is often added to during our survey. The goal is every time the 'SBP Anomaly' or 'BS Anomaly' is present in the 'Target_Typ' column a sequential integer will be marked in the 'SBP_Num' and 'BCKSCTR_Nu'(Better name forthcoming) columns respectively.

The first two 'for loops' under my Update Cursor are operating correctly, however, the third doesn't update/populate its target fields when the conditions are met.

import arcpy

fc =  arcpy.GetParameterAsText(0)

fields = ['Target_num','Target_Typ','WCA_Label', 'BCKSCTR_Nu', 'SBP_Num' ]

i = 1
x = 1
s = 1

with arcpy.da.UpdateCursor(fc,fields) as rows:
    for y in rows:
        y[0] = x
        x+=1
        rows.updateRow(y)

    for row in rows:
        if row[2] != None and row[1] != 'SBP Anomaly':
            row[1] = "WC Anomaly"
        else:
            row[1] = "BS Anomaly"
        rows.updateRow(row)

    for TypeCount in rows:
        if row[1] == 'SBP Anomaly':
            row[4] = int(s)
            s += 1
        elif row[1] == 'BS Anomaly':
            row[3] = int(i)
            i += 1
        else:
            pass
        rows.updateRow(TypeCount)

del rows

An image of the attribute table I am trying to manipulate is included also for reference.
I have made sure the Target fields for third 'for loop' are set up as the correct object type: short integers (at least I think that's appropriate
) and not strings so they should take the integers i/s. I have tried them as strings and Long integers, and even float one time.

Update based on some suggestions from various users. Tried this code and still no luck.

import arcpy

fc =  arcpy.GetParameterAsText(0)

fields = ['Target_num','Target_Typ','WCA_Label', 'BCKSCTR_Nu', 'SBP_Num' ]

i = 1
x = 1
s = 1

with arcpy.da.UpdateCursor(fc,fields) as rows:
    for row in rows:
        row[0] = x
        x+=1

        if row[2] != None and row[1] != 'SBP Anomaly':
            row[1] = "WC Anomaly"
        else:
            row[1] = "BS Anomaly"

        if row[1] == 'SBP Anomaly':
            row[4] = s
            s += 1
        elif row[1] == 'BS Anomaly':
            row[3] = i
            i += 1
        else:
            pass
        rows.updateRow(row)

Also per one users comment, A more detailed description of what I want to acheive. Entries in this feature class are usually manually entered via creating features, i.e. picking them based on data available. When that happens several attributes need to be update manually.

-The Target_Num or Target number needs to be entered in sequential order. That hasn't been a problem so much.

-The 'BS' and 'SBP' anomalies will have be populated in the Target Type column, however, the WS anomalies need to be manually input in that column. These are added from another software program so that particular attribute needs to be populated. The idea with this code is that it takes another column attribute, one that only exists for the WC anomaly, and when there is data present, set the Target type to 'WC Anomaly'. Elsewise, Make it a Backscatter Anomaly. The only prohibitive condition with this is if there if Target Type is already listed as a 'SBP Anomaly', which should be left alone.

-Lastly, if the Target type is equal to SBP or BS anomaly, then it should populate the SBP/BSCKTR_Num column. This is to keep a running tally of how many of each targets there is.


texts:
I am trying to run the saga fill sinks (wang &liu) but it always results in following error
"'NoneType' object has no attribute 'crs' See log for more details".  I am using QGIS 2.18.12. I am running this algorithm inside QGIS.

I do not know what i am doing wrong

Raster CRS is "+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs". I have projected it before running the fill sink(wang & liu).


texts: How can I see a custom symbol on ProViewer?

texts: I loaded the symbol to Mapinfo and used it in a workspace. I copied the symbol to the ProViewer and restarted the computer, but I can't see the symbols when I open the workspace on ProViewer.


texts: Restrict suggestions from ESRI ArcGIS REST API to US addresses only

texts:
I am wondering if there is a way to restrict esri arcgis REST API to suggest only US addresses.

Combination of location & distance parameters prioritizes the results, but that doesn't restrict suggestions to an area.

I tried setting the bbox parameter, but looks like it is only supported for find api and not for suggest.

SO, how do I make the arcgis suggestions restrict to only US addresses ??


texts: Installed ArcFM Desktop from Network Drive, cannot uninstall it

texts:
I have installed ArcFM Desktop 10.1 from a network drive i.e I ran the installation from a mapped network drive.

Now when I try to uninstall it from Control Panel, it doesn't do so and gives me the following error:

  The installation package could not be opened. Verify that the package
  exists and that you can access it, or contact the application vendor
  to verify that this is a valid Windows Installer package.


texts: QGIS installation vanished! Re-installation attempts produce dependency-errors

texts:
So, I am using Ubuntu 18.04.1 LTS and use Qgis 3.4 for GIS analysis. I had a week long pause using QGIS for about a week, and it was quite an unhappy surprise to find out this morning that the whole program had vanished from my OS! I cannot figure out anything else I could have done, but used the software update once as prompted so by the system and installing some new R-packages.

So, I tried re-installation of QGIS, and here come my old friends: dependency issues. Can anyone figure out what is going on here?

> sudo apt-get update && sudo apt-get install qgis python-qgis qgis-plugin-grass saga
Hit:1 http://fi.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://fi.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://fi.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 https://qgis.org/debian bionic InRelease
Hit:5 http://ppa.launchpad.net/albertomilone/hamster-indicator/ubuntu
bionic InRelease
Hit:6 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu
bionic InRelease
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease
[83,2 kB]
Fetched 83,2 kB in 1s (89,2 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
saga is already the newest version (2.3.1+dfsg-4~bionic0).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python-qgis : Depends: libqgis-analysis3.4.2 but it is not going to be
installed
qgis : Depends: gdal-abi-2-2-3
       Depends: libqgis-analysis3.4.2 but it is not going to be
       installed
       Depends: libqgis-app3.4.2 but it is not going to be installed
qgis-plugin-grass : Depends: libqgis-app3.4.2 but it is not going to
be installed
Depends: grass740
E: Unable to correct problems, you have held broken packages.

I tried installing the missing packages, with no luck:

> sudo apt-get install gdal-abi-2-2-3 libqgis-analysis3.4.2 libqgis-
app3.4.2 grass740
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gdal-abi-2-2-3 is a virtual package provided by:
libgdal20 2.2.3+dfsg-2 [Not candidate version]

Package grass740 is a virtual package provided by:
grass-core 7.4.0-1 [Not candidate version]

E: Package 'gdal-abi-2-2-3' has no installation candidate
E: Package 'grass740' has no installation candidate

Update:

According to the advice by Heikki I switched the Debian repository to Ubuntugis. Then I removed my previous installation using:

sudo apt-get remove qgis python-qgis qgis-plugin-grass saga

Then I tried re-installation, but still get the same error. There is still the problem of libgis-analysis3.4.2, gdal-abi-2-2-3 and libgis-app3.4.2 being unmet dependencies that cannot be installed for some reason.


texts: Adding separator in ArcGIS python add-in toolbar?

texts:
I am trying to separate two sets of button tools in a python add-in toolbar. I am trying to make a toolbar like existing arcmap toolbar where different classes of tools separated by "|".

Can this be done in python add in toolbar?


texts: How can I add an onmouseover tooltip pop-up to a PictureMarkerSymbol in JavaScript API?

texts:
When the mouse pointer hovers over a PictureMarkerSymbol, I need a tooltip to pop-up, then disappear onmouseout.

If that's not possible, then how might I have the marker's esri.symbol.TextSymbol show on mouseover and hide on mouseout?


texts: Using GeoPackage instead of SpatiaLite, and vice-versa?

texts:
I am using now QGIS 2.18, which includes support for GeoPackage format.

I know that GeoPackage is like a replacement for Shapefile but not quite so, as GeoPackage has database capabilities. At same time, GeoPackage isn't a full replacement for SpatiaLite, because it doesn't have spatial queries and functions. Also, Spatialite supports GeoPackage.

So, in the context of QGIS editing, when does it make sense to use GeoPackage (and access GeoPackage from SpatiaLite for Spatial SQL tasks), and when is better to use just Spatialite?


texts:
I'm trying to locate labeler tool in MapInfo Pro 15.2, but the tool is missing from the installation folder (I already checked the Program Files(x86) folder as well). There's no trace of it anywhere.

Is it likely that the tool is not included at all in the latest version of MapInfo Pro? Is there any way to locate the MapBasic script for it to create the .mbx?

I'm trying to rotate the labels based on a given column containing angle values (Rotate Symbols function didn't work), and the automatic labeling contained by MapInfo Pro 15.2 doesn't give any option at all to do that for a point layer.

I managed to display it ok with QGIS, but I need a version for MapInfo


texts: Load GeoJSON data onto Leaflet Map using Slippy Map formatted URL

texts:
I've been trying to get some GeoJSON polygon data to show up on a Leaflet map, but the endpoint I'm fetching the data from answers to the format /api/{z}/{x}/{y}.geojson. Leaflet has support for GeoJSON (as well as slicing GeoJSON via the VectorGrid plugin) but only takes Slippy Map tiles in png format, like:

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
  attribution: 'Map data &copy; OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox',
  maxZoom: 18,
  id: 'mapbox.streets',
  accessToken: <access token>
}).addTo(map);

What's the best way to read in GeoJSON from a tile endpoint like this in Leaflet?


texts: Region partitions (shapefiles) comparison in ArcMap 10

texts:
I have 2 shapefiles, in each file the region is divided into zones.

Each zone from 1st ("large") file is "almost" a union of a few zones from 2nd ("small") file. Specifically, for each union in "small" file that union's boundary may not exactly match boundary of some zone in "large" file (there may be a small overlap).

If there's an overlap and some zone z_i from "small" file intersects with a few zones (Z_1,...,Z_n) from "large" file, I'd like to count z_i as a part of a zone Z_k for which intersection area of z_i and Z_k is the greatest (among all intersections of z_i and Z_1,...,Z_n).

Is there any simple way to make a .dbf (or csv) file with the following: for each zone Z_i from large file list a set of zones from small file which "correspond" to Z_i (their union is Z_i) ?

For example, if z_1 \cap z_2 = Z_1 and z_3 \cap z_4 \cap z_5 = Z_2 (\cap means intersection), then the resulting file dbf (csv) file looks like:

Small; Large

1; 1

2; 1

3; 2

4; 2

5; 2


texts: How can use my own styles in klokantech/openmaptiles-server docker container?

texts:
If I use klokantech/openmaptiles-server docker-container it work well. I can download style and change it like in Upload Style to Mapbox Studio described.

But how can I use the new style.json in my klokantech/openmaptiles-server container? In docker cmd-line is the -v $(pwd):/data argument for an external data directory. There no hint in klokantech/openmaptiles-server documentation of how using "data".


texts: QGIS 2.18.0 - missing Geometry tools in the Vector tab

texts:
Yesterday, the only vector processing tool I had was Open Street Map. After checking here, I re-installed QGIS and I had all the processing tools.

This morning, I have been using Geometry tools. When I deleted the layer I had created using Export/Add geometry columns, several processing tools, including Geometry tools, had disappeared.

I closed down QGIS and re-opened it and they were all back again.

Has anyone any idea what is going on please. It is annoying to have to close down and restart to be able to use a particular tool.


texts:
How to print this map (page) to 1:500 without georeferencing or without using any gis software. It is better to say that the marked line of 3 km should be 6 cm on paper (A4).

See image:


texts: PostGIS Shapefile Loader Tool / export manager

texts:
I am trying to upload a shapefile to PostGIS using the PostGIS Shapefile Loader Tool/export manager and I receive this error?

Connection to the PostQL seems successful... though.

Any idea?

Connecting:  host=localhost port=5432 user=postgres password='*********' client_encoding=UTF8
Connection succeeded.
Connecting:  host=localhost port=5432 user=postgres password='*********' client_encoding=UTF8

==============================
Importing with configuration: sales_within_sydney_metro2prj, public, geom, C:\Temp\Sales_Final\Sales_Within_Sydney_Metro2Prj.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=0
Shapefile type: Point
PostGIS type: POINT[2]
Shapefile import failed.
Connecting:  host=localhost port=5432 user=postgres password='*********' client_encoding=UTF8

==============================
Importing with configuration: sales_within_sydney_metro2prj, public, geom, C:\Temp\Sales_Final\Sales_Within_Sydney_Metro2Prj.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=0
Shapefile type: Point
PostGIS type: POINT[2]
Shapefile import failed.


texts: Getting layered PDF output from QGIS Map Composer?

texts:
I need to create layered PDF output from QGIS Map Composer so that one can turn the layers in PDF on and off. And I have no clue how to do it.

Is it possible at all and if so, how could I achieve it?


texts:
I'm calling a tms service from service, and for some reason it looks like no matter what I do, it always gets cached data and is never aware of any modification from the database.

I've tried to delete browser cache, delete cache from GeoServer option, stop and start GeoServer, stop and start database and telling layer not to use cache but none of those things seem to work.

I'm using this for Leaflet, instead of using what comes next, in case it had to do anything:

 <script src="https://unpkg.com/leaflet.vectorgrid@latest/dist/Leaflet.VectorGrid.bundled.js"></script>

My tms url is:

var campground_geoserverlayer = 'data_nl:point';
// Creating the full vectorTile url
var campingURL = '/geoserver/gwc/service/tms/1.0.0/' + campground_geoserverlayer + '@EPSG%3A' + projection_epsg_no + '@pbf/{z}/{x}/{-y}.pbf';

I try to read data with this:

camping_vectorgrid.on('click', function(e) {
    displayBase64Image(e.layer.properties.naamnl,e,map);
       })
      .addTo(map

);

In e.layer.properties.naamnl there's always the first value used, changing naamnl to other database field doesn't help, it also always returns its initial value.

What could I do so cached data is not used if there's a new value in the database?


texts: Create linestring from coordinate values in text array after rounding to 3 decimal points


texts: " ".join(list) not inserting spaces when calculating field

texts:
I have a Python script where I'm trying to take the values from three fields (street address data - direction, street name, street type) and combine them into one field, e.g. S, Main, St should be S Main St.

I've tried three different ways, in code below, but no matter what I try the result comes out as 'SMainSt', no spaces. If the direction field, is empty, it results in ' MainSt', even when I use strip().  If the street name is two or more words, the space there is preserved, e.g. 'SHollow WoodsLn'. Any ideas on what's going wrong?

street = ('!FEDIRP!', '!FENAME!', '!FETYPE!')
val = " ".join(street)
val = "{0} {1} {2}".format("!FEDIRP!", "!FENAME!", "!FETYPE!")
val = "!FEDIRP!" + " " + "!FENAME!" + " " + "!FETYPE!"

arcpy.CalculateField_management(f, fld, val, 'PYTHON_9.3')


texts: QGIS crashes when updating / deleting / starting the Semi-Automatic Classification Plugin

texts:
My QGIS (2.18) crashes when updating / deleting / starting / activating / deactivating the Semi-Automatic Classification Plug-in without any log-massage.

QGIS startup massage is:

  Semi-Automatic Classification Plugin: Please, restart QGIS for
  executing the Semi-Automatic Classification Plugin. Possible missing
  dependencies.


texts: When performing a TIN interpolation on vector data to create a DEM, is there any reason NOT to increase column/row size to create a smoother DEM?

texts: For example, when I load my vector data into the TIN interpolation GUI, a column/row size of 300x300 is automatically filled in.  But when using those values, my DEM is very blocky.  Is there any reason why I shouldn't increase to something like 1200x1200, which creates a much smoother DEM?


texts: How to split a circle in equal parts in QGIS?

texts:
I'm looking to split a circle polygon generated by a buffer around a point in equal parts. The goal is to be able to calculate statistics about the raster that will be under the circle for each part of the circle.

This post explains how to do it for a square polygon and this one how to do it with arcpy, but does anyone know how can I achieve a similar thing with a circle AND with QGIS ?


texts: Problems when importing shapefile with the Blender GIS add on from QGIS: contour lines appear flat

texts:
So I'm trying to import a shapefile of contour lines of groundwater isohypses that I have loaded into QGIS and saved separately. I'm actually following the steps of a online tutorial of our department so it is really strange that things don't work out like they supposed to.
The Shapefile has ELEV data that can be checked within the attribute table but when clicking the relevant boxes in the Blender GIS Add On (Elevation->Field->ZLevel (the name of the ELEV data field)) the Result looks like this:

The contour lines seem to be "stuck" to the 0 Z-level.
I checked this question in the forum and tried all the things that this person did but it didn't change the result: Contour lines with imported shapefile using Blender GIS - wrong Z values
...is there any parameter that I oversee?
Interestingly, when I work with other contour line shapefiles, or different CRS (I tried both WGS Web and local CRS - according to the tutorial it isn't relevant to transform the shapefile to a WGS CRS if you only work with your own data in Blender) the result also isn't satisfying and looks like the line levels are exploded or stacked:

Is it a bug like in the other question or is it a mistake I'm doing?


texts:
I'm running a geoserver and users have limited access to certain layers.
Everything is running smooth, when a user is connecting the WMS via QGIS or ArcGIS.

The last step would be, that a user can login to a web application and watch the data, who he is allowed to. The application (based on Openlayers/JQuery/PHP) can already get layers from the Geoserver which are not protected.

The remaining problem is, that it is not possible to get secured layers (the GetCapabilites document only returns the free layers). Im dealing with this issue for a while but don't have a solution, yet.

How can I solve the authentication / authorization in my application?
Is Authkey a possible solution: http://docs.geoserver.org/stable/en/user/community/authkey/index.html? Where can I download the plugin - I can't find it on the page I posted?


texts: Merging large amount of adjacent polygons based on attribute field using ArcGIS Desktop?

texts:
I have overlaid two shapefiles with the tool "Identity".

Thus thousands of slivers were created. I eliminated slivers that are smaller than a certain area. But there are still several thousands left. I can not just eliminate them because it would merge them to neighboring polygons with the biggest area. In my case, this would set some forest to grassland.

I want to merge them based on attribute field, how can I achieve it?


texts: Prevent polygon feature (catchment) overlap for land-use extraction using QGIS?

texts:
My aim is to calculate catchments for around 150 points and to extract land-use variables for them. In order to do so I need a vector dataset where no polygons overlap. This, however, seems to be a challenging task.

Presume, that I already calculated the catchments for all 150 points (see Figure 1; here only points 1-6 are visualized):

How do I get from the overlapping catchment features in Figure 1 to the none overlapping catchment features in Figure 2?
How can I associate the catchment features to previous overlaps? I thought of adding up the IDs (see 'Sum ID Overlap' in the attribute table in Figure 2). Can this  be done automatically?


texts: KML polygon rainbow filled colors is showing only as simple color?

texts:
I draw filled color contour in Surfer application

I imported this file to Google Earth as .kml file

There is no problem so far
I tried to import the same file to QGIS 2.18.28
But the colors is not showing correctly
There is only one simple color

How can I fix it ?


texts: Bringing GeoServer CSS styled layer to Mapbox

texts:
I have a CSS styled layer in GeoServer 2.16.1 with CSS Extension and trying to bring my layer to Mapbox. Unfortunately it comes only as simple lines.

But if bring this layer to Mapbox it shows simple lines like below:

map.addLayer({
      id: 'streets',
      type: 'line',
      source: {
        type: 'vector',
        tiles: [
          'http://localhost:80/geoserver/gwc/service/wmts?layer=geoapp:lines&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=application/x-protobuf;type=mapbox-vector&TileMatrix=EPSG:900913:{z}&TileCol={x}&TileRow={y}'
        ]
      },
      'source-layer': 'lines'
      /* ,
      layout: {
        'line-join': 'round',
        'line-cap': 'round'
      },
      paint: {
        'line-color': '#08363e',
        'line-width': 0.8
      } */
    });

Any hint, suggestion, or other way around?


texts: Clipping a raster with a shapefile created with coordinates

texts:
I created a polygon shapefile this way:
def createShapefile(shapefileDir, ROI):
  w = shp.Writer(shapefileDir, shapeType=shp.POLYGON)
  w.field('FIRST_FLD','C','40')
  w.record('poly1')
  ROI = [[float(coord) for coord in pair] for pair in ROI]
  w.poly([ROI])
  w.close()

ROI is a list of latitude and longitude coordinates from other raster.
I visualized the shapefile in QGIS, together with the raster image that I want to clip, and it looks good.

Now, when I am trying to clip the raster using gdal.Warp, None is returned if I set cropToCutline=True, and a damaged (same size as the original file) file if I set cropToCutline=False.
outBand = gdal.Warp(outputTif, inputTif, cutlineDSName=shapefileHyp, cropToCutline = True)

Am I missing something?


texts: Flowmapper plugin will not load on QGIS Brighton

texts:
Iyi gunler Cem Bey, I have just installed QGIS 2.6 (Brighton) on my PC (Bootcamp) running Windows 7 and would like to try out FlowMapper. However after I have loaded it I received the following error:

Error Loading Plugin
The plugin seems to be invalid or have unfulfilled dependencies. It has been installed, but can't be loaded... Here is the error message below:

The plugin is broken. Python said:
ascii

Can you please help me solve this riddle?


texts: Having trouble overwriting raster layers default property sheet

texts:
I need to Override the Property Sheet Dialog to display a custom property sheet that has a custom GUI built to analyse raster data based on transformed values.

Alternatively, if I can access the property sheet itself through a pointer from a raster layer and put a custom page with the GUI into the default property sheet that is shown when the layer is double clicked in the table of contents.

The key here is that the custom Sheet must be displayed when the item is double clicked in the Table of Contents.


texts: Failure using inline variable %Name% as output file name in ModelBuilder

texts:
I am using the following model to iterate through ASCII files and then use the reclassify tool:

The model works very well if I use a generic name as the output file name, or even using an inline system variable (i.e. "name%n%" for example).

The problem comes when I want to use the inline variable %Name%, and I always get this error message. And I cannot find the origin of the problem.

ERROR 999999: Error executing function.
The table name is invalid.
No spatial reference exists.
Failed to execute (Reclassify).


texts: ST_Intersects optimization between lines and points

texts:
I'm currently trying to optimize my code and I wanted to know if someone could enlighten me concerning the use of ST_Intersects.

Basically, I'm trying to assign some points to each road sections based on a hypothetical intersection in order to split those roads (the points have been calculated using ST_StartPoint and ST_EndPoint). The problem is: the network is huge.

I came up with several ideas and I wanted to know what is the best one in terms of robustness as well as quickness.

The first one (the most obvious):

SELECT r.id, ST_Collect(n.geom) as blade, r.geom
FROM roads r, nodes n
WHERE ST_Intersects(r.geom, n.geom)
GROUP BY r.id, r.geom

Then, I thought about using a left join based on the intersection:

SELECT r.id, ST_Collect(n.geom) as blade, r.geom
FROM roads r
LEFT JOIN nodes n
ON ST_Intersects(r.geom, n.geom)
GROUP BY r.id, r.geom

Finally, the last one I'm considering, it uses a temporary table to find the intersection between bounding boxes, then apply the real intersection with a significantly decreased subset:

WITH intersection AS (
     SELECT r.id, n.id as idnode, n.geom as geomnode, r.geom
     FROM roads r, nodes n
     LEFT JOIN nodes n
     ON r.geom && n.geom
)
SELECT i.id, ST_Collect(i.geomnode) as blade, i.geom
FROM intersection i, intersection i2
WHERE ST_Intersects(i.geom, i2.geomnode) AND i.id = i2.id
GROUP BY i.id, i.geom


texts: Reading feature from a GML3 content-string

texts:
How can I show the geometries from a GML3 file? Nothing is shown.
This question is DIFFERENT from Show GML on map (using an example GML file).
The other project was to get a strange GML2 file visible on the map.
In my Angular project, I first set the specific projection.
proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000  +ellps=bessel  +towgs84=565.040,49.910,465.840,-0.40939,0.35971,-1.86849,4.0772 +units=m +no_defs");
register(proj4)
this.dutchProjection = GetProjection('EPSG:28992');

This is how I read the GML file (without errors):
this.gmlFeatures = new GML3().readFeatures(this.fileText, {
        featureProjection: 'EPSG:28992', dataProjection: 'EPSG:28992' });


texts: Earth Engine ee.ImageCollection export mis-projected

texts:
I am exporting MOD10A1 imagery from Google Earth Engine and the exported data are not aligned properly in space. I tried defining the export crs as per Nicholas Clinton's advice here but to no avail. I discovered the issue after exporting both the raster and vector data and projecting simultaneously in R. They do not align (note that the vector ROI drops off the lower-left side of the plotting window):

I verified that it is not a problem with the vector data by opening it separately in Google Earth Pro - the vector data are projected fine. And I believe the actual data in the raster are correct; low-quality pixels are unmasked with the value set to 255, and we can clearly see the outline of Mono Lake, which is the focus of this toy ROI. Thus, I am led to believe that the issue is in the proj information for the raster dataset.

Reproducible example (first the GEE data acquisition and export):

//// ROI
var Sample = ee.Geometry.Polygon([
  [[-119.22, 38.06], [-119.23, 37.97], [-119.01, 37.91],
  [-118.89, 37.93], [-118.85, 38.02], [-119.01, 38.09],
  [-119.22, 38.06]]
]);

// Generate Region of Interest
var ROI = ee.FeatureCollection(Sample);

// visualize
Map.centerObject(ROI, 7); // Center on the Grand Canyon.
Map.addLayer(ROI, {color: '6a0dad', opacity:0.99}, 'ROI');

//// Data filters
// Create a QA mask + clipping function
var masker = function(image){
  var mask = image.select('NDSI_Snow_Cover_Basic_QA').lte(1);
  var maskedImage = image.updateMask(mask);
  return maskedImage.unmask(255).clip(ROI);
};

//// Acquire data
// Compile the data
var dataset = ee.ImageCollection('MODIS/006/MOD10A1')
                  .filter(ee.Filter.date('2019-01-01', '2020-01-01'))
                  .map(masker);
print("MOD10A1 Image Collection", dataset);

// Select the data you're interested in
var ndsi = dataset.select('NDSI_Snow_Cover');
print("MOD10A1 NDSI Collection",ndsi);

// Plot the data
Map.addLayer(ndsi, {}, 'NDSI');

//// PREPARE DATA FOR EXPORT
// Thanks Tyler Erickson for the stacking function
// https://gis.stackexchange.com/a/254778/67264
// The code below is slightly modified from Erickson's
// approach in order to rename using dateString in
// stackCollection function
var stackCollection = function(collection) {
  // Create an initial image.
  var first = ee.Image(collection.first()).select([]);

  // Write a function that appends a band to an image.
  var appendBands = function(image, previous) {
      var dateString = ee.Date(image.get('system:time_start')).format('yyyy-MM-dd');
      return ee.Image(previous).addBands(image.rename(dateString));
  };
  return ee.Image(collection.iterate(appendBands, first));
};
var ndsi_img = stackCollection(ndsi);
print("NDSI stacked collection", ndsi_img);

//// Export the data
// Export table for plotting
Export.table.toDrive({
  collection: ROI,
  description: 'SampleROI',
  folder: "AlignmentTroubleshooting",
  fileFormat: 'SHP'
});

// Export imagery
// Specify a crs as per Nicholas Clinton's advice
// https://gis.stackexchange.com/a/257647/67264
// Export a cloud-optimized GeoTIFF.
// See https://developers.google.com/earth-engine/exporting
Export.image.toDrive({
  image: ndsi_img,
  description: 'NDSI_2019',
  folder: "AlignmentTroubleshooting",
  scale: 500,
  region: ROI,
  crs: ndsi_img.select(0).projection(),
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});

Reproducible part II (R import and plotting):

library(raster)
library(rgdal)

# Raster
ras = raster::stack("NDSI_2019.tif")
proj4string(ras)

# ROI
roi = readOGR(".",
              "SampleROI")
proj4string(roi)
roi = spTransform(roi, CRSobj = crs(ras))

# Plot
plot(ras[[150]])
plot(roi, add = T)

The NDSI_2019.tif and SampleROI.shp files can be accessed without running the Earth Engine code here.


texts: OpenLayers PanZoom control customization

texts:
I try to customize PanZoom control and have some questions.

1) What are OpenLayers.Control.PanZoom.X and OpenLayers.Control.PanZoom.Y constants?

2) Method "draw" takes "px" argument as input. I can not find where this method is called and what value of "px" it is passed?

3) Is it possible to change buttons div size through css? I've discovered that size and filenames of images are hardcoded.


texts: Adding a border on hover to a CartoDB map

texts: I have created a map of pedestrian collisions in Toronto in CartoDB. I would like the border of each neighbourhood to be outlined in a dark colour on hover. Is it possible to modify the CSS to achieve that effect?


texts:
I am using ArcGIS Pro to draw Pie chart from two columns.
Actual Budget vs Planned Budget
It is working like normal pie chart that is if we have 60 in actual budget and 100 in planned budget. It will calculate percentage of actual budget with the sum of actual budget and planned budget. This percentage will be depicted in Pie chart. so in this example it will be 60/(100+60) = 37.5%
This is the normal working of pie chart even if we draw it in excel. What i want is instead of creating a chart like this i want to show actual budget percentage. So in the above example instead of getting 37.5% i want to get 60/100 = 60%. And i want my pie chart in ArcGIS Pro symbology to show me 60% area covered.


texts: SearchCursor (arcpy.da), accessing data on joined tables

texts:
Can you access joined tables through a da.SearchCursor?

I've found documentation to do this with SearchCursor (arcpy), but nothing for the 10.1 data access module.


texts:
How to delete features/records in ArcGIS Online hosted service using Python?
I need to delete some features using Python from a feature services hosted in ArcGIS Online.
I read a similar post that included syntax for ArcGIS Server:

> import urllib, urllib2, json
>
> serviceEndPoint =
> "http://<server>/ArcGIS/rest/services/<name>/FeatureServer/<ID>/"
>
> #Query the server for the objects to be deleted params = urllib.urlencode({'where': <whereclause>, 'f': 'json',
> 'returnIdsOnly': 'true'}) response = urllib2.urlopen(serviceEndPoint +
> "query?", params).read()
>
> #Convert the response into JSON then extract the IDs. Convert to a string data = json.loads(response) IDs = data["objectIds"] range =
> ','.join([str(x) for x in IDs])
>
> #Build the delete code, and submit it delParams = urllib.urlencode({'objectIds': range, 'f': 'json'})
> urllib2.urlopen(serviceEndPoint + "deleteFeatures?", delParams)

In my scenario, I am adding the token snippet as well as the username/password at the top.
I tried modifying the script above in the  section to say OBJECTID > 0 but after testing it, it still returns me an error:

params = urllib.urlencode({'where': OBJECTID = 5, 'f': 'json', 'returnIdsOnly': 'true'})
                                             ^  SyntaxError: invalid syntax


texts: How to change featurelayer symbol in ArcGIS silverlight API?

texts: I created a webgis using ArcGIS silverlight API . my map contains network ( roads) and some points. The user want to change the network color. Is there any solution to change the featurelayer symbol ?


texts: fitBounds on points after feature selection

texts:
I am trying to follow some of the examples I have found here and in Google Groups about fitBounds for points. Most of the examples are for polygons and don't seem to work for points.  I think I've tried just about every combo of syntax that generally looks like the following:

 var sql = cartodb.SQL({ user: 'username' });

 //feature selection buttons:
 $('.button').click(function(e, latlon, lat, lng, pxPos, data, layer) {

   $('.button').removeClass('selected');
   $(this).addClass('selected');

   //I think I need to include an sql statement with lat and lon to get bounds, but I could be wrong:
   //sql.execute("SELECT cartodb_id, name, ST_X(the_geom) lon, ST_Y(the_geom) lat FROM table_name WHERE name = " + $(this).attr('selected'), function(ret) {

   var swLat = map.getBounds().getSouthWest().lat,
       swLon = map.getBounds().getSouthWest().lng,
       neLat = map.getBounds().getNorthEast().lat,
       neLon = map.getBounds().getNorthEast().lng,

       //fitBounds works with manual inputs (below)
       southWest = L.latLng(40.56, -112.05),
       northEast = L.latLng(40.77, -111.8),

       //...**but not with this part**
       //southWest = L.latLng(swLat, swLon),
       //northEast = L.latLng(neLat, neLon),

       bounds =  L.latLngBounds(southWest, northEast),

   map.fitBounds(bounds);

   LayerActions[$(this).attr('id')] ();

 });

I would be grateful for any feedback on this, or examples of fitBounds for points and not polygons. Here is the jsbin, annotated to the best of my ability: http://jsbin.com/hunovumu/38/edit


texts: What are nodes in ArcGIS and how do you create them?

texts: I want to create a elevation profile of a cross section so a polyline on ArcGIS.  I wanted to regularly space around 1000 points per 1700m long xsection and extract elevation data for each node/point from the underlying LiDAR raster to create a graph showing elevation vs distance.  However, at the moment I am having to use the intersect function with my 0.2m interval contours, which is ok but then it only extracts an elevation where the contour intersects the cross section.  So is it possible to create these regularly spaced nodes/points along the xsection, if so how do I do it?


texts: Where are GRID algorithms in SAGA 2.1.4?

texts:
I am a real newbie on QGIS and wanting to draw contour maps from satellite, following the youtube videos.  So now I have a table with all data, and following the video, I should use the SAGA tool GRID (natural neighbour) tool but can't find it on the toolbox.

Can anyone help me?


texts: Pixel sizes, cartographic scales and maps

texts:
In spite of being a widely discussed topic, I have not been able to find the complete answer to my concerns regarding scale's use in maps preparation. I am interested in finding in the relationship(s) between pixel size and the best scale which can be derived from a particular product (image). Let's suppose I want to prepare a Land cover map (using unsupervised classification for example), using for that purpose only Landsat imagery (fixed 30x30m pixels), which criteria should be considered to define the 'best' achievable scale for the land cover map in this case?

[update] Figuring out map scale when you know the spatial resolution of a Satellite Image?
Appropriate pixel size when converting vector to raster
Calculate scale of a raster


texts: How to calculate all paired shortest path using PyQGIS?

texts:
The code for shortest path analysis with PyQGIS specifies start and end nodes explicitly:

pStart = QgsPoint( -1.37144, 0.543836 )

pStop = QgsPoint( -1.1027, 0.699986 )

http://www.qgis.org/pyqgis-cookbook/network-analysis.html

Does anyone know whether it's possible to replace these statements with sets of all nodes, so that it's possible to get all-paired shortest path?

Thanks


texts: Using a custom font with the QGIS Composer

texts:
I have an issue with changing the font of a text zone in the QGIS composer.

I have downloaded Roboto font and want to use it in my composer instead of Arial black. After installation I quitted QGIS and relaunched it. The font is available in the font list yet when I apply it, it doesn't seems to be changing.

I'm running with QGIS 2.18.20 on a MacBook Pro Machine.

How can I handle this?


texts: Python script to summarize layer properties

texts:
I recently found this layer properties script that summarizes layer properties in a single file or a directory and all subdirectories: http://www.esri.com/esri-news/arcuser/winter-2015/create-a-python-tool-that-summarizes-arcmap-layer-properties. It would be enormously useful to me if it worked. It does, in one case: running it on the MXD (not the directory) included with the downloaded sample file exactly as download.

The first problem is the tool doesn’t find layers within groups. Many of my maps have groups or even a group under which I have all my layers. When modifying the layout on a map with lots of data, turning off all the layers speeds time to make changes to the layout; adding a top-level group under which I have all layers means all I have to do it turn off the group to turn off all the layers. Also, I find grouping a good way to organize layers and a great way to develop several maps within a single MXD. To test my hypothesis, I put some layers in the downloaded file within a group, and those layers did not appear in the generated CSV.

The second problem is the  tool doesn’t work on directories. The error I get is on this line:

for filename in filenames[2]:

And the message is:

NameError: name ‘filenames’ is not defined


texts:
I was wondering if it is possible to work out a POV heading for street view based on a GPS coordinate?

For instance, say I have the coordinate '43.6653055692 -79.3102166453'

If I plugin the coordinates into the maps API to create interactive street view:

var myLatlng = new google.maps.LatLng(43.6653055692, -79.3102166453);
var panoramaOptions = {
    position: myLatlng,
};

var panorama = new google.maps.StreetViewPanorama(document.getElementById('street-canvas'), panoramaOptions);
map.setStreetView(panorama);

If finds the closet street view coordinate to the coordinate that I gave, but it doesn't direct the 'camera' towards the coordinate, like the static image API does. I want it to be pointing to the GPS coordinate. This seems to work when doing it for static images, but not for the interactive maps. Is there an option I'm missing?

Static Image URL:
https://maps.googleapis.com/maps/api/streetview?location=43.6653055692,-79.3102166453&size=600x400


texts: Creating shapefile using GDAL OGR? Script runs but does not create the files

texts:
This script runs but does not create the shapefile files. It works, however, if I were to replace the driver for GeoJSON and create a GeoJSON file. Context: I'm working through Chris Garrard's "Geoprocessing with Python".
from osgeo import ogr
shp_fn = r'C:\Users\imper\Desktop\New folder\shp_test.shp'
shp_driver = ogr.GetDriverByName('ESRI Shapefile')
shp_ds = shp_driver.CreateDataSource(shp_fn)
if shp_ds is None:
    sys.Exit('Could not create {0}.'.format(shp_fn))