Monday, 2 September 2019

arcgis desktop - Identifying Features With a Relationship Class


I have a feature class which represents points where vegetation clearing has occurred. I also have a table which has a list of vegetation species which were cleared at each location and the amount of vegetation which was in the sampled area. I have a relationship class in the geodatabase which links the two based on a Clearing_ID field.



When the user clicks on a point with the Identify tool, they can drill down to see the list of plant species present. However, the list appears as numbers which is the OBJECTID. Ideally, I'd like the user to see the list of species present as the default field instead of the object ID.


enter image description here


Is there a way to do this?



Answer





  1. Open table properties by right-clicking on the tablename in the table of contents.




  2. In the Display tab, change the field to 'Plant_Species_Present'





pyqgis - Exporting processing modeler as Python script in QGIS 3?


How do I export my processing modeler as .py so that I can edit its code?


This does not seem as intuitive as previous versions.




How do you speed up creating new field in attribute table for huge amount of data in QGIS?



In my attribute table for a shapefile, I am converting one field (Julian day) to another field (date) using the field calculator but I'm working with about 7.7 million rows. QGIS has been running for about 17 hours and is half way done. Is there a way to speed up this process? I have QGIS 2.14.19 Essen, not sure if upgrading to 2.18 would be faster.



Answer



Don't do it through the attribute table, or with any attribute tables open. Instead create new attributes directly though layer properties or via the field calculator from the main window.


Adding/deleting columns with attribute tables open is super-slow.


qgis - How to calculate LS Factor of Watershed for RUSLE Calculation?


I managed to get subbasins for my catchment (7 km^2) with their areas but I haven't figured out how to get the LS factor (see Revised Universal Soil Loss Equation) from it.


I have the vector file for my subbasins and I have the DEM (digital elevation model) file. I extracted the LS raster file from the DEM file (via r.watershed) but I dont know what to do afterwards. I figured I can isolate the subbasins within the LS raster file and calculate the average LS factor of those areas. Do you know how to do this?


On a side note, is there a way to split up the subbasins since there are slopes that are steep with slopes that are flat? Thanks in advance.





Extracting Z data from point layer using ArcGIS Desktop?



I have created a point layer with ~150 points. I have a DEM beneath it, which is where I have taken the X and Y values from.


Does anybody know how I can retrieve the Z values, without using the info button?


I am using ArcGIS Desktop 10. I have licences for the spatial analyst etc tools.




Sunday, 1 September 2019

python - Why does a TIF file lose projection information when a pixel value is changed?


I am trying to change the pixel value of a tif file (containing projection information) but after the pixel value is changed it is losing projection information.


I am using the Python imaging library for this and the code is like this


import Image
im = Image.open("some tif file")
im.putpixel((2,3),0)

So please help me in solving this ..



Answer



You need a Python library that supports the GeoTIFF format. Libraries that support only the TIFF file discard the projection and geotransform metadata when they are saved. GDAL is the most used open source Python library for reading/writing spatially aware rasters. So, for your example:



from osgeo import gdal

# Load file, and access the band and get a NumPy array
src = gdal.Open('myfile.tif', gdal.GA_Update)
band = src.GetRasterBand(1)
ar = band.ReadAsArray()

# Assign a new raster pixel value
ar[2,3] = 0


# Save/close the file
band.WriteArray(ar)
del ar, band, src

arcgis 10.0 - Where can I find more details about rasterFunctions?


I have published an Image service with ArcGIS Server 10, containing the results of an interpolation operation. The Image which is returned from the service is in greyscale.


I wish to render it with a stretched color ramp, with the following properties: enter image description here


The RestEnd Point API, mentions that a rasterFunctions Parameter has to be given as a renderingRule, for the Export Image Operation. The given samples for the rasterFunctions are very limited, And I haven't been able to create a rasterFunctions which causes any noticeable change in the exported output.



Where can I find more details about rasterFunctions? Or build the rasterFunctions Object to get the same result as shown in the window?




arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...