Friday 30 November 2018

python - Arcpy remove invalid character


I've built a model that takes the name of the Excel worksheet containing xy data, and uses that name as the name of the output shapefile. ( Worksheet "massachusetts_sightings" in an xlsx becomes "massachusetts_sightings$.shp"). I do this using Parse Path. Notice that a "$" is added.


If I then feed this shapefile, massachusetts_sightings$.shp into a clip tool (say, to clip out points in the data that are not in my study area), I get an error for an invalid character in the clip tool. My suspicion is the $. I know I could remove this with Calculate Value...but I can't figure out the code block.


My parse path output is called Value:


Codeblock


Can someone help troubleshoot? I haven't used Python in years-


# Import arcpy module
import arcpy


# Load required toolboxes
arcpy.ImportToolbox("Model Functions")

# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "X:\\Tools\\XY\\point_upload\\Scratch"
arcpy.env.workspace = "X:\\Tools\\XY\\point_upload\\Data"

# Script arguments
XY_Table = arcpy.GetParameterAsText(0)


Define_Coordinate_System = arcpy.GetParameterAsText(1)

Projection = arcpy.GetParameterAsText(2)

Geographic_Transformation = arcpy.GetParameterAsText(3)

Study_Area = arcpy.GetParameterAsText(4)

Projected_and_Clipped_Data = arcpy.GetParameterAsText(5)
if Projected_and_Clipped_Data == '#' or not Projected_and_Clipped_Data:

Projected_and_Clipped_Data = "X:\\Tools\\XY\\point_upload\\Data\\%fixed%_Clip.shp" # provide a default value if unspecified

# Local variables:
xy_event = XY_Table
v_defined = xy_event
defined_data = v_defined
v_projected = defined_data
Value = XY_Table

# Process: Parse Path

arcpy.ParsePath_mb(XY_Table, "NAME")

# Process: Make XY Event Layer
tempEnvironment0 = gp.scratchWorkspace
arcpy.env.scratchWorkspace = "X:\\Tools\\XY\\point_upload\\Scratch"
tempEnvironment1 = gp.workspace
arcpy.env.workspace = "X:\\Tools\\XY\\point_upload\\Data"
arcpy.MakeXYEventLayer_management(XY_Table, "", "", xy_event, "", "")
arcpy.env.scratchWorkspace = tempEnvironment0
arcpy.env.workspace = tempEnvironment1


# Process: Copy Features
tempEnvironment0 = gp.scratchWorkspace
arcpy.env.scratchWorkspace = "X:\\Tools\\XY\\point_upload\\Scratch"
arcpy.CopyFeatures_management(xy_event, v_defined, "", "0", "0", "0")
arcpy.env.scratchWorkspace = tempEnvironment0

# Process: Define Projection
arcpy.DefineProjection_management(v_defined, Define_Coordinate_System)


# Process: Project
tempEnvironment0 = gp.scratchWorkspace
arcpy.env.scratchWorkspace = "X:\\Tools\\XY\\point_upload\\Scratch"
tempEnvironment1 = gp.workspace
arcpy.env.workspace = "X:\\Tools\\XY\\point_upload\\Data"
arcpy.Project_management(defined_data, v_projected, Projection, Geographic_Transformation, "")
arcpy.env.scratchWorkspace = tempEnvironment0
arcpy.env.workspace = tempEnvironment1

# Process: Clip

arcpy.Clip_analysis(v_projected, Study_Area, Projected_and_Clipped_Data, "")

# Process: Calculate Value
arcpy.CalculateValue_management("\"%Value%\".strip(\"$\")", "\\n", "String")


Exporting Feature GeoJSON from PostGIS?



I'd like to do a GeoJSON dump of a PostGIS table, but I want to export features (the geometry and the properties) not just the geometry. I've been digging into the ST_AsGeoJSON function but it looks like I can only get the coordinate information (which makes sense since it's a geometry function).


For example:



select st_asgeojson(the_geom) from street_centerline limit 1;

Returns:


{"type":"MultiLineString","coordinates":[[[-65.591776562805038,41.682190576167052],[-65.591998971284028,41.682082119060382],[-65.592001213509064,41.682081025737766],[-65.593689871787177,41.681257533373952],[-65.595415661879244,41.680415888937219],[-65.595440519465640,41.680403765889309],[-65.595603134242481,41.680324459445771]]]}

I'm curious if anyone knows of a simple way to get the property information as well. Has anyone written a pgsql2geojson script yet?




qgis - How does Zonal Statistics work exactly?


I'm a bit confused on how the zonal statistics tools work in QGIS (either the 'Zonal Statistics' tool under the Raster tools from the QGIS geoalgorithms toolbox or the 'Raster statistics from polygons' tool under the SAGA Vector<->Raster tools).


Basically I have a raster map layer and some small polygons in a separate layer. I want to assign each polygon the value of the raster below. In case a polygon overlaps multiple raster cells, I just want to have the maximum.


Yet the output doesn't make any sense and I can't get behind the reasoning of those results (which are obviously not the maximum of the underlain raster cell):



enter image description here


Any ideas what I'm doing wrong or what I didn't consider yet? The results with the python API in qgis.analysis.QgsZonalStatistics() (according to this question here) are much better, but it does only offer count, mean and sum...but for some reason no max or min.




python - Clipping vs Intersecting


I was curious why clipping shapefiles was just so difficult and whether it was different to intersecting shapefiles?


You will see from one my questions that I gave up trying to clip a polyline with a polygon (here)


I tried various different methods:




  1. Conversion ogr2ogr (too slow)


    import subprocess
    subprocess.call(["C:\Program Files\GDAL\ogr2ogr", "-f", "ESRI Shapefile", "-clipsrc", clipping_shp, output_shp, input_shp])
    print('Done!')



  2. SQL ogr (too slow)


    from osgeo import ogr
    ogr.UseExceptions()
    ogr_ds = ogr.Open('K:/compdata/OS_Shape_Files/os_open_roads/trim', True) # Windows: r'C:\path\to\data'
    start = time.clock()
    print('Starting:')
    print(ogr_ds)
    SQL = """\

    SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.*, B.*
    FROM ROADLINK_Project A, cut_se59ef_poly_60 B
    WHERE ST_Intersects(A.geometry, B.geometry);"""
    layer = ogr_ds.ExecuteSQL(SQL, dialect='SQLITE')
    # copy result back to datasource as a new shapefile
    layer2 = ogr_ds.CopyLayer(layer, 'h1_buf_int_ct3')
    # save, close
    layer = layer2 = ogr_ds = None
    print("Finished in %.0f seconds" % time.clock() - start)



  3. pyclipper (couldn't get this to work)


    solution = pc.Execute2(pyclipper.CT_INTERSECTION,     pyclipper.PFT_NONZERO, pyclipper.PFT_NONZERO)


  4. rTree (couldn't get this work as I have python 3.4)


    import fiona
    from shapely.geometry import shape, mapping
    import rtree


    bufSHP = produce_poly_shape
    intSHP = 'K:/compdata/OS_Shape_Files/os_open_roads /trim/ROADLINK_Project.shp'
    ctSHP = 'output.shp'

    start = time.clock()
    print('Starting')

    with fiona.open(bufSHP, 'r') as layer1:
    with fiona.open(ctSHP, 'r') as layer2:
    # We copy schema and add the new property for the new resulting shp

    schema = layer2.schema.copy()
    schema['properties']['uid'] = 'int:10'
    # We open a first empty shp to write new content from both others shp
    with fiona.open(intSHP, 'w', 'ESRI Shapefile', schema) as layer3:
    index = rtree.index.Index()
    for feat1 in layer1:
    fid = int(feat1['id'])
    geom1 = shape(feat1['geometry'])
    index.insert(fid, geom1.bounds)


    for feat2 in layer2:
    geom2 = shape(feat2['geometry'])
    for fid in list(index.intersection(geom2.bounds)):
    if fid != int(feat2['id']):
    feat1 = layer1[fid]
    geom1 = shape(feat1['geometry'])
    if geom1.intersects(geom2):
    # We take attributes from ctSHP
    props = feat2['properties']
    # Then append the uid attribute we want from the other shp

    props['uid'] = feat1['properties']['uid']
    # Add the content to the right schema in the new shp
    layer3.write({
    'properties': props,
    'geometry': mapping(geom1.intersection(geom2))
    })

    print("Finished in %.0f seconds" % time.clock() - start)



Finally, I looked at this but couldn't get it to work with python 3.4.


Then in R I tried:




  1. gIntersection(x,y, byid=TRUE)




  2. gDifference





  3. custom gClip command I found online




However with a large polylines shapefile (around 500mb) and a very small polygon shapefile (1mb) the intersection would take a day. This led me to think perhaps I am doing something incredibly stupid and there is a quick clip command?


For example, in arcGIS the intersection command takes a few seconds so surely clipping is even easier? I know very little about GIS but to me it seems as simple as aligning the two layers by one coordinate (assuming same projection) and then selecting the outside of the clipper shape (e.g. in paint) and just deleting it from the other layer. I guess obviously this isn't the case ..


Thus my goal: I create a polygon in my code and I want to clip the UK roads network I load in to the extent of that polygon, buffer the points, dissolve and then output as an array containing the polygon coordinates.


I don't need to retain any features that an intersection would provide just a straight clip. I guess I also don't strictly need shape files and could convert my 500mb UK road network into a geodatabase?




qgis - Layer with custom UI not working properly


I have a problem with QGIS 2.4 when introducing layers with a custom UI. More precisely, widgets such as CheckBoxes are not recognised as such (appear as Text Edit in Attributes) and the corresponding Checked value appears as NULL (although checked by default in the UI file).


When I am manually changing the specific field:


instudy_id = layer.fieldNameIndex("instudy")
layer.setEditorWidgetV2(instudy_id, 'CheckBox')

Everything is normal. The corresponding part of the UI file is:


UI file



Sorry if my explanation is poor, I am quite new to QGIS. Hope the screenshots help.


Layer -> Properties Attribute Table of Layer


To conclude:




  • some options of my Widgets (defined in my .ui file) are overwritten by QGIS (e.g. "Checked" or "Unchecked" state of a QCheckBox)




  • others, which are introduced in the corresponding .py file (like QgsEditorWidgetWrapper.fromWidget( in study ).setEnabled(False) ) are not respected by QGIS.





What is the proper way to introduce a custom / customise an .ui file ? Is there anywhere detailed information/examples on the use of newer methods like QgsVectorLayer.setEditorWidgetV2, setEditorWidgetV2Config, QgsEditorWidgetWrapper ?




arcmap - Counting raster values in each polygon using ArcGIS Desktop?


I have a Watershed with ~100 smaller watersheds as a shapefile. I want to count the number of different land use values (they are in a 30x30m raster) in each of the small watersheds.


I tried combining them but nothing turns out they way I need it. Which tool or routine can I use to get this?


enter image description here



Answer



One of the powerful tools in ArcGIS is the Tabulate Area tool, which allows you to calculate the area of each land use within each polygon in the polygon shapefile (watershed in your case).


The output will be a table that computes the area of land use in each polygon. If you want to know the number of pixels of land use simply you can create a new column and divide the area by 900 (30 x 30) and you will get the number of pixels of land use within each polygon.


Spatial Analyst extension is required to use Tabulate Area tool.



style - Is Geoserver's "styler" plugin dead?


The "Styler" plugin for Geoserver promised flexible styling of your data, using the GeoExt library:


GeoExt Styler


The user guide tells you to first install the REST plugin, and then extract the styler zip file into the /data/www Geoserver directory. However, the download page for Geoserver 2.2 does not include the REST plugin. Installing older versions (I'm using Geoserver 2.2) failed for me, with one error saying "This web site needs a different Google Maps API key" (from /geoserver/www/styler/ - I have a Google Maps API).


REST seems to have disappeared recently: versions up to 2.0.3 contained the option to download the REST zip package, whereas after that there is no mention of REST, and the installation guide remains.



I did find some evidence that REST may have died, however:



This feature is no longer updated as an independent GeoServer download, but is available as part of the OpenGeo Suite. For more information on its development see OpenGeo project page



If Geoserver's "styler" plugin really is dead, then I should probably change the question to something more general like "how do I make OpenGeo's Styler work on Geoserver?" Just wanted to check with others who've had similar experience.


Context I've set-up Geoserver on an AWS EC2 instance (testing map can be seen here). What I'm trying to do is to make those boring grey polygons colourful and interesting, based on their attributes. I've tried exporting the sld that discribes the style below into Geoserver, but, at present, this does not work.


styled-polys



Answer



The OpenGeo Suite's GeoExplorer now has the styling capability that Styler used to have. That must be why they shelved it.


enter image description here



You can get the code and installation instructions at Github.


qgis - Add raster value to features AttributeError: 'module' object has no attribute 'TYPE_RASTER'?


When I try to run the "add raster value to features" (available into SAGA Tools), I get this error:


Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/processing/gui/AlgorithmDialog.py", line 249, in accept
msg = self.alg._checkParameterValuesBeforeExecuting()

File "/usr/share/qgis/python/plugins/processing/core/GeoAlgorithm.py", line 239, in _checkParameterValuesBeforeExecuting
return self.checkParameterValuesBeforeExecuting()
File "/usr/share/qgis/python/plugins/processing/algs/saga/SagaAlgorithm.py", line 343, in checkParameterValuesBeforeExecuting
param.datatype == dataobjects.TYPE_RASTER):
AttributeError: 'module' object has no attribute 'TYPE_RASTER'

I'm using QGIS 2.18.10 and Python 2.7.12 on Ubuntu 16.04


I don't have any clue to solve this error.




Thursday 29 November 2018

Getting shapefile of river from OpenStreetMap?


I do not want to download the whole map of an area. I just want rivers and other waterbodies present in an area in shapefiles so that I can use them in QGIS. I tried geofabrik but it is giving whole map and that also of full country while i need data of a city. Right now I am trying JOSM. will update you when it will works.



Answer



Use the Overpass Turbo API!


First, I'd go to openstreetmap.org,



You can either


1) Search for the feature you're after. I chose "south platte river", which runs through Denver. This gives the fields and tags that are used by OSM to store the data:


enter image description here


2) Identify the tags and values of the features you're after by



  1. Zooming all the way into the map

  2. Click on the layers icon on the right (the three sheets of paper)

  3. Click on the last menu entry (Map data or something similar in your language)

  4. The features on the map turn blue (make sure you're zoomed in far enough to see

  5. Click on the feature you're after


  6. The Tags and Values appear on left side of the screen, and you can proceed below...


enter image description here


Then go on over to the Overpass Turbo page, then click Wizard


Using information, the name value is South Platte River, and the waterway value is river, so you can build a query like this:


name="South Platte River" and waterway=river

Then click "build and run query"


enter image description here


The query will run and the result will show on the map:



enter image description here


Next click the "Export" option:


I like the geoJSON option


Click "Save"


Open the file in QGIS, and away you go!


enter image description here


You can do a 'save as' to save it as a new type of vector layer...


In your case, you could also use the waterway=river query to get all the rivers in the area you're after, and you can draw a manual selection box to narrow down the geography.


enter image description here


@underdark showed me this.



qgis - How to merge many individual KML layers into one?


I'd like to open a USGS KML file of bedrock geology for an entire county, but there are over 2,000 individual polygon layers. Does anyone know if there is a way to merge all of these layers together into one file before opening in QGIS?




coordinate system - Should point data be equidistant projected when using ArcGIS IDW spatial interpolation?


I am wondering if anyone can clarify whether point data should be projected to an equidistant projection when using ArcGIS IDW spatial interpolation?


I am working on a dataset from Western North America spanning about 30 degrees of latitude. The data are currently in Lat/Long (NAD83).



Does ArcGIS "project on the fly" or somehow adjust for latitude when calculating distances to my sample points during the interpolation procedure or should I be supplying everything in a projection that preserves distances?



Answer



IDW works by finding the data points located nearest each point of interpolation, weighting the data values according to a given power p of the distances to those points, and forming the weighted average. (Often p = -2.)


Suppose there is some amount of distance distortion around an interpolation point that is the same in all directions. This will multiply all distances by some constant value x. The weights therefore all get multiplied by x^p. Because this does not change the relative weights, the weighted average is the same as before.


When the distance distortion changes with direction, this invariance no longer holds: data points in some directions now appear (on the map) relatively closer than they should while other points appear relatively further. This changes the weights and therefore affects the IDW predictions.


Consequently, for IDW interpolation we would want to use a projection that creates roughly equal distortions in all directions from each point on the map. Such a projection is known as conformal. Conformal projections include those based on the Mercator (including Transverse Mercator (TM)), Lambert Conic, and even Stereographic.


It is important to realize that conformality is a "local" property. This means that the distance distortion is constant across all bearings only within small neighborhoods of each point. For larger neighborhoods involving greater distances, all bets are off (in general). A common--and extreme--example is the Mercator projection, which is conformal everywhere (except at the poles, where it is not defined). Its distance distortion becomes infinite at sufficiently large north-south distances from the Equator, while along the Equator itself it's perfectly accurate.


The amount of distortion in some projections can change so rapidly from point to point that even conformality will not save us when the nearest neighbors are far from each other or near the extremes of the projection's domain. It is wise, then, to choose a conformal projection adapted to the study region: this means the study region is included within an area where its distortion is the smallest. Examples include the Mercator near the Equator, TM along north-south lines, and Stereographic near either pole. In the conterminous US, the Lambert Conformal Conic is often a good default choice when the reference latitudes are placed within the study region but near its northern and southern extremes.


These considerations usually are important only for study regions that extend across large countries or more. Within small countries or states of the US, popular conventional coordinate systems exist (such as various national grids and State Plane coordinates) which introduce little distance distortion within those particular countries or states. They are good default choices for most analytical work.


python - Fiona - Preffered method for defining a schema


I'm fairly new to the world of python and GIS - so this is definitely a beginner question.


I am following Tom Macwrights small guide to Shapely and Fiona, and I noticed that even when opening the previously created shapefile, it doesn't contain the schema I defined using:



schema = { 
'geometry': 'Point',
'properties': { 'name': 'str' } }

This is evident because when I try to call it using schema = input.schema.copy(), it spits out AttributeError: 'function' object has no attribute 'schema'


Reading the Fiona documentation, it states that:



the schema of its record type (a vector file has a single type of record, remember) is accessed via a read-only schema attribute.



Does that mean that it is not possible to store a schema in the shapefile,a nd therefore I'm always required set up the variables in the beginning, rather than reading from the file using input.schema.copy()? Or do I setup the schema using Records?



If so, how do you read from a csv file (as in Tom's example) and place the data into the records to be read from input.schema.copy()? is it helpful to do this, or am I just complicating things and should define the schema every time i open the shapefile?


Thanks for the help - I'm really interested in developing my understanding of the processes occurring.



Answer



I don't really understand your problem. Some explanations: for example, we want to



  1. create a new shapefile


  2. modify the original schema: for that, it's easier to just copy things to a new shapefile and make the changes as you copy



    • Create a new Polyline shapefile:





import fiona
# schema: it is a simple dictionary with geometry and properties as keys
schema = {'geometry': 'LineString','properties': {'test': 'int'}}
# for defining the geometry, you need Shapely
from shapely.geometry import LineString, mapping
# two simples geometries
lines = [LineString([(272830.63,155125.73),(273770.32,155467.75)]),LineString([(273536.47,155914.07),(272033.12,152265.71)])]

with fiona.open('myshp.shp', 'w', 'ESRI Shapefile', schema) as layer:
for line in lines:
# filling schema
elem = {}
# geometry with mapping function of shapely
elem['geometry'] = mapping(line)
# attribute value (the same here)
elem['properties'] = {'test': 145}
# writing element in the file
layer.write(elem)



  • Now we want to modify the schema of the original shapefile in a new shapefile:


1) Open the original shapefile:


shapefile =fiona.open('myshp.shp')
#read the schema
schema2 = shapefile.schema
print schema2
{'geometry': 'LineString', 'properties': OrderedDict([(u'test', 'int:10')])}


2) As it is a dictionary, it is easy to add new fields/keys in the properties:


schema2['properties']['string']='str'

3) Now we create a new shapefile copying myshp.shp with the new schema :


with fiona.open('myshp.shp', 'r') as input:
schema = schema2
# writing the new shapefile
with fiona.open('myshp_copy.shp', 'w', 'ESRI Shapefile', schema) as output:
for elem in input:

# add the new attribute value
elem['properties']['string']="hello"
output.write({'properties': elem['properties'],'geometry': mapping(shape(elem['geometry']))})


  • verification


c = fiona.open('myshp_copy.shp')
c.schema
{'geometry': 'LineString', 'properties': OrderedDict([(u'test', 'int:10'), (u'string', 'str')])}

# first element of the shapefile
c.next()
{'geometry': {'type': 'LineString', 'coordinates': [(272830.63, 155125.73000000001), (273770.32000000001, 155467.75)]}, 'type': 'Feature', 'id': '0', 'properties': OrderedDict([(u'test', 145), (u'string', u'hello')])}


  • Conclusion


If you don't want to modify the shapefile, it is easier with schema.copy() that is only used to get a copy of the original schema (no definition here)


with fiona.open('myshp.shp', 'r') as input:
schema = input.schema.copy()

with fiona.open('myshp_copy2.shp', 'w', 'ESRI Shapefile', schema) as output:
for elem in input:
output.write({'properties': elem['properties'],'geometry': mapping(shape(elem['geometry']))})

arcmap - Creating relationship database in ArcGIS Desktop


I am creating a file geodatabase with a feature class. I have created attribute columns in which a few of them have domain value YES/NO but when I select, NO, I have to provide a measurement value as per the condition.


How do I design such a database?


The objective of this database is to collect field information through the ArcGIS collector App where the field workers will measure the length of the roadside drainage if it does not satisfy the length specification.




QGIS Python script for creating project file


Is there a way to create QGIS project file(.qgs) using only Python script outside QGIS Python console. I am trying to publish a map using QGIS Web Client using python.


For this, I am trying to do below



  1. Create .qgs file dynamically

  2. Add Legend and Layers to the .qgs file and save

  3. Set WFS,WCS parameters in the .qgs file


Finally use this file to view QGIS web client.



I tried to tweak the tool available at https://github.com/oware/Mxd2Qgs. I am successful to certain extent, i.e. creating a .qgs file. But I need some inputs on Getting layer (vector/raster) properties when path for the files is given.



# Import system modules
from xml.dom.minidom import Document
import string
import os
import glob


#Read input parameters from GP dialog

output = "myworld.qgs"

#Create an output qgs file
f = open(output, "w")

# Create the minidom
doc = Document()

# Create the base element
qgis = doc.createElement("qgis")

qgis.setAttribute("projectname", " ")
qgis.setAttribute("version", "2.4.0-Chugiak")
doc.appendChild(qgis)

# Create the element<br/>title = doc.createElement("title")<br/>qgis.appendChild(title)<br/><br/><br/>unit = doc.createTextNode("degrees")<br/><br/>xmin1 = doc.createTextNode(str("-180"))<br/>ymin1 = doc.createTextNode(str("-90"))<br/>xmax1 = doc.createTextNode(str("180"))<br/>ymax1 = doc.createTextNode(str("90"))<br/>proj4id = doc.createTextNode(str("+proj=longlat +datum=WGS84 +no_defs"))<br/>srid1 = doc.createTextNode(str("4326"))<br/>srid2 = doc.createTextNode(str("3452"))<br/>epsg1 = doc.createTextNode(str("4326"))<br/>epsg2 = doc.createTextNode(str("4326"))<br/>description1 = doc.createTextNode(str("WGS 84"))<br/><br/>description2 = doc.createTextNode(str("WGS 84"))<br/>ellipsoidacronym1 = doc.createTextNode(str("WGS84"))<br/>ellipsoidacronym2 = doc.createTextNode(str("WGS84"))<br/>geographicflag1 = doc.createTextNode("true")<br/>geographicflag2 = doc.createTextNode("true")<br/>pa=doc.createTextNode("longlat")<br/>authid2 = doc.createTextNode("EPSG:"+str("4326"))<br/>authid3 = doc.createTextNode("EPSG:"+str("4326"))<br/>count2=0<br/># mapcanvas<br/><br/>def map_canvas():<br/> # Create the <mapcanvas> element<br/> mapcanvas = doc.createElement("mapcanvas")<br/> qgis.appendChild(mapcanvas)<br/><br/># Create the <units> element<br/>units = doc.createElement("units")<br/>units.appendChild(unit)<br/>mapcanvas.appendChild(units)<br/><br/><br/># Create the <extent> element<br/>extent = doc.createElement("extent")<br/>mapcanvas.appendChild(extent)<br/><br/># Create the <xmin> element<br/>xmin = doc.createElement("xmin")<br/>xmin.appendChild(xmin1)<br/>extent.appendChild(xmin)<br/><br/># Create the <ymin> element<br/><br/>ymin = doc.createElement("ymin")<br/>ymin.appendChild(ymin1)<br/>extent.appendChild(ymin)<br/><br/># Create the <xmax> element<br/>xmax = doc.createElement("xmax")<br/>xmax.appendChild(xmax1)<br/>extent.appendChild(xmax)<br/><br/># Create the <ymax> element<br/><br/>ymax = doc.createElement("ymax")<br/>ymax.appendChild(ymax1)<br/>extent.appendChild(ymax)<br/><br/># Create the <projections> element<br/>projections = doc.createElement("projections")<br/>mapcanvas.appendChild(projections)<br/><br/># Create the <destinationsrs> element<br/>destinationsrs = doc.createElement("destinationsrs")<br/><br/>mapcanvas.appendChild(destinationsrs)<br/><br/># Create the <spatialrefsys> element<br/>spatialrefsys = doc.createElement("spatialrefsys")<br/>destinationsrs.appendChild(spatialrefsys)<br/><br/># Create the <proj4> element<br/>proj4 = doc.createElement("proj4")<br/>proj4.appendChild(proj4id)<br/>spatialrefsys.appendChild(proj4)<br/><br/><br/># Create the <srsid> element<br/>srsid = doc.createElement("srsid")<br/>srsid.appendChild(srid2)<br/>spatialrefsys.appendChild(srsid)<br/><br/># Create the <srid> element<br/>srid = doc.createElement("srid")<br/>srid.appendChild(srid1)<br/>spatialrefsys.appendChild(srid)<br/><br/><br/># Create the <authid> element<br/>authid = doc.createElement("authid")<br/>authid.appendChild(authid2)<br/>spatialrefsys.appendChild(authid)<br/><br/># Create the <description> element<br/>description = doc.createElement("description")<br/>description.appendChild(description1)<br/>spatialrefsys.appendChild(description)<br/><br/><br/># Create the <projectionacronym> element<br/>projectionacronym = doc.createElement("projectionacronym")<br/>spatialrefsys.appendChild(projectionacronym)<br/>projectionacronym.appendChild(pa)<br/><br/># Create the <ellipsoidacronym element<br/>ellipsoidacronym = doc.createElement("ellipsoidacronym")<br/>ellipsoidacronym.appendChild(ellipsoidacronym1)<br/>spatialrefsys.appendChild(ellipsoidacronym)<br/><br/><br/># Create the <geographicflag> element<br/>geographicflag = doc.createElement("geographicflag")<br/>geographicflag.appendChild(geographicflag1)<br/>spatialrefsys.appendChild(geographicflag)<br/><br/><br/><br/># Legend<br/># Legend<br/><br/>def legend_func():<br/> global count2<br/> # Create the <legend> element<br/> legend = doc.createElement("legend")<br/> qgis.appendChild(legend)<br/><br/><br/>for lyr in os.listdir(r"C:\Build\xyz\shapefiles"):<br/> if lyr.endswith('.shp'):<br/> count2=count2+1 <br/><br/> print lyr<br/> print "\n"<br/> # Create the <legendlayer> element<br/> legendlayer = doc.createElement("legendlayer")<br/> legendlayer.setAttribute("open", "true")<br/> legendlayer.setAttribute("checked", "Qt::Checked")<br/> legendlayer.setAttribute("name",lyr)<br/><br/> legend.appendChild(legendlayer)<br/><br/><br/> # Create the <filegroup> element<br/> filegroup = doc.createElement("filegroup")<br/> filegroup.setAttribute("open", "true")<br/> filegroup.setAttribute("hidden", "false")<br/> legendlayer.appendChild(filegroup)<br/><br/> # Create the <legendlayerfile> element<br/> legendlayerfile = doc.createElement("legendlayerfile")<br/> legendlayerfile.setAttribute("isInOverview", "0")<br/> legendlayerfile.setAttribute("layerid", lyr+str(20110427170816078))<br/><br/> legendlayerfile.setAttribute("visible", "1")<br/> filegroup.appendChild(legendlayerfile)<br/><br/><br/># Project Layers<br/>def project_layers(): <br/> # Create the <projectlayers> element<br/> projectlayers = doc.createElement("projectlayers")<br/> count1=str(count2)<br/> projectlayers.setAttribute("layercount", count1)<br/><br/> qgis.appendChild(projectlayers)<br/><br/>for lyr in os.listdir(r"C:\Build\xyz\shapefiles"):<br/><br/> if lyr.endswith('.shp'):<br/><br/> print lyr<br/> print "\n"<br/> ds = doc.createTextNode(str(r"C:\Build\xyz\shapefiles"+"\\"+lyr))<br/> #Tool fails here as there is dependency on ArcGIS<br/><br/> #Is there a way to replace below 2 lines ,with equivalents from QGIS?<br/> geometry1 = arcpy.Describe(lyr)<br/> geometry2 = str(geometry1.shapeType)<br/><br/> name1 = doc.createTextNode(lyr+str(20110427170816078))<br/> name2 = doc.createTextNode(lyr)<br/><br/> # Create the <maplayer> element<br/> maplayer = doc.createElement("maplayer")<br/> maplayer.setAttribute("minimumScale", "0")<br/><br/> maplayer.setAttribute("maximumScale", "1e+08")<br/> maplayer.setAttribute("minLabelScale", "0")<br/> maplayer.setAttribute("maxLabelScale", "1e+08")<br/> maplayer.setAttribute("geometry", geometry2)<br/> maplayer.setAttribute("type", "vector")<br/> maplayer.setAttribute("hasScaleBasedVisibilityFlag", "0")<br/> maplayer.setAttribute("scaleBasedLabelVisibilityFlag", "0")<br/> projectlayers.appendChild(maplayer)<br/><br/> # Create the <id> element<br/><br/> id = doc.createElement("id")<br/> id.appendChild(name1)<br/> maplayer.appendChild(id)<br/><br/> # Create the <datasource> element<br/> datasource = doc.createElement("datasource")<br/> datasource.appendChild(ds)<br/> maplayer.appendChild(datasource)<br/><br/> # Create the <layername> element<br/><br/> layername = doc.createElement("layername")<br/> layername.appendChild(name2)<br/> maplayer.appendChild(layername)<br/><br/> # Create the <srs> element<br/> srs = doc.createElement("srs")<br/> maplayer.appendChild(srs)<br/><br/> # Create the <spatialrefsys> element<br/> spatialrefsys = doc.createElement("spatialrefsys")<br/><br/> srs.appendChild(spatialrefsys)<br/><br/> # Create the <proj4> element<br/> proj4 = doc.createElement("proj4")<br/> spatialrefsys.appendChild(proj4)<br/><br/> # Create the <srsid> element<br/> srsid = doc.createElement("srsid")<br/> spatialrefsys.appendChild(srsid)<br/><br/><br/> # Create the <srid> element<br/> srid = doc.createElement("srid")<br/> srid.appendChild(srid2)<br/> spatialrefsys.appendChild(srid)<br/><br/><br/> # Create the <authid> element<br/> authid = doc.createElement("authid")<br/> authid.appendChild(authid3)<br/> spatialrefsys.appendChild(authid)<br/><br/><br/><br/> # Create the <description> element<br/> description = doc.createElement("description")<br/> description.appendChild(description2)<br/> spatialrefsys.appendChild(description)<br/><br/><br/> # Create the <projectionacronym> element<br/> projectionacronym = doc.createElement("projectionacronym")<br/><br/> spatialrefsys.appendChild(projectionacronym)<br/><br/> # Create the <ellipsoidacronym element<br/> ellipsoidacronym = doc.createElement("ellipsoidacronym")<br/> ellipsoidacronym.appendChild(ellipsoidacronym2)<br/> spatialrefsys.appendChild(ellipsoidacronym)<br/><br/><br/> # Create the <geographicflag> element<br/> geographicflag = doc.createElement("geographicflag")<br/><br/> geographicflag.appendChild(geographicflag2)<br/> spatialrefsys.appendChild(geographicflag)<br/><br/> # Create the <transparencyLevelInt> element<br/> transparencyLevelInt = doc.createElement("transparencyLevelInt")<br/> transparency2 = doc.createTextNode("255")<br/> transparencyLevelInt.appendChild(transparency2)<br/> maplayer.appendChild(transparencyLevelInt)<br/><br/> # Create the <customproperties> element<br/><br/> customproperties = doc.createElement("customproperties")<br/> maplayer.appendChild(customproperties)<br/><br/> # Create the <provider> element<br/> provider = doc.createElement("provider")<br/> provider.setAttribute("encoding", "System")<br/> ogr = doc.createTextNode("ogr")<br/> provider.appendChild(ogr)<br/> maplayer.appendChild(provider)<br/><br/><br/> # Create the <singlesymbol> element<br/> singlesymbol = doc.createElement("singlesymbol")<br/> maplayer.appendChild(singlesymbol)<br/><br/> # Create the <symbol> element<br/> symbol = doc.createElement("symbol")<br/> singlesymbol.appendChild(symbol)<br/><br/> # Create the <lowervalue> element<br/> lowervalue = doc.createElement("lowervalue")<br/><br/> symbol.appendChild(lowervalue)<br/><br/> # Create the <uppervalue> element<br/> uppervalue = doc.createElement("uppervalue")<br/> symbol.appendChild(uppervalue)<br/><br/> # Create the <label> element<br/> label = doc.createElement("label")<br/> symbol.appendChild(label)<br/><br/><br/> # Create the <rotationclassificationfieldname> element<br/> rotationclassificationfieldname = doc.createElement("rotationclassificationfieldname")<br/> symbol.appendChild(rotationclassificationfieldname)<br/><br/> # Create the <scaleclassificationfieldname> element<br/> scaleclassificationfieldname = doc.createElement("scaleclassificationfieldname")<br/> symbol.appendChild(scaleclassificationfieldname)<br/><br/> # Create the <symbolfieldname> element<br/> symbolfieldname = doc.createElement("symbolfieldname")<br/><br/> symbol.appendChild(symbolfieldname)<br/><br/> # Create the <outlinecolor> element<br/> outlinecolor = doc.createElement("outlinecolor")<br/> outlinecolor.setAttribute("red", "88")<br/> outlinecolor.setAttribute("blue", "99")<br/> outlinecolor.setAttribute("green", "37")<br/> symbol.appendChild(outlinecolor)<br/><br/> # Create the <outlinestyle> element<br/><br/> outlinestyle = doc.createElement("outlinestyle")<br/> outline = doc.createTextNode("SolidLine")<br/> outlinestyle.appendChild(outline)<br/> symbol.appendChild(outlinestyle)<br/><br/> # Create the <outlinewidth> element<br/> outlinewidth = doc.createElement("outlinewidth")<br/> width = doc.createTextNode("0.26")<br/> outlinewidth.appendChild(width)<br/> symbol.appendChild(outlinewidth)<br/><br/><br/> # Create the <fillcolor> element<br/> fillcolor = doc.createElement("fillcolor")<br/> fillcolor.setAttribute("red", "90")<br/> fillcolor.setAttribute("blue", "210")<br/> fillcolor.setAttribute("green", "229")<br/> symbol.appendChild(fillcolor)<br/><br/> # Create the <fillpattern> element<br/> fillpattern = doc.createElement("fillpattern")<br/><br/> fill = doc.createTextNode("SolidPattern")<br/> fillpattern.appendChild(fill)<br/> symbol.appendChild(fillpattern)<br/><br/> # Create the <texturepath> element<br/> texturepath = doc.createElement("texturepath")<br/> texturepath.setAttribute("null", "1")<br/> symbol.appendChild(texturepath)<br/><br/><br/><br/><br/>map_canvas()<br/>legend_func()<br/>project_layers()<br/><br/><br/># Write to qgis file<br/><br/>try:<br/> f.write(doc.toprettyxml())<br/><br/>finally:<br/> f.close()<br/><br/>print 'Done'<br/></code></pre></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Struggled a bit for last 2 days. Abandoned XML approach. Able to accomplish first 2 tasks.</p><br/><p>Need to check how I can accomplish setting WFS,WCS parameters</p><br/><ol><br/><li>Create <code>.qgs</code> file dynamically</li><br/><li>Add Legend and Layers to the <code>.qgs</code> file and save</li><br/><br/><li>Set WFS,WCS parameters in the <code>.qgs</code> file</li><br/></ol><br/><br/><pre><code>from xml.dom.minidom import Document<br/>import string<br/>import os<br/>import sys<br/>from qgis.core import *<br/>from qgis.gui import *<br/>from PyQt4.QtCore import *<br/><br/>from PyQt4.QtGui import QApplication<br/>from PyQt4.QtXml import *<br/><br/><br/>#Read input parameters from GP dialog<br/>strProjetName = "C:/OSGeo4W/apache/htdocs/QGIS-Web-Client-master/projects/myworld.qgs"<br/><br/> if os.path.isfile(strProjetName):<br/> os.remove(strProjetName)<br/><br/><br/> def add_Layers():<br/> QGISAPP = QgsApplication(sys.argv, True) <br/> QgsApplication.setPrefixPath(r"C:\OSGeo4W\apps\qgis", True)<br/> QgsApplication.initQgis() <br/> QgsProject.instance().setFileName(strProjetName)<br/> print QgsProject.instance().fileName()<br/><br/><br/>for file1 in os.listdir(r"C:\myprojects\world"):<br/> if file1.endswith('.shp'):<br/><br/> layer = QgsVectorLayer(r"C:\myprojects\world"+r"\\"+file1, file1, "ogr")<br/> print file1<br/> print layer.isValid()<br/> # Add layer to the registry<br/> QgsMapLayerRegistry.instance().addMapLayer(layer)<br/><br/><br/>QgsProject.instance().write()<br/>QgsApplication.exitQgis()<br/><br/><br/>add_Layers()<br/></code></pre></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-python-script-for-creating-project.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-python-script-for-creating-project.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-29T17:45:00-08:00'>November 29, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-python-script-for-creating-project.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=7733141262871347704&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7733141262871347704&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7733141262871347704&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7733141262871347704&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7733141262871347704&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7733141262871347704&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='1945608334649833233' itemprop='postId'/> <a name='1945608334649833233'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-10-geotiff-export.html'>ArcGIS 10 GeoTIFF Export</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1945608334649833233' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><br/><p>I'm not terribly familiar with ArcGIS in general, but I have a geodatabase (I think) containing a 3m DEM in ArcGis 9.3.</p><br/><p>I would like to have this 3m DEM in a GeoTIFF file so I can do some processing with the TauDEM package.</p><br/><p>I've tried right-clicking the 3m DEM layer and going to Export->Tiff, but it asks me what size (DPI, in essence) I want the exported TIFF to be.</p><br/><p>If I put in a low DPI, the exported file size is too small to be the actual DEM and comparisons between the GeoTIFF image and my view on ArcGIS show that the TIFF is smoothed. If I put in a high DPI I can't open the TIFF, but I'm pretty sure the result wouldn't be what I wanted, based on the low-DPI test.</p><br/><p>How do I export a GeoTIFF containing exactly the data in the 3m DEM layer without having to worry about resolution?</p><br/><p>Thanks!</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-10-geotiff-export.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-10-geotiff-export.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-29T14:33:00-08:00'>November 29, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-10-geotiff-export.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=1945608334649833233&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1945608334649833233&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1945608334649833233&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1945608334649833233&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1945608334649833233&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1945608334649833233&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/89swE.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='6861917091757758904' itemprop='postId'/> <a name='6861917091757758904'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-ifthen-field-calculator.html'>arcgis desktop - If/Then Field Calculator Return Calculations</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-6861917091757758904' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><br/><p><a href="https://i.stack.imgur.com/89swE.jpg" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/89swE.jpg"></a></p><br/><p>After collecting GPS location for road culverts I would like to calculate the $ values for each culvert based on their diameter and length in ArcMap. Existing number fields in the attribute table are Culvert <em>Diameter</em>, <em>Length</em> and the <em>Value</em> field I would like to populate. Unfortunately I have no programming experience so I'm hoping for your help. I adjusted a basic if/then formula I found in this forum and added a multiplication function in the return line. Unfortunately this doesn't work...</p><br/><pre><code> def CulvertValue(Diameter):<br/> if Diameter > 0 and Diameter < 14:<br/> return (Length*50)<br/> elif Diameter > 14 and Diameter < 20:<br/> return (Length*100)<br/> else:<br/> return "N/A"<br/></code></pre><br/><br/><p>And the result</p><br/><pre><code> CulvertValue(!Diameter!)<br/></code></pre><br/><p>So let's say the culvert is under 14 inches in diameter and 20 feet long, knowing that a culvert with this diameter costs $50 per foot, the result would be 1,000. I would obviously have to add more elif lines to cover the different price categories. Any thoughts how this could be realized with a Python script?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>You need to modify your function definition to include the length of the culvert:</p><br/><p><code>def CulvertValue(Diameter, Length):</code></p><br/><p>and modify the function call in the "Value = " box to pass the diameter and length fields:</p><br/><p><code>CulvertValue(!Diameter!, !Length!)</code></p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-desktop-ifthen-field-calculator.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-ifthen-field-calculator.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-29T12:53:00-08:00'>November 29, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-ifthen-field-calculator.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=6861917091757758904&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=6861917091757758904&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=6861917091757758904&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=6861917091757758904&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=6861917091757758904&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=6861917091757758904&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='1441732146961361748' itemprop='postId'/> <a name='1441732146961361748'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/reading-feature-class-in-file.html'>Reading feature class in file geodatabase using R?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1441732146961361748' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I have a feature contained in a geodatabase that is larger than 2GB as an exported shapefile. I need to run an extract function in R to attribute the polygons with data from a raster file. Exporting the feature as a table is not a solution. How can I read feature classes contained within an Esri file geodatabase?</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/reading-feature-class-in-file.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/reading-feature-class-in-file.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-29T10:08:00-08:00'>November 29, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/reading-feature-class-in-file.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=1441732146961361748&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1441732146961361748&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1441732146961361748&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1441732146961361748&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1441732146961361748&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1441732146961361748&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='2773391009810805693' itemprop='postId'/> <a name='2773391009810805693'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/raster-what-resampling-technique-should.html'>raster - What resampling technique should be used when projecting aerial photos?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-2773391009810805693' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I'm doing some time-intensive projecting of aerial photos, and I'm curious - what resampling technique is best to use on aerial photos? In ArcMap, my options are NEAREST, BILINEAR, CUBIC, and MAJORITY.</p><br/><p>Nearest Neighbor and Majority are recommended for categorical data, whereas Cubic Convolution and Bilinear Interpolation are for continuous data.</p><br/><br/><p><strong>I'm curious to know if there's any commonly-used algorithm for projecting aerial photos</strong>. I've just finished projecting one image using Nearest Neighbor and it seems to look good, but an aerial photo is not categorical data, so I'm going to try Bilinear next.</p><br/><p><strong>EDIT</strong><br/>I wasn't thinking of aerial photos as the same kind of continuous data as DEMs or precipitation data, but whuber pointed out that they are continuous and should be handled as such. Thanks again.</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p><strong>Aerial photos are continuous data.</strong> Each pixel represents the response of a region of a sensor to light directed at it and as that light varies, the response varies continuously. The result is usually discretized (often into 255 or 256) categories, but that doesn't change the nature of the data. Therefore you want to interpolate rather than using categorical algorithms like nearest neighbor or majority. Bilinear interpolation is usually just fine; at some cost in execution time, cubic convolution will retain local contrast a tiny bit better. A small amount of additional blurriness is unavoidable, but that's almost impossible to notice until the image has undergone many such transformations. The errors made with nearest neighbor are much worse in comparison.</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/raster-what-resampling-technique-should.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/raster-what-resampling-technique-should.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-29T05:09:00-08:00'>November 29, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/raster-what-resampling-technique-should.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=2773391009810805693&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2773391009810805693&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2773391009810805693&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2773391009810805693&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2773391009810805693&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2773391009810805693&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Wednesday 28 November 2018</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/hDnHR.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='4585077288897843755' itemprop='postId'/> <a name='4585077288897843755'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/pyqgis-changing-layer-name-of-output.html'>pyqgis - Changing layer name of output vector from processing script in QGIS?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4585077288897843755' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I define an input csv file and an output like so in my processing script:</p><br/><pre><code>##Input_CSV_File=file<br/>##Output_Shapefile=output vector<br/></code></pre><br/><p>The output shapefile is added to the map automatically when the script is done, but the name of the layer in QGIS is always "Output Shapefile". I want to name the layer based on something in the file. Is there a way to change the name the layer is added with after the script is done?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><br/><p>Processing offers two approaches:</p><br/><ul><br/><li>using the file name or</li><br/><li>using the output name specified in the scripts.</li><br/></ul><br/><p>You can change the behavior in the Processing options:</p><br/><p><img alt="enter image description here" src="https://i.stack.imgur.com/hDnHR.png"></p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/pyqgis-changing-layer-name-of-output.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/pyqgis-changing-layer-name-of-output.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-28T15:27:00-08:00'>November 28, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/pyqgis-changing-layer-name-of-output.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=4585077288897843755&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4585077288897843755&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4585077288897843755&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4585077288897843755&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4585077288897843755&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4585077288897843755&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='5324584679058210470' itemprop='postId'/> <a name='5324584679058210470'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-fix-entry-point-for.html'>qgis - How to fix "The entry point for the procedure sqlite3_open_v2 cannot be found in the dynamic link library sqlite3.dll"</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5324584679058210470' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><h3>Translation:</h3><br/><p>Hello, I have a problem installing version 1.0.8. The following error message appears:</p><br/><blockquote><br/><br/><p>The entry point for the procedure <code>sqlite3_open_v2</code> cannot be found in the dynamic link library <code>sqlite3.dll</code></p><br/></blockquote><br/><p><em>[The next sentence is ungrammatical in the original and therefore its translation is in doubt.]</em></p><br/><p>Previously I had version 1.7 Wroclaw, which I uninstalled before installing the new one.</p><br/><p>Thank you for your help.</p><br/><h3>Original</h3><br/><p>Bonjour, J'ai un problème pour installer la version 1.0.8, le message d'erreur suivant apparait:</p><br/><blockquote><br/><p>Le point d'entrée de procédure <code>sqlite3_open_v2</code> est introuvable dans la bibliothèque de liens dynamiques <code>sqlite3.dll</code></p><br/></blockquote><br/><br/><p>J'avais avant d'installer la version 1.7 Wroclaw que j'ai désinstaller pour installer la nouvelle.</p><br/><p>Merci pour votre aide.</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-how-to-fix-entry-point-for.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-how-to-fix-entry-point-for.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-28T14:04:00-08:00'>November 28, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-how-to-fix-entry-point-for.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=5324584679058210470&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5324584679058210470&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5324584679058210470&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5324584679058210470&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5324584679058210470&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5324584679058210470&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='5616517316913708294' itemprop='postId'/> <a name='5616517316913708294'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/compute-angle-of-line-in-conventional.html'>Compute Angle of line in conventional bearing using ArcGIS API for JavaScript?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5616517316913708294' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I am trying to compute angle between two lines (line segment) using ESRI (ArcGIS, JS) in conventional bearing (Eg: N29'E)</p><br/><p>I am using Add Toolbar to draw a line segment where point A is a fixed point (already drawn) and when the user is hovering over the map looking for point B, it should display projected angle.</p><br/><p>Has anybody tried anything like this before or any idea?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><br/><p>For anyone needing this:</p><br/><pre><code>function computeAngle(pointA, pointB){<br/> var dLon = (pointB.x - pointA.x) * Math.PI / 180;<br/> var lat1 = pointA.y * Math.PI / 180;<br/> var lat2 = pointB.y * Math.PI / 180;<br/> var y = Math.sin(dLon) * Math.cos(lat2);<br/> var x = Math.cos(lat1)*Math.sin(lat2) - Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);<br/> var bearing = Math.atan2(y, x) * 180 / Math.PI;<br/> bearing = ((bearing + 360) % 360).toFixed(1); //Converting -ve to +ve (0-360)<br/> if(bearing >= 0 && bearing < 90){<br/><br/> return 'N' + (bearing != 0 ? bearing + 'E' : '');<br/> }<br/> if(bearing >= 90 && bearing < 180){<br/> return (bearing != 90 ? 'S' + (180 - bearing).toFixed(1) : '') + 'E';<br/> }<br/> if(bearing >= 180 && bearing < 270){<br/> return 'S' + (bearing != 180 ? (bearing - 180).toFixed(1) + 'W' : '');<br/> }<br/> if(bearing >= 270){<br/> return (bearing != 270 ? 'N' + (360 - bearing).toFixed(1) : '') + 'W';<br/><br/> }<br/> return 'N';<br/>}<br/></code></pre><br/><p>References:</p><br/><p><a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="noreferrer">http://www.movable-type.co.uk/scripts/latlong.html</a></p><br/><p><a href="http://www.mathsteacher.com.au/year7/ch08_angles/07_bear/bearing.htm" rel="noreferrer">http://www.mathsteacher.com.au/year7/ch08_angles/07_bear/bearing.htm</a></p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/compute-angle-of-line-in-conventional.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/compute-angle-of-line-in-conventional.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-28T08:27:00-08:00'>November 28, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/compute-angle-of-line-in-conventional.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=5616517316913708294&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5616517316913708294&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5616517316913708294&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5616517316913708294&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5616517316913708294&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5616517316913708294&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/AeewG.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='4303731706252074836' itemprop='postId'/> <a name='4303731706252074836'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-add-picture.html'>qgis - pyqgis add a picture</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4303731706252074836' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I am looking for a way to add a picture to my map using pyqgis. Are there any examples of how to do this. I know it can be done using the classQgsComposerPicture. I am not much of a programmer so I cannot decode the api documentation. Any links where I can find such examples or documentation with options.</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>If I want to add an icon QGIS logo (111 pixels x 111 pixels) to my composer map, the snipped code that it works is:</p><br/><pre><code>.<br/>.<br/>.<br/><br/><br/>#Initialize the picture object<br/>logo = QgsComposerPicture(c) #c is a QgsComposition object<br/>logo.setPictureFile("/home/zeito/pyqgis_data/qgis-icon_21.png")<br/>logo.setSceneRect(QRectF(0,0,40,40)) #Resize logo<br/>logo. setItemPosition(20,20)<br/>c.addItem(logo)<br/>.<br/>.<br/>.<br/><br/></code></pre><br/><p>The result is:</p><br/><p><a href="https://i.stack.imgur.com/AeewG.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/AeewG.png"></a></p><br/><p>With this <strong>QRectF(0,0,20,20)</strong> object I have:</p><br/><p><a href="https://i.stack.imgur.com/5GLMg.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/5GLMg.png"></a></p><br/><p>I have to use the 'setSceneRect' method of <strong>QgsComposerPicture</strong> class.</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-add-picture.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-add-picture.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-28T06:54:00-08:00'>November 28, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-add-picture.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=4303731706252074836&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4303731706252074836&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4303731706252074836&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4303731706252074836&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4303731706252074836&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4303731706252074836&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Tuesday 27 November 2018</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/d5YYi.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='1240595383620778231' itemprop='postId'/> <a name='1240595383620778231'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcpy-formatting-dependent-parameters.html'>arcpy - Formatting dependent parameters in Python Toolbox?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1240595383620778231' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I am setting up my parameters for my tool in python toolbox. So far it looks like this:</p><br/><p><a href="https://i.stack.imgur.com/d5YYi.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/d5YYi.png"></a></p><br/><br/><p>The user inputs a tif into the Input Raster. I want the Select Bands (optional) tab to be a drop down menu that includes all of the bands contained in the .tif in the Input Raster. What changes do I need to make to my code (included below) to make this happen? I do not want to use the script wizard available in arcmap. This has to be done in Python Toolbox only.</p><br/><pre><code>import arcpy,os,sys<br/><br/>class Toolbox(object):<br/>def __init__(self):<br/> self.label = "Exploding Rasters"<br/> self.alias = "ER"<br/><br/> # List of tool classes associated with this toolbox<br/> self.tools = [ExplodeRasters] <br/><br/><br/>class ExplodeRasters(object):<br/> def __init__(self):<br/> self.label = "Explode Rasters"<br/> self.description = " This tool will take an input multiband raster and extract its individual bands. "<br/><br/>def getParameterInfo(self):<br/><br/># Input Features parameter<br/>in_features = arcpy.Parameter(<br/><br/> displayName="Input Raster",<br/> name="in_features",<br/> datatype="DEFeatureClass",<br/> parameterType="Required",<br/> direction="Input")<br/><br/># create select all bands button<br/>all_bands = arcpy.Parameter(<br/> displayName="Select all bands",<br/> name="Select_All",<br/><br/> datatype="Boolean",<br/> parameterType="Required",<br/> direction="Input") <br/>TIFF = arcpy.Parameter(<br/> displayName="TIFF",<br/> name ="TIFF",<br/> datatype="Boolean",<br/> parameterType="Optional",<br/> direction="Input")<br/>JPG = arcpy.Parameter(<br/><br/> displayName="JPG",<br/> name="JPG",<br/> datatype="Boolean",<br/> parameterType="Optional",<br/> direction="Input")<br/>IMG = arcpy.Parameter(<br/> displayName="IMG",<br/> name="IMG",<br/> datatype="Boolean",<br/> parameterType="Optional",<br/><br/> direction="Input") <br/><br/># Range of Desired Bands parameter<br/>select_bands = arcpy.Parameter(<br/> displayName="Select Bands",<br/> name="Select_Bands",<br/> datatype="DEFeatureClass",<br/> parameterType="Optional",<br/> direction="Input")<br/><br/><br/>select_bands.parameterDependencies = [in_features.name]<br/>select_bands.schema.clone = True<br/><br/>#select bands for NDVI band parameters<br/>NDVI_red= arcpy.Parameter(<br/> displayName="Select a red band for NDVI calculation",<br/> name="NDVI_bRed",<br/> datatype="DERasterDataset",<br/> parameterType="Optional",<br/> direction="Input")<br/><br/><br/>NDVI_NIR= arcpy.Parameter(<br/> displayName="Select a NIR band for NDVI calculation",<br/> name="NDVI_BNIR",<br/> datatype="DERasterDataset",<br/> parameterType="Optional",<br/> direction="Input")<br/><br/>#out directory<br/>OutDir=arcpy.Parameter(<br/><br/> displayName="Output Workspace",<br/> name="Out_Directory",<br/> datatype="DEWorkspace",<br/> parameterType="Required",<br/> direction="Input")<br/><br/># Create filename output prefix<br/>prefix = arcpy.Parameter(<br/> displayName="Output filename prefix",<br/> name="output_prefix",<br/><br/> datatype="String",<br/> parameterType="Required",<br/> direction="Input")<br/><br/>parameters = [in_features, all_bands, select_bands, NDVI_red, NDVI_NIR, prefix, OutDir, TIFF, JPG, IMG]<br/><br/>return parameters<br/><br/>def execute(self, parameters, messages):<br/> Out_Dir=parameters[6].valueAsText<br/><br/> in_raster=parameters[0].valueAsText<br/> out_prefix=parameters[5].valueAsText<br/><br/>messages.addMessage("INPUT RASTER=" +in_raster)<br/>messages.addMessage("Yay, you're doing great!")<br/><br/>#individual bands within multiband rasters already exist, so overwrite<br/><br/>arcpy.env.workspace=in_raster<br/>arcpy.env.overwriteOutput = True <br/><br/><br/># get a list of the bands that make up the raster<br/>bRng = arcpy.ListRasters()<br/><br/># loop through the bands and export each one with CopyRaster<br/>for ThisBnd in bRng:<br/> InBand = ThisBnd<br/> bndDesc = arcpy.Describe(InBand)<br/> NoData = bndDesc.noDataValue<br/><br/><br/> outRaster = os.path.join(Out_Dir, out_prefix + ThisBnd+".tif")<br/><br/> #copy single band rasters<br/> arcpy.CopyRaster_management(InBand,outRaster, format = "TIFF", nodata_value = NoData)<br/>return<br/></code></pre></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Looking at your code, it looks like the root of your problem may lie in the very first input parameter... "Input Raster". You've defined the data type as a "DEFeatureClass", but that can only be used for vector data, not raster data.</p><br/><p>Instead, try changing the data type to one of the raster types, defined in the help link below. I would start off with either "DERasterDataset" or "GPRasterLayer". Finally, for the "select_bands" class, I think you might be looking for the "DERasterBand" data type.</p><br/><p>See <a href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/defining-parameter-data-types-in-a-python-toolbox.htm" rel="nofollow noreferrer">Defining parameter data types in a Python toolbox</a> for more detail on the types of parameters that are available in a Python toolbox.</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcpy-formatting-dependent-parameters.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcpy-formatting-dependent-parameters.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T15:54:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcpy-formatting-dependent-parameters.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=1240595383620778231&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1240595383620778231&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1240595383620778231&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1240595383620778231&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1240595383620778231&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1240595383620778231&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='349967163488017246' itemprop='postId'/> <a name='349967163488017246'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-calculating-incidence.html'>arcgis desktop - Calculating incidence angle of polyline?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-349967163488017246' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>How can I calculate the angle of each polyline in ArcGIS?</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-desktop-calculating-incidence.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-calculating-incidence.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T13:45:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-calculating-incidence.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=349967163488017246&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=349967163488017246&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=349967163488017246&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=349967163488017246&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=349967163488017246&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=349967163488017246&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='5677675396045510447' itemprop='postId'/> <a name='5677675396045510447'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/joining-several-raster-mbtiles.html'>Joining several raster .mbtiles?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5677675396045510447' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I have several <code>.mbtiles</code> with no (or little) overlapping areas and I would like to merge them into one file in order to be able to serve them more easily.</p><br/><p>I'm looking for a command line tool that can do this.</p><br/><p><a href="https://github.com/mapbox/tippecanoe" rel="nofollow noreferrer">tile-join</a> seems to work only on vector tiles. When I run to on my raster tiles it crashes:</p><br/><pre><code>tile-join first.mbtiles second .mbtiles -o combined.mbtiles<br/>libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: libc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionterminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionterminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionlibc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exceptionlibc++abi.dylib: terminating with uncaught exception of type protozero::unknown_pbf_wire_type_exception: unknown pbf field type exception<br/><br/>Abort trap: 6<br/></code></pre><br/><p><a href="http://www.gdal.org/gdal_merge.html" rel="nofollow noreferrer">gdal_merge.py</a> works on <code>.tiff</code> files but I have <code>.mbtiles</code> as input.</p><br/><p>Update:</p><br/><p>I managed to convert the .mbtiles to .tiff using</p><br/><pre><code>gdal_translate input.mbtiles output.tiff<br/>gdal_translate input2.mbtiles output2.tiff<br/></code></pre><br/><p>Then merge them using</p><br/><pre><code>gdal_merge.py -co COMPRESS=LZW *.tiff<br/><br/></code></pre><br/><p>This gives me one <code>out.tiff</code> but then how to get a <code>.mbtiles</code> back? <code>goal_translate</code> gives me this error:</p><br/><pre><code>gdal_translate -of mbtiles out.tif out.mbtiles<br/>Input file size is 81920, 81920<br/>0ERROR 6: GDALDriver::Create() ... no create method implemented for this format.<br/></code></pre><br/><p>any ideas?</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/joining-several-raster-mbtiles.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/joining-several-raster-mbtiles.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T12:23:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/joining-several-raster-mbtiles.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=5677675396045510447&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5677675396045510447&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5677675396045510447&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5677675396045510447&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5677675396045510447&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5677675396045510447&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/kfwVg.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='2057447543044559756' itemprop='postId'/> <a name='2057447543044559756'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-identify-polygons.html'>arcgis desktop - How to identify polygons with "flag" sliver errors</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-2057447543044559756' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>Working in ArcMap, I have come across errors in a polygon layer that I will call "flag slivers" (taken from similar language in parcels call "flag lots"). These sliver polygons (see image below) are typically composed of just one additional node that user has accidentally added.</p><br/><p>In the images below, the "flag" and the "flagpole" are one single-part feature where the "flagpole" just overlaps itself. The left-hand image has a total of 5 nodes.</p><br/><p><img alt="simple flag" src="https://i.stack.imgur.com/kfwVg.jpg"> <img alt="enter image description here" src="https://i.stack.imgur.com/p1557.jpg"></p><br/><p>When seen alone the errors are very obvious, but when multiple polygons are adjacent, they are nearly impossible to see because they appear to be the boundary between 2 polygons.</p><br/><p>This likely happens because they are using a shapefile based editor, and therefore I cannot implement any topology-based editing rules to prevent this from happening in the future.</p><br/><br/><p>Does anyone have a way of identifying and resolving these types of errors? I would prefer an automated method of both identification and resolution since field users are the ones who created the errors, but I am stuck cleaning up after them. Thanks.</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>if you have access to Safe Fme tools you will find useful the transformer called spikeRemover, give it a look. You may try a downloadable limited version of SAFE FME or check your ArcGis license for "FME Extension for ArcGIS"</p><br/><p><a href="http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/spikeremover.htm" rel="nofollow">http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/spikeremover.htm</a></p><br/><p><a href="http://cdn.safe.com/resources/fme/FME-Transformer-Reference-Guide.pdf" rel="nofollow">http://cdn.safe.com/resources/fme/FME-Transformer-Reference-Guide.pdf</a></p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-identify-polygons.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-identify-polygons.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T08:27:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-identify-polygons.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=2057447543044559756&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2057447543044559756&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2057447543044559756&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2057447543044559756&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2057447543044559756&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=2057447543044559756&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='8473790427317603315' itemprop='postId'/> <a name='8473790427317603315'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/how-do-i-get-feature-from-single.html'>How do I get the feature from a single-feature OGR layer in Python without looping?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-8473790427317603315' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>A while ago <a href="https://gis.stackexchange.com/questions/186012/why-is-the-first-element-of-my-wfs-layer-none-instead-of-a-feature">I asked why the 0 index in a OGR layer was not a feature and it turned out that OGR interprets the index as Feature ID and looks that up</a>.</p><br/><p>Now I filtered a layer to have only one feature in it. I would like to use that feature straight-away but cannot figure out how.</p><br/><p>The setup:</p><br/><pre><code>from osgeo import ogr<br/><br/><br/>driver = ogr.GetDriverByName("WFS")<br/>wfs = driver.Open("WFS:https://geodienste.hamburg.de/HH_WFS_Statistische_Gebiete?REQUEST=GetCapabilities&SERVICE=WFS") # This is a public WFS with open data<br/>layer = wfs.GetLayerByName("Stadtteile") # Some polygons, possibly multipolygons<br/><br/># A random point inside one of them<br/>point_in_hamburg = ogr.CreateGeometryFromWkt("POINT (566795 5935774)")<br/><br/># Checking which features on layer intersect with our point<br/>layer.SetSpatialFilter(point_in_hamburg)<br/><br/><br/># Due to the nature of Stadtteile (=districts) we<br/># will get only one intersecting feature:<br/>print("One single feature: {}".format(len(layer) == 1)) # Prints "True"<br/></code></pre><br/><p>Now I want to use that single feature. The only way I managed to is by using a loop over that length 1 layer:</p><br/><pre><code>for feature in layer:<br/> print(feature.GetFID()) # Prints "94"<br/></code></pre><br/><p>I find that incredibly ugly and illogical. How can I directly access the feature instead without knowing anything about it?</p><br/><p><code>layer[0]</code> is not it. Strangely enough I can use <code>layer[94]</code> before the Spatial Filter and I get the feature (even though the WFS server returned a "Generic WFS service error") but if I try to use it afterwards, I get an <a href="https://github.com/OSGeo/gdal/blob/1.11/gdal/swig/python/osgeo/ogr.py#L2059" rel="nofollow noreferrer">IndexError</a> from ogr. So even if the FID is 94 and is still 94 after filtering, <code>layer[94]</code> will fail at that point.</p><br/><br/><p>Is there some alternative?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Use <code>layer.GetNextFeature()</code></p><br/><pre><code>from osgeo import ogr<br/><br/>driver = ogr.GetDriverByName("WFS")<br/>wfs = driver.Open("WFS:https://geodienste.hamburg.de/HH_WFS_Statistische_Gebiete?REQUEST=GetCapabilities&SERVICE=WFS") # This is a public WFS with open data<br/><br/>layer = wfs.GetLayerByName("Stadtteile") # Some polygons, possibly multipolygons<br/><br/><br/># A random point inside one of them<br/>point_in_hamburg = ogr.CreateGeometryFromWkt("POINT (566795 5935774)")<br/><br/># Checking which features on layer intersect with our point<br/>layer.SetSpatialFilter(point_in_hamburg)<br/><br/># Due to the nature of Stadtteile (=districts) we<br/># will get only one intersecting feature:<br/>print("One single feature: {}".format(len(layer) == 1)) # Prints "True"<br/><br/><br/>feature = layer.GetNextFeature()<br/>print(feature.GetFID()) # Prints "94"<br/></code></pre><br/><blockquote><br/><p>I find that incredibly ugly and illogical.</p><br/></blockquote><br/><p>I agree, but gdal/ogr is not a python library, it is a C++ library with python bindings. It is quite "unpythonic" and there are many "<a href="https://trac.osgeo.org/gdal/wiki/PythonGotchas" rel="nofollow noreferrer">gotchas</a>"</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/how-do-i-get-feature-from-single.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/how-do-i-get-feature-from-single.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T04:16:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/how-do-i-get-feature-from-single.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=8473790427317603315&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=8473790427317603315&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=8473790427317603315&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=8473790427317603315&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=8473790427317603315&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=8473790427317603315&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/FG3B9.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='4196273930950203857' itemprop='postId'/> <a name='4196273930950203857'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/qgis-align-label-text-using-expression.html'>qgis - Align label text using an expression</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4196273930950203857' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><br/><p>I want to align text to a specific angle in QGIS. Both the text and the angle are specified in a table (column: street name / column: angle) When I generate the labels, at the moment all the labels are placed horizontal. I want the labels (street name) to align to the specified angle from the angle column.</p><br/><p>Any ideas on how to do this? Maybe using an expression?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Welcome to GIS.SE! In QGIS you can control any aspect of labeling (and styling as well) by attribute values or expression, a feature called <em>data defined override</em>. Goto <strong>Layer properties | Labels | Placement</strong> and under <strong>Data defined</strong> near Rotation you can select the column / field containing your rotation angles:</p><br/><p><a href="https://i.stack.imgur.com/FG3B9.jpg" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/FG3B9.jpg"></a></p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-align-label-text-using-expression.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-align-label-text-using-expression.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T03:29:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-align-label-text-using-expression.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=4196273930950203857&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4196273930950203857&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4196273930950203857&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4196273930950203857&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4196273930950203857&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4196273930950203857&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/AOpw9.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='159766630008765334' itemprop='postId'/> <a name='159766630008765334'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/spatial-analyst-understanding-arcgis.html'>spatial analyst - Understanding ArcGIS Flow accumulation result?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-159766630008765334' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I have modified an existing DEM to produce two sinks - the brightest pixels, both with a dot drawn on them below.</p><br/><p><a href="https://i.stack.imgur.com/AOpw9.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/AOpw9.png"></a></p><br/><p>I have verified that they are, in fact, the lowest points with the ID tool and have confirmed that flow should follow successively lower elevation values to the center point with the "interpolate line" graph.</p><br/><p><a href="https://i.stack.imgur.com/49EUa.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/49EUa.png"></a></p><br/><p>I would expect that the flow accumulation result over this area would show the highest value at these low points. In fact that's what I'm trying to force in my model - I want these depression to act like a catcher's mitt for flow lines in the area since my pour points are not perfect.</p><br/><br/><p>However the result I get is that the low point shows a flow accumulation of "0" and there are multiple flow lines into each depression that do not connect and do not flow to the low point. all flow lines terminate at the pixel immediately before the low point rather than merging into it</p><br/><p>Is this the expected behaviour for this tool?</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/spatial-analyst-understanding-arcgis.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/spatial-analyst-understanding-arcgis.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T03:28:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/spatial-analyst-understanding-arcgis.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=159766630008765334&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=159766630008765334&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=159766630008765334&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=159766630008765334&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=159766630008765334&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=159766630008765334&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/MrtJU.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='52752943924469471' itemprop='postId'/> <a name='52752943924469471'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/geometry-how-to-calculate-angle-at.html'>geometry - How to calculate the angle at which two lines intersect in PostGIS?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-52752943924469471' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I want to calculate the angle between two lines where they intersect in PostGIS.</p><br/><p>The starting point for angle calculations in PostGIS seems to be <a href="http://postgis.refractions.net/documentation/manual-2.0/ST_Azimuth.html">ST_Azimuth</a> - but that takes points as input. My first thought was to take the endpoints of the intersecting lines and performing an Azimuth calculation on those. That is not good enough, because most of the line features are not straight, and I am interested in the angle at intersection. So what I came up with is a nested operation that goes through the following steps:</p><br/><ol><br/><br/><li>Identify all the intersections between the two line feature tables.</li><br/><li>Create a very small buffer around the intersection point</li><br/><li>Identify the points where the line features intersect the buffer exterior (taking the first point if there are more than one - I'm really only interested in whether the angle is close to 0, 90 or 180 degrees)</li><br/><li>Calculate ST_Azimuth for those two points.</li><br/></ol><br/><p>The full SQL is kind of long to post here, but I gisted it <a href="https://gist.github.com/2646988">here</a> if you're interested. (By the way, is there a better way than to carry over all the fields going down the WITH statements?)</p><br/><p>The results don't look right, so I'm clearly doing something wrong:</p><br/><p><img alt="output example 1" src="https://i.stack.imgur.com/MrtJU.png"> <img alt="output example 2" src="https://i.stack.imgur.com/NkpTM.png"></p><br/><p>EDIT I redid the calculations in EPSG:3785 and the results are a little different but still not right:</p><br/><p><img alt="output in 3785 #1" src="https://i.stack.imgur.com/Pc6uN.png"> <img alt="output in 3785 #2" src="https://i.stack.imgur.com/xipwN.png"></p><br/><br/><p>My question is where the flaws are in this process. Am I misunderstanding what ST_Azimuth does? Is there a CRS issue? Something else altogether? Or maybe there's a much, much simpler way to do this?</p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>I had the epiphany. It is rather mundane. I was leaving out one essential piece of information for PostGIS to calculate the right angle.</p><br/><p>What I was calculating was the angle between only the two points intersecting the small buffer exterior. To calculate the angle of the intersection, I need to calculate both angles between both points on the buffer exterior and the intersection point of the two line features and subtract them.</p><br/><p>I updated the full <a href="https://gist.github.com/2646988">SQL</a>, but here's the salient bit:</p><br/><pre><code>SELECT<br/> ...<br/> abs<br/> (<br/> round<br/><br/> (<br/> degrees<br/> (<br/> ST_Azimuth<br/> (<br/> points.point2,<br/> points.intersection<br/> )<br/> -<br/> ST_Azimuth<br/><br/> (<br/> points.point1,<br/> points.intersection<br/> )<br/> )::decimal % 180.0<br/> ,2<br/> )<br/>)<br/>AS angle<br/>...<br/><br/>FROM<br/>points <br/></code></pre></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/geometry-how-to-calculate-angle-at.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/geometry-how-to-calculate-angle-at.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-27T01:22:00-08:00'>November 27, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/geometry-how-to-calculate-angle-at.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=52752943924469471&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=52752943924469471&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=52752943924469471&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=52752943924469471&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=52752943924469471&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=52752943924469471&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Monday 26 November 2018</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='4705474419821429680' itemprop='postId'/> <a name='4705474419821429680'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/postgis-how-to-render-table-with-mixed.html'>postgis - How to render a table with mixed geometry types in QGIS?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4705474419821429680' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I created a table with geometry type "GEOMETRY" AND inserted data of point, line and polygon type. My question is how to show this spatial data Qgis not supporting for geometry type "GEOMETRY".</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/postgis-how-to-render-table-with-mixed.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/postgis-how-to-render-table-with-mixed.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T20:07:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/postgis-how-to-render-table-with-mixed.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=4705474419821429680&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4705474419821429680&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4705474419821429680&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4705474419821429680&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4705474419821429680&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4705474419821429680&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/sNnsn.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='7941725182018590915' itemprop='postId'/> <a name='7941725182018590915'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/creating-contiguous-pixel-based.html'>Creating contiguous pixel based cartogram using ArcGIS for Desktop?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7941725182018590915' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>There are several types of cartograms out in the world, but I feel the best one are the continuous cartograms made with separate pixels. I recently made one on paper and then transcribed it to excel by filling in each cell with different colors. This was time consuming and disheartening. Is there a straightforward way of doing a similar cartogram in ArcGIS?</p><br/><p>Examples <img alt="Credit: improving-visualisation.org" src="https://i.stack.imgur.com/sNnsn.jpg"> <img alt="Credit: Reuters electoral college map" src="https://i.stack.imgur.com/4KzQ4.jpg"></p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/creating-contiguous-pixel-based.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/creating-contiguous-pixel-based.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T19:00:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/creating-contiguous-pixel-based.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=7941725182018590915&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7941725182018590915&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7941725182018590915&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7941725182018590915&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7941725182018590915&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7941725182018590915&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/7EvSi.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='509820741031351343' itemprop='postId'/> <a name='509820741031351343'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/polygon-inner-convex-hulls-in-set-of-2d.html'>polygon - inner convex-hulls in a set of 2D points</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-509820741031351343' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>A set of 2D Points are scattered randomly (i.e., no specified pattern), we are interested in finding all <strong>inner-convex-hulls</strong> (ICH) in an order of largest in area to a minimum until the entire study area to be covered by set of ICHs, if possible.</p><br/><p>As shown in the following figure, it appears that the green convex-hull is the largest possible inner one. We mean inner implying that no point can be inside in the desired convex-hull. The boundary condition for the region can be a normal (i.e., conventionally recognised) convex-hull for all points. In Figure for the first largest in area inner-convex-hull #1 is selected first. The area covered by #1 is then excluded to avoid overlapping problem of the next generations. It seems a bit confusing and hard, hope Figure helps. We guess may be the concept of largest enclosed ellipse could help. It is however a starting guess.</p><br/><p><img alt="enter image description here" src="https://i.stack.imgur.com/7EvSi.jpg"></p><br/><p><strong>Update 1:</strong><br/>Well the result of our implementation of the idea given below by <code>Uffe Kousgaard</code> is here:</p><br/><p><img alt="enter image description here" src="https://i.stack.imgur.com/5AIzl.png"></p><br/><p>Numbers are ranks i.e., smaller number, larger area. It shows working, however, we noticed several cases the result is not correct. It may be due to bugs in our implementation or the method as noted by <code>whuber</code> below as comment.</p><br/><p>Here is result of the method mentioned by <code>Uffe</code> applied on <code>whuber</code>'s data:</p><br/><br/><p><img alt="enter image description here" src="https://i.stack.imgur.com/bkN1i.png"></p><br/><p>Apparently something does <strong>NOT</strong> work well!</p><br/><p><strong>Update 2:</strong><br/>The correct complete solution is as follows (for <code>whuber</code>'s example data): <img alt="enter image description here" src="https://i.stack.imgur.com/aTw8M.png"></p><br/><p>There are three stages, therefore, to complete the solution. We apply the method fully on each stage. That is, at stage one when all triangles were visited for possible largest inner convex-hull, the selected ICH is stored and the obsolete associated edges/points are removed from data. The procedure starts again for the remaining data. Found a solution, the steps just mentioned above apply. After exhausting all iterations (in a lucky situation as here) the area is fully covered by ICHs (here by 3 ICH) which is our ultimate goal. Note that the given answers so far are only one iteration.</p><br/><p>Here we show our understanding of <code>whuber</code>'s comment/answer. <img alt="enter image description here" src="https://i.stack.imgur.com/ffSfo.png"></p><br/><p>He was correct that greedy approach won't work as demonstrated above. This disqualifies <code>Uffe</code>s idea as a fully correct solution, unfortunately. It looks more challenging thus compared to the initial thoughts.</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/polygon-inner-convex-hulls-in-set-of-2d.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/polygon-inner-convex-hulls-in-set-of-2d.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T12:29:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/polygon-inner-convex-hulls-in-set-of-2d.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=509820741031351343&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=509820741031351343&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=509820741031351343&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=509820741031351343&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=509820741031351343&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=509820741031351343&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='1995488351420290125' itemprop='postId'/> <a name='1995488351420290125'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/determining-percent-land-coverage.html'>Determining percent land coverage around points of interest using NLCD and QGIS</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1995488351420290125' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>A former grad student was working on a project using ArcGIS to calculate land coverage (specifically water) around the breeding location of a threatened bird species. His zones went out 3, 10, 17, and 24km from each location. The reviewers have now asked for 1) zones up to 100km and 2) forest/grassland distinctions.</p><br/><p>I have zero experience with GIS, and my former grad student is a new parent, trying to work, etc, so I’m sort of on my own. Can anyone give me the QGIS for dummies that will allow me to do this type of analysis? I have downloaded the NLCD and some shapefiles which apparently contain the coordinates for all locations. As a back up, I have all coordinates in excel as well. When I import his shapefile as a vector layer and try to add buffers, I’m only able to select degrees (not km) and the buffers are ovals instead of round. Ideally, I’d like to be able to extract the percent coverage for each category in NLCD for a few different radii.</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/determining-percent-land-coverage.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/determining-percent-land-coverage.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T10:10:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/determining-percent-land-coverage.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=1995488351420290125&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1995488351420290125&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1995488351420290125&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1995488351420290125&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1995488351420290125&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1995488351420290125&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='7520289505993375200' itemprop='postId'/> <a name='7520289505993375200'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-server-why-has-web-mercator.html'>arcgis server - Why has Web Mercator (auxiliary sphere) become the web map standard?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7520289505993375200' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>I understand what the <a href="http://forums.arcgis.com/threads/5204-Web-Mercator-%28auxiliary-sphere%29-vs.-Web-Mercator-overlay-consequences-mixing-them">difference</a> is between the Web Mercator <a href="http://en.wikipedia.org/wiki/Map_projection">projection</a> and Web Mercator Auxiliary Sphere (WMAS). I also understand that both Google and Esri have adopted this projection as their primary projection for their web-maps which is why we have specialized functions that not only re-project between all projections, but are specific functions for WM, such as <a href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#webMercatorToGeographic">webMercatorToGeographic</a>. So ultimately I was wondering <strong>why we use the WMAS projection, and the reason it has become a standard in web mapping.</strong> Is it a purely a result of two spatial giants moving in that direction or was it just solely because of accuracy reasons?</p><br/><p>Additional Links:<br/><a href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator Projection</a></p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>I'm pretty sure we have Google to thank. Take a look at the original <strike><a href="http://www.epsg.org/">EPSG</a> code</strike> WKID for <a href="http://spatialreference.org/ref/sr-org/6627/prettywkt/">Web Mercator</a>. What does 900913 look like? Helps if you're at least a little l33t.</p><br/><p>When Google Maps blew up a few years ago (2005ish), everyone started copying Google. This included Virtual Earth/Bing, Mapquest, Yahoo Maps and eventually Esri. Everyone wanted/needed to be compatible with the most popular web mapping platform. It has been the standard ever since.</p><br/><p>Edit: per mkennedy's comment, changed EPSG code to WKID</p><br/><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-server-why-has-web-mercator.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-server-why-has-web-mercator.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T07:47:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-server-why-has-web-mercator.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=7520289505993375200&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7520289505993375200&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7520289505993375200&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7520289505993375200&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7520289505993375200&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7520289505993375200&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='7378859566901085303' itemprop='postId'/> <a name='7378859566901085303'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-qgsvectorlayer-loading.html'>qgis - PyQGIS QgsVectorLayer() Loading Invalid Layer in Standalone Python Script?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7378859566901085303' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>In my standalone python 3 script, QgsVectorLayer() is loading an invalid layer. When I use the exact same function and inputs in the QGIS GUI python console, the layer loads fine. I am not sure what is missing in my standalone script. I have double checked the paths and made sure they are correct. I used</p><br/><pre><code>QgsApplication.prefixPath()<br/></code></pre><br/><p>to check the correct path for input in the</p><br/><pre><code>QgsApplication.setPrefixPath()<br/><br/></code></pre><br/><p>function within my standalone script. The path and inputs I use in the</p><br/><pre><code>QgsVectorLayer()<br/></code></pre><br/><p>function in my standalone script are the same as those used in the GUI python console. I'm not sure why loading a vector layer in my standalone script it failing. The vector object is created, but .isValid() returns False.</p><br/><p>Here is my standalone script:</p><br/><pre><code>import sys, os, time<br/><br/>sys.path.extend([r'C:\OSGeo4W\apps\qgis\python',r'C:\OSGeo4W\apps\Python37\Lib\site-packages'])<br/><br/><br/>#modify environment variables to find qgis and qt plugins during qgis.core import<br/>os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = r'C:\OSGeo4W\apps\Qt5\plugins'<br/>os.environ['QT_PLUGIN_PATH'] = r'%QT_PLUGIN_PATH%;C:\OSGeo4W\apps\Qt5\plugins;C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qgis\plugins'<br/>os.environ['PATH'] += r';C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\Qt5\bin;C:\OSGeo4W\\bin'<br/><br/>from qgis.core import *<br/>from qgis.gui import *<br/><br/># supply path to qgis install location<br/>QgsApplication.setPrefixPath(r'C:\OSGeo4W\apps\qgis', True)<br/><br/>#QgsApplication.setPluginPath('C:\\OSGeo4W\\apps\Qt5\\plugins\\platforms')<br/>#print(QgsApplication.systemEnvVars())<br/><br/># create a reference to the QgsApplication<br/># setting the second argument to True enables the GUI, which we need to do<br/># since this is a custom application<br/>qgs = QgsApplication([], True)<br/><br/># load providers<br/>qgs.initQgis()<br/><br/><br/>##########################<br/># Write your code here to load some layers, use processing algorithms, etc.<br/>canvas = QgsMapCanvas()<br/>canvas.show()<br/>layer = QgsVectorLayer(r'C:\Users\Matt\OneDrive\FarmProject\Kankakee_Parcels\K3_TaxParcels.shp', 'Kankakee', 'ogr')<br/>if not layer.isValid():<br/> print('Failed to open the layer')<br/><br/># add layer to the registry<br/><br/>add_layers = QgsProject.instance().addMapLayer(layer)<br/><br/># set extent to the extent of our layer<br/>canvas.setExtent(layer.extent())<br/><br/># set the map canvas layer set<br/>canvas.setLayers([add_layers])<br/>canvas.refresh()<br/>time.sleep(30)<br/>########################<br/><br/><br/># When your script is complete, call exitQgis() to remove the provider and<br/># layer registries from memory<br/>qgs.exitQgis()<br/></code></pre></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Per the solution found at this link: <a href="https://github.com/OSGeo/homebrew-osgeo4mac/issues/197" rel="nofollow noreferrer">https://github.com/OSGeo/homebrew-osgeo4mac/issues/197</a></p><br/><p>The QgsApplication.setPrefixPath() is not correctly setting the prefix. Therefore, the vector layer cannot load properly.</p><br/><p>A workaround is to set the QGIS prefix environment variable directly using the os module in Python:</p><br/><pre><code>os.environ['QGIS_PREFIX_PATH'] = r'prefix\path'<br/></code></pre><br/><br/><p>Once the prefix path is correctly set, the vector layer should load properly and .isValid() should yield 'True'</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-qgsvectorlayer-loading.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-qgsvectorlayer-loading.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T04:54:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-qgsvectorlayer-loading.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=7378859566901085303&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7378859566901085303&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7378859566901085303&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7378859566901085303&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7378859566901085303&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7378859566901085303&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/1pFVk.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='1683411574064441640' itemprop='postId'/> <a name='1683411574064441640'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/qgis-split-polygon-with-polygon-in.html'>qgis - Split polygon with polygon in different tables / layers</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-1683411574064441640' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><br/><p>I have a large number (1 million+) multi point polygons (red lines, table_a), in which are around 20 million other multi point polygons (black blocks table_b). They are in separate tables. What i want to do is measure the sum of the area of the black blocks within the red line.</p><br/><p>My workflow is to first cut the black blocks along the red line then use <code>st_intersection</code> to select them and sum using <code>st_area</code>.</p><br/><p>Something like</p><br/><p><code>SET table_a UPDATE bldg_footprint = st_area (cut_buildings) FROM table_b WHERE ST_Intersects( admin_bound table_a , buildings table_b )</code></p><br/><p>I can see from this answer <a href="https://gis.stackexchange.com/questions/169734/how-to-split-a-polygon-by-a-polygon-using-postgis">here</a>. That I can either the blocks directly using the polygon or first extract the lines and then cut using lines.</p><br/><p>My question is wether there's a function in PostGIS that is more efficient than that approach?</p><br/><p>I'd be open to a QGIS solution but had assumed that given the size of data PostGIS will be faster.</p><br/><p><a href="https://i.stack.imgur.com/1pFVk.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/1pFVk.png"></a></p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>This is probably not the most elegant or efficient way of solving the problem but it worked for me;</p><br/><br/><p>The following cuts the black blocks using the red lines and returns the measurement of the cut blocks falling within the red line;</p><br/><p><code>SELECT boundaries.postcode, boundaries.pc_sectors, ST_Intersection(boundaries.pc_unit_geom, bldgs.geom) AS bldgs_split,--splits the black blocks ST_Area (st_intersection(boundaries.pc_unit_geom, bldgs.geom)) as bldg_area --returns area of the split blocks, as individual records FROM d_os_vectormap_bldgs bldgs, d_os_codepoint_poly boundaries WHERE st_intersects(boundaries.pc_unit_geom, bldgs.geom) --selects blocks within the boundary</code></p><br/><p>I then passed the results of that query to another, as below, to get the sum of all the block by boundary area, you could do this by modifying the original query using <code>group by</code>.</p><br/><p><code>SELECT SUM (bldg_area) as sum_bldg_footprint, boundary_id from buildings_clipped_to_boundaries GROUP BY boundary_id</code></p><br/><p><strong>NB</strong> Make sure you have an index on the geometry columns or this will be very slow.</p><br/></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/qgis-split-polygon-with-polygon-in.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/qgis-split-polygon-with-polygon-in.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-26T00:38:00-08:00'>November 26, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/qgis-split-polygon-with-polygon-in.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=1683411574064441640&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1683411574064441640&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1683411574064441640&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1683411574064441640&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1683411574064441640&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=1683411574064441640&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Sunday 25 November 2018</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='7586434381915471955' itemprop='postId'/> <a name='7586434381915471955'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/web-mapping-using-local-mbtiles-in.html'>web mapping - Using local mbtiles in openlayers?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-7586434381915471955' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>--The problem-- I've successfully added mbtiles from Mapbox free online source to OpenLayers, but cannot figure out how to get the mbtiles I've created/stored locally to show up in OpenLayers.</p><br/><p>--The process-- Style data in Tilemill, export mbtiles, add mbtiles to Tilestream running on localhost, then add to openlayers using the localhost:8888 url.</p><br/><p>--The code--</p><br/><p>This works:</p><br/><pre><code>// Add mapbox mbtiles from web<br/>map.addLayer(new OpenLayers.Layer.TMS('geography-class',<br/><br/>'http://a.tiles.mapbox.com/mapbox/', {<br/>maxResolution: 156543.0339,<br/>type: 'png',<br/>layername: 'geography-class',<br/>isBaseLayer: true<br/>}));<br/></code></pre><br/><p>This doesn't work:</p><br/><pre><code>// Add tilestream mbtiles local data layer<br/>map.addLayer(new OpenLayers.Layer.TMS('overlayWorld',<br/><br/>'http://localhost:8888/2.0.0/overlay_62ee43/{z}/{x}/{y}.png', {<br/>maxResolution: 156543.0339,<br/>type: 'png',<br/>layername: 'overlayWorld',<br/>isBaseLayer: false<br/>}));<br/></code></pre><br/><p>That localhost url comes from the 'TILE URL' field in Tilestream. I've tried multiple different edits to the localhost url but cannot get it right.</p><br/><p>Any help is appreciated.</p><br/></div><br/><br/> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/web-mapping-using-local-mbtiles-in.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/web-mapping-using-local-mbtiles-in.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-25T21:22:00-08:00'>November 25, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/web-mapping-using-local-mbtiles-in.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=7586434381915471955&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7586434381915471955&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7586434381915471955&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7586434381915471955&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7586434381915471955&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=7586434381915471955&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/poqtj.jpg' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='4942949002209039800' itemprop='postId'/> <a name='4942949002209039800'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-randomly-subset-x.html'>arcgis desktop - How to randomly subset X% of selected points?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-4942949002209039800' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>What methods are available in ArcGIS 10.2 to randomly subset a selection of points. For example, in the attached screenshot I am interested in keeping 20% of the selected points and deleting the rest.</p><br/><p><img alt="enter image description here" src="https://i.stack.imgur.com/poqtj.jpg"></p><br/><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>Here's a python function that will select random features in a layer based on percent, ignoring current selection:</p><br/><pre class="lang-py prettyprint-override"><code>def SelectRandomByPercent (layer, percent):<br/> #layer variable is the layer name in TOC<br/> #percent is percent as whole number (0-100)<br/> if percent > 100:<br/> print "percent is greater than 100"<br/> return<br/> if percent < 0:<br/> print "percent is less than zero"<br/><br/> return<br/> import random<br/> fc = arcpy.Describe (layer).catalogPath<br/> featureCount = float (arcpy.GetCount_management (fc).getOutput (0))<br/> count = int (featureCount * float (percent) / float (100))<br/> if not count:<br/> arcpy.SelectLayerByAttribute_management (layer, "CLEAR_SELECTION")<br/> return<br/> oids = [oid for oid, in arcpy.da.SearchCursor (fc, "OID@")]<br/> oidFldName = arcpy.Describe (layer).OIDFieldName<br/><br/> path = arcpy.Describe (layer).path<br/> delimOidFld = arcpy.AddFieldDelimiters (path, oidFldName)<br/> randOids = random.sample (oids, count)<br/> oidsStr = ", ".join (map (str, randOids))<br/> sql = "{0} IN ({1})".format (delimOidFld, oidsStr)<br/> arcpy.SelectLayerByAttribute_management (layer, "", sql)<br/></code></pre><br/><p>Copy/paste this into the python shell in ArcMap.</p><br/><p>Then in the shell type <code>SelectRandomByPercent ("layer", num)</code>, where <code>layer</code> is the name of your layer, and <code>num</code> is a whole number of your percent.</p><br/><p><a href="https://i.stack.imgur.com/IFn7w.png" rel="noreferrer"><img alt="Random selection" src="https://i.stack.imgur.com/IFn7w.png"></a></p><br/><br/><p>A variation to find a subset selection as asked:</p><br/><pre class="lang-py prettyprint-override"><code>def SelectRandomByPercent (layer, percent):<br/> #layer variable is the layer name in TOC<br/> #percent is percent as whole number (0-100)<br/> if percent > 100:<br/> print "percent is greater than 100"<br/> return<br/> if percent < 0:<br/> print "percent is less than zero"<br/> return<br/><br/> import random<br/> featureCount = float (arcpy.GetCount_management (layer).getOutput (0))<br/> count = int (featureCount * float (percent) / float (100))<br/> if not count:<br/> arcpy.SelectLayerByAttribute_management (layer, "CLEAR_SELECTION")<br/> return<br/> oids = [oid for oid, in arcpy.da.SearchCursor (layer, "OID@")]<br/> oidFldName = arcpy.Describe (layer).OIDFieldName<br/> path = arcpy.Describe (layer).path<br/> delimOidFld = arcpy.AddFieldDelimiters (path, oidFldName)<br/><br/> randOids = random.sample (oids, count)<br/> oidsStr = ", ".join (map (str, randOids))<br/> sql = "{0} IN ({1})".format (delimOidFld, oidsStr)<br/> arcpy.SelectLayerByAttribute_management (layer, "", sql)<br/></code></pre><br/><p>Finally, one more variation to select a layer by a count, instead of a percent:</p><br/><pre class="lang-py prettyprint-override"><code>def SelectRandomByCount (layer, count):<br/> import random<br/> layerCount = int (arcpy.GetCount_management (layer).getOutput (0))<br/> if layerCount < count:<br/><br/> print "input count is greater than layer count"<br/> return<br/> oids = [oid for oid, in arcpy.da.SearchCursor (layer, "OID@")]<br/> oidFldName = arcpy.Describe (layer).OIDFieldName<br/> path = arcpy.Describe (layer).path<br/> delimOidFld = arcpy.AddFieldDelimiters (path, oidFldName)<br/> randOids = random.sample (oids, count)<br/> oidsStr = ", ".join (map (str, randOids))<br/> sql = "{0} IN ({1})".format (delimOidFld, oidsStr)<br/> arcpy.SelectLayerByAttribute_management (layer, "", sql)<br/><br/></code></pre></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-randomly-subset-x.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-randomly-subset-x.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-25T20:33:00-08:00'>November 25, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-randomly-subset-x.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=4942949002209039800&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4942949002209039800&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4942949002209039800&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4942949002209039800&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4942949002209039800&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=4942949002209039800&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://i.stack.imgur.com/EvkrK.png' itemprop='image_url'/> <meta content='6220276627345324806' itemprop='blogId'/> <meta content='5277796193707152856' itemprop='postId'/> <a name='5277796193707152856'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='https://gisqas.blogspot.com/2018/11/postgis-how-to-get-smallest-line.html'>postgis - How to get smallest line segments from intersection + difference of multiple overlapping lines?</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-5277796193707152856' itemprop='description articleBody'> <div class="post-text" itemprop="text"><br/><p>Inspired by <a href="https://gis.stackexchange.com/q/109692/36886">this question</a>, and <a href="https://gis.stackexchange.com/a/785/36886">this excellent answer</a>.</p><br/><p>I have multiple overlapping lines and want to extract the <em>complete</em> intersection of them. So from this sample data</p><br/><pre><code>SELECT id, geom INTO stackex FROM (VALUES<br/>(1,ST_GeomFROMText('MULTILINESTRING((-71.1074566182813 42.3678123402605,-71.1071774374479 42.3678371063022,-71.1070346151051 42.3676745085758,-71.1069420616668 42.3675691384874))'))<br/>,(2,ST_GeomFROMText('MULTILINESTRING((-71.1071774374479 42.3678371063022,-71.1070346151051 42.3676745085758,-71.1069420616668 42.3675691384874,-71.1068847478646 42.3675038904688,-71.1070265897396 42.3673507913022))'))<br/><br/>,(3,ST_GeomFROMText('MULTILINESTRING((-71.1070523458763 42.3679834790295,-71.1071774374479 42.3678371063022,-71.1070346151051 42.3676745085758))')))<br/>as t(id, geom)<br/></code></pre><br/><p><a href="https://i.stack.imgur.com/EvkrK.png" rel="nofollow noreferrer"><img alt="Initial Lines" src="https://i.stack.imgur.com/EvkrK.png"></a></p><br/><p>Producing something like the image below, where each resulting line segment is the shortest possible intersection/difference of the inputs.</p><br/><p><a href="https://i.stack.imgur.com/34A7x.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/34A7x.png"></a></p><br/><h2>What I've tried:</h2><br/><p>A combination of <code>ST_Intersection</code> & <code>ST_Difference</code></p><br/><pre><code>SELECT a.id,a.id||'x'||b.id as join_id, ST_Intersection(a.geom, b.geom) AS segment<br/>FROM stackex a<br/><br/>INNER JOIN stackex b ON ST_Overlaps(a.geom, b.geom)<br/>WHERE b.id < a .id<br/>UNION<br/>SELECT a.id, a.id||'-'||b.id, ST_Difference(a.geom, b.geom) AS segment<br/>FROM stackex a<br/>INNER JOIN stackex b ON ST_Overlaps(a.geom, b.geom)<br/>WHERE b.id <> a .id<br/></code></pre><br/><p>Which almost produces the right set of lines (1-2,3-1,2x1,2-1) but misses 1x2x3 and produces larger lines such as 2-3 below and 2x1 (not pictured, but also not a great example, since 2x1 is a multiline in this case which can be split with ST_Dump). <a href="https://i.stack.imgur.com/ssXoO.png" rel="nofollow noreferrer"><img alt="enter image description here" src="https://i.stack.imgur.com/ssXoO.png"></a></p><br/><p>Would the solution be to set this up as a function with a loop until the resulting line segments are so small that there are no more overlaps? Is there a more elegant solution?</p><br/><br/><h2>Update with more real data</h2><br/><p>There seems to be a problem with the aggregation part of the current answer when using more real-world and complex linestrings. Some of the resulting segments don't join back up with the original geometries in order to aggregate the ids. Heres the data:</p><br/><pre><code>SELECT id, geom INTO stackex2 FROM (VALUES<br/>(1,ST_GeomFromText('LINESTRING(-71.059844 42.359287,-71.059851 42.359347,-71.059869 42.359462,-71.059891 42.359577,-71.059924 42.359691,-71.059992 42.359825,-71.060053 42.359945,-71.060132 42.360065,-71.06021 42.360174,-71.060324 42.360305,-71.060451 42.360426,-71.060581 42.360533,-71.060738 42.360638,-71.060912 42.360729,-71.061131 42.360824,-71.061316 42.3609,-71.061446 42.360944,-71.061609 42.360995,-71.061797 42.361053,-71.062012 42.361107,-71.062251 42.361149,-71.062469 42.361172,-71.062671 42.361182,-71.062881 42.361182,-71.062864 42.361306,-71.062873 42.361305,-71.063716 42.36129,-71.063829 42.361286,-71.064383 42.361273,-71.064554 42.361267,-71.064752 42.36126,-71.065046 42.361246,-71.065518 42.361243,-71.066361 42.361237,-71.066855 42.361233,-71.066972 42.361232,-71.067855 42.361222,-71.068729 42.3612,-71.069896 42.361168,-71.069996 42.361178,-71.070086 42.361206,-71.070309 42.361312,-71.070396 42.361348,-71.07047 42.361371,-71.070593 42.361399,-71.070682 42.361407,-71.070784 42.361406,-71.071159 42.361377,-71.071302 42.361365,-71.071599 42.361342,-71.071724 42.361336,-71.071857 42.361335,-71.071991 42.361342,-71.079054 42.361867,-71.079214 42.361879,-71.079781 42.36192,-71.081515 42.362062,-71.082379 42.362124,-71.082457 42.362127,-71.082596 42.362121,-71.082787 42.362105,-71.08289 42.362102,-71.082972 42.3621,-71.083065 42.362102,-71.083164 42.362107,-71.083245 42.362115,-71.083318 42.362126,-71.08339 42.362139,-71.083362 42.362082,-71.083343 42.362004,-71.083335 42.361956,-71.083299 42.361998,-71.083343 42.362004,-71.083362 42.362082,-71.08339 42.362139,-71.083318 42.362126,-71.083245 42.362115,-71.083164 42.362107,-71.083065 42.362102,-71.082972 42.3621,-71.08289 42.362102,-71.082787 42.362105,-71.082596 42.362121,-71.082457 42.362127,-71.082379 42.362124,-71.081515 42.362062,-71.079781 42.36192,-71.079214 42.361879,-71.079054 42.361867,-71.071991 42.361342,-71.071857 42.361335,-71.071724 42.361336,-71.071599 42.361342,-71.071412 42.361355,-71.071302 42.361365,-71.071159 42.361377,-71.071111 42.361324,-71.071079 42.36127,-71.071024 42.361124,-71.07098 42.361043,-71.070904 42.360956,-71.070738 42.360909,-71.070639 42.360892,-71.070533 42.360886,-71.070432 42.360888,-71.070312 42.360906,-71.070215 42.36093,-71.070131 42.360969,-71.07004 42.361024,-71.070037 42.360904)')),(2,ST_GeomFromText('LINESTRING(-71.096246 42.379862,-71.09602 42.379769,-71.095897 42.379759,-71.09579 42.379721,-71.095696 42.379711,-71.095567 42.379631,-71.094337 42.379181,-71.094215 42.379133,-71.094105 42.379098,-71.093998 42.379063,-71.093871 42.379016,-71.093568 42.378902,-71.093098 42.378718,-71.092866 42.378635,-71.092589 42.378536,-71.092457 42.37849,-71.09222 42.378412,-71.091857 42.378292,-71.091043 42.377988,-71.090633 42.377845,-71.090162 42.377677,-71.089803 42.377519,-71.089267 42.377284,-71.089231 42.37715,-71.089155 42.37687,-71.089119 42.376737,-71.089046 42.376428,-71.088948 42.376189,-71.08878 42.37582,-71.088424 42.374964,-71.08837 42.37484,-71.088206 42.374496,-71.08806 42.374156,-71.088005 42.374087,-71.087935 42.374024,-71.087647 42.373768,-71.087408 42.373597,-71.086987 42.373276,-71.086892 42.373205,-71.086461 42.373053,-71.085213 42.372581,-71.08462 42.37236,-71.0841 42.372297,-71.083721 42.372251,-71.082967 42.372147,-71.0822 42.372045,-71.081339 42.371928,-71.080508 42.371821,-71.07968 42.371713,-71.079483 42.371687,-71.078441 42.371551,-71.078348 42.371544,-71.078273 42.371549,-71.078209 42.371559,-71.078109 42.37158,-71.078051 42.371593,-71.077812 42.371524,-71.077679 42.371474,-71.077649 42.371428,-71.077609 42.371344,-71.077547 42.371298,-71.077039 42.371037,-71.07682 42.370929,-71.076696 42.370865,-71.076636 42.370833,-71.076704 42.370689,-71.076743 42.370606,-71.076923 42.370636,-71.077066 42.370027,-71.076948 42.370011,-71.076612 42.369967,-71.076434 42.369943,-71.076071 42.369895,-71.075759 42.369854,-71.075704 42.370107,-71.075604 42.370097,-71.075499 42.370076,-71.075384 42.370042,-71.075275 42.37,-71.075164 42.370125,-71.075048 42.370066,-71.075106 42.370002,-71.075339 42.369745,-71.075434 42.369644,-71.0755 42.369575,-71.074016 42.368801,-71.073904 42.368744,-71.074023 42.368623,-71.074104 42.368683,-71.07458 42.368927,-71.074761 42.369029,-71.075029 42.369173,-71.075452 42.369373,-71.075561 42.369422,-71.075656 42.369372,-71.075723 42.369405,-71.075824 42.36943,-71.07588 42.369436,-71.075981 42.369434,-71.076043 42.369424,-71.076141 42.369393,-71.076255 42.369322,-71.076335 42.369221,-71.076362 42.369108,-71.076334 42.368994,-71.076284 42.368923,-71.076222 42.368869,-71.07614 42.368823,-71.076031 42.36879,-71.075927 42.368779,-71.075777 42.368795,-71.075693 42.368823,-71.075643 42.368848,-71.07558 42.368892,-71.075522 42.368955,-71.075472 42.368997,-71.0754 42.369006,-71.074722 42.368664,-71.074738 42.368644,-71.074684 42.368616,-71.073908 42.36821,-71.073819 42.368107,-71.073285 42.36783,-71.073279 42.367777,-71.073694 42.367346,-71.073752 42.367329,-71.073824 42.367329,-71.073819 42.367382,-71.073818 42.36744,-71.073823 42.367496,-71.073835 42.367552,-71.073854 42.367604,-71.073888 42.367656,-71.073933 42.36771,-71.073998 42.367776,-71.074039 42.367828,-71.074061 42.367872,-71.074095 42.367956,-71.074108 42.368044,-71.074072 42.36812,-71.074016 42.368175,-71.073631 42.368547,-71.073473 42.368663,-71.073246 42.368884,-71.07313 42.368912,-71.073012 42.368925,-71.072884 42.368907,-71.072799 42.368884,-71.072423 42.36871,-71.071684 42.368346,-71.070729 42.367864,-71.06967 42.367319,-71.069505 42.367236,-71.069279 42.367122,-71.069057 42.367012,-71.06842 42.366678,-71.068738 42.366384,-71.068813 42.366349,-71.069353 42.365872,-71.069455 42.365784,-71.069493 42.365744,-71.069532 42.36569,-71.069597 42.365572,-71.069771 42.36521,-71.070027 42.36468,-71.070385 42.363923,-71.070428 42.363848,-71.070477 42.363778,-71.070549 42.3637,-71.070625 42.36363,-71.070702 42.363574,-71.071661 42.362957,-71.071911 42.362792,-71.072016 42.362712,-71.072111 42.362621,-71.072326 42.362366,-71.072459 42.362204,-71.072504 42.362154,-71.072619 42.362009,-71.072681 42.361914,-71.072742 42.361785,-71.072789 42.361662,-71.072824 42.361553,-71.072896 42.361145,-71.0729 42.361067,-71.072902 42.360992,-71.072896 42.36094,-71.072878 42.36089,-71.072836 42.360803,-71.072739 42.360652,-71.072774 42.360644,-71.072867 42.36062,-71.072989 42.360564,-71.073046 42.360629,-71.072927 42.360679,-71.07284 42.360716,-71.072753 42.360752,-71.072675 42.360778,-71.072594 42.360801,-71.072501 42.360825,-71.072409 42.360842,-71.072305 42.360861,-71.072174 42.360879,-71.07208 42.360885,-71.071981 42.360887,-71.071824 42.360885,-71.071608 42.360867,-71.071496 42.360881,-71.071728 42.360926,-71.071778 42.360826,-71.071563 42.360887,-71.071445 42.360903,-71.07133 42.360907,-71.071134 42.360883,-71.071145 42.36082,-71.071024 42.360804,-71.070882 42.360786,-71.070687 42.360781,-71.07052 42.360802,-71.070407 42.360848,-71.070312 42.360906,-71.070215 42.36093,-71.070131 42.360969,-71.07004 42.361024,-71.069965 42.361058,-71.069888 42.361072,-71.069808 42.361075,-71.06946 42.361076,-71.068745 42.36109,-71.068257 42.3611,-71.067856 42.361109,-71.066958 42.361118,-71.066383 42.361128,-71.066002 42.361129,-71.065515 42.361134,-71.065156 42.361136,-71.064557 42.361147,-71.064152 42.361156,-71.063816 42.361166,-71.063723 42.361168,-71.06337 42.361176,-71.062881 42.361182,-71.062671 42.361182,-71.062469 42.361172,-71.062251 42.361149,-71.062012 42.361107,-71.061797 42.361053,-71.061609 42.360995,-71.061446 42.360944,-71.061316 42.3609,-71.061131 42.360824,-71.060912 42.360729,-71.060738 42.360638,-71.060581 42.360533,-71.060451 42.360426,-71.060324 42.360305,-71.06021 42.360174,-71.060132 42.360065,-71.060053 42.359945,-71.059992 42.359825,-71.059924 42.359691,-71.059891 42.359577,-71.059869 42.359462,-71.059851 42.359347,-71.059847 42.359226,-71.059849 42.359137,-71.059859 42.359026,-71.059874 42.358941,-71.059892 42.358831,-71.059952 42.358715,-71.060021 42.358589)')),(3,ST_GeomFromText('LINESTRING(-71.069246 42.361184,-71.069896 42.361168,-71.069996 42.361178,-71.070086 42.361206,-71.070309 42.361312,-71.070396 42.361348,-71.07047 42.361371,-71.070593 42.361399,-71.070682 42.361407,-71.070784 42.361406,-71.071159 42.361377,-71.071302 42.361365,-71.071599 42.361342,-71.071724 42.361336,-71.071857 42.361335,-71.071991 42.361342,-71.079054 42.361867,-71.079214 42.361879,-71.079781 42.36192,-71.081515 42.362062,-71.082379 42.362124,-71.082457 42.362127,-71.082596 42.362121,-71.082787 42.362105,-71.08289 42.362102,-71.082972 42.3621,-71.083065 42.362102,-71.083164 42.362107,-71.083245 42.362115,-71.083318 42.362126,-71.08339 42.362139,-71.083362 42.362082,-71.083343 42.362004,-71.083299 42.361998,-71.083189 42.361983,-71.082914 42.361964,-71.082808 42.361955,-71.080547 42.361784,-71.080422 42.361774,-71.080316 42.361644,-71.080395 42.361475,-71.081293 42.361237,-71.0815 42.361175,-71.081621 42.361137,-71.081657 42.361198,-71.081939 42.361646,-71.081901 42.361714,-71.081979 42.361766,-71.081963 42.361926,-71.082486 42.361966,-71.082655 42.361998,-71.082723 42.362034,-71.082787 42.362105,-71.082596 42.362121,-71.082457 42.362127,-71.082379 42.362124,-71.081515 42.362062,-71.079781 42.36192,-71.079214 42.361879,-71.079054 42.361867,-71.074732 42.361547,-71.071991 42.361342,-71.071857 42.361335,-71.071724 42.361336,-71.071599 42.361342,-71.071302 42.361365,-71.071159 42.361377,-71.071111 42.361324,-71.071079 42.36127,-71.071024 42.361124,-71.07098 42.361043,-71.070904 42.360956,-71.070738 42.360909,-71.070639 42.360892,-71.070533 42.360886,-71.070432 42.360888,-71.070312 42.360906,-71.070215 42.36093,-71.070131 42.360969,-71.07004 42.361024,-71.070037 42.360984)'))<br/>as a(id,geom)<br/></code></pre><br/><p>Using <code>ST_Overlaps</code> as an additional join for segments that don't join using <code>ST_Contains</code> works on some, but not all of the segments that don't join using <code>ST_Contains</code></p><br/></div><br/><div class="post-text" itemprop="text"> <div style="font-weight: bold;"><p class="normal">Answer</p> <br/></div><br/><p>You can get the smallest intersections of the linework by splitting the unioned linework geometry (blue) by the unioned boundary points from the linework (red).</p><br/><p><a href="https://i.imgur.com/JDSDtwx.png" rel="nofollow noreferrer"><img alt="result" src="https://i.imgur.com/JDSDtwx.png"></a></p><br/><br/><p>In SQL it looks like this, with result in WKT:</p><br/><pre><code>SELECT ST_Split(ST_Union(geom), ST_Union(ST_Boundary(geom)))<br/>FROM stackex;<br/><br/>GEOMETRYCOLLECTION(<br/> LINESTRING(-71.1071774374479 42.3678371063022,-71.1070346151051 42.3676745085758),<br/> LINESTRING(-71.1070346151051 42.3676745085758,-71.1069420616668 42.3675691384874),<br/> LINESTRING(-71.1069420616668 42.3675691384874,-71.1068847478646 42.3675038904688,-71.1070265897396 42.3673507913022),<br/> LINESTRING(-71.1074566182813 42.3678123402605,-71.1071774374479 42.3678371063022),<br/> LINESTRING(-71.1070523458763 42.3679834790295,-71.1071774374479 42.3678371063022))<br/><br/></code></pre><br/><hr /><br/><p>And for bonus points, if you need to label the <code>join_id</code> from the original IDs (as in the figure above), here is how it can be aggregated:</p><br/><pre><code>WITH smallest_segements AS (<br/> SELECT (ST_Dump(ST_Split(ST_Union(geom), ST_Union(ST_Boundary(geom))))).*<br/> FROM stackex<br/>)<br/>SELECT row_number() over() AS rn, join_id, s.geom AS segment<br/>FROM smallest_segements s, LATERAL (<br/> SELECT string_agg(id::text, '+') AS join_id<br/><br/> FROM stackex a<br/> WHERE ST_Contains(a.geom, s.geom)<br/>) l;<br/><br/> rn | join_id | segment<br/>----+---------+----------------------------------------------------------------------------------------------------------------------<br/> 1 | 1+2+3 | LINESTRING(-71.1071774374479 42.3678371063022,-71.1070346151051 42.3676745085758)<br/> 2 | 1+2 | LINESTRING(-71.1070346151051 42.3676745085758,-71.1069420616668 42.3675691384874)<br/> 3 | 2 | LINESTRING(-71.1069420616668 42.3675691384874,-71.1068847478646 42.3675038904688,-71.1070265897396 42.3673507913022)<br/> 4 | 1 | LINESTRING(-71.1074566182813 42.3678123402605,-71.1071774374479 42.3678371063022)<br/><br/> 5 | 3 | LINESTRING(-71.1070523458763 42.3679834790295,-71.1071774374479 42.3678371063022)<br/>(5 rows)<br/></code></pre></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> - <meta content='https://gisqas.blogspot.com/2018/11/postgis-how-to-get-smallest-line.html' itemprop='url'/> <a class='timestamp-link' href='https://gisqas.blogspot.com/2018/11/postgis-how-to-get-smallest-line.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2018-11-25T18:47:00-08:00'>November 25, 2018</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='https://gisqas.blogspot.com/2018/11/postgis-how-to-get-smallest-line.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> <span class='item-control blog-admin pid-1033420059'> <a href='https://www.blogger.com/post-edit.g?blogID=6220276627345324806&postID=5277796193707152856&from=pencil' title='Edit Post'> <img alt='' class='icon-action' height='18' src='https://resources.blogblog.com/img/icon18_edit_allbkg.gif' width='18'/> </a> </span> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5277796193707152856&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5277796193707152856&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5277796193707152856&target=twitter' target='_blank' title='Share to Twitter'><span class='share-button-link-text'>Share to Twitter</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5277796193707152856&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=6220276627345324806&postID=5277796193707152856&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='https://gisqas.blogspot.com/search?updated-max=2018-12-02T07:16:00-08:00&max-results=7&reverse-paginate=true' id='Blog1_blog-pager-newer-link' title='Newer Posts'>Newer Posts</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://gisqas.blogspot.com/search?updated-max=2018-11-25T18:47:00-08:00&max-results=7' id='Blog1_blog-pager-older-link' title='Older Posts'>Older Posts</a> </span> <a class='home-link' href='https://gisqas.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='blog-feeds'> <div class='feed-links'> Subscribe to: <a class='feed-link' href='https://gisqas.blogspot.com/feeds/posts/default' target='_blank' type='application/atom+xml'>Posts (Atom)</a> </div> </div> </div><div class='widget FeaturedPost' data-version='1' id='FeaturedPost1'> <div class='post-summary'> <h3><a href='https://gisqas.blogspot.com/2020/02/arcpy-changing-output-name-when.html'>arcpy - Changing output name when exporting data driven pages to JPG?</a></h3> <p> 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... </p> </div> <style type='text/css'> .image { width: 100%; } </style> <div class='clear'></div> </div><div class='widget PopularPosts' data-version='1' id='PopularPosts1'> <div class='widget-content popular-posts'> <ul> <li> <div class='item-content'> <div class='item-title'><a href='https://gisqas.blogspot.com/2016/10/arcpy-assigning-keyboard-key-to-python.html'>arcpy - Assigning keyboard key to Python script in ArcMap?</a></div> <div class='item-snippet'>I have a python script and I use it through my toolbox but I use it many times in a day. Is it possible to assign a keyboard shortcut to my ...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-thumbnail'> <a href='https://gisqas.blogspot.com/2018/07/highlighting-area-in-google-maps-on.html' target='_blank'> <img alt='' border='0' src='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v9v9JKgQlImNNFzXpYk5JakNNG6r0bMjqaR3yaA4mzoHQrNCBlc6QXUNLULFUQlFOXA-fycq7qxIZ50ENHokpKtzIdUTVZ=w72-h72-p-k-no-nu'/> </a> </div> <div class='item-title'><a href='https://gisqas.blogspot.com/2018/07/highlighting-area-in-google-maps-on.html'>Highlighting area in Google Maps on mouse hover</a></div> <div class='item-snippet'>I want to implement a feature in my app (gmap powered) to highlight the area on mouse over. Much like the functionality in wikimapia. Check ...</div> </div> <div style='clear: both;'></div> </li> <li> <div class='item-content'> <div class='item-thumbnail'> <a href='https://gisqas.blogspot.com/2019/12/javascript-kml-not-overlaying-onto.html' target='_blank'> <img alt='' border='0' src='https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_t-JZfIkIpiU-XFiXuHlY6dd9XtFtFYRqnwqG6FL2LhrXgE-nIOI0s8ON7atoZT7JWi6PinZF4RmXvZ9gM_aqOrOQSiVzrr=w72-h72-p-k-no-nu'/> </a> </div> <div class='item-title'><a href='https://gisqas.blogspot.com/2019/12/javascript-kml-not-overlaying-onto.html'>javascript - Kml not overlaying onto Google Map</a></div> <div class='item-snippet'>I created a basic dashboard with MVC 4, visual studio 2012, The dashboard displays a Google map. Here is an image of the dashboard: My inten...</div> </div> <div style='clear: both;'></div> </li> </ul> <div class='clear'></div> </div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> <div class='sidebar section' id='sidebar-right-1'><div class='widget BlogSearch' data-version='1' id='BlogSearch1'> <h2 class='title'>Search This Blog</h2> <div class='widget-content'> <div id='BlogSearch1_form'> <form action='https://gisqas.blogspot.com/search' class='gsc-search-box' target='_top'> <table cellpadding='0' cellspacing='0' class='gsc-search-box'> <tbody> <tr> <td class='gsc-input'> <input autocomplete='off' class='gsc-input' name='q' size='10' title='search' type='text' value=''/> </td> <td class='gsc-search-button'> <input class='gsc-search-button' title='search' type='submit' value='Search'/> </td> </tr> </tbody> </table> </form> </div> </div> <div class='clear'></div> </div><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2020/'> 2020 </a> <span class='post-count' dir='ltr'>(295)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2020/02/'> February 2020 </a> <span class='post-count' dir='ltr'>(93)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2020/01/'> January 2020 </a> <span class='post-count' dir='ltr'>(202)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/'> 2019 </a> <span class='post-count' dir='ltr'>(2514)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/12/'> December 2019 </a> <span class='post-count' dir='ltr'>(226)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/11/'> November 2019 </a> <span class='post-count' dir='ltr'>(227)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/10/'> October 2019 </a> <span class='post-count' dir='ltr'>(203)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/09/'> September 2019 </a> <span class='post-count' dir='ltr'>(185)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/08/'> August 2019 </a> <span class='post-count' dir='ltr'>(231)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/07/'> July 2019 </a> <span class='post-count' dir='ltr'>(222)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/06/'> June 2019 </a> <span class='post-count' dir='ltr'>(220)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/05/'> May 2019 </a> <span class='post-count' dir='ltr'>(234)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/04/'> April 2019 </a> <span class='post-count' dir='ltr'>(171)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/03/'> March 2019 </a> <span class='post-count' dir='ltr'>(222)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/02/'> February 2019 </a> <span class='post-count' dir='ltr'>(184)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2019/01/'> January 2019 </a> <span class='post-count' dir='ltr'>(189)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/'> 2018 </a> <span class='post-count' dir='ltr'>(2470)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/12/'> December 2018 </a> <span class='post-count' dir='ltr'>(222)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/11/'> November 2018 </a> <span class='post-count' dir='ltr'>(206)</span> <ul class='posts'> <li><a href='https://gisqas.blogspot.com/2018/11/python-arcpy-remove-invalid-character.html'>python - Arcpy remove invalid character</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/exporting-feature-geojson-from-postgis.html'>Exporting Feature GeoJSON from PostGIS?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-does-zonal-statistics-work.html'>qgis - How does Zonal Statistics work exactly?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/python-clipping-vs-intersecting.html'>python - Clipping vs Intersecting</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-layer-with-custom-ui-not-working.html'>qgis - Layer with custom UI not working properly</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcmap-counting-raster-values-in-each.html'>arcmap - Counting raster values in each polygon us...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/style-is-geoserver-plugin-dead.html'>style - Is Geoserver's "styler" plugin dead?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-add-raster-value-to-features.html'>qgis - Add raster value to features AttributeError...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/getting-shapefile-of-river-from.html'>Getting shapefile of river from OpenStreetMap?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-merge-many-individual-kml.html'>qgis - How to merge many individual KML layers int...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/coordinate-system-should-point-data-be.html'>coordinate system - Should point data be equidista...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/python-fiona-preffered-method-for.html'>python - Fiona - Preffered method for defining a s...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcmap-creating-relationship-database.html'>arcmap - Creating relationship database in ArcGIS ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-python-script-for-creating-project.html'>QGIS Python script for creating project file</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-10-geotiff-export.html'>ArcGIS 10 GeoTIFF Export</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-ifthen-field-calculator.html'>arcgis desktop - If/Then Field Calculator Return C...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/reading-feature-class-in-file.html'>Reading feature class in file geodatabase using R?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/raster-what-resampling-technique-should.html'>raster - What resampling technique should be used ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/pyqgis-changing-layer-name-of-output.html'>pyqgis - Changing layer name of output vector from...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-fix-entry-point-for.html'>qgis - How to fix "The entry point for the procedu...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/compute-angle-of-line-in-conventional.html'>Compute Angle of line in conventional bearing usin...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-add-picture.html'>qgis - pyqgis add a picture</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcpy-formatting-dependent-parameters.html'>arcpy - Formatting dependent parameters in Python ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-calculating-incidence.html'>arcgis desktop - Calculating incidence angle of po...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/joining-several-raster-mbtiles.html'>Joining several raster .mbtiles?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-identify-polygons.html'>arcgis desktop - How to identify polygons with "fl...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/how-do-i-get-feature-from-single.html'>How do I get the feature from a single-feature OGR...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-align-label-text-using-expression.html'>qgis - Align label text using an expression</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/spatial-analyst-understanding-arcgis.html'>spatial analyst - Understanding ArcGIS Flow accumu...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/geometry-how-to-calculate-angle-at.html'>geometry - How to calculate the angle at which two...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/postgis-how-to-render-table-with-mixed.html'>postgis - How to render a table with mixed geometr...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/creating-contiguous-pixel-based.html'>Creating contiguous pixel based cartogram using Ar...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/polygon-inner-convex-hulls-in-set-of-2d.html'>polygon - inner convex-hulls in a set of 2D points</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/determining-percent-land-coverage.html'>Determining percent land coverage around points of...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-server-why-has-web-mercator.html'>arcgis server - Why has Web Mercator (auxiliary sp...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-pyqgis-qgsvectorlayer-loading.html'>qgis - PyQGIS QgsVectorLayer() Loading Invalid Lay...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-split-polygon-with-polygon-in.html'>qgis - Split polygon with polygon in different tab...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/web-mapping-using-local-mbtiles-in.html'>web mapping - Using local mbtiles in openlayers?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-randomly-subset-x.html'>arcgis desktop - How to randomly subset X% of sele...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/postgis-how-to-get-smallest-line.html'>postgis - How to get smallest line segments from i...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/rseries-grass-algorithm-in-qgis-32.html'>r.series GRASS algorithm in QGIS 3.2 output no-dat...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcpy-how-do-you-use-folders-as.html'>arcpy - How do you use folders as input/output par...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/google-earth-color-coded-elevation-data.html'>Google Earth - Color Coded elevation data</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/openlayers-2-why-does-geoserver-not.html'>openlayers 2 - Why does Geoserver not serve my pri...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/geoserver-and-openlayers-in-production.html'>GeoServer and OpenLayers in production - Securing ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/processing-vector-to-raster-faster-with.html'>Processing vector to raster faster with R</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-3-selecting-only-visible-features.html'>qgis 3 - Selecting only visible features from diff...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/removing-small-pepper-polygons-from.html'>Removing small "salt & pepper" polygons from layer...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-do-i-calculate.html'>arcgis desktop - How do I Calculate Grouped Percen...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-workaround-large.html'>arcgis desktop - How to workaround large mosaic pr...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/how-to-use-vector-layers-in-qgis-using.html'>How to use "Merge vector layers" in QGIS using Geo...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-copy-attributes-from-many.html'>qgis - How to copy attributes from many columns to...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-polygonize-function-doesn-overlay.html'>qgis - Polygonize function doesn't overlay the sha...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/postgis-transform-to-srid-900913.html'>postgis - Transform to SRID 900913</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/gpx-uploading-shapefile-onto-garmin-gps.html'>gpx - Uploading shapefile onto Garmin GPS, and dis...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/cartography-is-there-name-for.html'>cartography - Is there a name for deformation-base...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/creating-attribute-rules-using-arcpy-in.html'>Creating Attribute Rules using ArcPy in ArcGIS Pro</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/geometry-calculating-spherical-polygon.html'>geometry - Calculating a spherical polygon centroid</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/remote-sensing-ndvi-image-value-changes.html'>remote sensing - NDVI image value changes from -1 ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/convert-exporting-vector-to-kml-with.html'>convert - Exporting vector to kml with ogr2ogr wit...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/change-data-format-in-qgis-field.html'>Change data format in QGIS field calculator using ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/polygon-overlay-in-qgis.html'>polygon - "Identity" overlay in QGIS?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/coordinate-system-gdal-for-reprojection.html'>coordinate system - gdal for reprojection of VSCMO...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-changing-second-line.html'>arcgis desktop - Changing second line text using A...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-integrating-whitebox-gat.html'>arcgis desktop - Integrating Whitebox GAT (free an...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/in-openlayers-zoom-to-extent-of-all.html'>In OpenLayers zoom to extent of all overlays</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/can-postgis-and-qgis-provide-dependable.html'>Can PostGIS and QGIS provide dependable multi-user...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-add-vertex-to-existing.html'>qgis - How to add vertex to an existing polyline p...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/postgis-pgrdijkstra-gives-wacky-routes.html'>postgis - pgr_dijkstra gives wacky routes sometime...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-openlayers-and-osgb-1936-crs-27700.html'>qgis - OpenLayers and OSGB 1936 (CRS 27700)</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/spatial-database-detecting-patterns-in.html'>spatial database - Detecting patterns in vehicle G...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/seeing-qgis-python-commands.html'>Seeing QGIS Python Commands</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-100-how-to-convert-raster-data.html'>arcgis 10.0 - How to convert raster data into regu...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-93-change-symbol-scale-in-arcmap.html'>arcgis 9.3 - Change the symbol scale in ArcMap leg...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-update-xy-fields-when-i.html'>arcgis desktop - Update xy fields when I move points?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/uploading-data-to-trimble-via-pathfinder.html'>Uploading data to trimble via pathfinder</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-322-openlayers-plugin-isn-listed.html'>QGIS 3.2.2 OpenLayers plugin isn't listed to install</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/microstation-fme-features-to-read.html'>microstation - FME Features to read parameter</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/sql-arcpy-cursors-where-clauses-and.html'>sql - Arcpy cursors, WHERE clauses, and date/time ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/is-anzlic-metadata-supported-using-new.html'>Is ANZLIC Metadata supported using the new approac...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/moving-raster-to-different-mapset-grass.html'>Moving raster to different mapset GRASS GIS</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/openlayers-2-how-to-create-wms-service.html'>openlayers 2 - How to create WMS service with GeoS...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/python-overlay-union-geopandas-improve.html'>python - Overlay Union Geopandas improve performance</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-desktop-how-to-fix-shapefile.html'>arcgis desktop - How to fix shapefile projections</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/map-display-not-filling-window-in-qgis.html'>Map display not filling window in QGIS on Mac?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/arcgis-modelbuilder-looping-wrong-tools.html'>ArcGIS ModelBuilder looping wrong tools?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/wfs-geoserver-cql-cross-layer.html'>wfs - Geoserver CQL Cross Layer Intersection Failing</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-stgeometry-to-sdogeometry.html'>qgis - ST_GEOMETRY to SDO_GEOMETRY</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/performing-idw-interpolation-in-qgis.html'>Performing IDW interpolation in QGIS?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/python-odd-behavior-in-qgis-plugin-my.html'>python - Odd behavior in a QGIS plugin: my functio...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/rotate-geometry-generator-marker-line.html'>Rotate geometry generator marker line depending on...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/gis-principle-raster-vs-grid-vs-lattice.html'>gis principle - Raster vs Grid vs Lattice terminol...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-update-attribute-table-of.html'>qgis - How to update the attribute table of featur...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-where-to-find-qgsaffine-in-menu.html'>qgis - Where to find qgsaffine in the menu?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-remove-abnormalities-from.html'>qgis - How to remove abnormalities from the Green ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/r-return-utm-zone-that-wgs84-point.html'>R: Return the UTM zone that a WGS84 point belongs to</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/python-applying-layer-file-not.html'>python - Applying layer file not formating labels ...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/qgis-how-to-use-map-composer-in-stand.html'>qgis - How to use map composer in a stand-alone sc...</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/when-is-3d-visualisation-in-gis-useful.html'>When is a 3D Visualisation in GIS Useful?</a></li> <li><a href='https://gisqas.blogspot.com/2018/11/how-to-join-external-tables-with.html'>How to join external tables with a shapefile's att...</a></li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/10/'> October 2018 </a> <span class='post-count' dir='ltr'>(209)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/09/'> September 2018 </a> <span class='post-count' dir='ltr'>(205)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/08/'> August 2018 </a> <span class='post-count' dir='ltr'>(211)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/07/'> July 2018 </a> <span class='post-count' dir='ltr'>(189)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/06/'> June 2018 </a> <span class='post-count' dir='ltr'>(198)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/05/'> May 2018 </a> <span class='post-count' dir='ltr'>(230)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/04/'> April 2018 </a> <span class='post-count' dir='ltr'>(215)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/03/'> March 2018 </a> <span class='post-count' dir='ltr'>(211)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/02/'> February 2018 </a> <span class='post-count' dir='ltr'>(180)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2018/01/'> January 2018 </a> <span class='post-count' dir='ltr'>(194)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/'> 2017 </a> <span class='post-count' dir='ltr'>(2551)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/12/'> December 2017 </a> <span class='post-count' dir='ltr'>(218)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/11/'> November 2017 </a> <span class='post-count' dir='ltr'>(210)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/10/'> October 2017 </a> <span class='post-count' dir='ltr'>(203)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/09/'> September 2017 </a> <span class='post-count' dir='ltr'>(198)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/08/'> August 2017 </a> <span class='post-count' dir='ltr'>(215)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/07/'> July 2017 </a> <span class='post-count' dir='ltr'>(235)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/06/'> June 2017 </a> <span class='post-count' dir='ltr'>(185)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/05/'> May 2017 </a> <span class='post-count' dir='ltr'>(205)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/04/'> April 2017 </a> <span class='post-count' dir='ltr'>(192)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/03/'> March 2017 </a> <span class='post-count' dir='ltr'>(227)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/02/'> February 2017 </a> <span class='post-count' dir='ltr'>(209)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2017/01/'> January 2017 </a> <span class='post-count' dir='ltr'>(254)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/'> 2016 </a> <span class='post-count' dir='ltr'>(2612)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/12/'> December 2016 </a> <span class='post-count' dir='ltr'>(234)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/11/'> November 2016 </a> <span class='post-count' dir='ltr'>(182)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/10/'> October 2016 </a> <span class='post-count' dir='ltr'>(231)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/09/'> September 2016 </a> <span class='post-count' dir='ltr'>(209)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/08/'> August 2016 </a> <span class='post-count' dir='ltr'>(256)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/07/'> July 2016 </a> <span class='post-count' dir='ltr'>(206)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/06/'> June 2016 </a> <span class='post-count' dir='ltr'>(201)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/05/'> May 2016 </a> <span class='post-count' dir='ltr'>(230)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/04/'> April 2016 </a> <span class='post-count' dir='ltr'>(197)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/03/'> March 2016 </a> <span class='post-count' dir='ltr'>(255)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/02/'> February 2016 </a> <span class='post-count' dir='ltr'>(201)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2016/01/'> January 2016 </a> <span class='post-count' dir='ltr'>(210)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/'> 2015 </a> <span class='post-count' dir='ltr'>(2324)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/12/'> December 2015 </a> <span class='post-count' dir='ltr'>(218)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/11/'> November 2015 </a> <span class='post-count' dir='ltr'>(195)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/10/'> October 2015 </a> <span class='post-count' dir='ltr'>(193)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/09/'> September 2015 </a> <span class='post-count' dir='ltr'>(206)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/08/'> August 2015 </a> <span class='post-count' dir='ltr'>(203)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/07/'> July 2015 </a> <span class='post-count' dir='ltr'>(208)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/06/'> June 2015 </a> <span class='post-count' dir='ltr'>(210)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/05/'> May 2015 </a> <span class='post-count' dir='ltr'>(205)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/04/'> April 2015 </a> <span class='post-count' dir='ltr'>(220)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/03/'> March 2015 </a> <span class='post-count' dir='ltr'>(226)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/02/'> February 2015 </a> <span class='post-count' dir='ltr'>(179)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gisqas.blogspot.com/2015/01/'> January 2015 </a> <span class='post-count' dir='ltr'>(61)</span> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='sidebar no-items section' id='sidebar-right-2-1'></div> </td> <td class='columns-cell'> <div class='sidebar no-items section' id='sidebar-right-2-2'></div> </td> </tr> </tbody> </table> <div class='sidebar no-items section' id='sidebar-right-3'></div> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <table border='0' cellpadding='0' cellspacing='0' class='section-columns columns-2'> <tbody> <tr> <td class='first columns-cell'> <div class='foot no-items section' id='footer-2-1'></div> </td> <td class='columns-cell'> <div class='foot no-items section' id='footer-2-2'></div> </td> </tr> </tbody> </table> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='Footer'><div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> Theme images by <a href='http://www.istockphoto.com/portfolio/enot-poloskun?platform=blogger' target='_blank'>enot-poloskun</a>. Powered by <a href='https://www.blogger.com' target='_blank'>Blogger</a>. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/1807328581-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY7MVZQR8SOcTqVDQNr-BxF4mTxW9w:1714141363616';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d6220276627345324806','//gisqas.blogspot.com/2018/11/','6220276627345324806'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '6220276627345324806', 'title': 'Blog', 'url': 'https://gisqas.blogspot.com/2018/11/', 'canonicalUrl': 'https://gisqas.blogspot.com/2018/11/', 'homepageUrl': 'https://gisqas.blogspot.com/', 'searchUrl': 'https://gisqas.blogspot.com/search', 'canonicalHomepageUrl': 'https://gisqas.blogspot.com/', 'blogspotFaviconUrl': 'https://gisqas.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en-GB', 'localeUnderscoreDelimited': 'en_gb', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Blog - Atom\x22 href\x3d\x22https://gisqas.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22Blog - RSS\x22 href\x3d\x22https://gisqas.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Blog - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/6220276627345324806/posts/default\x22 /\x3e\n', 'meTag': '', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/16e657cb9c57b8a2', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'Twitter', 'key': 'twitter', 'shareMessage': 'Share to Twitter', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en_GB\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'archive', 'pageName': 'November 2018', 'pageTitle': 'Blog: November 2018'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard', 'ok': 'Ok', 'postLink': 'Post link'}}, {'name': 'template', 'data': {'name': 'custom', 'localizedName': 'Custom', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': true}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'Blog', 'description': '', 'url': 'https://gisqas.blogspot.com/2018/11/', 'type': 'feed', 'isSingleItem': false, 'isMultipleItems': true, 'isError': false, 'isPage': false, 'isPost': false, 'isHomepage': false, 'isArchive': true, 'isLabelSearch': false, 'archive': {'year': 2018, 'month': 11, 'rangeMessage': 'Showing posts from November, 2018'}}}]); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/3627635519-lbx__en_gb.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/13464135-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_FeaturedPostView', new _WidgetInfo('FeaturedPost1', 'main', document.getElementById('FeaturedPost1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_PopularPostsView', new _WidgetInfo('PopularPosts1', 'main', document.getElementById('PopularPosts1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogSearchView', new _WidgetInfo('BlogSearch1', 'sidebar-right-1', document.getElementById('BlogSearch1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar-right-1', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); </script> </body> </html>