texts: Making a map that can be easily resized or scaled

texts:
I've recently been dealing with a map requestor who wants maps resized at the very last minute -- from 8.5x11 to 22x34, or from large poster-sized to "something that can fit in a report" (those vague ones are the best). Obviously there are some "people management" things I can do to help him better plan his projects and requests, but beyond that I still need to produce multiple sizes of the same map with a minimum of time investment.

It is tedious to manually adjust all the elements -- legend, title, labels, various text fields -- to create a new layout. I did find "Scale Map Elements proportionally to changes in Page Size" in the Page and Print Setup dialog:

However, it still leaves me with things to do:

It doesn't work on all map elements (particularly text rectangles)
It does nothing to the labels within the map; the 16-point font labels that are great for large poster maps are much too large for small figures (and similar scale issue if making the map bigger)

What are additional strategies for making an ArcMap layout more easily scalable? (My goal is to have as few font-size tweaks as possible.)


texts: Error msg "Name is not defined" when trying to populate a field with the shape file name

texts:
I am trying to populate a field with corresponding file name. For example, if the file name is Route1.shp then the field value will be Route1 as well. However my code is not working. Can you please suggest a code that works? The code I used is given below, along with the error message

    import arcpy, os, sys
    from arcpy import env
    arcpy.env.overwriteOutput = True
    env.workspace = r"C:\ABC\GIS"
    fc_tables = arcpy.ListFeatureClasses ("R*")
    for fc in fc_tables:
        field = "RouteName"
        arcpy.AddField_management (fc, field, "TEXT")
    for fc in fc_tables:
    arcpy.CalculateField_management (fc, field, str(fc), "PYTHON")

And this is the error message

  Runtime error  Traceback (most recent call last):   File "",
  line 2, in    File "c:\program
  files\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3128, in
  CalculateField     raise e ExecuteError: ERROR 000539: Error running
  expression: Route1.shp  Traceback (most recent call last):   File
  "", line 1, in  NameError: name 'Route1' is not
  defined  Failed to execute (CalculateField).


texts: How to align two rasters of exact same cell size, extent in ArcGIS DEsktop?

texts:
I have two raster datasets. One is already georeferenced.
The second one is not georeferenced but should have the exact same extent and cell size as the first one. It is supposed to exactly overlap the first one.

Is there an easy way to have the second raster adopt the same georeferencing information as the first one?

This is all in ArcGIS 10.

I should add that the second raster was derived from the first one. I exported the first one and ran some analyses on it using a C++ tool I wrote, now I want to get the output back into ArcGIS. So the two layers will definitely overlap, it's just a matter of giving the second raster the right cell size/extent.


texts: Vector Intersect QGIS (1.8.0) Gives empty shapefile

texts:
I am trying to find points that fall within a polygon. Both layers are vector ESRI shapefiles. I used the fTools based intersect under Vector>GeoprocessingTools>Intersect. The output is an empty shapefile and I get the following warning:

Warnings: Feature geometry error: One or more output features ignored
due to invalid geometry. Some output geometries may be missing or
invalid.

I first tried this with layer of ~519 points and a complex polygon layer outline of the city limits of a city. I then made a new shapefile with just 6 points with some inside and some outside a polygon in a separate layer that I also drew. I got similar results. With this error:

Warnings:
Feature geometry error: One or more output features ignored due to
invalid geometry. Some output geometries may be missing or invalid.

I used the geometry check tool to check both layers and got no errors.
If I use the same two simple layers and clip the point layer with the polygon layer I get what I want (i.e. all the points that fall within the polygon but not those outside the polygon).
If I use the spatial query tool (Vector>SpatialQuery) I get the results I want as a selection.
In my original use and with the simple polygons, both shapefiles share the same CRS.
My question is, am I misunderstanding what the Geoprocessing tool Intercept does or am I missing some requirement of this tool or is it just working incorrectly?


texts: Draw order (zIndex) of OpenLayers polygons and points in the same layer

texts:
My question is similar but slightly different to: https://stackoverflow.com/questions/5003349/openlayers-vector-features-z-indexing

I have an OpenLayers Vector layer which contains polygons and points from PostGIS. I do not want to create a separate table for each entity. I have a StyleMap set for the layer and have zIndexing set to true. My points are using an external graphic and my polygons just a normal style.

Problem: I cannot get the external graphic to render above the the polygons. If I used a normal point then it does render above the polygons. I believe I've tried all combinations of graphicZIndex and zIndex for the point and polygon layers.

Layer def:

        var lyrJamoats = new OpenLayers.Layer.Vector("Jamoats", {
                strategies : [new OpenLayers.Strategy.Fixed()],
                styleMap : Styles.styleJamoat,
                rendererOptions : {
                    zIndexing : true
                },
                protocol: {protocol stuff}
    });

Style def:

styleJamoat : new OpenLayers.StyleMap({
    "default" : new OpenLayers.Style(null, {
        rules : [new OpenLayers.Rule({
            symbolizer : {
                "Point" : {
                    fillColor : "#ffcc66",
                    strokeColor : "#ff9933",
                    strokeWidth : 2,
                    graphicZIndex : 1000,
                    //zIndex: 99999999,
                    externalGraphic : "./img/jamoat_pin.png",
                    pointRadius : 30
                },
                "Polygon" : {
                    strokeWidth : 2,
                    strokeOpacity : 1,
                    strokeColor : "#FFFFFF",
                    fillColor : "#002776",
                    fillOpacity : 0.75,
                    zIndex: 0
                    //graphicZIndex: 0,
                }
            }
        })]
    }),


texts: Refresh a georeferenced image after modifying its worldfile

texts:
I have several raster layers which each layer is created from an image and its worldfile for georefencing.
I want to refresh the layers after changing the world files.
I have tried the code below but it does not refresh the image layer.
The image layers stay unchanged.
I am using QGIS 3.2.3. The code below is developed for a plugin.
# get the active layer
selected_layer = self.iface.mapCanvas().layers()
for layer in selected_layer:
    layer.setCacheImage(None)
    layer.dataProvider().reloadData()
    layer.triggerRepaint()


texts:
I just installed a tiles server in a VM following this tutorial, everything seems to work. I can see the image exemple on http://localhost/osm_tiles/0/0/0.png like it's supposed to be...

Now, I would like to "open" my tiles in QGIS, using WMS (or whatever) protocol.

I'm new in GIS and a bit lost about what I'm supposed to do.

So, I'm using CentOS 6.x, mod_tile, renderd, mapnik, osm2pgsql and a PostgreSQL/PostGIS database.


texts: Heatmap plugin with relatively small area

texts: I'm trying to make a heatmap using points in a relatively small area (about 50km by 50km) and I just get a single red block every time (even after switching the color map to 'pseudocolor'). I've read several tutorials on how to make heat maps and it works when I use a larger area. Is there a limitation of the plugin so that it doesn't work with small areas, or am I just doing something wrong?


texts:
I'm reading a Shapefile with PySAL in order to do some anlysis. The shapefile's DBF contains three columns, "id", "count" and "population". All three are large integers with no Null values.

I try to prepare variables with the following code:

cnt = data.by_col_array('count')
pop = data.by_col_array('population')

cnt works fine and returns with the expected values, but pop becomes an array filled with None types. I write the shapefile with FME and have verified that there are no missing values and the datatypes are the same. Looking at the file in QGIS it shows up fine.

Is there any obvious place to start looking here?


texts:
What is the format in which SAR images are stored? By format I mean when a SAR captures an image, it gets saved in what format? jpg? png? tiff? or there is some other special format?

Is there a single format, or are there multiple formats?

I also want to know if SAR is itself a sensor or not? I mean, all satellites having a SAR will have the same sensors for acquiring images, or the sensors can be different?

Does LANDSAT use a SAR also for image acquisition, among other sensors?


texts: I'm trying to build a model in modelbuilder, and as part of that, I'd like to use the dissolve tool on a feature class created/modified after some previous steps. However, when I try to connect this feature class, I'm not given the option to use it as an input, only a precondition. Is this a normal problem with Dissolve? Is there something specific that the table needs to be in order to perform the Dissolve? I've attached a snippet of the part of my model leading up to the problem to help.


texts: Import Files failed with cartoDB installed in Ubuntu 14.04 LTS

texts:
I have successully installed and configured CartoDB in Ubuntu 14.04 LTS VM and could also view the main page of CartoDB interface and login into my development account. But when I try to import any file (CSV or shapefile in zip format), I am getting import error which is decribed as follows.

Error Code : 2001

Error Description : Unable to load the file into database

I have also tried with updating ogr2ogr to ogr2ogr2 as mentioned in the post "https://groups.google.com/forum/#!topic/cartodb/xI15ygEy4Fo" but with no success. Also I have set 777 permissions to /tmp folder.
Note my GDAL version is 1.10.2.


texts: How to implement place auto-complete using nominatim?

texts:
I want to auto complete like Google Place but I don't want to use Google Place API. I got nominatim auto-complete example but it's not working in  Windows 8 because it's implemented in node.js

Can anyone help me?


texts: NullPointerException on OverlapBehavior in SLD

texts:
When rendering raster data, GeoServer (v2.15.0) is reporting a NullPointerException on the OverlapBehavior specified in the SLD :

...
<Rule>
    <RasterSymbolizer>
        <Opacity>1.0</Opacity>

        <OverlapBehavior>
            <AVERAGE/>
        </OverlapBehavior>
        ...

The stacktrace produced by GeoServer :

...
java.lang.NullPointerException: Name is null
    at java.lang.Enum.valueOf(Enum.java:236)
    at org.opengis.style.OverlapBehavior.valueOf(OverlapBehavior.java:30)
    at org.geotools.styling.RasterSymbolizerImpl.setOverlap(RasterSymbolizerImpl.java:380)
    at org.geotools.xml.styling.SLDParser.parseRasterSymbolizer(SLDParser.java:1317)
...

I looked at the AVERAGE-value, and according to the docs and the source-code it should be ok...

@XmlElement("OverlapBehavior")
public enum OverlapBehavior {
    LATEST_ON_TOP,
    EARLIEST_ON_TOP,
    AVERAGE,
    RANDOM;

    private OverlapBehavior() {
    }
}

Why is GeoServer throwing this error ? On our test-environment this SLD is working just fine...
Why is the error messaging saying that the Name is null ?

What am I missing here ?


texts:
Is it possible to label a feature in ArcMap using geometry values?

In this instance I want to label features (polylines) with the Live Z value of the last vertex obtained from the Shape.

However when I try something simple like the XMin of the extent of the shape:

It returns an error:

Is it possible to use the features' geometry to formulate a label? I do not want to calculate values from the geometry into a field and then label that field unless I absolutely have to:

Ideally the label should be live, changing as the feature is modified.

Based on the answer by Felix:

def FindLabel ( [OBJECTID]  ):
  mxd = arcpy.mapping.MapDocument("CURRENT")
  layers=arcpy.mapping.ListLayers(mxd, "WatrcrsL")
  lr=layers[0]
  with arcpy.da.SearchCursor(lr, 'Shape@','OBJECTID = '+str( [OBJECTID] )) as cursor:
      for row in cursor:
         a=row[0].lastPoint.Z
  return a

Will label the features with the last points' Z value live!


texts: Update Existing Feature Class by Replacing Features with Updated Versions from a Shapefile

texts:
I have a feature class in a versioned ArcSDE geodatabase with archiving enabled. I receive regular updates for this data in shapefile format. I want to be able to replace any features that have changed with the new version from the shapefile. How can I do that without recreating the feature class and thus losing my archived history?

I have gotten as far as identifying which features have changed, been added, or been deleted. But how to I select all of the features in the existing feature class that have the same ID as the changed/deleted features in the updated data and replace them with the updated features?


texts:
I what to create many lines with this code:

v_layer = QgsVectorLayer("LineString", "cable", "memory")
pr = v_layer.dataProvider()
seg = QgsFeature()
seg.setGeometry(QgsGeometry.fromPolyline([line_start, geomPoint]))
pr.addFeatures( [ seg ] )
v_layer.updateExtents()
QgsMapLayerRegistry.instance().addMapLayers([v_layer])

Buth this create one layer for each of this code.

How can I create all in one layer.


texts: Hibernate and Mysql gives "Geometry byte string must be little endian." error

texts:
I'm using mysql and wildly.

I want to look for points in a given polygon. My method looks like:

public Response getGeoJsonByBox(
                                    @QueryParam("topLeftX") double topLeftX,
                                    @QueryParam("bottomRightX") double bottomRightX,
                                    @QueryParam("topLeftY") double topLeftY,
                                    @QueryParam("bottomRightY") double bottomRightY) {

        Envelope viewPort = new Envelope(topLeftX, bottomRightX, topLeftY, bottomRightY);
        List<Stammdaten> stammdatenList = em.createQuery("select s from Stammdaten s where contains(:viewPort, s.coordinate) = true")
                .setParameter("viewPort", viewPort)
                .getResultList();
return stammdatenList;}

But I got the error:

Caused by: java.sql.SQLException: Geometry byte string must be little endian.

My Entity looks like:

@Entity
@Table(name = "partner_stammdaten")
@XmlRootElement(name = "stammdaten")
@XmlAccessorType(XmlAccessType.FIELD)
@NamedQuery(name = Stammdaten.all, query = "SELECT s from Stammdaten s")
public class Stammdaten extends GeoJson
        {

    public static final String all = "all";
    public static final String viewPort = "getByViewPort";

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    @XmlElement
    private String name;
    @XmlElement
    private String strasse;
    @XmlElement
    private String hausnummer;
    @XmlElement
    private String ort;
    @XmlElement
    private String plz;
    @XmlElement
    private int rating;
    private double longtitude;
    private double latitude;
    private Point coordinate;
    private int placeId;
    private String osmId;

    public Stammdaten() {

    }

//Getters/Setters and other implementation

}

So by the documentation of hibernate spatial the contains method is available for mysql.
And both of the objects passed to my method are a type of geometry.

So I haven't any idea why this error happens.

Any idea on this would be nice.


texts: Difference between Geodetic Distance and Great Circle Distance?

texts:
According to Wikipedia:

  The great-circle distance or orthodromic distance is the shortest distance between two points on the surface of a sphere, measured along the surface of the sphere (as opposed to a straight line through the sphere's interior). The distance between two points in Euclidean space is the length of a straight line between them, but on the sphere there are no straight lines. In spaces with curvature, straight lines are replaced by geodesics. Geodesics on the sphere are circles on the sphere whose centers coincide with the center of the sphere, and are called great circles.

Note that the definition also mentions 'Geodesics'

Operationally what is the difference between them?

In ArcMap, the measurement tool allows measuring 'Geodesic' distances but not 'Great Circle' distances. Can these be considered equivalent?

A similar question regarding Planar vs Euclidean distance can be found at Difference between planar and Euclidean distance?


texts: MySql select points contained in polygon

texts:
I am extremely new to mysql, but I cannot find the error in this query

SELECT latitude, longitude from mytable where ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON((47 -67, 47 -123, 21 -78, 47 -67)'), point(longitude, latitude))

The polygon is a triangle that covers most of the US. All of the lat/lng of the points should be inside the above polygon wkt, yet I get no rows. I have reversed the wkt coords in case I had it backwards, but still no luck. I am hoping I have an obvious mistake.


texts: Writing QGIS script to load Output file to Map Project with Desired Name?

texts:
The following line of code produces the output as a shapefile with the name I want ("MyFile") and where I want it ("path"),

path = "/Users/User1/Desktop/"
processing.runandload('qgis:saveselectedfeatures', Input, path+'MyFile.shp')

The actual new output shapefile has been saved on my Desktop with the name "MyFile".

However, the "andload" part of "runandload" places the output ON MY MAP PROJECT with the name "Selection", not "MyFile".

This becomes a problem later in my script if I generate another output file, it too gets added to the map project with the name "Selection", making it impossible to choose between them for subsequent processing.

How should my script be written to load output to the map project with the desired name?


texts: Update Description of Feature Class in SDE or GDB

texts:
I need to add a Description to a Feature Class using arcpy. The feature class lives in our enterprise geodatabase.

The Feature Class does not live in an MXD file, nor will it ever for this script's purposes.

The following code works in ArcMap when applied to a layer in the Table of Contents, however, it does not persist to the dataset within the database.

layer = arcpy.mapping.Layer("layer")
layer.description = "Description of the layer"
layer.save

Any ideas on how to modify the description (and other property values) of Feature Classes within Geodatabases and not MXD files?

I am on ArcGIS 10.2


texts: What are TRW or TRE formatted locations?

texts:
I have data from a U.S. state and for each item, there is a Location ID in the format T##R##E-## Sometimes the E is a W.

What is this format?


texts: Recode Supervised Classification In ArcGIS 10.1

texts:
I have used Supervised classification technique in ArcGIS 10.1 software to generate of Land use/Land cover classification.

In my built-up class, it has been spread out into different other classes.

Now, I would like to recode it (just like in Erdas software).

Any ideas how to fix it?


texts: Can I have access to mapbox baselayer data?

texts:
I am just starting working with mapbox and have a question.
I want to know if I have access to information from the baselayer, for example within a map view to get a set of all objects of type park, so I can do some analysis with them.

I am using Mapbox Studio and I see I can modify css properties using

#landuse[class='park']

Can it be done? Should I use mapbox.js or can I use this inside the studio? Is there an API call for this?


texts: Use a WFS-T layer in d3.js without adding a background map?

texts:
I am currently working on a d3.js project and would like to include a WFS-T layer to my SVG map to display and update location data stored in a PostGIS database. I know that I need to transform my layer to a geoJSON format for d3.js to be able to read the data. But this would mean that I break my WFS-T logic and I am not able to update my data (?). Also I don't want to add a background map (e.g. from openlayers) to the map. Finally I need to display the data on a globe (like this), which is another reason I cannot use openlayers.

Can anybody point me to a strategy how to solve this?


texts: OpenLayers: Animate fitExtent call by passing extent

texts:
How can you animate the fitExtent call, so the map slowly zooms and scrolls to the newly set extent.

What I have is similar to this answer: https://stackoverflow.com/a/23401232/639035

var source = new ol.source.Vector();
...

map.getView().fitExtent(source.getExtent(), map.getSize());

Now I have a "button", which sets a new fitExtent, where I want to have a smooth animation.

What I found so far:
OpenLayers Animation example http://openlayers.org/en/v3.1.0/examples/animation.html

However this doesn't use ol.Extent and fit(extent


texts: QGIS georeferenced image does not apear in the map area

texts:
I'm having issues with some georeferenced images in QGIS 2.10.1-Pisa.

I generally georeference PDF's of new land subdivisions over aerial photos to get the layout of the new subdivision, generally it works fine. Occasionally I go through the process of georeferencing the image and when finished the overlay doesn't show up on the map area.

When I look at the layer property the overlay shows as a thumbnail but not on the screen.

All that shows on the screen are the little red dots indicating the reference points I use to georeference the overlay so I assume the CRS settings are correct as the dots appear in the right places.

I have tried most settings that I can think of however I can't get the image to appear.


texts: ArcMap 10.4 Find the size of a service area?

texts: I have a service area for two fire stations, and I'm trying to find out the size of the service areas. But for the life of me, I can't find how to get that information.


texts:
How do you go about correcting USPS Zip Code polygons? I have an address with a zip code assigned and recognized by the USPS. However, when I look at the USPS Zip Code polygon map I see the wrong polygon for the location of the residence. The address is for a newly built house so I suspect the Zip Code polygon map is just outdated and in need of a fix.

The wrong polygon also shows up on Google Maps. When signing up for services with the address, I typically have to lie by putting the Zip for the wrong polygon in order to pass the address validation step. To get navigation software to work I have to enter the wrong zip. My guess is these problems all stem from the outdated polygon map.

My understanding is that Google Maps and other services get their Zip Code polygon data from the USPS which publishes updates monthly. Is that right?

If so, what's the procedure for getting the USPS to fix the polygon such that the fix is included in the next monthly update and flows down to the Google Maps of the world?


texts: QGIS Scale Problem (it starts with 0.000xx)

texts:
Iam new here and i'm beginner of QGIS..

My problem is the Shapefiles i have is very very small, the scale is starts with 0.0000xx.

please help ASAP. it so very important in our Municipality.


texts:
Running on QGIS 2.14.2 for Mac OS X.

I installed Flowmapper and prepared the three files required in txt format (node coordinates, node names, matrix).

Flowmapper imports the files OK through its dialog box, but then takes into account only the first node, and no arrows.

Is there another step required in order to have Flowmapper chart the rest of my data?


texts: ArcGIS TabulateArea() :: Recommend Ratio of Zone Area to Value Raster Cell Size?

texts:
Any recommended ratio of zone area / raster cell size when running small input zones with ArcGIS Tabulate Area Tools?
Esri mentions:

If the zone input is a feature dataset with relatively small features, keep in mind that the resolution of the information needs to be appropriate relative to the resolution of the value raster. If the areas of single features are similar to or smaller than the area of single cells in the value raster, in the feature-to-raster conversion some of these zones may not be represented.
To demonstrate this, try converting the feature dataset to a raster with the appropriate feature-to-raster conversion tool and specify the resolution to be that of the Value raster. The result from this conversion will give an indication about what the default output of the zonal operation will be.
If you have fewer results in the output than you may have expected, you need to determine an appropriate raster resolution that will represent the detail of your feature input, and use this resolution as the Cell Size of the Raster Analysis Settings of the Environment.


texts: I'm using ArcGIS 10.1 and I have two line shapefiles. I know there is a way to make one shapefile follow the contour of the base shapefile but I can't figure how it is done. How can I make the blue shapefile lines align with the brown base lines? In other words apply the line configuration to the blue shapefile based on proximity?


texts: I want to build weighted Voronoi diagram in R, as in How to draw weighted voronoi polygons (thiessen) from points in QGIS? or Create weighted Thiessen polygons?, but I could not find any function for that. I have average coding skills for R, but not enough for this task. Is there any function available?


texts: Layers are not Responding in ArcGIS Online Webmap

texts:
I am using the same layer for six layers in this webmap: http://www.arcgis.com/home/item.html?id=a69b1cbde859433ba816ab0e036712b8.

I am getting a "not responding" error and only half of the layers are drawing properly.  Any ideas why this is happening?


texts: gdal's polygonize function (via qgis) is not turning monochrome rasters into readable shapefiles regardless of inversion of color scale

texts:
I've tried polygonizing this monochrome bitmap as this:

and this:

and either way it ends up looking like this when (zoomed in) after gdal's polygonize operation:

Is there any way I can tell it which binary component I want to be the shape and which I want to be the void?


texts: Using an ArcSDE Connection through Python

texts:
I would like to run a script on a ArcSDE feature class. The script runs perfectly when I hard code a shapefile, but is unable to connect to an ArcSDE database. The purpose of the script is to assign odd valued UIDs, and generate a dbf as an output with selected fields.

import arcpy
from arcpy import management as dm
arcpy.env.overwriteOutput = True

# Set environment path to SDE connection
arcpy.env.workspace = r"C:\Users\client\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog\OZ@DB_MAPS.sde"

# Define fc name, DBF output location, and DBF output name
fc = "DB.OZ.PlantCenter"
gisID = "GIS_2016_0"
dbfLocation = r"C:\Users\client\data"
dbfOutputName = "trees_GIS"

if arcpy.Exists(fc):
    arcpy.AddMessage("The feature class exists")
else:
    arcpy.AddError("The feature class does not exist")

with arcpy.da.UpdateCursor (fc, gisID) as cursor:
    for row in cursor:
        if row[0] == None:
            row[0] = 0
            cursor.updateRow(row)

# Query out odd values in "GIS_2016_0"
odd = []
even = []
oddCursor = arcpy.SearchCursor(fc)
for row in oddCursor:
    uid = row.getValue (gisID)
    if uid %2 == 1:
        odd.append (uid)
    else:
        even.append (uid)

field = arcpy.AddFieldDelimiters(fc,gisID)
odd_sql = ' OR '.join('%s = %s' %(field,i) for i in odd)
dm.MakeFeatureLayer(fc, "fc_temp")
dm.SelectLayerByAttribute("fc_temp", "NEW_SELECTION", odd_sql)

# Search for the latest maximum odd value
maxCursor = arcpy.da.SearchCursor("fc_temp", gisID)
FirstRecord = True
for row in maxCursor:
    if FirstRecord:
        FirstRecord = False
        maxValue = int(row[0])
    else:
        maxValue = max(int(row[0]),maxValue)

if (maxValue % 2 == 1): #odd
    # Define the function to assign incrementing odd values
    def autoIncrement (start=0, step=1):
        i = start
        while 1:
            yield i
            i+=step

    # Query for new attributes with no assigned unique ID, and populate with a number following the last largest odd value
    zero_qry = '"' + gisID + '" = ' + "0"
    dm.MakeFeatureLayer(fc, "fc_temp")
    dm.SelectLayerByAttribute("fc_temp", "NEW_SELECTION", zero_qry)
    incrementCursor = arcpy.UpdateCursor ("fc_temp")
    nextValue = maxValue + 2
    incrementer = autoIncrement (nextValue, 2)
    for row in incrementCursor:
        row.setValue(gisID, incrementer.next())
        incrementCursor.updateRow(row)
else:
    arcpy.AddMessage("No odd unique IDs found.")

# Delete previous dbfs and export the feature class as a dbf with selected fields (overwrite)
dbfPath = dbfLocation + '\\' + dbfOutputName + '.dbf'
if arcpy.Exists(dbfPath):
    dm.Delete(dbfPath)
arcpy.TableToTable_conversion (fc, dbfLocation, dbfOutputName)

# Get all fields in dbf and remove unwanted fields
fields = arcpy.ListFields("fc_temp")
keepFields = ['GIS_2016_0', 'SourceAcce', 'AccessionC', 'SectionNam', 'Longitude', 'Latitude']
dropFields = [x.name for x in fields if x.name not in keepFields]
dm.DeleteField (dbfPath, dropFields)
dm.Delete("fc_temp")

When the client ran this script through task scheduler using a basic task, the script returned no errors, but no output was produced.

New edit 01/13/2017:

The client ran the script in Arc, and was provided this error message:

I believe this SDE layer is versioned, so it might be related to the issue here: https://geonet.esri.com/thread/88268

Any thoughts on how to resolve the code?


texts:
So I saw an example of animating plane on a route, based on Mapbox. Here the example:
    https://www.mapbox.com/mapbox-gl-js/example/animate-point-along-route/

I wonder, is it possible to use them to ArcGIS, how could it be? Not so familiar with both of GIS, is it any tutorial or any related documentation?


texts:
I am attempting to create a simple basemap selector to use in a leaflet map to assist in selecting a basemap of interest. I've created a new Select control that works great in a computer browser but does not respond when accessed via mobile device. I am guessing the mouse events in the following line of code are causing the problem:

this._baseLayerDropDown.firstChild.onmousedown = this._baseLayerDropDown.firstChild.ondblclick = L.DomEvent.stopPropagation;

However, I have no idea how to reengineer this line to make the Select responsive in the mobile environment. Anyone have any ideas? Here is a larger sample of my code:

basemapControl = L.Control.extend({
    options: {
        position: 'bottomleft'
    },

    onAdd: function (map) {
        // create the control container with a particular class name
        this._initLayout();
        return this._container;
    },
    _initLayout: function(){
        var className = 'basemapControl'
        var container = this._container = L.DomUtil.create('div', className);
        // var form = this._form = L.DomUtil.create('form', className + '-list');
        this._baseLayersList = L.DomUtil.create('div', className + '-base');
        container.appendChild(this._baseLayersList);

        this._baseLayerDropDown = L.DomUtil.create('div', 'basemapDropDown', this._baseLayersList);
        this._baseLayerDropDown.innerHTML = '<select id = "basemapSelect" style="width: 100px"><option value = "Streets">Streets</option><option value = "Aerials">Aerials</option><option value = "Zoning">Zoning</option></select>';
        this._baseLayerDropDown.firstChild.onmousedown = this._baseLayerDropDown.firstChild.ondblclick = L.DomEvent.stopPropagation;
        L.DomEvent.on(this._baseLayerDropDown, 'change', this._onBaseLayerChange,this);

    },

Any hints would be greatly appreciated.

Best Regards, Tyler


texts: What do the numbers in the intersection Matrix in the JTS TestBuilder mean?


texts: Set size of points independent from map scale

texts:
In ArcGIS the size of a point feature is constant independent from the map scale. In QGIS when I zoom in the point get smaller and when I zoom out they get bigger. How can I fix the point size?

What I mean is: Assuming the point is a manhole in a street. In the following picture it Looks like we have a very small manhole in a wide street.

In this image it looks like the manhole covers half of the street width

Here it seems the manhole is as wide as the street


texts: Link pdf/jpeg to locations in QGIS all coming from a standard folder

texts:
I am currently making a geotechnical database for a company as a student.
One of the goals is to locate all CPT data and make it so that if someone clicks on the CPT location they get an image of (or a link to) the cpt results.
The data would be in a folder together with the QGIS project which would be transferred within the company.

So, they would get a folder from me and if they open it on their pc they should be able to just run the qgis project and have acces to the hyperlinks.

What is the best method to do this?


texts: Publishing PostGis table using GeoServer REST returns error when geometry column is NOT named "geom"

texts:
I tried publishing an existing PostGis table with geometry column named "wkb_geometry" to Geoserver using its REST API. I used the following command:

curl -v -u admin:geoserver -X POST -H "Content-type: text/xml" -d "<featureType><name>boundary</name></featureType>" http://mygeoserver:8080/geoserver/rest/workspaces/myworkspace/datastores/mypostgis/featuretypes

however, the server returned:

> <featureType><name>adminbnd_prov_xxx</name></featureType>HTTP/1.1 500 Internal
 Server Error
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Server: Jetty(6.1.8)
:java.io.IOException: Error occured calculating bounds* Connection #0 to host
mygeoserver left intact
* Closing connection #0

One thing I found out is that if I renamed my geometry column from "wkb_geometry" to "geom" and execute again the command, the PostGis table is published successfully.

Using Geoserver's web interface, this is a not an issue. You can publish PostGis tables regardless of its geometry column name.

Is this the default behaviour for the REST api? Is there any workaround on this? What does "error occured calculating bounds" has to do with it?

Thanks a lot!


texts: I want to label multiple lines (segments) of a bike path. Every segment represents a part of the bike path which has a number and a specific measure assigned to it to meet the quality standards one day. The label should show the segment number. Unfortunately, the callout line begins mostly at the beginning or the end of each segment/line. Is it possible to have a callout line just point horizontally/vertically from the label to the line (segment) with the "new" callout line option or should I use the "old" geometry generator for this and if so, how? (QGIS 3.16)


texts: Converting AutoCAD blocks to ArcGIS symbols?

texts:
Im trying to import AutoCAD blocks into ArcGIS. The polyline part of the symbols in these blocks i want to store as a symbol in ArcGIS.

Some symbols i was more or less able to find in existing symbols or edit from 2 or more existing symbols, but its cumbersome to change color for example that way.

Anyone know an easy way to convert blocks to ArcGIS symbols ?


texts: Return list of spatial tables with at least one feature intersecting a given geometry?

texts:
I am trying to return a list of all spatial tables in my database that have at least one feature's geometry intersecting another specific geometry.

I am trying to wrap my head around what would be the most efficient way of doing this with a query. I assume that once a single feature has been found to intersect the specified geometry that I could terminate the query for that given table and the continue on to the next table.

What would be my best option to carry out such a task?


texts: How to create different size of bubbles with different colors?

texts:
I have a set of points with fields like 'TYPE','SIZE','SALES VOLUME',what i would like to do in QGIS is:
Apply different color code by 'TYPE',
Apply graduated size of bubble circles based on 'SIZE'

Havent figured out what to do with 'SALE VOLUME' yet,

but my problem is in property page, you can only define one type of style,either by TYPE or by SIZE, but how to have different size of bubble with different colors?


texts: How exactly do I use the GeoDjango Union function?

texts:
I have two models in my application:

class Organization(models.Model):
    consortium = models.ForeignKey('Consortium')
    org_map = models.MultiPolygonField()

class Consortium(models.Model):
    cons_map = models.MultiPolygonField()

I'm trying to write some code that will union all the org_maps for organizations in a consortium, but am having trouble.

The documentation leads me to believe that this is possible, I'm just a little off.

What I have so far is this:

from django.contrib.gis.db.models import functions as geodjango_functions

for consortium in Consortium.objects.all():
    for organization in Organization.objects.filter(consortium=consortium):
        if not consortium.cons_map:
            cons_map = organization.org_map
        else:
            union = geodjang_functions.Union(consortium.cons_map, organization.org_map)
            consortium.cons_map = union.geo_field
            consortium.save()

Unfortunately, this does not seem to work. Running the code doesn't produce any errors, but the resulting cons_map is always just the org_map for the last organization in that consortium. Any pointers about what exactly I'm doing wrong would be wonderful.


texts: openlayers how to make translate event only in shift click

texts:
is there a way to make ol.interaction.Translate only fires only on shift + click it's really hard to edit a layer when you have Translate and Modify together.

this is my code

var selectInteraction = new ol.interaction.Select({
        condition: ol.events.condition.singleClick,
        //toggleCondition: ol.events.condition.shiftKeyOnly,
        layers: function (layer) {
            return layer.get('id') == 'redline';
        }
    });

    var modify = new ol.interaction.Modify({
        features: selectInteraction.getFeatures()
    });

    var Translate = new ol.interaction.Translate({
        features: selectInteraction.getFeatures()
    });

    map.getInteractions().extend([selectInteraction, modify, Translate]);

    selected_features = selectInteraction.getFeatures();


texts: Calculating value of unique points in polygon in PostGIS

texts:
I'm working with a spatial PostgreSQL database that contains species records, there is a point layer 'spp_points', each point has a "spp_ID" and "spp_score" field. I also have a polygon layer 'field_poly'.
I need to work out the sum of unique "spp_id" scores only within each polygon, so multiple records of the same species should only be counted once.
I have tried using the following query but this calculates the total of all species, so multiple instances of the same species are included in the sum:
SELECT site.gid AS field,
       SUM(spp.total) AS field_score,
       site.geom
FROM (SELECT DISTINCT spp_id,
             spp_score AS total,
             geom
      FROM spp_points) AS spp
JOIN field_poly AS site ON ST_Within(spp.geom, site.geom)
GROUP BY site.gid

I'm not sure where I need to go from here.


texts: problem when building a code under qgis 2.8 c++ api

texts:
i have this code

QgsUniqueValueRenderer *lRenderer = (QgsUniqueValueRenderer *)pLayer->renderer();

QMap<QString, QgsSymbol*> lSymbolMap = lRenderer->symbolMap();

QgsSymbol *lSymbol = lSymbolMap.value("");

My problem is that in the c++ qgis api the header QgsUniqueValueRenderer has been deleted

can i subsitute QgsUniqueValueRenderer by qgsrendererV2 ?


texts:
Can I convert a geometry point to wkt including the srid formatted. See below the example.

"SRID=4326;POINT(-43.9725637435913 -19.9411078674228)".

Although I tried to put point.toText() only return the coordinate without the srid.


texts: How to set partial transparency for GRASS layer?

texts: I am trying to style layers in a GRASS monitor such that they are partially transparent. I'm guessing that there's a module for that (d.shadedmap seems close), but I haven't found it. I need a solution for partial transparency in both vector and raster layers (including rgb groups). It would be great if you could provide instructions for how to do this with the wxGUI AND the command line, but I'm finding that I can learn most of the command line methods from the wxGUI while using it.


texts: Copy & Paste the styles of several layers to similar layers in an other project

texts:
I have a project with several layers and a specific styling for each one. In a similar project I have similar layers which need to be stlyed the same way.

I could copy the style of one layer in my first project and paste it to the corresponding layer in the second project. But it takes a lot of time to do this for many layers.

Perhabs there is a way to copy the styles of several layers in the first project and paste it again to several layers in the second one? Any ideas if this is somehow possible?

For example:

I would like to copy the styles of the Layers "Landnutzung; Schadenspotenzial; Gefährdung" and paste to the corresponding layers all at once. I want to create  one Style document for all three Layers and use it for the other three Layers only once.

I hope it's clear what I mean.


texts: Comparing ArcGIS Data Interoperability with FME or GeoKettle?

texts: In order to import/extract data from tons of DWG files, I'd like to know experiences with ArcGIS Data Interoperability, and its strong points versus FME or GeoKettle.


texts: Add secured WMS service from Geoserver to ArcGIS 10.2 to 10.4

texts:
I have a Geoserver running with multiple accounts (secured via Geofence). Each account has access to a certain workspace. In Qgis I am able to add data from any account using the WMS service.

The problem arises with Arcgis, where I can make a connection to Geoserver but the layers are not added. Using Wireshark to check the outgoing request I've noticed that ArcGIS does not include a basic authentication header, and is therefore unable to show the layers.

My Geoserver service security rules are: Rule Path: * . * , Roles: *
Role(s) are associated with the required user and those Roles are linked with the correct workspace/layers in Data Security.

What I've already tried is adding username and password in the URL like: http://user:pasword@urltogeoserver.com/geoserver/wms?, with no succes.

How can I add a secured WMS layer through ArcGIS? Or how can I force ArcGIS to include a basic authentication header in the request?


texts:
I am trying to match the edges of two polygon layers. One is Orleans county, NY and the other layers is Monroe county, NY. Since the Orleans county is from a different source, the boundaries are not matching. S_Pol_Ar is Orleans and Green outlined polygon is Monroes. Likewise, I have to match the boundaries with Niagara too.
Tried edge matching and reshape but they did not work.


texts: Geoserver + MongoDB: connection OK but layers list empty

texts:
I setted up Geoserver (ver. 2.5.2) with the MongoDB plugin (ver. 11.2 - http://repo.opengeo.org/org/geotools/gt-mongodb/11.2/). The connection between Geoserver and MongoDB is OK and when I create a new datastore in geoserver->stores->Add new Store, it creates the database on mongo as expected. The problem is that, if I go in layers->Add a new resource and select the correct resource, the layer's list remain empty. On the top i see only "You can create a new feature type by manually configuring the attribute names and types. Create new feature type..." but i cannot find documentation on how to use that.

Any help?
Thanks in advance

EDIT: in the goserver's log i've just found this error:

ERROR [data.mongodb] - getLayers error; command failed [mapreduce]:
    { "serverUsed" : "[ip:port]" ,
    "errmsg" : "exception: ReferenceError: mapfields_recursive is not defined near 'ction()
    { mapfields_recursive (\"\", this);' " , "code" : 16722 , "ok" : 0.0}

but I can't still figure out what is the problem and how to solve it.
Any ideas?


texts: Create points along a line from spreadsheet data in QGIS

texts:
I have a sewer network comprising:

Manholes - a points layer
Pipes - a polyline layer, with attributes comprising the upstream and downstream manhole

I have a spreadsheet of pipe defects (from a CCTV contractor), where each defect is identified by the following data.  Each defect is logged on a separate line with the following attributes:

Pipe ID
Starting Manhole
Ending Manhole
Distance from Starting manhole
A range of attributes on observations made

I want to create a set of points for each defect so that I can then analyse the defects.  As there can be a huge number of defects, I want to create a workflow to bring the points into QGIS so I can prioritise them.

I can see how to generate points at vertices, crossings or equidistant.  However I am not certain where to even start in this task.


texts: QGIS WKT Raster Plugin error, what does this mean?

texts:
I have been playing with the WKT Raster plugin. I have installed the WKT Raster experimental binaries in PostGIS successfully and followed the instructions in the read me to the letter.

When i am in QGIS I use the WKT Raster plugin to "Load Raster to PostGIS" everything seems to run fine there but once completed I get this error below.

Even though I get this error the table shows up in PostgreSQL and I can load it into QGIS but it does appear empty/blank. I checked in PostgreSQL and the table is there and it has values in it. Also the error message says "DbError: relation '' already exists", but its the first time I have ever created a table with that name in the DB.

Any ideas?

Thanks
Ando


texts: Creating minimum spanning tree using OpenStreetMap and QGIS?

texts:
I'm working in QGIS (3.8) and PostGIS (2.5) and I have 2 layers: 1. set of points, 2. set of OSM roads.

I would like to generate a subset of the roads network which represents the minimum spanning tree that connects all the points, something like this:

How do I do this using QGIS-PostGIS?

The roads map can be downloaded from this link as a shapefile: https://download.geofabrik.de/


texts: Adding polygons from an existing layer to a new layer (shapefile)?

texts: I have an existing shapefile that contains parcel data.  I would like to add some of the existing parcels to a new shapefile.  I am using ArcMap 10.1.


texts: ArcGIS quantile classification method results in unequal data values in each class

texts:
I have a raster dataset which I visualized in ArcMap 10.6.1. I used the quantile data classification method to assign colours to the data values. ESRI's documentation says the following about quantiles: "Quantile assigns the same number of data values to each class". Thus, I would expect a raster map that looks something like this. However, I end up with the map below.
Does anyone have an explanation for the unexpected outcome of the quantile classification? Could it have something to do with the distribution of the values? All values in the open ocean are very low (0-50), while values near coastlines can be very high (up to 12734). Unfortunately I am not allowed to share the actual data due to confidentiality.


texts: earthpy.spatial stack() -function and data type

texts:
I have Landsat-8 OLI images in directories named after image WRS-2 scenes. I tried to compose script that would iterate these directories and stack rasters within each directory - using earthpy python package.

earthpy.spatial.stack() -function returns array and a rasterio object, and writes a new stacked .tif file to the folder. Currently the function returns ValueError: the array's dtype 'uint8' does not match the files dtype 'uint16'. Is it possible to work around this problem without scaling the uint16 data to uint8 format?

my script:

# Import needed packages

import glob2 as glob
import rasterio
import os
import earthpy
import matplotlib.pyplot as plt
import rasterio as rio
from rasterio.plot import plotting_extent
import geopandas as gpd
import earthpy as et
import earthpy.spatial as es
import earthpy.plot as ep

# WRS-2 naming convention: path 210, row 4 = 210004)
wrs = ["210004", "211004", "212004", "213004", "214004","215004","216004","217003","217004","218003","219003"]

#Local path for reference images
refPath = "F:/ref_Images/"

for sceneId in wrs:
    ''' Iteratively create datacubes by stacking bands within each acquistion scene folder'''
    #check sub-directories (acquistions) under every WRS-scene
    subDirs = os.listdir(refPath + sceneId + "/")
    for directory in subDirs:
        #iterate subdirectories and compile datacubes within them
        bandList = glob.glob(refPath + sceneId + "/" + directory + "/*.tif")
        output = refPath + sceneId + "/" + directory + "/"
        filename = directory + "_STACK.tif"
        array, raster = es.stack(bandList, out_path=output + filename, nodata = 0)

Value error returned:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-82fa289db5a0> in <module>
     10         output = refPath + sceneId + "/" + directory + "/"
     11         filename = directory + "_STACK.tif"
---> 12         array, raster = es.stack(bandList, out_path=output + filename, nodata = 0)

C:\ProgramData\Anaconda3\envs\lopputyo\lib\site-packages\earthpy\spatial.py in stack(band_paths, out_path, nodata)
    252             # Write stacked gtif file
    253             with rio.open(out_path, "w", **dest_kwargs) as dest:
--> 254                 _stack_bands(sources, write_raster, dest)
    255
    256             # Read and return array

C:\ProgramData\Anaconda3\envs\lopputyo\lib\site-packages\earthpy\spatial.py in _stack_bands(sources, write_raster, dest)
    313                 bands = bands[np.newaxis, ...]
    314             for band in bands:
--> 315                 dest.write(band, ii + 1)
    316
    317     else:

rasterio\_io.pyx in rasterio._io.DatasetWriterBase.write()

ValueError: the array's dtype 'uint8' does not match the file's dtype 'uint16'


texts:
I'm trying to build virtual raster (catalog) following instructions from the documentation in QGIS.. It appears the following error in python code:

2016-04-17T12:13:07 1   Traceback (most recent call last):
          File "C:/PROGRA~1/QGISES~1/apps/qgis/./python\qgis\utils.py", line 160, in open_stack_dialog
            pypath=u"".join(u"
{}
".format(path) for path in sys.path))
          File "C:/PROGRA~1/QGISES~1/apps/qgis/./python\qgis\utils.py", line 160, in <genexpr>
            pypath=u"".join(u"
{}
".format(path) for path in sys.path))
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 9: ordinal not in range(128)

I don't know what it means...


texts: I want to find the isolated rings in an OSM dump loaded into PostGIS, using pgRouting. I need to do this in order to delete the isolated rings of the network. Does anyone know how to do it?


texts: how to plot gps coordinates on my own raster map?

texts:
I have lat log values available in degree format, i donot know how to access raster maps using c#, and how to plot accurately.

which libraries should i use and what are the controls avialable ,i am using visual studio 2010 ultimate edition. There are controls available for vector maps in which one can zoom ,pan and plot the given coordinates accurately etc etc, but i have a georeferenced raster map with 4000*5000 resolution, i have done tiling with the map,each tile is of 256*256 resolution i need some source code or a manual to use the raster map to develop a navigation app and to plot the location accuraetly on the map, thanks


texts: Automatically split KML into point, line and polygon SHPs?

texts:
I have a lot of KMLs that include points, lines and polygons together.

Is there a way to automatically parse them into separate shapefiles (one for point, one for line, one for polygon) in QGIS or ArcGIS?

Otherwise I have to go through and delete the other two for each file, which is time consuming.


texts: I am working in  a Database preaparation for that I exported a shapefile from Qgis to PostGis.The Problem is this: In Qgis I can see a Polygon feature but when the same polygon feature is exported to postgis the particular fields is missing its Geom what is the problem behind it?


texts: Are there any free or reasonably priced databases for the US which can be searched and return latitude and longitude information?


texts: How to use regular expressions within QGIS Actions

texts:
I have stored html links in a column of a postgis layer. There are a few entries which have multiple links stored in one cell (blank separated).
I have to use the firefox.exe to open the links in multiple tabs. This doesn't work with Open type,

I can open these links with:

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" [% "link" %]

An entry of link looks like:

file:///H:/going/goingfurther_01_page.html

Now I want to use the same column to open the link in this way:

file:///H:/going/page.html

I tried:

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" [% regexp_replace("link",'goingfurther_[0-9][0-9]_' ,'') %]

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" regexp_replace([% "link" %],'goingfurther_[0-9][0-9]_' ,'')

But QGIS can't open this.
The first replace expression works with the field calculator.


texts: Applying raster symbology to raster layer with different values using ArcGIS Pro

texts:
I am using ArcGIS Pro 2.5 and starting with an 8 bit raster layer that has specific symbology and labeling - a value of 0 is labeled as a certain species, and so on.

I want to apply this symbology/labeling to another raster that has the same data, but has been masked against another layer. Thus, some values (such as 1 and 2) are no longer included in the layer.

How can I apply the symbology from my first layer to my second layer?
I tried using the Apply Symbology from Layer tool, but I got an error that the symbol layer does not match the input layer.


texts: Copying polygon features with WHERE clause using arcpy.da?

texts:
This question is similar to Copy a polygon geometry in Arcpy, except within the context of using Arcpy.da instead.

I want to copy the geometry from one feature class to another using ArcPy.da (I'm not concerned about attributes of the feature class right now).

I have a Python script that reads features from one feature class based upon a given WHERE clause using a search cursor and then inserts the features from the search cursor into another feature class:

import arceditor
import arcpy

inputfeatureclass = arcpy.GetParameterAsText(0)
insert_field = arcpy.GetParameterAsText(1)
where_field = arcpy.GetParameterAsText(2)
expression = arcpy.GetParameterAsText(3)
insertfeatureclass = arcpy.GetParameterAsText(4)

def get_specified_rows(inputfeatureclass, insert_field, where_field, expression):

    searchcursor = arcpy.da.SearchCursor(inputfeatureclass, (insert_field, where_field), where_clause=expression)

    return searchcursor

def insert_specified_rows(searchcursor, insertfeatureclass):

    insertcursor = arcpy.da.InsertCursor(insertfeatureclass, ("SHAPE@"))
    for row in searchcursor:
        arcpy.AddMessage(row[0])
        insertcursor.insertRow(row[0])

searchcursor = get_specified_rows(inputfeatureclass, insert_field, where_field, expression)
insert_specified_rows(searchcursor, insertfeatureclass)

The polygon Shape field is the value passed for my insert_field parameter.

The program fails on insertcursor.insertRow(row[0]) with the following error: sequence size must match size of the row.

I'm getting the following message on arcpy.AddMessage(row[0]): [3088680.146493972, 10159411.210196389].

This does not look like a polygon array, perhaps I am reading the polygon incorrectly using my search cursor?


texts: What's wrong with my SQL? Invalid Expression

texts:
I'm just trying to make it where the user types what county they want and the script selects those features.
import arcpy

County = arcpy.GetParameterAsText(0)

arcpy.env.workspace = (GDB path)

SelectedField = "COUNTY1"

Expression = (SelectedField + '=' + 'County')

arcpy.SelectLayerByAttribute_management("ArmoringBackup", "New_Selection", Expression)

If I put the county name in the expression, it works fine. The issue I'm having is with making it a parameter that can be changed.


texts: KMZ from QGIS won't display in Android Google Earth - raster images?

texts:
Trying to get a KMZ working in the Google Earth Android app... works fine on Google Earth desktop... I think maybe it's because it has images in it?

Any ideas?

Error I get is:

  Error: 1 Parse Error at line 1, column 0:

  no element found

View KMZ here


texts:
I found some batch code using ogr2ogr in order to convert and reproject vector layers. The difficulty for me is to know what to install and which gdal commandline should I use, and how to configure it...

The fact is I'm quite lost with all the packages that gdal offers and I don't know :

which package am I supposed to install : OSGeo4W, FWTools, MS4W,...?? What is the difference between them ? Can I use any of them ?
What is the procedure to set PATH and environment variables ? I work with windows 7.
I have already QGIS and GRASS installed on my computer. Is an installation of gdal could damage anything ?


texts:
Is there a way to clip a terrain in ArcMap, or make sure it doesn't exceed a certain geographical extent area in the first place?

After creating my terrain from a multipoint file it looks like this:

As you can see, the interpolation goes beyond the extent of the original las files (red boxes).

With a TIN it's possible to limit the extent either before or after you create it; before by adding a surface constraint to the las dataset and after with tools like Edit TIN and Delineate Tin Data Area. However, these options doesn't seem to be available when working with terrains.


texts: Commit error when splitting several polygons with "array type" attribute (PostGIS / QGIS)

texts:
I have a simple PostGIS table :
CREATE TABLE public.elem_p
(
    gid integer NOT NULL DEFAULT nextval('elem_p_gid_seq'::regclass),
    liste character varying[] COLLATE pg_catalog."default" NOT NULL,
    geom geometry(MultiPolygon,2154),
    CONSTRAINT elem_p_pkey PRIMARY KEY (gid)
)

The 'liste' field is array-type ;
When I split polygons one-by-one with the QGIS splitting tool, there is no problem.
When I split several polygons that all have at least 2 dimension in the array type "liste", there is no problem ...
BUT when I split several polygons that have less than 2 dimensions in the array type "liste" (0 or 1) I have an error like this  :

Could not commit changes to layer elem_p
Errors: SUCCESS: 2 geometries were changed.   ERROR: 2 feature(s) not
added.
Provider errors:
PostGIS error while adding features: ERREUR:  tableau litéral mal formé : « abcd »
DETAIL:  La valeur du tableau doit commencer avec « { » ou avec l'information de la
dimension.

(raw translation from french : "wrongly build array : "abcd" ; DETAIL : array value must start with "{" or with information about dimension)

EDIT :
The whole new script :
/* TABLE */
DROP TABLE IF EXISTS elem_p CASCADE ; CREATE TABLE elem_p (gid serial, liste varchar[], geom geometry(multipolygon, 2154)) ;
INSERT INTO elem_p (gid, liste, geom)
VALUES (nextval('elem_p_gid_seq'::regclass), '{E-1, E-5}', ST_MULTI(ST_SETSRID(st_geomfromtext('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))'), 2154)))
   ,(nextval('elem_p_gid_seq'::regclass), '{E-1, E-7}', ST_MULTI(ST_SETSRID(st_geomfromtext('POLYGON((10 10, 6 6, 6 7, 6 8, 7 10 , 9 10, 10 10))'), 2154)))
   ,(nextval('elem_p_gid_seq'::regclass), NULL, ST_MULTI(ST_SETSRID(st_geomfromtext('POLYGON((0 10, -3 10, -3 8, -5 5, 0 4, 0 10))'), 2154))) ;
UPDATE elem_p  SET liste = '{E-30}'  WHERE gid = 2 ;

/* VIEW  */
CREATE OR REPLACE VIEW v_elem_p AS (SELECT * FROM elem_p) ;

/*  FUNCTION  */
DROP FUNCTION IF EXISTS maj_elem_p() CASCADE ;
CREATE FUNCTION maj_elem_p() RETURNS TRIGGER AS
$$   BEGIN
IF TG_OP = 'INSERT' THEN INSERT INTO elem_p (liste, geom)  VALUES(COALESCE((NEW.liste::varchar)::varchar[], '{}'::varchar[]), NEW.geom); RETURN NEW; END IF;
IF TG_OP = 'UPDATE' THEN UPDATE elem_p SET (liste, geom) = (COALESCE((NEW.liste::varchar)::varchar[], '{}'::varchar[]), NEW.geom) WHERE gid = NEW.gid; RETURN NEW ; END IF ;
END;
$$  LANGUAGE PLPGSQL ;

/* TRIGGER  */
DROP TRIGGER IF EXISTS tg_maj_elem_p  ON v_elem_p ; CREATE TRIGGER tg_maj_elem_p INSTEAD OF INSERT OR UPDATE ON v_elem_p  FOR EACH ROW   EXECUTE PROCEDURE public.maj_elem_p();

/* TESTS */
UPDATE v_elem_p  SET liste = '{E-99}'  WHERE gid = 2 ;
INSERT INTO v_elem_p VALUES (DEFAULT, '{E-123, E-54}', ST_MULTI(ST_SETSRID(st_geomfromtext('POLYGON((3 3, 5 3, 5 4,5 5, 2 6, 3 3))'), 2154)))


texts:
I have a WPF Map control whose extent I would like to restrict to a certain area (e.g. to the full extent of some layer). That is, a user should not be able to zoom out too far, or shift the map to an area outside that full extent.

How can I restrict Map display to a certain extent?

This is my code:

<esri:Map x:Name="Map" SizeChanged="Map_SizeChanged">
    <esri:ArcGISTiledMapServiceLayer x:ID="LB" ... />
    ...
</esri:Map>

And here is the code-behind (this code does not work):

void Map_SizeChanged(object sender, SizeChangedEventArgs e)
{
    if (currentExtent > Map.Zoom(Map.Layers["LB"].FullExtent)) // check the current extent of the map. If currentExtent is more than FullExtent
    {
        // jump back to full extent
        Map.Zoom(Map.Layers["LB"].FullExtent);
    }
}

I'd like to get something like that:

private void Map_SizeChanged(object sender, SizeChangedEventArgs e)
{
    … // get current extent of the map

    … // check the current extent of the map.
      // if currentExtent is more than FullExtent jump back to full extent
}

I'm using the ESRI API for WPF and C# in Visual Studio 2010.


texts: update Image and Tile/XYZ layers while panning in OpenLayers 3

texts:
I want my map to load/update dynamically as the user pans with mouse/finger drag. Currently, as I drag and expose new areas of the map, those areas generally stay blank/undrawn until I release the mouse button. In OpenLayers2 I didn't have this problem; the layers loaded/updated their contents as I dragged.

I see this post:

OpenLayers 3: Vector Layers not Drawing during animated panning or mouse-drag events

and it appears there is now an updateWhileAnimating flag for Vector layers. I want such a flag for Image and Tile/XYZ layers. Is there a reason that flag/functionality can only exist for Vector layers?


texts: Terminology for "projection" on different 2d planes (no sphere involved)

texts:
I'm building software and want to use good terminology for variables, tables, etc.

Most of my work involves blueprint drawings on which I render shapes (pins, polygons, etc). The same set of pins can be represented on different blueprints which has different "projections". The main blueprint is my "base projection".

A section blueprint of a beam will be rotated along x or y so it has a completely different coordinate system.
Another section blueprint can represent the same 2d plane as the base blueprint but with an offset origin and a different scale. I guess that the offset could be called datum, but I call it transform as is usual in computer graphics terminology.

For now I'm calling my different coordinate systems "Projections", but they are not projections in GIS terms, i.e. transformations from spherical to planar.

I'll soon implement support for working with maps, which will probably be WGS84 (Google maps). The term projection will for sure be used in that implementation.

Question: Should I call my 2D projections anything else than projections? Is there another term for this?


texts: Find the irregular polygons in QGIS using Python

texts:
I have a vector shapefile and I want to find the irregular polygons. What are the parameters to be considered to check the irregularity of the polygon features?

Calculating the perimeter and extent will be useful for rectangle so how can I find the irregular polygons in the polygon shapefile?

for f in layer.getFeatures():
    perimeter = feat.geometry().length()
    bbox = geom.boundingBox()
    width = bbox.xMaximum() - bbox.xMinimum()
    height = bbox.yMaximum() - bbox.xMinimum()


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

I wish to render it with a stretched color ramp, with the following properties:

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

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


texts: Overwrite datasets in scratch geodatabase arcpy?

texts:
I've created a scratch file geodatabase, intended to be a temporary location where I can reproject the necessary datasets. The script runs fine the first go around. However, it fails on the second try since the feature classes in the scratch file geodatabase already exist.

What is the best way to overwrite or delete the data sets (sourceNAD27, sourceNAD83 and sourceWGS84) in my scratch file geodatabase?

       # source is the full path to the datasets in the sde
        sourceNAD27 = os.path.join(sourceDB,'{schema}.{table}'.format(schema=sourceDict['schema'], table=sourceDict['table']))

        # copy features into a temporary location
        arcpy.FeatureClassToFeatureClass_conversion(sourceNAD27,os.path.join(arcpy.env.scratchGDB),'sourceNAD27')

        # project from GCS_North_American_1927 to GCS_North_American_1983
        arcpy.Project_management (os.path.join(arcpy.env.scratchGDB, 'sourceNAD27'), os.path.join(arcpy.env.scratchGDB, 'sourceNAD83'), 4269, "NAD_1927_To_NAD_1983_NADCON", 4267)

        # project from GCS_North_American_1983 to WGS_1984_Web_Mercator_Auxiliary_Sphere
        arcpy.Project_management (os.path.join(arcpy.env.scratchGDB, 'sourceNAD83'), os.path.join(arcpy.env.scratchGDB, 'sourceWGS84'), 3857, "WGS_1984_(ITRF00)_To_NAD_1983", 4269)

        # target is the full path to the datasets in the sde
        target = os.path.join(targetDB,'{schema}.{table}'.format(schema=targetDict['schema'], table=targetDict['table']))


texts: ArcObjects: Equivalent/Similar object to old Avenue ObjectTag from ArcView 3.x?

texts: I have annotation where a single annotation feature consists of one or more TextElements and RectangleElements grouped together in a GroupElement and then stored in the annotation feature.  To edit the contents of the annotation feature later, it would be nice to be able to know which elements are related to each other.  The elements have natural groupings, but those groups cannot be grouped together and then grouped into the final GroupElement for storage.  Due to a bug, the ESRI optimized map service cannot handle nested groups in annotation.  (See this posting.)  So all elements just have to be thrown in together.  An identifier object, holding, say, a group name string, attached to each element would make identification of elements belonging to each subgroup much easier to identify.  The Avenue ObjectTag object in old ArcView GIS 3.x (I guess it was a property) used to be great for such things.  You could stick a tag on just about any object in the whole model, including dialog controls.  Really handy.  I haven't thought about this -- until recently -- since the old Avenue days, but it has now come to my consciousness again.  I haven't been able to find anything like the old ObjectTag in ArcObjects.  Any ideas?


texts: How to ensure that only my application has access to ArcGIS Server services

texts:
I'm making a web map based on the ArcGIS Server JS API. How can I ensure that users must use my front-end to access the ArcGIS Server layers?

That is, I want anyone visiting MyDomain.com/index.html to have access to the ArcGIS Server layers referenced on the page, but I don't want users to be able to access the ArcGIS Server layers directly (eg, by using Firebug to detect the URLs then using them in their own applications).

I want to allow anonymous users to access the site, so I don't want to provide a prompt for users to log in - it needs to work seamlessly.

An idea is to secure the layers with tokens, and have my application automatically fill in the token credentials.

Has anyone done this? How would I hide the token credentials so that people couldn't access the information?


texts: Print/Export Attribute Table in Form View (QGIS 2.10.1)

texts:
Is there a means or available plugin which works to enable a direct print of the attribute table in form view?

I recall this feature was on many a wishlist back around 2.6, but I'm unaware if the issue has been addressed.


texts: Are geodesic buffers dependant on geographic v projected coordinate system?

texts: I am trying to create a geodesic buffer in ArcGIS (v10.7) but the outcome differs depending on whether I use a projected coordinate system of geographic coordinate sytem, while I would expect that the output of a geodesic buffer is the same, independent of coordinate systems. Can anyone please explain this difference? And what would be the preferred input for this algorithm then? A projected or geographic coordinate system?


texts: Cannot get Not Installed Plugins in QGIS 2.18

texts:
I tried looking for Not Installed plugins but they do not show up on QGIS version 2.18. Under Plugin Settings, QGIS official plugin repository is shown as unavailable. When reloading nothing happens.

(I previously tried using the mmqgis plugin on 3.2 but did not work for most things, I assume that's because the version is not yet stable, so updating versions seems to not be an option in this case)


texts: ArcPy QueryPointAndDistance: Incorrect Lengths?

texts:
Background:

I'm currently trying to determine the chainage (distance m) of my points along a polyline (i.e. proposed railway alignment). A colleague within my firm assisted me with the following script

# @date 06/03/2015
# @author Cindy Williams
#
# Returns the distance a point is along a line. Assumes that the
# existing point and line feature classes have the same spatial reference,
# and the points are snapped to the line.
#
# For use as a standalone script.
#

import arcpy
arcpy.env.workspace = r"C:\Some\Arb\Folder\work.gdb"

# Input variables
fc_line = arcpy.management.MakeFeatureLayer("ftr_line")
fc_pnt = arcpy.management.MakeFeatureLayer("ftr_point")

# Get line geometry - assumes only one feature in feature class
polyline = arcpy.da.SearchCursor(fc_line, "SHAPE@").next()[0]

# Loop over the point feature class
with arcpy.da.SearchCursor(fc_pnt, "SHAPE@") as cursor:
    for row in cursor:
        # Get the percentage the current point is along the line
        perc = polyline.queryPointAndDistance(row[0], True)[1]

        # Calculate the percentage distance in metres
        dist = polyline.getLength()*perc
        print("% along line: {0}%\tDistance along line: {1}m".format(round(perc*100, 2), round(dist, 2)))

print("Script complete.")

Comparison:

I compared the values generated by the following script and splitting the polyline manually based on the points positions. The values differ appromimately by 4m.

The following is the first position along the line and the value determined by the script is 871 m and the value determined manually is 875 m.


texts:
I need to fit a utm wgs84 tiff raster to a topomap in the same projection. I use GCP and it invariably fails. The first raster uncorrected rater superimpose well, the "geocorrected" raster is projected far away. I use the same projection for the project. What's happening?

Ok, sorry and thanks for your answer. I have a utm wgs84 image in tiff and toposheet in utm wgs84 in tiff. The image need geocorrection. I open the toposheet in the main qgis screen and I import the image in the georeferencer. I create GCP with the "Enter map coordinates" tool, "From map canvas". This fails: srcX will be almost the same as dstX, the absolute value of srcY will also be very close to the dstY, but srcY is negative. The new geocorrected map is projected in a totally different area.


texts: Setting the correct raster no data value with gdal

texts:
I am trying to split a multi-band raster using gdal, and in the process set the nodata value to 0 (currently it is -9999). The way I thought to do this was as follows:

gdal_translate -b 1 -a_nodata 0 scr_ds.tif dst_ds.tif

I think this does set the nodata value to 0, but doesn't update the -9999 values to 0. So I tried to use gdalwarp to first convert all -9999 values to 0. However this returns [1] - which I believe means it failed. The gdalwarp line of code I used was:

gdalwarp -dstnodata 0 src_ds.tif dst_ds.tif


texts: Changing raster display in QGIS to look same as ArcGIS Desktop?

texts:
I have a strange problem. I have noticed that the same satelite imagery looks totally different in QGIS and ArcGIS.

The problem is that I need to get the same style in QGIS. I've tried to calculate statistics for every band in ArcGIS and applied this values to a display properities in QGIS but it doesn't work.

Manipulating standard deviation values in QGIS helps a liitle bit but the whole image is still more blue than it should be.

Can anyone give me some clue what can I do to improve this image style in qgis?


texts: Is there a FOSS implementation for Discrete Global Grid System & Global Statistical Geospatial Framework?

texts:
This 2019 document, "GSGF Europe -Implementation guide for the Global Statistical Geospatial Framework in Europe" describes the harmonization of two standards:

INSPIRE D2.8.I.2_v3.1 of year 2014;
OGC's DGGS, "Topic 21: Discrete Global Grid Systems Abstract Specification", of year 2017.

Is there an official or experimental  FOSS  implementing these harmonized requirements?

NOTES on my personal interpretation. The 2019 document suggests that a solution is feasible. Checking Internet, seems that is possible to use FOSS solution (free and open-source software)  for it.  For example using  DGGRID project... Or, for more a flexible Requirements 5, 7 and 8 of DGGS standard (the hierarchy of equal area tessellations), projects like  S2-geometry and H3 Uber.


texts:
I am new to GIS and I want to run several view shed analysis operations for wind turbines located in the North of England

I have installed QGIS and have the GRASS r.los plug in installed for line of sight analysis.

Is this the best way of running view shed analysis?

Also, I am unsure about what terrain data to use for this operation?

Thanks in advance for any insight

Note: I am using a Mac with OS X Mavericks


texts: Expanding raster with many zone values using ArcMap?

texts:
I am using ArcMap 10.6.1 and I need to expand a large raster with tens of thousands of zones by 1 cell using either the expand tool or a map algebra expression. The tool asks to specify each zone to be expanded but I have too many zones for this approach.

How can I write a map algebra expression in raster calculator to expand all zones in the input raster without entering each zone value separately i.e. is there a way to write it so it expands zones from one number through to another?

So for a range of raster values from the input raster.


texts: Exporting and editing annotation feature class using ArcPy?

texts:
I would like to convert labels to annotations and make some advanced editing for these labels using ArcPy.

How would I do this?

I'm using a file geodatabase and ArcMap 10.


texts:
I have installed and followed the process to produce an elevation profile from the Route Profile plug-in in QGIS, but for some reason I am getting no profile to appear.

The grids are from OS Terrain50 and the route is a polyline shapefile. The tool version is 3.7.0 and I am using QGIS Lyon 2.12.0 on a Mac (El Capitan).

I have attached a screenshot of what is appearing.

I cannot see what I am doing wrong.


texts: Why is the Spatial Analyst toolbar graph different to Graphs>Create Graph?

texts:
I'm using ArcGIS 10.3 and want to look at elevation vs frequency of each elevation for a DEM. There seems to be two ways to create this graph:

Use the "Create histogram" tool on the Spatial Analyst toolbar.
Go to View>Graphs>Create Graph.

The Histogram graph type in Create Graph looks very different to the Spatial Analyst one and  I can't find a way to even set the x-axis field, so the graph doesn't work. The Vertical Bar graph type seems to be what I need but there are some differences that I don't understand. The graph created through the Spatial Analyst toolbar has a frequency count maximum of about 11,000. The Vertical Bar graph has a frequency count maximum of about 220,000. And although the general pattern of frequencies is the same, there are some differences - e.g. a couple of spikes are massive on the Vertical Bar graph compared the the Spatial Analyst histogram.

I can't find any ArcGIS documentation that explains this. Can anyone help?

Edit: By the way I am zoomed to the full extent of the DEM, so the Spatial Analyst histogram includes all pixels.


texts: QGIS: Landover Analysis Dialog Box Too Small

texts: When I open the Landcover Analysis plugin within QGIS, the information in the dialog box is overlapping and doesn't fit the window. Even if I increase the size of the dialog box. It makes it pretty much impossible to use.


texts: Computing linestring between two different point shapefiles

texts:
I have two point shapefile representing towns within a state and I want find the distance between them. Since the points are in different shapefiles, should I merge them so they would be in the same shapefile before computing the linestring or is it possible to compute the linestring without merging both point shapefiles using shapely and Fiona function not GeoPandas.

  ValueError: Record does not match collection schema:

 import shapely
 import fiona
 from shapely.geometry import MultiPoint, Point, shape

 POL = ".cache/merbin.shp"
 POI = ".cache/merert.shp"

 with fiona.open(POI) as src:
    for elem in src:
      if elem['id'] == '0':
         geom = shape(elem['geometry'])
         elem['geometry'] = mapping(geom.centroid)

 with fiona.open(POL) as salt:
 for tea in salt:
     if tea['id'] == '0':
         geom = shape(tea['geometry'])
         tea['geometry'] = mapping(geom.centroid)

        schema = {'geometry': 'Point',
            'properties': {} }
        with fiona.open('mew.shp', 'w', 'ESRI Shapefile', schema, crs=from_epsg(4326)) as output:
       prop = {}
       print(tea)
       output.write(tea)
       output.write(elem)


texts: Getting largest area polygon using ArcGIS Desktop

texts:
I have a layer of polygon shapes.

I am a beginner and probably I am not using the right concept or terminology when looking at the Desktop Help of ArcGIS as I have not find anything useful.

How do I find the polygon with the largest area, and from it then calculate its center coordinate?


texts: Getting netCDF data into PostGIS database using Python?

texts:
I can read the netCDF file data with netCDF-python or with gdalinfo, but I am unsure of the easiest way to get it into a PostGIS database.  It would be really easy if I could convert the netCDF file to the shapefile format because using ogr2ogr is fairly straightforward.  I started to used some code netCDF2postgis.py from the PostGIS Recipes book, but it has a lot of problems and what I did get working created way too many tables.

If it helps, the data is NOAA GOES 15 weather satellite data which contains the following information. This is only for Band 1 (visible light) at a specific date and time:

gdalinfo NETCDF:"goes15.2014.175.190020.BAND_01.nc"
Driver: netCDF/Network Common Data Format
Files: none associated
Size is 512, 512
Coordinate System is `'
Metadata:
  NC_GLOBAL#Conventions=CF-1.4
  NC_GLOBAL#Satellite Sensor=G-15 IMG
  NC_GLOBAL#Source=McIDAS Area File
Subdatasets:
  SUBDATASET_1_NAME=NETCDF:"goes15.2014.175.190020.BAND_01.nc":auditTrail
  SUBDATASET_1_DESC=[2x80] auditTrail (8-bit character)
  SUBDATASET_2_NAME=NETCDF:"goes15.2014.175.190020.BAND_01.nc":data
  SUBDATASET_2_DESC=[1x29x68] data (32-bit floating-point)
  SUBDATASET_3_NAME=NETCDF:"goes15.2014.175.190020.BAND_01.nc":lat
  SUBDATASET_3_DESC=[29x68] lat (32-bit floating-point)
  SUBDATASET_4_NAME=NETCDF:"goes15.2014.175.190020.BAND_01.nc":lon
  SUBDATASET_4_DESC=[29x68] lon (32-bit floating-point)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)


texts:
I am getting very low reflectance values (mostly < 0.1) in Landsat 8 bands 2-7 on different scenes after rescaling from Digital Numbers (DN) to Reflectance. All scenes are in a tropical landscape with a lot of vegetation, secondary and old grown forests, agriculture (rice paddy) and urban areas & infrastructure. I see no reason that the majority of reflectance values should be that low.

I am using the formula for TOA planetary reflectance with correction for solar angle (provided on http://landsat.usgs.gov/Landsat8_Using_Product.php).

For example:

The mean DN value in Band 4 (red band) of my scene is 6937. Putting that into the formula for planetary reflectance

ρλ = ρλ'/cos(solar_zenith_angle)

where

ρλ' = Mρ * Qcal + Aρ

and

Mp = 2.0000E-05 (REFLECTANCE_MULT_BAND_4)
Qcal = 6937 (DN)
Ap = -0.100000 (REFLECTANCE_ADD_BAND_4)

gives me

(0.00002×6937-0.1)/cos(90-41.71087310) = 0.058

Is it possible, that the Ap value (-0.1) has to be "positive" (0.1) in the formula? If it was positive, my reflectance values would become more reasonable:

(0.00002×6937+0.1)/cos(90-41.71087310) = 0.36

For a comparison I also tried to use i.landsat.toar in GRASS 7 but I also get very low reflectance values (TOA, uncorrected) there. Here the mean reflectance values for each band after i.landsat.toar:

B2: 0.0898574
B3: 0.0747076
B4: 0.0582399
B5: 0.252395
B6: 0.160692
B7: 0.0808918

I am having this problem regularly also with other scenes from different locations.


texts: kmz mismatch in the Google Maps API v3 and Google Earth

texts: I have some kmz files(exported from ArcMap). They overlay perfect with the base maps of Google Earth, but when it applied to Google Maps API, they mismatch the base maps. Can anyone give me some clues?


texts: Iterating Select By Location in ModelBuilder?

texts:
I need to do exactly what the help topic http://resources.arcgis.com/EN/HELP/MAIN/10.1/index.html#/Select_By_Location_Select_based_on_spatial_relationship_within_the_layer/0017000000tr000000/ says can be done, but they do not include the model architecture:

  The Select Layer By Location tool allows the Input Feature Layer to be
  the same the layer specified in theSelecting Features parameter. A
  useful application of this behavior is to select adjacent, connected,
  or nearby features within a layer. Different Relationship options can
  be used to generate the desired analysis or result. For details of how
  the Relationship options differ, see Select By Location: graphical
  examples.

  A loop inside a script or the For or While iterators in ModelBuilder
  can be used in conjunction with this approach to expand a selection
  based on a number of iterations or until some criterion is met. One
  common criterion is expand until no new features are added to the
  selection. The Get Count tool can be used to establish when the
  number of selected features stops changing (therefore stops growing).

Could someone show me how this type of model is put together?

I'm especially having trouble determining where I can put GetCount functions in the model to get numbers of selected features before and after each Select by Location, and also figuring out where to put a While iterator (if indeed that is the correct iterator to use) so that only the Select by Location process is repeated and not the entire model.


texts: Count the number of characters in a field (Python)

texts: I have a field that contains street names and a second field called COUNT.  I need to perform a Python field calculation on the COUNT field that counts the number of characters in the STREET_NAME field.  For example if the street name is Main St then the COUNT field would be 7.


texts: QGIS Batch vector layer $ shapefile $ polygon processing

texts:
I am wondering how to make the batch vector layer setup for my comma-delimited layers inputted.

In the image below there is one layer ready (merged with few layers) and few other comma-delimited layers, which appear to be looking the same as the first one.

For the first one I done:

Minimum bounding geometry - convex hull
Make buffers
Merging them into one piece
Customizing the styles by categorized

I would like to do pretty much the same for the remaining ones. Is there a possibility to do these steps for all of them at once (batch process)?

I see, that some batch processing in QGIS is possible:

Extracting polygons by attribute in batch processing using PyQGIS?
Batch conversion of polygonz into polygon in QGIS?


texts:
I used Phantom DJI Standard 3 drone for some aerial photos of an archaeological site. When I viewed the properties of the jpeg file, it contained Longitude (like this: 22; 14; 37.701258239) and Latitude (like this: 41; 24; 33.58346), and also elevation attributes. However, when I try to add the image to QGIS, it's not in the geographical place that it should be.

Do I need to georeference the images even if they have Long/Lat values already, and why it doesn't work with the Lat/Long information available like this?

I'm using WGS 84.


texts: Are speeds in GPS data obtained by detection or calculation?

texts:
I have been doing a study into taxi behavior with its GPS data. I could calculate taxi's mileage by either longitudes and latitudes or times and speeds in the data. Since there are several errors in the data itself. I find it might be helpful to calculate mileages by these two ways and compare them. If huge differences occur, there might be some problem in data. But the effectiveness of this method is on the premise that speeds are not calculated by longitudes+latitudes and time stamps.

So, my question is whether the speeds are detected by some way or just calculated by longitudes, latitudes and time stamps.

  Plus, are bearings obtained by in-car compass as someone put it?


texts: Qgis2threejs wireframe mode displays diagonals (not just edges) of buildings

texts:
I have exported an ESRI Shapefile of building polygons using Qgis2threejs in QGIS 2.18.14.

When attempting to view these buildings in wireframe mode it shows the edges of the buildings, as well as additional diagonals in purple.

How can I get it to only have the black edges?


texts: Why does my clipped raster seem to be slightly moved?

texts:
I'm having some problems with clipping rasters.

I started clipping my raster using extents, but I saw that the clipped raster is different from the original raster. I created a virtual raster to use as a mask layer but the tool doesn't generate the output file.


texts: Why is the asc file associated with Fusion CanopyModel different from the GeoTiff I create?

texts:
I'm working in Python (using PyQGIS) to create a digital surface model from .las data. When I use fusion:canopymodel it creates a .dtm file, and a .asc file. I then convert the .dtm file to .tiff using fusion:dtmtotif.
alg_params_dsm = {
    'ADVANCED_MODIFIERS': '',
    'ASCII': True,
    'CELLSIZE': 1,
    'CLASS': '',
    'GROUND': '',#run_folder+'DEM.dtm', don't use ground.dtm according to FL
    'INPUT': run_folder+'ground_outside_b.las'+';'+run_folder+'buildings_inside_b.las',
    'MEDIAN': '',
    'SLOPE': False,
    'SMOOTH': '',
    'VERSION64': True,
    'XYUNITS': 0,
    'ZUNITS': 0,
    'OUTPUT': run_folder+'DSM.dtm'
    }
DSM = processing.run('fusion:canopymodel', alg_params_dsm)

# converts the .dtm to .tif using fusion:dtm2tif
processing.run("fusion:dtm2tif",{'INPUT':run_folder+'DSM.dtm','MASK':False,'OUTPUT':run_folder+'DSM.tif'})

If I view both the asc and tif files in QGIS, the value ranges are significantly different. Should I be ignoring the asc file as it's just an artifact of the dtm production, or is something going wrong here?
ASC
{ 'BAND' : 1, 'INPUT' : 'C:/Users/weedingb/Desktop/utas_solweig_run/SOLWEIG_run_09-04-2021_1023/DSMasc.asc', 'OUTPUT_HTML_FILE' : 'C:/Users/weedingb/Desktop/utas_solweig_run/asc_stats.html' }

Execution completed in 0.25 seconds
Results:
{'MAX': 217.020004,
'MEAN': 87.76850797590447,
'MIN': 1.335127,
'OUTPUT_HTML_FILE': 'C:/Users/weedingb/Desktop/utas_solweig_run/asc_stats.html',
'RANGE': 215.684877,
'STD_DEV': 49.898164110912916,
'SUM': 87853380.12311716,
'SUM_OF_SQUARES': 2492231954.310662}

TIF
Input parameters:
{ 'BAND' : 1, 'INPUT' : 'C:/Users/weedingb/Desktop/utas_solweig_run/SOLWEIG_run_09-04-2021_1023/DSMtif.tif', 'OUTPUT_HTML_FILE' : 'C:/Users/weedingb/Desktop/utas_solweig_run/dsm_stats.html' }

Execution completed in 0.03 seconds
Results:
{'MAX': 255.0,
'MEAN': 101.98007774877166,
'MIN': 0.0,
'OUTPUT_HTML_FILE': 'C:/Users/weedingb/Desktop/utas_solweig_run/dsm_stats.html',
'RANGE': 255.0,
'STD_DEV': 58.94115770080025,
'SUM': 102388304.0,
'SUM_OF_SQUARES': 3487963259.515189}


texts: Include Search option in table of contents

texts: I am building an interactive map using ArcGIS javascript API and I want to provide the function to search by the layers in the table of contents. What's the best way to do this?


texts: Reading GeoJSON from external file in Leaflet

texts:
I found the following script on the web but I don't know how to change the way to read JSON code.
In the script the JSON code is included in a var called sitec but I need to read that code from an external file. Any ideas how to do?

<!DOCTYPE html>

    <title>JSON - Leaflet</title>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
          integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
          crossorigin="" />


texts: Equivalent of Simple Data Loader in Modelbuilder

texts:
I have a model which processes a user specified polygon feature class InputFC, with the final result a dissolved (based on a user specified dissolve field D_FIELD) polygon feature class OutputFC. The model also creates a file geodatabase and an empty feature class called FinalFC using InputFC as a template (for the attribute schema).

If I were doing this manually, I would now load the data from OutputFC into FinalFC using the Simple Data Loader in ArcCatalog. Since they have the same table structure, ArcCatalog would automatically match D_FIELD in OutputFC to its matching D_FIELD in FinalFC and load the data into it. The rest of the attributes in FinalFC would be empty. Is this functionality available as a tool for ModelBuilder, or is there a better way to get the dissolved data into the correct table structure?


texts: Clip raster with shapefile and set a value outside the mask

texts:
I want to clip a raster using a shapefile with the command:

gdalwarp -cutline INPUT.shp INPUT.tif OUTPUT.tif

From this answer. However I want to set the pixels outside the mask to a particular value (-9999 for example). I want to do it with gdalwarp so I can perform the same process in several files (In other words I don't want to use QGIS, ArcGIS, or any similar package). A Python programmatic approach would also be desirable, as currently I am calling gdalwarp from a Python script.


texts: Creating a surface of zones of high,medium and low intensity based on an attribute

texts:
I have a point shapefile having attribute of fire probability in the range of 0,1,2,3.
0 = zero probability
1 = low probability
2 = medium probability
3 = high probability

Only 2 points have 0 values, very fever points with low, most of the points with medium probability and second highest number of points with high probability.

From this I want to create a continuous zonal map showing areas with high,medium and low probability.

I've tried many interpolation tools in arcmap but none is giving me desired results.It should take into consideration the point density first and further classify it on the basis of fire probability attribute


texts: Turn Penalty (Delay) Function for Esri Network Analyst

texts:
I have a street network for more than 150 intersecting routes which each one of them has its own cost, also changing routes (at junctions between routes) has its cost too.

Creating turn feature class manually is not an appropriate solution bcz of overlapping routes. Imagine bus routes, there are many of them overlapping. The question is how to define turn features for bus stops when a passenger goes for changing routes.

I have tried this solution and bcz its about restricted turns not about penalty for turns I couldn't imply it into my data-set.

The Turn Penalty table at junctions is sth in a table like below

Orig_Route,Dest_Route,Cost
r(1)      ,r(2)      ,100
r(2)      ,r(2)      ,0
r(1)      ,r(3)      ,75
...

How can I convert this table to Turn Feature Class with Impedance?

I found http://support.esri.com/technical-article/000008033 for modifying Global Turn penalties but its about Angle but not about start and end EdgeID. I'm after sth like below code

turnPenalty = 0
a = Turn.EdgeId_FROM
b = Turn.EdgeId_TO
If a = b Then
  turnPenalty = 0
elseif a = 1 and b = 2 then
  turnPenalty = 100
elseif ... ' or with Select Case
End If


texts: Attaching files to features: File server vs SDE attachment

texts:
I have some files that I would like to attach to my sde features. Files are small in size ( <40 KB) and have 1:1 relation to features.
I wonder which method is superior, specially in terms of performance?

1) to add a URL field to my features and store my files on the file server
2) To let arcsde do it for me on the database (attachment table)

What are the advantages and disadvantages of storage of small files within the SDE geodatabase?


texts:
My polygon feature layer hosted on Arcgis.com (ArcGIS Online) is slow to load on iPads and iPhones after the latest ArcGIS for iOS update (version 10.1.2 August 6, 2013).  If you search for Taupo Fire Jurisdictions within the ArcGIS for IOS app and try to open it you might (hopefully?) experience the delay on your device too.

It was working without issues prior to the ArcGIS for IOS update this morning (NZ).

Any ideas?


texts: Why are GeoJSON coordinates different exported from QGIS vs. ogr2ogr?

texts:
I have a shapefile with a Google Mercator projection (900913) that I need converted to GeoJSON. I need to do this on a regular basis amongst other things so I wrote a shell script to do it using ogr2ogr. I am also converting this to a 4326 projection so the coordinates are more usable.

This is how I am using ogr2ogr to do that:
ogr2ogr -f "GeoJSON" -s_srs EPSG:900913 -t_srs EPSG:4326 output.geojson my-shapefile.shp -lco WRITE_BBOX=YES -lco COORDINATE_PRECISION=6 --debug on

For some reason all of my coordinate arrays have 3 values, the last one always being 0.0. Like so:
    [ -122.633291, 48.628477, 0.0 ]

Where is the extra 0.0 coming from?? However, if I export from qgis the coordinates come out as expected..
    [ -122.633291, 48.819157 ]

I also notice that the longitude is slightly different between the two. Any ideas on how I could improve my ogr2ogr command? Or perhaps this is a bug?

Pete

Here are some more details about the shapefile being converted.

Storage type of this layer:ESRI Shapefile
Geometry type of the features in this layer: Polygon
The number of features in this layer: 431
Editing capabilities of this layer: Add Features, Delete Features, Change Attribute Values, Add Attributes, Create Spatial Index, Fast Access to Features at ID, Change Geometries

In layer spatial reference system units : xMin,yMin -19951913.23,2139102.40 : xMax,yMax 20021888.10,11554793.57

+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs


texts: Copy_raster to remove no data value using ArcPy

texts:
I have multiple raster, I am trying to remove Nodata value using Copy_raster option. Since I have multiple raster, I am running a ArcPy script, save the raster as same input name.

But that script, does not allow me to remove the nodata pixel,and

Script below:

import arcpy, os
from arcpy.sa import *
arcpy.env.overwriteOutput = True

arcpy.CheckOutExtension('Spatial')

arcpy.env.workspace = r"D:\Argicul\Maize\maize_Yield"

outFolder = r"Argicul\Maize\maize_Yield1"

list = arcpy.ListRasters()

for inRaster in list:
    localRaster = Raster(inRaster)
    outRaster = arcpy.CopyRaster_management( localRaster, nodata_value="0")
    outRaster.save(outFolder + "\\" + inRaster )