texts:
public void DrawText( IActiveView view, string text, string fontName, int fontColor, float fontSize, IPoint point ) {

        ITextSymbol textSymbol = new TextSymbol();

        stdole.IFontDisp font = textSymbol.Font;
        font.Name = fontName;
        font.Size = (decimal)fontSize;
        textSymbol.Font = font;

        IColor color = textSymbol.Color;
        color.RGB = fontColor;
        textSymbol.Color = color;

        ITextElement textElement = new TextElementClass();
        textElement.Text = text;
        textElement.Symbol = textSymbol;
        textElement.ScaleText = true;

        IElement element = textElement as IElement;
        element.Geometry = point;

        view.GraphicsContainer.AddElement( element, 0 );

        view.PartialRefresh( esriViewDrawPhase.esriViewGraphics, element, null );
    }

Can anyone suggest to me why this code always sets the font and size correctly but sometimes fails to set the color correctly? I always see the correct color in the 'textSymbol.Color' property after the line that sets it to 'color.'  On the map (within a layer) it sometimes appears to 'combine' with that layer's fill color and off the map it sometimes appears 'blue.'


texts: Mapbox GL JS : Setting bounds of raster tile layer

texts:
I have some weather radar data as a raster tileset. Mapbox documentation states that raster tilesets will default to the size of the world on the map unless otherwise specified.

Here is my code for adding my layer (and indeed, it is extremely large when it should only be a few hundred miles across on the map. - Image added below). How do I set the bounds of the raster tile source? I have also tried code which I will explain below.

map.addLayer({
    "id": "KEWX",
    "type": "raster",
    "source": {
        "type": "raster",
        "tiles": ["output/{z}/{x}/{y}.png"],
        "minzoom": 1,
        "maxzoom": 6,
        "scheme": "tms",
        "tileSize": 256
    }});

This produces a VERY large image as seen below, but as expected.

After attempting to add bounds to the tileset, it does not do anything (however it does cause the tiles to glitch out weirdly when zooming, so it's doing something.)

Below, I added   "bounds": [ -102, 26, -94, 33 ], which should locate all of the imagery within the state of Texas. What am I doing wrong?

map.addLayer({
    "id": "KEWX",
    "type": "raster",
    "source": {
        "type": "raster",
        "tiles": ["output/{z}/{x}/{y}.png"],
        "minzoom": 1,
        "maxzoom": 6,
        "scheme": "tms",
        "tileSize": 256,
         "bounds": [ -102, 26, -94, 33 ]
    }});

EDIT :

Here are the GDAL commands I used, as asked for in a comment.

First, I get my original geoTIF and add bounds to it :

gdal_translate input.tif -a_ullr -101 33 -93 26 output.tif

With the .tif file now having bounds, I use gdal2tiles :

gdal2tiles --profile=mercator -z 1-6 C:\example\output.tif C:\example\output -p raster


texts:
I have a shapefile I made in QGIS 1.7.4. One of the fields is a String of length 80. I'd like to make the field accept longer stings, but I can't figure out how to change its length. How do I do this?

Thanks.


texts:
I am trying to run an AML in a python program I am writing and haven't been having much luck figuring out the correct way to run the AML.

The AML requires ArcInfo Workstation to be from the GRID prompt.

Any tips? I am only a novice in ArcInfo Workstation.

I'm running ArcMap 10.0


texts: How to update new column in attribute table with same values but different field type?

texts:
I am struggling a bit with debugging my code, over something that seems very simple. I am using an update cursor to copy and convert existing string data into a new float column of my shapefile's attribute data.
In the original column titled "DIRECTION_" consists of strings with the following values: n, e, s, w, ne, nw, se, sw; 0-360; and finally, just blank entries. See the figure below.

Here is a picture of my code, with a typo in the comment. (TYPO = "short integer field", when should be "float type"). This code results in all other values inputted as zero except of NSEW.

I have tried to change the type of the new field to FLOAT, LONG, SHORT. And I have tried the following else statements at the end of my for loop, all resulting in type errors.

else:
    row[1] == float(row[0]) #gives Value error: could not convert string to float
else:
    row[1] == row(0)
else:
    row[1] == int(row[0]) #gives error: The value type is incompatible with the field type
else:
    row[1] = row[0] #gives RuntimeError: The value type is incompatible with the field type


texts: Exporting data using sketch tool in ArcGIS API for JavaScript

texts:
I am looking to see if it possible to extract data from a feature when we use sketch tool. After I draw a polygon it is selected as a feature what can I write to get the data behind that select feature may be in a grid to show what I have selected and have capability to export to csv.

I tried using "highlight features by geometry" but that only gives polygon and I need other shapes and also need to have multiple features created at a time which was not happening

const sketch = new Sketch({ layer: layer, view: view }); view.ui.add(sketch, "top-right")


texts: Merge intersecting polygons in same table using Postgis

texts:
I am trying to merge polygons in the same table where the polygons intersect while preserving a unique id (can be any id from the features which intersect) in postgis. Currently, I end up with more features instead of less features after running this sql statement more than once.

create table general.bldg_done as
SELECT DISTINCT least(q.a_id, q.b_id) as gid,
q.newgeom as geom FROM (
    SELECT a.gid as a_id, b.gid as b_id,
    ST_Union(a.geom,b.geom) as newgeom
    FROM general.bldg_to_merge a JOIN general.bldg_to_merge b ON a.geom &&
    b.geom AND ST_Intersects(a.geom, b.geom)
    WHERE a.gid <> b.gid"
    )
q;

For some polygons there are more than two intersecting polygons, therefore the query is run more than once.


texts: Using Python, Batch Project output won't drop into feature dataset?

texts:
When attempting to batch project in ArcGIS 9.3 or 10 (using either arcpy or arcgisscripting), I cannot get my geoprocessing results to drop into the feature dataset that I specify.  The results instead are dropped in the root of the Geodatabase (*.mdb).

Here's an abbreviated version of what I have so far:

import arcgisscripting, os
gp = arcgisscripting.create(9.3)

#set date
dmy = datetime.now()
currentDate = str(dmy.month) + "-" + str(dmy.day) + "-" + str(dmy.year)

outputfolder = gp.getparameterastext(0) #where we're going to drop the gdb
citydata = gp.getparameterastext(1)

gp.workspace = outputfolder
projectedfolder = os.path.join(outputfolder, "projected")
gp.CreateFolder_management(*os.path.split(projectedfolder))
gdb = "Projected_Data_" + currentDate + ".mdb"

#set coordinate system
outputCS = gp.CreateObject("SpatialReference")
outputCS.createFromFile(os.path.join(gp.getinstallinfo()['InstallDir'], "Coordinate Systems\\Geographic Coordinate Systems\\North America\\NAD 1983.prj"))
transformation = ""

gp.AddMessage("Creating City feature dataset")
gp.CreateFeatureDataset(os.path.join(projectedfolder, gdb), "City", outputCS)

gp.AddMessage("Loading in City feature classes")
arcpy.BatchProject_management(citydata, os.path.join(projectedfolder, gdb, "City"), outputCS, "", transformation)

Obviously, the part I'm having trouble with is the Output Path in the last line.  I've also hard-coded the path to the "City" feature dataset, but still drops it in the root.  Any ideas?

(Cross-posted at ESRI Forums here)


texts: Forming and Creating Town maps for Public Use

texts:
I have a keen interest in Graphics Design and have always wondered how town maps are created I assume it's a mixture of GIS and Photoshop/Illustrator.
Anyone here of any experience producing these kind of maps? I'd love to know the process and have a go myself.

I've included an example of something more on the GIS side of the spectrum.
I do think this map could be produced with OS Mastermap and coloring the right designated classes but I'm sure this map was likely produced with layers I'm unfamiliar with any ideas?

Ledbury Town Map

To Focus my question could anyone direct me to any resources that discuss this in detail?


texts: How to use SRTM DEM files for shaded relief in ArcMap?

texts:
I would like to create a nice shaded relief for France using SRTM3 data. Most of the threads on the subject are from awhile ago, when ArcMap was not able to import these without changing the file extension.

Now, it seems, ArcMap can import the .hgt files just fine. The problem is that the value for elevation is set at 32767 to - 32767. If I change the symbology settings and set the stretch value to standard deviation. This sets the values much lower and you can see the elevation differences.

A complete set of images is present at this imgur album showing the comparison, stretch setting, and final difference.

This creates two more problems:
- How might I do this on a mass scale? I've searched for tools and unfortunately most conversion custom toolkits seem to be inaccessible.
- Each hgt file seems to be shaded differently, due to the changing of the stretch value to standard deviation, as seen below:

I apologize if this is something that has been covered before. I am still relatively new to the world of Cartography and GIS so there may be a simple tool that I should be using.

Many thanks for any guidance on the subject.


texts: Calculating overall TRI value using QGIS

texts:
I have used the TRI (Terrain Ruggedness Index) function in QGIS>Raster>Analysis to develop TRI maps (see below). The maps are useful, but I am also trying to determine a single TRI value for the entire area covered by the DEM.

How can I do this?


texts: Removing an empty entry rule by using QgsRuleBasedRenderer without affect other rules filled in PyQGIS?

texts:
I create rules with this code but it creates one more but without data and when using root_rule.removeChildAt (0) it deletes a correct one.
layer = iface.activeLayer()
symbol = QgsSymbol.defaultSymbol(layer.geometryType())
renderer = QgsRuleBasedRenderer(symbol)

def rule_based_style(layer, symbol, renderer, label, expression, color):
    root_rule = renderer.rootRule()
    rule = root_rule.children()[0].clone()
    rule.setLabel(label)
    rule.setFilterExpression(expression)
    rule.symbol().setColor(QColor(color))
    # append the rule to the list of rules
    root_rule.appendChild(rule)
    #delete the default rule[![remove 2 rules][1]][1]
    root_rule.removeChildAt(0)
    layer.setRenderer(renderer)
    layer.triggerRepaint()

    iface.layerTreeView().refreshLayerSymbology(layer.id())

#rule_based_style(layer, symbol, renderer, 'Para Campo', ' \"REVISION\" = \'Para Campo\' ', 'yellow')
rule_based_style(layer, symbol, renderer, 'Para Campo', ' \"REVISION\" = \'Para Campo\' ', 'yellow')
rule_based_style(layer, symbol, renderer, 'De Campo NA NULL', ' \"REVISION\" = \'De Campo\' or \"REVISION\" = \'De Campo\' or \"REVISION\" IS NULL ', 'green')


texts: How do I create a new feature class from an existing FC and a WHERE clause?

texts:
I have a feature class. I want to copy the FC and use a WHERE clause to limit the rows copied. I tried using the CopyFeatures_management but it throws an error on the CopyFeatures_management() line.

Here's the code:

import arcpy

arcpy.env.workspace = 'C:/.../localFile.gdb'

inFC = 'inputFeatureClassName'
outFC = 'tmp_JUNK'

arcpy.CopyFeatures_management(inFC, outFC, '"FIELD_NAME" = "VALUE"')

The error thrown:

arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of  | DEFAULTS | TEXT_UTF16 | MAX_FILE_SIZE_4GB | MAX_FILE_SIZE_256TB | GEOMETRY_OUTOFLINE | BLOB_OUTOFLINE | GEOMETRY_AND_BLOB_OUTOFLINE | TERRAIN_DEFAULTS | MOSAICDATASET_DEFAULTS | MOSAICDATASET_INLINE.
Failed to execute (CopyFeatures).

Any ideas what I'm doing wrong and how to fix it?

Update #1 - This code works but I question whether it's really the best approach. If I understand this, I create a feature layer, perform the selection on the feature layer, and then write the selection to a new feature class. Is that correct? Is this the most efficient approach?

    # Import system modules
    import arcpy
    from arcpy import env

    # Set overwrite option
    arcpy.env.overwriteOutput = True

    # Put in error trapping in case an error occurs when running tool
    try:

       # Make a layer from the feature class
       arcpy.MakeFeatureLayer_management("C:/.../localFile.gdb/tmp_FeatureClass","tmpOMG")

       arcpy.SelectLayerByAttribute_management("tmpOMG", "NEW_SELECTION", """"FIELD_NAME" = 'VALUE'""")

       # Write the selected features to a new featureclass
       arcpy.CopyFeatures_management("tmpOMG", "C:/.../localFile.gdb/tmpOutFromLayer")

except:
   print arcpy.GetMessages()

source: ArcGIS Help


texts: How can I remove old partially installed postgis 2.0 from Mac?

texts:
I am trying to install postgis in mac using brew. However it shows that postgis-2.0.0 is already installed. Actually I tried to install it from source. Up to configuration it was fine but when I did make, it showed some errors and didn't continue. Further I installed postgresql from brew so I think it would be  better to install postgis from brew as well.

How can I remove this old partially installed postgis of version 2.0.0


texts: Choosing between Densify vs Geodetic Densify tools

texts:
ArcGIS has both Densify and Geodetic Densify tools. The help pages do not describe the tools well enough to determine when and where each is the most appropriate choice.

When and where should we use Geodetic Densify over Densify and vice versa?


texts: Avoiding error 000539 from code block in Calculate Value tool?

texts:
I do not have a very good understanding of python and have attempted to write a code block so that my model will skip rasters that do not contain any information and continue the process with rasters that do contain information.
This is pertinent part of the model:

My current issue is that I keep getting this error:

Executing (Calculate Value):
CalculateValue getValue(%Check Raster%) "def getValue(CheckRaster):\n import arcpy\n if "Has Values": return True\n if "Has No Values": return False" Variant
Start Time: Fri Oct 30 10:16:54 2015
ERROR 000539:
SyntaxError: invalid syntax (, line 1) Failed to execute (Calculate Value).

This is what my calculate value tool currently looks like:

Any ideas to how I could change the code so that there are not any more syntax errors?
(The complete model can be found here.)

EDIT: The below answers were helpful but they have not entirely circumvented the problem yet. The check raster tool that I am using seems to always give an output that "Has Values" even though the following error will occur during Raster To Polygon: ERROR 010151: No features found in C:\Users\boll0230\Documents\ArcGIS\Suitability_stuff\03\Scratch\polygon_03.shp. Possible empty feature class.

I believe this means their is a problem with the check raster tool I have. Perhaps this has become more complicated that it needs to be. Is there a possible code that could be written in the calculate value tool that would check Raster@Threshold for the presence of features?


texts: Expression labelling in ArcMap: Label only where value is > 1

texts: I have a field in a shapefile with values ranging from 1-50 and multiple listed as 0. Is there a way to label only the features where the number in the priority field is > 0?


texts: Dissolving and returning values from primary lines using ArcGIS Desktop

texts:
Im building a model and I need to dissolve line, that I marked in picture, to a line with field(NUMBER_OF_LINES) value of 2. Thsi filed represents how many lines were constructed to one line after Merge Divided Roads tool. I tried just to Dissolve all lines based on CODE and VOLTAGE and then using Spatial Join, Buffer and Identity to give/return my dissolved lines attributes of the longest line they are constructed off.
e.g.: in this case dissolved line (OID:1346 + OID:771) should get field(NUMBER_OF_LINES) value(2).I get good results when creating a buffer from dissolved line and then finding longest line in it. But if some polygones overlap at some places the value of longest line may be incorect.

I'm working with ArcGIS 10.2.2 Advanced licence.


texts: Remove Illegal Characters in Model Builder

texts:
Possible Duplicate:
  Arcpy remove invalid character

I've created a model that iterates through a shape file and pulls out unique values in a field.  These unique values are then used to create new shapefiles with the name of the shapefile being the unique value.  The problem is I have illegal characters (such as "-") in the unique values.  How can I strip these out before the shapefile is made?

Here's the python:

# Import arcpy module
import arcpy

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

# Script arguments
Inc_Birds2_shp = arcpy.GetParameterAsText(0)
if Inc_Birds2_shp == '#' or not Inc_Birds2_shp:
Inc_Birds2_shp = "C:\\Users\\OJB\\Desktop\\BurdsGIS\\Peru\\GIS\\Created\\Inc_Birds2.shp" # provide a default value if unspecified

# Local variables:
v_Output_Values_ = Inc_Birds2_shp
v_Val__shp = v_Output_Values_
Val = Inc_Birds2_shp
Testing = "C:\\Users\\OJB\\Desktop\\BurdsGIS\\Peru\\GIS\\Created\\Testing"

# Process: Iterate Feature Selection
arcpy.IterateFeatureSelection_mb(Inc_Birds2_shp, "Com_Name #", "false")

# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(v_Output_Values_, Testing,

I'm new to python and prefer working in Model Builder, but I think there is a strip function somewhere.  I'm guessing I need to strip the illegal characters out of v_Output_Values_

Any help appreciated


texts: Assigning road road segments to single line file?

texts:
I am working on a map of traffic data.

How can I join my excel spreadsheet which has traffic data based on segments of a road to the shapefiles where each road is a single line file?

Do I have to use the split tool?


texts: Google earth engine:SST by month per year

texts:
I'm trying to plot a chart and get data from Google Earth Engine. I'm using MODIS-Aqua/L3SMI data in Earth Engine.

I have used Earth Engines in built functions to compare average sea surface temperatures by day of year per year. However, it's pretty busy and would like to calculate an average per month then plot the different years of the data set. Using the code here I've been able to get an average per month over all years in the data set.

var sst = ee.ImageCollection('NASA/OCEANDATA/MODIS-
Aqua/L3SMI').select('sst').filterDate(ee.Date('2013-01-01'), ee.Date('2017-
12-31'))

var byMonth = ee.ImageCollection.fromImages(
months.map(function (m) {
return sst.filter(ee.Filter.calendarRange(m, m, 'month'))
            .select(0).mean()
            .set('month', m);
 }));

Can this code be altered to pull out the year information as well, so I can get the data by per month per year at all?


texts: Apply onEachFeature only on Points. Ignore LineStrings

texts:
I have a couple of GeoJSON files where each GeoJSON file contains a LineString and some Points (a LineString represents a hiking route and the points represent shelters). I would like to display the names of each point in a popup when clicking on the point. When clicking on the Line, I would like to display the length of the line in a popup. I'm using turf.js for the length calculation. I only know how to do one or the other.

At the end of my code, I'm creating a FeatureGroup for my Lines/routes. I was wondering if it's possible to use the function (that displays information on my points and lines) on the entire FeatureGroup instead of having to run it on every LineString and every point.

var length = Math.round(turf.lineDistance(RaslangenHalenRundt, 'kilometers') * 10 ) / 10;

//Display length of line like this
//RaslangenHalenRundt.bindPopup("Route length: " + length + " km");

//But still display name of each point like this
var RaslangenHalenRundt = L.geoJSON(RaslangenHalenRundt, {
      pointToLayer: function (feature, latlng) {
    return L.marker(latlng, {icon: shelterIcon});
  }, onEachFeature: onEachFeature
}).addTo(map);

var Kalmarsundsleden = L.geoJSON(Kalmarsundsleden, {
      pointToLayer: function (feature, latlng) {
    return L.marker(latlng, {icon: shelterIcon});
  }, onEachFeature: onEachFeature
}).addTo(map);

function onEachFeature(feature, layer) {
    var popupContent = feature.properties.name;
  layer.bindPopup(popupContent);
}

//============
//Create layer
//============

group = new L.FeatureGroup();
group.addLayer(RaslangenHalenRundt);
group.addLayer(Kalmarsundsleden);
map.addLayer(group);


texts: How do I specify the lon,lat ordering in CSW bounding box request?

texts:
I'm confused about the order of the lat/lon pairs when a CSW BBOX request is specified.

On this Geoportal Server CSW page, there is a GetRecords example where clearly the ordering is (lon,lat):

<ogc:BBOX>
  <ogc:PropertyName>ows:BoundingBox</ogc:PropertyName>
  <gml:Envelope>
    <gml:lowerCorner>-118.3 32.1</gml:lowerCorner>
    <gml:upperCorner>-87.1 45.2</gml:upperCorner>
  </gml:Envelope>
</ogc:BBOX>

but on this Data.gov example gist, it says:

"bounding box queries and responses always use axis order latitude longitude"

Is there a way to specify which order the request is using to avoid ambiquity (and possibly incorrect query responses)?


texts: Water Geometric Network Editing and Analysis solution

texts:
I’m a new user for the Water Geometric Network Editing and Analysis tool.
First, I am using ArcMap 10.8, and I built a geometry network as some online guides explain, although the process produced a 30-line error table for me, the net is as good as I checked. I've been trying to update the rules of the network, and I think that's fine too. But, when I get to run the tool options, like valves isolation, it didn't work at all. After searching the web and forums, I realized that I needed to configure the configuration file to fit the network I built, based on the entities I have.
After the configuration I did, things got better, he didn't throw an error message, but now he's running the tool, but nothing comes out.
From what I understand, I obviously have to define which layer is the valves, lines, etc.
Is there a way to do this without the configuration file?
I'm attaching the GDB with the layers and the network, the configuration file, and the error table.


texts: meridian convergence local coordinate systems

texts:
I am new to the concept of meridian convergence. I understand that it is the angle between True North and Grid North. But I have problems understanding how
 meridian convergence affects local Coordinate Reference System (CRS), such as the Gauss-Krüger system?


texts: Adding graticules to the edge of the map only in QGIS

texts:
I would like to add graticules to a map, once it is in the 'print composer', on the border of the map, and not on the frame (my map insists on being smaller than the frame). I have managed to add a lat/long grid over my map, and the grid lines are transparent. I do not want crosses or grid lines, just tick marks on border.

I am using QGIS Dufour (2.0) or Valmiera (2.2).

Can any one help?


texts: Setting custom valid values to a MapInfo field?

texts: I was wondering if it was possible in MapInfo to set valid values for a field, e.g a field called material and only valid values being BIT, CON or STO? I have a basic knowledge of MapBasic.


texts: How to calculate orientation of line segments using open source GIS?

texts: I'd like to calculate the orientation of line segments relative to north direction using open source tools. Which tools or functions would you recommend?


texts: Using multiple tiff files as a data store in Geoserver

texts: I have hundreds of tifs I want to use as a data store on my Geoserver.  So many that QGIS won't merge them for me.  I heard some about .vrt but I never found a clear source of information on the matter.  What would be the best route to get all of my tif files to behave as a single layer in Geoserver?


texts: Changing grid label style in ArcGIS for Desktop?

texts:
In  all my maps the grid labels looks like:

I try to find a way to change it to that label style:

I work with version arcview 10.3. I seek in data frame properties-->grid-->style - but didn't found any suitable example.


texts:
I once again have a question regarding this map project I'm working on. I'm trying to add a time slider to my CartoDB map, and the slider appears, but instead of displaying the correct dates and the appropriate information, it's picking random dates. I've verified within CartoDB directly that the SQL query is correct. Below is my code - any thoughts? I feel it's probably something really simple that I'm missing, like a missed capital letter or something.

Thanks!

<script>
  function changeLegend(start) {
    $('#legend').html(new Date(start))
    }
  function addTimeSlider(sublayer) {
         var sql = cartodb.SQL({ user: 'ssci582-user12' })
         // fetch time range
         sql.execute('SELECT max(date), min(date) FROM History', function(data) {
           var range = data.rows[0];
           var max = new Date(range.max).getTime()
           var min = new Date(range.min).getTime()
           // update slider with range
             $("#slider").slider({
              range: true,
              min: min,
              max: max,
              values: [ min , max],
              change: function(event, ui) {
                // give feedback to the user on slide change
                changeLegend(ui.values[0], ui.values[1]);
              },
              stop: function( event, ui ) {
                // when user selects the dates, update the layer with the range
                var start = new Date(ui.values[0]).toISOString()
                var end = new Date(ui.values[1]).toISOString();

                // build sql
                sublayer.setSQL("SQL QUERY GOES HERE" [i've already verified it's correct]);
                }
            });

                changeLegend(min, max);
         });
     }

function main() {
    var map;

    cartodb.createVis('map', 'http://[username]/api/v2/viz/...json', {
    shareable: true,
    title: true,
    description: false,
    layer_selector: true,
    center_lat: 35.79,
    center_lon: -78.65,
    zoom: 10
})

.done(function(vis, layers) {

    layers[1].setInteraction(true);
    layers[1].on('featureOver', function(e, pos, latlng, data) {
        cartodb.log.log(e, pos, latlng, data);
    });

    var vislayers = vis.getLayers();
    addTimeSlider(vislayers[1].getSubLayer(0));
    map = vis.getNativeMap();

    })

    .error(function(err) {
        console.log(err);
    });

}
window.onload = main;


texts: Change SQL Query of an Annotation Class in an existing Annotation Feature Class

texts:
I have an annotation feature class containing several annotation classes. There are SQL queries set on the annotation classes. They act as a definition query, determining which features are part of a certain annotation class.

An example would be OBJTYP = '3A' OR OBJTYP = '3B' OR OBJTYP = '3C'. The queries originate from the label settings on the layer which was used to create the annotation feature class.

I now want to change the SQL queries. Is there a way to do this?


texts:
I have a question about "default value" based on expression.
For exeaple, I have a layer in a GPKG, with 3 attributes: "Number" / "Letter" / "Roman".
For my attribute "Number", I have a value from a list with 1, 2 and 3.

For the attribute "Letter", this attribute is not editable. In "default value", I have this expression:
IF("Number"=1, 'one', IF("Number"=2, 'two','three'))

This step work fine, and if I change the value "Number", the "Letter" is updated... Perfect!
Now, if I do the same for the attribute "Roman", but based on "Letter", calculated previously:
IF("Letter" like 'one', 'I', IF("Letter" like 'two', 'II','III'))

But it doesn't work. The attribute isn't calculated, and isn't updated when a change occurs.


texts: union of two vector layers gives only one layer attributes as output

texts:
layer1 layer2 Resultant union LayerIt is giving only one layer as output

I have used the following

val='layer1'
val2='layer2'
operation='qgis:union'

processing.runalg(operation,val,val2,'result.shp')
layerAdded = iface1.addVectorLayer(os.getcwd(),'result', "ogr")
QgsMapLayerRegistry.instance().addMapLayer(layerAdded )


texts: Compiling PDAL with both Python2 and Python3 bindings support

texts:
I would like to build PDAL with both together support for Python2 and Python3 bindings (on Ubuntu 16.04).

Fig. 1: Screenshot of the Python stuff within cmake-gui.

How could I achieve this?
If a re-compile with Python3 support I end up with such error message when installing, so I have to uninstall it before, which will uninstall the Python2 bindings... :

Selecting previously unselected package pdal-1.7.1-py3.
(Reading database ... 546498 files and directories currently installed.)
Preparing to unpack .../pdal-1.7.1-py3_20180920-1_amd64.deb ...
Unpacking pdal-1.7.1-py3 (20180920-1) ...
dpkg: error processing archive /opt/PDAL/build/pdal-1.7.1-py3_20180920-1_amd64.deb (--install):
 trying to overwrite '/usr/local/bin/pdal', which is also in package pdal-1.7.1 20180823-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /opt/PDAL/build/pdal-1.7.1-py3_20180920-1_amd64.deb
/var/tmp/tmp.TeaEeCUL0y/dpkginstall.log (END)


texts: Undesired abbreviation when saving joined layer

texts:
I have a polygon layer patches in QGIS. I joined with attributes from an attributes table, where the column names are relatively large. Then I save the polygon layer as patches.new.

When opening patches.new, everything seems fine except for the fact that the column names appear to be abbreviated. Is there a way to omit abbreviation when saving a shapefile in QGIS? I tried different encondings, it didn't help. So I suppose there must be something I missed...


texts: Building model to select values at point from folder of several raster layers?

texts:
I am using ModelBuilder to interpolate values with inverse distance weighting, iterated through several rows, resulting in many raster datasets - one raster layer per row. I have this and all the raster files are in one folder.

Next, I would like to select the value at specific coordinates, and repeat for each of the raster files, resulting in a table with a row for each coordinate-rasterlayer (so, total number of rows in the final table = # coordinates*number of raster layers in folder).

I added on to the original model, but it is creating an overall estimate from all the raster datapoints (so, total number of rows in this incorrect table = # coordinates)

How can I fix this model?

Here is the model I have now.

This works through the IDW step, creating this output, which is a raster layer per row in the original data

The goal is to create at table with estimates for each centroid coordinate from each raster layer. The zip_centroid is a point dataset with lon and lat I need estimates for.


texts:
I have a point data set with terrain aspect at the location of the points, measured in degrees. I want to compute the similarity of aspect between the points, e.g. 70° is similar to 90°. This is straight forward, but the problem arises for aspects near the north direction. A aspect of 350° should be similar to 10°. How can I detect these two aspects to be similar?
I am looking for a transformation of the values that takes into account that 358° and 2° is almost the same, even though it is far apart in my 0-360 metric.


texts: Quickly change my current location in the QGIS 3 browser

texts:
I use Windows Explorer to manage the contents of the folder, and the fastest way to change my current folder in different applications is to copy the folder path and paste it into the browser tab of another application. But I can't find any input boxes in QGIS 3 browser to insert the path to the folder.

There is a way to quickly change my current location in the QGIS 3 browser without manually pressing all of these + buttons on the browser tab?


texts: Customizing rules for Address Standardizer using PostGIS?

texts:
Following PostGIS documentation, I created a custom table for having different pagc_rules (also pagc_lex and pagc_gaz) so I can standardize/normalize addresses with different formats than the US where "house number" goes after the street name(s).
E.g. instead of "123 Main Street", it would be "Main Street 123".

I've tried adding rules to cover as many cases as possible, but it never works, so I'm not sure if the parser is even matching against my custom table or not.
What I did confirm, tough, is that my custom Lex and Gaz tables do work; I tested them with US addresses and the standard rules, and got my own lexicon for streets/states in the results.

This works

SELECT *
FROM standardize_address('ar_lex', 'ar_gaz', 'pagc_rules', '123 Main Street');

This doesn't

SELECT *
FROM standardize_address('ar_lex', 'ar_gaz', 'ar_rules', 'Main Street 123');

So I'm not sure what I might be missing to make it work with my custom rules as well.

I'm looking for some guidance more than specific answers, since I couldn't find any resources on the web where someone customized rules for using the address standardizer with countries other than US/Canada.


texts: exact_extract in R does not include col_names when

texts:
I have a list of a spatial dataset and a stack of rasters. The sf represent fires from 1985 to 2017 and the stack of rasters represent the climate conditions from 1985 to 2017. I want to extract the raster values for each pixel in the fire polygons using the exact_extract function in R. The function has the argument include_cols which is an optional character vector of column names in sf to be added to the data frame. Also, it has the argument append_cols that do the same when the fun is not NULL.  However, when I try to apply the function I get the following error:
Error in `[.data.frame`(x, i, j, drop = drop) :
  undefined columns selected

Here is my code:
waterclimPre_extract<- mapply(x= waterclimPre_maps, y = polys_maps, FUN= function(x,y)
  exact_extract(x, y, include_xy = T, include_cell=T, include_cols = c("year", "fireClas")))

and also:
waterclimPre_stat <- mapply(x= waterclimPre_maps, y = polys_maps, FUN= function(x,y)
    exact_extract(x, y, fun = c("mean", "min", "max", "median", "variance"), append_cols = c("year", "fireClas")))


texts: WFS consumed in QGIS generates duplicate features

texts:
Problem: When some of my layers are published by Geoserver 2.8.0 and added as WFS layer in QGIS 2.16.0 some of the data are duplicated. The duplicated data do not have geometry. I have observed this in two layers that I am serving but it is not consistent with all of them. However for those two layers the same does NOT apply when the data are imported in FME 2016 or ArcGIS 10.3.1 using the interoperability extension.

Background: The geoserver layers are held as 'views' in a PSQL 9.4 server which sits in Ubuntu 14.04. The views are generated using a statement of the following form:

CREATE OR REPLACE VIEW geoserver_view AS
(
SELECT
column_1,
column_2,
column_3,
...,
geom
FROM schema_name.table_name
)

I have also tried creating or replacing the views using the following form of view creation as suggested in the Duplicate entries in table list when adding PostGIS layer in QGIS but I observed the same records duplication.

CREATE OR REPLACE VIEW schema_name.geoserver_view AS
(
SELECT
column_1,
column_2,
column_3,
...,
geom::Geometry(MultiPolygon, 27700),
FROM schema_name.table_name
)

I think that QGIS is probably the problematic software here since I have checked the data in PSQL and they are fine, and when importing the WFS in other software no record duplication is observed.

Any insights?


texts: How to make two layers with different CRS line up correctly?

texts:
I have an Excel Table with Lat/Long information. Its lat/long of this coordinate System: UTM zone 29n

My population density map instead is this coordinate system: UTM WGS84

Example: Barcleyville: Lon = 585242 / Lat = 517100

What I tried to do:

I loaded the pop_density data and changed the projection to WGS84 / UTM zone 29n : EPSG32629. Afterwards I loaded the CSV-Data with the same projection but it's still not overlapping. Do you have any suggestions?


texts: Loading the Spanish Cadastre INSPIRE WFS into a leaflet in R

texts:
I am trying to load some WFS data into a leaflet using R. The problem is that there doesn't seem to be a straightforward way to collect it, unlike with WMS, which has the addWMSTiles() function in the leaflet package for R.

How can I proceed?

Out of all attempts so far, the one with "greatest" success (no success really, just fetched the XML data) was done using the following code:

library(c(XML,plyr))

fileurl <- "http://ovc.catastro.meh.es/INSPIRE/wfsCP.aspx?service=WFS&request=GetFeature&Typenames=cp.cadastralparcel&SRSname=EPSG::25830&bbox=233673,4015968,233761,4016008&version=2.0.0&"
doc <- xmlParse(fileurl,useInternalNodes = TRUE) ### xmlParse()- is to parse the xml content, the parsed content is stored into doc
xL <- xmlToList(doc) ###is to convert xml doc into List

data <- ldply(xL, data.frame)
head(data)

This yields an XML with polygon points in one of the columns, but how can I include this in a Leaflet? It seems too much of a workaround to do this in this way. Does anyone know how to do this in a more straightforward manner?

Link to the inspire XML document on how to request data

UPDATE 1: I have found a way to do this using the sf R package. With

st_read("http://ovc.catastro.meh.es/INSPIRE/wfsCP.aspx?service=WFS&request=GetFeature&Typenames=cp.cadastralparcel&SRSname=EPSG::25830&bbox=233673,4015968,233761,4016008&version=2.0.0&")

Unfortunately it was not as straightforward as it seems. I had to install OSGeo4W64 in my machine because the rgdal package was not working properly. I also had to make the evironment variables point toward the OSGeo4W64, and delete the ones that pointed to sf. I followed this guide.

However I am still wondering how to integrate this in R just as I did with WMS. As you may notice from the url in st_read, it includes a Bounding Box, which I want leaflet to determine just like it did with WMS (which also required one)


texts: start GRASS 7.6.1 with OpenCl from windows prompt

texts:
I desperately tried this code and variations:

grass76  LOCATION_NAME=32632  GISDBASE=C:\Users\706774\Desktop\xxx\grass_database  MAPSET=PERMANENT  --with-opencl  --gu

but I get this error:

  ERROR: Location  doesn't exist Exiting...

Someone could be so kind to help me?


texts: NOAA Magnetic Field Component Grid Calculator Help

texts:
I am using NOAA's magnetic field component grid calculator trying to calculate the magnetic declination of the entire United States (here's the help page).

Essentially, the link asks for a minimum and maximum lat-lon for the grid you want to calculate the magnetic declination for. According to the help page:

  The grid calculator allows for calculation of magnetic field values
  for an area or a point. In order to calculate a grid of components for
  an area, you fill out min and max longitude and min and max latitude
  values in order to define a bounding box for the area of interest.

To input an area:

Max longitude = 85 1 39.6192 W
Min longitude = 125 1 39.6192 W
Lon Step Size = 1.0
Max latitude = 60 3 3.7836 N
Min latitude = 20 3 3.7836 N
Lat Step Size = 1.0

I am not sure what the correct "bounding box" for the entire United States is. I used an open-source tool called Bounding Box Tool, but it didn't help. Someone posted on Quora and said the "extent" of the bounding box was:

Extent: (-124.848974, 24.396308) - (-66.885444, 49.384358)

But... I'm not sure what that means.

Can someone help?


texts: How to force 1 bit GeoTiff (binary image) outputs from QGIS processing in Python console?

texts:
In a QGIS Python script I'm trying  to produce raster 0/1 mask with use of procesing package. The pipeline looks like that:

Create an image of index (NDSI if that matters) with numpy arrays from a satellite image,
Do thresholding with saga:rastercalculator from processing to obtain 0/1 mask where the index exceeds a value. I can force data type on this stage, so I set it to 1 bit file. Because of some peculiarity of format and QGIS (as I understand it), assigning 0 in a saga formula results with NaNs in the output file,
Convert nans to 0 with saga:reclassifygridvalues.

Here my problem begins. There's no flag for datatype in reclassification, so it seems, that I get Float32 by default. And the values are 0 and 0.999, which is a problem, as I have to subtract them later on from another mask (raster calculation again) and instead of clean 0/1 cut I get a few shades of gray.

How can I make processing algorithms return 0/1 images consistently?


texts: Interpolating and infilling raster from 5km pixels to 100m pixels in ArcMap

texts:
I am trying to refine a raster dataset of annual rainfall from a 5km grid down to a 100m grid. Before I continue, I am aware that this could result in some uncertainty regarding the data. However, the data is only available in the 5km grids, and this is of no use to me, as I am looking to compare rainfall to landuse, and the landuse map is to a 100m grid.

To get around this, I thought I would be able to infill the data through the use of contours (as rainfall data is generally gradient based, rather than discrete isolated data points)

I contoured the 5km raster file using Contour (Spatial Analyst), and then tried to use the contour file to create a new raster file (Feature to Raster) at a 100m resolution. However, because the contour feature is a polyline feature, there isn't any data between the contours. This means that anywhere the contour lines fall more than 100m apart, the raster file leaves a blank pixel.

As I see it, there are three options that I may be able to look into (no idea how, or if,  the first two would work)

Option 1: Directly refining the resolution of the original raster file, by increasing the resolution from 5km to 100m pixels and infilling the new pixels with values interpolated from the original file.

Option 2: Some sort of interpolation tool, (I saw several in the Geostats toolbox, but don't understand how they work) that could transform the contour polyline feature into a continuous dataset, which could then be converted to raster.

Option 3: Create a contour file with ridiculously fine contours (I have already tried 0.5 mm, over a range from ~ 500mm to 3000mm, and this didn't do the trick in places)


texts: Difference between regionalization and image segmentation

texts:
Regionalization is a special form of clustering where spatial units are grouped together, based on a set of defined criteria (cluster homogeneity) and a set of contiguity or adjacency constraints.

Isn't this exactly the same thing that image segmentation tries to accomplish: finding contiguous and homogeneous clusters in image data? What is the difference?


texts:
have created database by tool osm2pgrouting. On my website can user enter start and end point.

How can I find ids of nodes? Because I have only text value of nodes which enter user, but tables generated by tool does not.
UPDATE:
On the website will be 2 inputs for 2 points (start and end) user enter for example New York (as start) and Los Angeles (as end). Next I call service to my geoserver and select route, and return tiles or geoJSON. But for selecting route I use pgr_dijkstra function which requires node IDs, but I have only NY and LA in text format. How can I convert this to coordinates or osm_id??

This is how my table of nodes looks:

This is reason why I need convert text values of user to id or coordinates.


texts: WMSGetFeatureInfo not showing in Firefox and chrome

texts:
This code set works for me in IE but not in Firefox and chrome.What is the problem? Map is showing in all browsers ,but when i click on point of map nothing showing in  Firefox and chrome.

Welcome any idea!

<!DOCTYPE html>

<title>My OpenLayers Map</title>

 <link rel="stylesheet" href="1.css" type="text/css">
 <link rel="stylesheet" href="2.css" type="text/css">

Feature Info in Popup

    WMS, GetFeatureInfo, popup

    Demonstrates the WMSGetFeatureInfo control for fetching information
    about a position from WMS (via GetFeatureInfo request).  Results
    are displayed in a popup.


texts: How to imbed lat/long geodata into GoPro 4K video

texts:
I'm looking for an efficient way to take 360 panorama video and imbed geodata lat/long into the video.

I'd prefer to mount something like this http://www.360heros.com/ on a truck and drive down a neighborhood and overlay geodata on the video itself.

For example, If I drive down the street, I want the street numbers to be overlaid on the homes that I view on the video as I drive by.

I'm trying to find something that is off the shelf that I can buy that will associate my video with accurate geodata.


texts: Mix two raster files with different land mass in QGIS or R

texts:
I need to mix two raster files (tif-Format) in QGIS or R.

File 1 is a DEM of recent times.
File 2 contains only information about land mass and sea level of 40.000 years ago.
File 1 & 2 have the same extent and cell size.

How can I mix both files in R or QGIS to get a result where the most part is of File 1 (the DEM because its land mass) but when the current land mass ends, it should be extended by file 2?


texts: Stripes and Distortion in classification result when performing maximum likelihood classification in ArcMap

texts:
I have trouble performing a supervised classification in ArcMap 10.3.

I created training areas and executed the "interactive supervised classification"-tool, which works totally fine and gives back the expected result. Now, since I later want to integrate the classification in model builder, I have to use the "Maximum Likelihood Classification"-tool, since the interactive tool is not available in model builder.

Therefore, I saved the training areas signature file and executed the "Maximum Likelihood Classification"-tool (Input: 4-band tif and the signature file). But the result is errorneous, it contains stripes and it is distorted as well (see below both results)...

Maybe someone has already experienced this and has advice or solution for me. In the ArcGIS-Help it says that when executing "interactive supervised classification"-tool, it internally calls the "Maximum Likelihood Classification"-tool. So I have no idea where the problem appears.


texts: Resampling in Google Earth Engine: exporting Sentinel 1A to Google Drive

texts:
I tried to export Sentinel 1A to Google Drive on Google Earth Engine. The function has a parameter name "scale" which determines pixel scale of the exported image.

Export.image.toDrive({
    image:imgtype[type],
    description: id,
    folder: folder,
    fileNamePrefix: id,
    region: region,
    scale: scale,
    maxPixels: maxPixels})
}

From the docs, it is said that Sentinel 1A has three resolution: 10m, 25m and 40m. My questions are:

If I set scale = one of three above scale, is the exported image original image or resampled image. And if it is resampled, then what resampling method is used?
If scale = another number (i.e. 20, 50, ...) then how GEE produce those images to Google Drive?


texts: OpenStreetMap Tiles Not Loading in Firefox 17.0.1 - Pink Background

texts:
I recently ran into an issue where only a pink background is displayed in the openstreetmap on my webpage (tiles are not displaying). I found this topic OpenStreetMap tiles not loaded despite being received which would seem to address the issue but the solution presented no longer fixes it.

I tried adding the suggested code to my layer but the issue persists.

map.addLayer(new OpenLayers.Layer.GeoRSS("My Points", "georss", {
    tileOptions: {
        crossOriginKeyword: null
    }
}));

Any ideas on how to fix this in the newer version of Firefox?


texts: Change data format in QGIS field calculator using format_date

texts:
I´d like to change the data format in the attribute table from yyyy-MM-dd (default) to dd.MM.yy using the format_date function in the field calculator.

Using:

format_date(date, 'dd.MM.yy')

I got NULL values in the new field in the attribute table.

My create a new field settings:

Although the output review looks correct, in the new field only NULL values appear:

Choosing string as the output field type the new field contains intended values but in the wrong format.
Applying to_dateexpression on the string values is invalid.

Any ideas how to solve this problem?


texts: Identify feature tool auto open form is not working in QGIS?

texts:
I am using QGIS 2.14, and using the 'Identify Features' tool.

I have the 'Auto open form' checked, I am zoomed in so I can identify a single feature easily, I have the layer selected, I have the layer in editing mode, and the 'Mode' set to 'Current layer'.
The layer is an spatialite offline file from a PostGIS database.

In the past the form would open automatically and I could edit the attributes of the feature.

This has now stopped working for me. I can click into the 'Identify results' dock and then 'Edit form feature' to manually open the form.

Can anyone tell me why the form won't open for me automatically?


texts:
I've recently come into a new position where I'm using QGIS instead of ESRI and am learning the ropes on handling all the things ESRI comes out of the box with that QGIS doesn't.

I've found tile server URLs for OpenStreetMap and Bing Aerial, but nothing of the hybrid variation. Does anyone have information on anything like Bing or Google Hybrid tiles with worldwide/US coverage?


texts:
I have QGIS 1.8 and I want to upgrade to 2.0 Dufour...

Should I just download the file and launch the installation, or first uninstall 1.8?


texts:
I have about 170 DWG files that need to be clipped to their corresponding tile. Each tile is 14,000ft wide, 8,000ft height.

The grid:

Each DWG file overlaps the tile border by 800ft:

Unfortunately, each DWG file is in its own directory, so I'm not sure if that makes coding a batch clip more difficult. The file we're working with will always be named like "###_2ft.dwg"

So my question is: How can I efficiently clip these DWG's and output them as feature class files?

I have thought about creating a fGeoDB to copy each DWG polyline file into, however, for whatever reason when expanding the DWG layer it takes ~30 seconds to show the annotation, point, polyline, etc.

I've checked out some guides using iteration in ModelBuilder, but I can't get the same results. Specifically posts like this. In that post, a user mentions constructing the geoprocessing command in notepad and using excel to help with filenames, but I'm not sure what the commands would be.


texts: Tuning Esri Geodatabase on Oracle Spatial (SDO_Geometry) performance?

texts:
We are storing data in a Geodatabase on Oracle 11g using Oracle Spatial with SDO_Geometry, and then consuming that using ArcGIS server 10.2.1.

The performance is very slow, because we are talking about between one to two million records.

When I loaded the data, I didn't pay attention to creating or configuring indexes,
as I just used FME to load the data from a file geodatabase.

What are the best practices when you use Geodatabase on Oracle with SDO geometry?

Which indexes are being used, the oracle ones, or sde ones?

I am very new to database performance issues because I am mostly a developer.


texts: How to change the color of a selected feature with pyQGIS?

texts:
is it possible to change the color of a selected feature in qgis 1.8?
To highlight a feature I use:

vlayer.setSelectedFeatures(selectedList)
box = vlayer.boundingBoxOfSelected()
qgis.utils.iface.mapCanvas().setExtent(box)
qgis.utils.iface.mapCanvas().refresh()

But the selected featue is colored yellow. Is it possible to define for example a red color for this feature?


texts: Programmatically finding polygons which are >90% overlapped by another vector polygon layer using QGIS?

texts:
I'm trying to figure out how to use python to extract the polygons in one vector that are overlapped by >90% by another vector.  I would then like to have a vector/map that will only show those polygons.  The example picture shows my layers.  I want all the grey polygons that are > 90% red.

I need to do this all via python (or similarly automated methods). I have ~1000 maps to process the same way.


texts: How to place only one symbol on the centroid of a multipart polygon?

texts:
I am using QGIS version 2.14.1 (Essen). I would like to place symbols on the centroids of my data. The problem is that some of my data has multi-part polygons, which means it places the symbol at the centroid of each mutlipart.

Is there anyway to place a unique symbol at the centroid of the polygon even if the geometry is a multi-part?

It works fine for single part geometries but not for multiparts.


texts: Getting Shaded relief from DXF mesh using QGIS?

texts:
I am stuck with a problem in QGIS. I have a three-dimensional mesh as DXF from AutoCAD, which I imported into QGIS.

Now I wanted to create a shaded relief map. I think I need to create a raster from the mesh first. I tried converting the mesh to lines and the rasterize these lines, but this approach didn´t seem to work.

Has anyone any suggestions?


texts: Creating thematic map on calculated field in ArcGIS Desktop?

texts:
Is it possible to create a thematic map in ArcGIS Desktop on a calculated field, without changing the DBF file of the SHP file?

I know I can do it in MapInfo, but have searched without much luck in ArcGIS Desktop.


texts:
I am working on an ArcGIS map. I need to be able to interact with KML layers.

Here is a minimal version of my current code:

map = new Map("map", {
  basemap: "topo",
  center: [-108.663, 42.68],
  zoom: 6
});
parser.parse();

var kmlUrl = "https://dl.dropboxusercontent.com/u/2142726/esrijs-samples/Wyoming.kml";
var kml = new KMLLayer(kmlUrl);
map.addLayer(kml);
kml.on("load", function() {
  console.log("done");
});

Here is a fiddle

I'm looking to achieve something more like this map, which outlines the layer on hover. (This example is from the FeatureLayer class, but my KML is dynamically generated. Is it possible to create a featurelayer dynamically from KML data?)

How can I listen for mouseover on a KML shape?


texts: Reading OGC geometry data from SQL server using R

texts:
I would like to write a script in R that creates a map using OGC geometry data that is stored on a Microsoft SQL server.  Is there a way to read OGC geometry data using a query passed from R?

Maybe the code would look something like this (But not like this because the following code is actually garbage).

library(RODBC)
library(maptools)
library(maps)

png(file="example%02d.png", width=600, height=480)

con <- odbcDriverConnect('driver={SQL Server};server=SERVERNAME;database=DBNAME;trusted_connection=true')

objects_1 <- sqlQuery(con, 'SELECT OBJID, Shape FROM TABLENAME;')

spplot(objects_1, col="#000000FF", sp.layout = list(otherObjects))


texts: Rollback error when restoring SQL dump file in postgresql using PSQL console via Pgadmin

texts:
I am trying to restore a pg_dump SQL file into my postgresql database using PSQL console , where I typed the below command:

\i 'c:/../path/to/sample.sql'

when I run this I get an error saying transaction is aborted and ends with ROLLBACK.

Can anyone please let me know the reason for this error?


texts: Why are buildings shown with a distortion instead of directly from above?

texts:
I am pretty new to QGIS so I already am crossing a problem. I opened an open
source map where you can see the buildings. The weird thing is that I see the buildings from an angle instead of directly from above.

Anyone know what the problem may be?


texts: There was an error exporting the layer from ArcGIS for Desktop?

texts:
When trying to do export a layer to create anther shapefile I receive this message:
It's only giving me this message for this layer. I tried on another layer and it seemed to work.

I'm using ArcGIS 10.2.2 for Desktop.


texts: ArcSDE Enterprise Geodatabase - XML and Tolerance Issue

texts: I set up an ArcSDE Enterprise Geodatabase in SQL Server 2012. I imported the XML file from the Utility and Pipeline Data Model without any modifications. I am now running into an issue: the XY tolerance is set at 0.0002 degrees in the XML and when I go to digitize a polyline it is not saving it properly. I have the feature class and data frame set to WGS_1984 and the XY tolerance does not change. Any suggestions on how to fix?


texts:
I am working on a report that include different maps of the exact same area, with different items on it. My problem is that I need to select a portion of the US West Coast from a shapefile of the whole United States. I'm doing it manually, but of course each time I repeat the process, the selection is slightly different.

Is there a way to select specific areas and store such selection in order to be able to replicate it from scratch with no effort?


texts: Can anyone tell me how to recover a map accidentally deleted in arcgis online  from the Delete folder?  The delete folder says theres currently 14 items in there .


texts: Looking for Ontario topographic data and property line data; willing to purchase the latter.  Shapefiles or file geodatabase files would be optimal.  In terms of topographic data, I am looking for: basic outline of Ontario, county or municipal outlines, contour data, water (lines, poly, etc), buildings, and so forth.


texts: Failed to seed layer in GWC of GeoServer when Zoom Start is selected greater than 4 using a user-defined Grid Set

texts:
Everybody,

I'm undergoing development on a application which is constructed by GeoServer and OpenLayers. Considering that there is a large set of layers (8 layer groupS and totally 121 layers) to display, we decided that user access the map in the cache way rather than dynamic generating. Because there are only 2 optional Grid Set in GeoWebCache from, I searched from google to create a new user-defined Grid Set 'EPSG:2326' which is aimed for HongKong, following are steps I did:

1, Newly added a Grid Set in 'geowebcache.xml' which is under path 'data_dir/gwc':

  <gridSets>
    <gridSet>
      <name>EPSG:2326</name>
      <srs>
        <number>2326</number>
      </srs>
      <extent>
        <coords>
          <double>806677.9759</double>
          <double>802420.9858</double>
          <double>8876817.5647</double>
          <double>853384.7903</double>
        </coords>
      </extent>
      <scaleDenominators>
        <double>25000000</double>
        <double>1000000</double>
        <double>100000</double>
        <double>25000</double>
      </scaleDenominators>
      <tileHeight>256</tileHeight>
      <tileWidth>256</tileWidth>
    </gridSet>
  </gridSets>
  <layers>

2, Added new optional Grid Set into layer group's XML config file which is under the path 'data_dir/sample_group' and named for 'sample_group.xml':

<entry key="GWC.gridSets">EPSG:4326,EPSG:900913,EPSG:2326</entry>

Finally, I go to the GWC Seed Form page to generate cache png, and seeding task can done successfully only on the condition that Stop Zoom is lower 4, otherwise will be failed and below is the related error message:

java.lang.IllegalStateException: Found no range bounds for z level 4: {0=[J@16a4cf2, 1=[J@1e1b0e7, 2=[J@2516dc, 3=[J@1000323}
        at org.geowebcache.storage.TileRange.rangeBounds(TileRange.java:169)
        at org.geowebcache.seed.SeedTask.tileCount(SeedTask.java:217)
        at org.geowebcache.seed.SeedTask.doActionInternal(SeedTask.java:107)
        at org.geowebcache.seed.GWCTask.doAction(GWCTask.java:76)
        at org.geowebcache.seed.MTSeeder.call(MTSeeder.java:36)
        at org.geowebcache.seed.MTSeeder.call(MTSeeder.java:25)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

I guess that means no Bound Box for Zoom Level 4, I'm now confused and hope anybody out there give me some ideas?

Thanks a lot.


texts:
Given a 3D mesh I need to visualize and analyze properties and elements generated from the object such as:

tensors
coplanar/similar elements ( coplanar faces, aligned vertices, etc etc, 3D geometry basically )
normals
grouped faces

I'm especially interested in tensors and in any property that I can use to simplify and understand some linear algebra computation.

Do you know about any tool like the one I'm looking for ?


texts: Dynamically trimming informational border off of FAA sectional raster charts?

texts:
I'm trying to write a script that can automatically use GDAL to crop the informational border from the FAA's published sectional charts (GeoTIFF) found here:

I know that I can use gdal_translate -projwin ulx uly brx bry to crop it to a coordinate range, but I'm not sure where to get the values for the map area aside from by hand, or if there is possibly a better way to crop it.

Is the information necessary to crop the chart extractable from the files they provide?


texts: Mapping latitude-longitude to body of water

texts: Is there a web service or dataset making it possible to map a latitude-longitude pair to the name of a body of water such as the name of an ocean, or large sea or lake? I am thinking of something akin to, say, http://services.gisgraphy.com/public/geocoding.html or one of the datasets available from thematicmapping.org for countries.


texts: 'select' listener in xtype combo, scope issue with IF?

texts:
I wonder if this is a problem of scope. The thing is that I select an option in a xtype combo (extjs3.4) and that selection at first can be read outside and inside an if section (attached image). Now, when I select another option, that selection is only read outside the if section (ie. it's not read inside it). Is this a normal problem of scope? if so, how could I solve it?

listeners: {
  'select': function(combo, record) {
    var comboLayer = this.getValue();
    var rawLayer = this.getRawValue();
    var loadedLayers = [];
    for(var i = 0; i < mapPanel.map.layers.length; i++) {
      loadedLayers.push(mapPanel.map.layers[i].name);
    }
    console.log('outsideIf: ' + loadedLayers);
    console.log('outsideIf: ' + rawLayer);
    console.log('outsideIf: ' + comboLayer);
    if (loadedLayers.indexOf(rawLayer) > -1) {
      console.log('insideIf: ' + loadedLayers);
      console.log('insideIf: ' + rawLayer);
      console.log('insideIf: ' + comboLayer);
      newUrl = '/pg?layers=' + comboLayer;
      protocol.options.url = newUrl;
    }
  }
}


texts: gdal2tiles georeferenced image as overlay not working

texts:
I'm using gdal2tiles-leaflet to create tiles for my Leaflet application.
The images I use are GeoTiff's with the embedded projection WGS84, they are in flight photos taken by a drone.

So I tried gdal2tiles-leaflet. I successfully created a map where I can navigate the image. It works great. But the image is not working properly when I use it as a overlay layer on a normal map, with other base layers. Such as open street map.
The image is then super large, so I have to zoom out really much. And the image covers almost the whole earth. So it's basically not georeferenced in the way I'd like it to be.

Here's some of the commands that I've been using:

gdal2tiles-multiprocess.py -l -p raster -z 0-9 test.tif tiles
gdal2tiles-multiprocess.py -l -p raster -z 0-7 -s src.prj -w all test.tif tiles
gdal2tiles-multiprocess.py -l -p raster -z 0-7 -s src.prj -t "+proj=longlat +ellps=WGS84" -w all test.tif tiles
gdal2tiles-multiprocess.py -l -p geodetic -z 14-15 test.vrt

I've tried different zoom levels, raster, geodetic and so on. But I can't seem to get the result I'm looking for.

I know that MapTiler has the functionality to get this to work, I've tried it on a smaller image. But the application does not really fit in to my workflow on the server everything is hosted on.
So I would like to be able to use gdal2tiles-leaflet.

I pretty certain I'm just missing some small thing.


texts: I've a set of kmz files of point location. These point locations have 2 fields along with location. I want to import these kmz files in a free database. How can we achieve this?


texts: How to clip a vector feature to the extent of an existing raster dataset using arcpy

texts:
I have a clipped raster dataset with polylines (from the contour tool) overlayed (see attached).  I am trying to clip the polylines to the extent of the raster dataset, which seems simple enough, but I've tried multiple things and can't seem to get it to work.  I will eventually need to code this using arcpy but I think for now, just a nudge in the right direction as to which tool will accomplish this will help me for now.

Thanks.

P.S.  I am using ArcInfo 10.0


texts: How to calculate max distance between two polygons in ArcMap?

texts:
I have two layers formed by polygons that I need to overlap in order to calculate the max distance of one polygon with respect to the perimeter of the other one.

In order to be clear I have this type of situation:

I have a file with the black polygons and another file with the red one. I need to know the maximum distance of the red one to the black one (the blue arrow in the example).... any suggestion?

Here the passages that I'm making:

1) this is the initial situation. In order to simplify the situation I made the polygons with the exact colours as in the example:

2) Next, I made the euclidean distance as follows:

3) Zonal statistics:

4) this is the output:

If I'm correct: the COUNT is the previous FID (so the number that indicate each black polygon). Max should be the maximum distance of the black polygon to the next red polygon. If this is right, how is it possible that in some cases I have Min greater than zero and Max equal to zero? Moreover, this values are already in meters?

Actually it is a bug: if I compute only max make sense:

So that MAX are the maximum number of METERS to the next red polygon, right? A last question: is it possible to have a 0 value if NO red polygons are inside the black polygons?


texts:
I save my Qgis project in  PostgreSQL database. I've made a table witch contains the owner's name of the project (one user between all). I would like to be able to set my project in read only mode for a specific user (in python), i.e. :
User A : create a new QGIS project with 10 layers
User B : can read the project but can't save it
User A : can update or delete the project
If is not possible, is there a solution to load a new QgsProject from an other (making a clone) ?


texts: Read color bil file striped in QGIS, R or gdal

texts: I am trying to render a bil file I downloaded from this link, but in QGIS, R raster::raster() or gdal_translate it shows rotated and with stripes, as shown on the picture; I think it is a problem with the hdr file, I remember opening them in arcmap and they would show without trouble.


texts: How to install MapServer on IIS 7.5 with windows 7 OS

texts:
I want to use the map server in my asp.net application. For that one, I need to install mapserver on IIS. I am using windows 7 with 64 bit os. I have IIS 7.5 installed on my PC.

Can any one help me to on install mapserver on IIS 7.5 with windows 7 OS.


texts: Buffering line in ArcMap is creating smaller buffer than expected?

texts:
When I buffer a point (red dot on image) by 3 miles, it is 3 miles on all sides. When I buffer a line (blue line on image) by 3 miles, it is more like 2.67 miles on the sides parallel to the line. I tried various projections, but I basically get the same result.

Any ideas on why this happens or workarounds?


texts: Openlayers 3 reloading the map after updating features

texts:
I'm trying to add and move features on my map. These updates come through a form, so after the data has been updated I want to reload the map to see the changes. I've tried the old

map.updateSize();

but it's not actually updating the map. Is there some other way to force update the map or reload all layers?


texts: Calculating distance from centre of polygon to point using ArcGIS Desktop?

texts:
How do I calculate the distance between the certain of a polygon (in this case, centre of a district), to the closest point on a map (in this case, the points are road entries)?

I haven't tried anything yet. I know how to find the centre of a polygon, and I know how to calculate distances. But I do not know how to combine the two.


texts:
I am working on large raster in QGIS and I am doing various simulations on them. There is one thing that I don't understand.

I have a large raster (111 072 kb) that I clip to only have the values I'm interested in. The new raster only retains 3% of the values from the original raster. When I look at the values in QGIS, everything seems right. The values that I clipped have the good values and outside it's only a No data area (which is what I want). However, the clipped raster is still pretty heavy for the amount of value it has (85 596 kb), so approximately 77% of the size of the original raster.

Why is the clipped raster still so heavy and not more or less 3% of the original file size?


texts: Automatic script to update selected records in QGIS

texts:
I am after some advice on how to produce a script that a user can run in QGIS. The script will be run against newly created feature/s (Point, Line or Polygon) that will perform not only a spatial join to populate the Ward, Parish and Postcode fields, but also populate a field called CREATED with the current date/time.

I haven't got a clue where to start to produce such a script, what platform to build it in on but i'm guessing that its possible?

All ideas welcomed.

Med


texts: Counting points in polygons with sf package of R?

texts:
I'm quite new to R and especially GIS with R. So recently I had to proceed to a quite simple analysis: counting health centers (points) per administrative unit (polygons). Quite common process in arcgis or qgis but I didn't found any similar tool in R, at least with the "sf" package that I'm trying to work with exclusively for now (for an easier learning of the way this package works).

So I googled it and found some people with the same problem but I didn't understand most of the methods they were suggesting, it looked oddly complicated for such a simple operation to me. So I created a function to solve my problem, which works now. But I would like to know in order to get better at this:

Is there an easier way that I missed?

Here's the code below for the function which works simply by: selecting polygons one by one, intersecting it with the point layer, counting the size of the extracted points, adding that count to a vector, repeating with the next polygon... And in the end, binding that "count" vector to my initial polygon dataframe.

CountPointsInPolygons <- function(pts, polygons){
  countPts = c()
  for (i in 1:nrow(polygons)) {
    polySelect <- polygons[i,]
    pts2 <- st_intersection(pts, polySelect)
    countPts[i] = nrow(pts2)

  }

  return(cbind(polygons,countPts))
}


texts: Using .shp files in R with leaflet and shiny

texts:
I'd like to use the following .shp file to plot area development outlines for KY using leaflet in a shiny app. I use the code below, but I get an error that ".prj file is missing." Also, no outline shows up when I run the second line.

add<-shapefile("~/kyaddbnds.shp")
leaflet(add) %>% addTiles()


texts: Need to get spatial data from tab-separated list into csv or similar

texts:
I am trying to download spatial data (points) from a site that offers it in two forms: a KML and a tab-separated list. Unfortunately when I download the KML file, the attributes table is basically blank, and even more importantly, I can't clip the points to a polygon in QGIS (I posted a question about this a while back called 'Can't clip point shapefile with missing attribute data', but have not resolved the issue yet).

My next step is to get the tab-separated list into a usable form like a csv file, with the ultimate goal of converting to a shapefile. I have tried saving the .pl (perl script) file that opens in the browser, and opening it in Xcode (the default) but it doesn't contain all the information it should (at least not that I can see). I also tried copying the text from the browser and pasting it in TextEdit, using Find and Replace to switch the tabs for commas, then saving the result as a csv, but the result was messy and thus not usable (there appears to be tabs in places where there shouldn't be which causes the data to misalign within the table).

Any suggestions on how to get this data into a usable form?

Here is the data (on the upper right, under 'Download Options').


texts:
I am trying to create an SLD to style a polygon; the goal is to create hash fill for polygon but to leave empty space between hatch and bounds of the polygon, something like this:

I am using this to create fill

<PolygonSymbolizer>
    <Fill>
        <GraphicFill>
            <Graphic>
                <Mark>
                    <WellKnownName>shape://slash</WellKnownName>
                    <Stroke>
                        <CssParameter name="stroke">#000000</CssParameter>
                        <CssParameter name="stroke-width">1</CssParameter>
                    </Stroke>
                </Mark>
            </Graphic>
        </GraphicFill>
    </Fill>
</PolygonSymbolizer>
<LineSymbolizer>
    <Stroke>
        <CssParameter name="stroke">#000000</CssParameter>
        <CssParameter name="stroke-width">1</CssParameter>
    </Stroke>
</LineSymbolizer>

There is a way to use a thicker white line, but if there is some object near I wont be able to see it, so that is not an option.


texts: QGIS: creating TIN from raster with a specific point density per m²

texts: I have an elevation data from Laser Scan with 8 points/m2 density. To lower the computation time (and to transfer it to another Software) I want to create a TIN file with density of 0.5 points / m². Is there a tool in QGIS for this?


texts: Using circle as polygon for querying PostGIS

texts:
I'm trying to query PostGIS and find some object features that intersect with a circular buffer created by the user using OpenLayers, JavaScript and PHP.

I use the following code for creating the circle:

var circle = OpenLayers.Geometry.Polygon.createRegularPolygon(
    new OpenLayers.Geometry.Point(X, Y),
    1,
    30
);

and then I'm planning to use the following SELECT Query in my php code:

SELECT b.geom
FROM buildings AS b
WHERE ST_WITHIN (b.geom, ST_MAKEPOLYGON(circle, srid));

Q1: how can I pass the geometry created for the circle from my .JS file to .php file? can I pass it as an object? can I do something like below??:

http://mydomain.com/page.php?buffer=circle

Q2: Is my SELECT query correct? Am I using the correct function ST_MAKEPOLYGON?


texts: Varying transparency of symbols within single layer in ArcMap

texts:
I have a polygon layer which I am drawing in ArcMap using a graduated color symbology:

Is it possible to vary the transparency between the classes, so that the transparency tapers off with the color ramp?
For example, draw the first range (0.175 - 0.225) with no transparency, but the last range (0.45 - 0.52) with 50% transparency.
This is the effect I am trying to mimic, taken from Google Earth as a polygon KML:

One workaround could be to create a separate layer for each class using a definition query, vary each layer's transparency, then group them together but I am looking for a less cumbersome approach.


texts: I am attempting to calculate slope from a temperature/elevation relationship on a particular grid I have defined in ArcMap, however I am unsure how to effectively approach it. The first image attached is from monthly PRISM temperature data, the second is the corresponding 800 m elevation DEM grid that lies under it. My expectation is to take the maximum and minimum value in each cluster of grids and get a slope (degree Fahrenheit change/foot).


texts: Select a feature in a layer group in QGIS by coordinates

texts:
I have the following layers inside a layer group 'Parcels'

I have created a Plugin that will determine a coordinate (Coordx,Coordy) based on a user input and then pan/zoom the map to the coordinate (Note: Coordx and Coordy are Qstrings). What I want it to do is select a feature that contains the coordinate and zoom/pan to the extent of that feature.  The feature could be in any of the 12 vector layers shown in the picture.  If there is no feature that contains the coordinate in any of the layers, then the plugin will zoom/pan to the coordinate instead at some predetermined extent based on the variable 'scale'. I have included the code for the pan/zoom function for reference

            # Create new extent rectangle
        rect = QgsRectangle(
          float(Coordx) - scale,
          float(Coordy) - scale,
          float(Coordx) + scale,
          float(Coordy) + scale)
        mc=self.iface.mapCanvas()
        # Set the extent to our new rectangle
        mc.setExtent(rect)
        # Refresh the map
        mc.refresh()


texts: What is the difference between Create Thiessen Polygons tool (ArcGIS) and Voronoi Polygons tool (QGIS)?

texts: Is Thiessen polygons the same thing as Voronoi polygons? I am using ArcMap 10 and also QGIS 2.4 and I would like please to know the exact difference (If any) between the two methods.


texts:
I made a model in the model builder (ArcGis) to make a service area layer (see figure).

Now I want to run this tool for the same locations but for different hours.
-> the results would be a feature class for the location of the service areas at 6.00h,
  the next output would be another feature class for the location of the service areas at 7.00h and so on... (from 6.00 AM until 22.00PM)

How can I change the time of day automatically and the name of each output file?

Like mentioned in the first answer/ comment

I add the tool 'iterate field values' at my model
in the csv file are the different time periods in the format: 6:00:00  7:00:00 and so on..

Now, it's the problem that i don't understand how i can link the value to the tool 'make service area layer' in the field 'Time of Day (optional)


texts:
I have a shapefile with one layer. I want to create another layer, copy all the features from this layer to the new one, and then delete the first layer. I should say that the new layer has also one new field, called "Flagged".
This is what I'm doing:

for feature in range(maxID_node):
    if nodes_layer.GetFeature(feature) is not None:
        new_feature = nodes_layer.GetFeature(feature)
        new_feature.SetField("Flagged", 0)
        new_layer.CreateFeature(new_feature)
new_layer.SyncToDisk()
nodes_shapefile.DeleteLayer(0)
nodes_shapefile.SyncToDisk()
new_layer = nodes_shapefile.GetLayerByIndex(0)
new_layer.GetFeature(3).SetField("Flagged", 1)
new_layer.SyncToDisk()

Unfortunately, my attempt to set the feature(3)'s "Flagged" field to 1, fails. It just remains 0 (which is what I set inside the loop). All my attempts with all other features don't work either. Why isn't SetField setting the field to 1?
The Flagged field was created through this code

nodefeatureDefn = nodes_layer.GetLayerDefn()
node_feature = ogr.Feature(nodefeatureDefn)
flagged_field = ogr.FieldDefn()
flagged_field.SetName("Flagged")
flagged_field.SetType(ogr.OFTInteger)
nodes_layer.CreateField(flagged_field)


texts: Conditional Formatting in Label Expressions

texts:
I need help with the syntax with my label expression. I have a specific set of parameters I need to display but I need to change only one attribute to label as something else.

I have AC pipeline that I need to label as NM. How do I get everything else to label but have anything that equals AC change to NM?

A quick work around for me was to duplicate the layer and do a Definition Query and do a simple label expression. My other layer excluded my AC mains and labeled them normally. I know there is a way to build a more complex syntax to complete this task without having to duplicate layers and create Definition queries. Here is the VBScript I have currently.

I am assuming is it would be an if then else statement...not sure how to actually write it correctly though.


texts:
I have a shapefile (called Actuals) of 270,000+ point features with their actual X and Y coordinates and a road intersections shapefile (again with X and Y coordinates). Due to privacy reasons, I cannot report the actual locations and thus I need to report the Actuals based on the nearest road intersection. I'm using Spatial Join (with one to many as my join option and intersect as my match option and no search radius) to merge the two together. My output shapefile is short by 20,000 points. Once I have identified which ones are missing, is my option to add them back in manually?

I'm running ArcGIS 10.3 (basic license). I've tried other match options (closest, within etc.) but the results are even worse (returning 8000 points).


texts:
I wanted to find the distance from a point (lat 36N long 12E) to all the polygons in my shapefile. People on this forum helped me out and said that I should create an "XY layer" with only that point, and then use the 'spatial join' tool to find the distance from the polygons to the point.

When I use 'spatial join' it says that the "XY layer" I created doesn't have a defined projection. So I tried to define the projection, but no matter which Coordinate System I try, it fails to do so. (My polygon shapefile is defined under the GCS_WGS_1984 coordinate system).

I'm new to ArcGIS and am using ArcMap 10.1.


texts: ModuleNotFoundError: No module named '_gdal' ... but I have GDAL

texts:
I'm really at my wit's end with this. I'm on a Macbook running Sierra 10.12, so I used the KyngChaos installation of QGIS 3.8. I followed the instructions in the ReadMe (added the PATH variable), and installed python (though I already had it on my machine), GDAL and then QGIS. Here's a screenshot showing that I have the GDAL framework in the proper place:

And yet, QGIS continues to say that it can't find '_gdal' and therefore can't load the processing plugin. Does this have something to do with the underscore? Here's a snipped of the error message I'm seeing.

Couldn't load plugin 'processing'

ModuleNotFoundError: No module named '_gdal'
Traceback (most recent call last):
  File "/Applications/QGIS3.8.app/Contents/MacOS/../Resources/python/osgeo/__init__.py", line 11, in swig_import_helper
    fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_gdal'


texts: Creating Geometry Collection from set of Pointz using PostGIS?

texts:
I have a large number of 3D points that are stored as the postGIS Pointz type.
I'd also like to create a geometry collection from these points, but I'm struggling to do it directly in SQL. I've tried the following, but this only puts one point into the geometry collection:

UPDATE public.geometry_collection
SET geometry_collection_data =
    ST_ForceCollection(
        (SELECT ALL object.geometric_point -- this is the pointz type
        FROM object,point,geometry_collection
        WHERE object.pk IN
            (
            SELECT object_pk
            FROM point
            WHERE point.geometry_collection_pk = geometry_collection.geometry_collection_pk
    ))
);

Is it possible to select pointz and insert the selection into a geometry collection column?


texts: Merge adjacent polygons into a land use map

texts:
I illustrate my problem:
in practice I have a land use in vector format that is also made up of polygons irrelevant from a dimensional point of view but that I would like to delete for a question of structure of the file.
These polygons have dimensions that are not very relevant for the scale that I have to produce (we are also talking about values around the square meter).
Now, to avoid correcting them one by one, what semiautomatic methodology could I apply to ensure that these polygons are merged (using merge) to adjacent ones, both spatially and as an attribute?
It 'clear that each minipolygon borders with different, however, given the scale I work at, it is indifferent whether these are merged with one or the other.
I hope my question is clear!


texts: Changing Mapnik style -- generating empty tiles/images

texts:
I got my osm2pgsql/PostGIS/Mapnik/Nik4 setup up and running. I have tested it with the openstreetmap-carto style and everything works well. Now I want to change the style to Mapbox' pencil style (https://github.com/mapbox/mapbox-studio-pencil.tm2). I am not sure how to do that as this style does not have ".style" file that I could use with osm2pgsql. I have tried leaving data exported using openstreetmap-carto and exporting using Nik4 using the "project.xml" file. This only gives me the background image with nothing on it.
I guess I need to import the data to PostGIS with the correct style. How do I do this when I do not have the ".style" file? Or is it possible to do it without importing using the specific style?


texts:
In connection with an archaeological project, I have data in .dxf format (lines and polygons). When I import them to QGIS, however, it positions them 8000 km southeast. I tried to change the CRS (WGS 84; WGS 84/UTM zone 35) of the files, but without success. The input data are in the local coordinate system 1970 I guess. I also tried to save .dxf file as .shp in different CRS - no effect.
Is there a way to fix the problem?


texts: Shifting extent and data values of NetCDF with GDAL

texts:
I am processing OSCAR third-degree ocean currents data from:

https://podaac.jpl.nasa.gov/dataset/OSCAR_L4_OC_third-deg

These are netCDF files. Longitude extends from 20 E to 420 E to avoid a break in major ocean basins. Data repeats in the overlap region. I would like to shift the extent and the data to a target extent of -180 -90 180 90. When I shift the extent, the data doesn't follow. I am running:

gdalwarp -of netCDF -t_srs EPSG:4326 -te -180 -90 180 90 u.nc u2.nc -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

This gives me the following result, as viewed in the netCDF viewer Panoply:

As you can see, the data is only appearing in the overlap with the original extent instead of throughout.

How might I write a gdal command to shift the data along with the extent?


texts:
Using OpenLayers, I added a WFS layer (on GeoServer) with a filter that returns all features (black) that intersect my polygon (yellow) placed over some Latin American countries within certain dates.

However, the feature that crosses horizontally across the map does NOT actually intersect my polygon. This feature is somewhere in the pacific ocean between Hawaii and Fiji and NOT in Latin America. The problem is that instead of crossing the International Date Line it is being rendered on the map by wrapping around the whole world.

The problamatic feature is defined:

  POLYGON((-179.700417
  14.202717,-178.687422 13.992875,179.024138 8.24716,-179.98241 8.035567,-179.700417 14.202717))

I have many of problematic date line features like this but have narrowed it down to this one for this example. I can't just ignore it in my application because I have many of them.

I've tried using "wrapDateLine: true" in base layer and WFS layer with same results.

Not sure if this would be a GeoServer problem or an OpenLayers problem.

Does anyone know a solution to my international date line problem?


texts:
I have added the attribute search plugin to my leaflet map, but I cannot use in the correct way. Somehow my script loads the GeoJSON features two times. The first are the styled markers, the attribute search is not working on them and when I search it says: location not found. The others are the default markers, the attribute search working fine. Can I combine the two together somehow?

You can find the example here: http://gis.xyz/ukpn_linkbox.html and you can see the code below.

    var ukpn_layer = new L.GeoJSON();
          function getJson(data) {
              ukpn_layer.addData(data);
          }

    var parameters2 = L.Util.extend(defaultParameters2);
    var URL2 = owsrootUrl + L.Util.getParamString(parameters2);

    var WFSLayer2 = null;
    var ajax2 = $.ajax({
        url : URL2,
        dataType : 'jsonp',
        jsonpCallback : 'getJson',
        success : function (response) {
           WFSLayer2 = L.geoJson(response, {
                pointToLayer: function(feature, latlng) {
                   var smallIcon2 = L.icon({
                                      iconSize: [27, 27],
                                      iconAnchor: [13, 27],
                                      popupAnchor:  [1, -24],
                                      iconUrl: 'leaflet/icons/' + feature.properties.csg_survey_status + '.png'
                   });

                   return L.marker(latlng, {icon: smallIcon2});
    },
                onEachFeature: function (feature, layer) {
                    popupOptions = {maxWidth: 600};
                    layer.bindLabel('
'+feature.properties.plant_no+'
');
                    //sidebar.setContent('
'+feature.properties.plant_no+'

'+'
'+feature.properties.csg_survey_pack+'

'+feature.properties.csg_streetview, popupOptions);
                    layer.bindPopup('
'+feature.properties.plant_no+'

'+'
'+feature.properties.csg_survey_pack+'

'+feature.properties.csg_street_view
                        ,popupOptions);
                }
            }).addTo(ukpn_layer.addTo(map));
        }
    });

//------------------------attributom search------------------------

    var searchControl = new L.Control.Search({layer: ukpn_layer, propertyName: 'plant_no', circleLocation: true, zoom: 18});

    searchControl.on('search_locationfound', function(e) {

        e.layer.setStyle({fillColor: '#3f0', color: '#0f0'});
        if(e.layer._popup)
            e.layer.openPopup();

    }).on('search_collapsed', function(e) {

        featuresLayer.eachLayer(function(layer) {   //restore feature color
            featuresLayer.resetStyle(layer);
        });
    });

    map.addControl( searchControl );  //inizialize search control


texts: How to best populate points within a polygon with a set of rules

texts:
I've got a polygon (a Circle) with a certain size. I want to put points inside it, as much as I can, but with a set of rules :

Points can't be near each other, up to 500 meters.
Points can't be near a polyline (roads) up to 200 meters.

Any idea how can I do it with ArcMap or Qgis ?


texts: Removing small areas from raster layer using QGIS?

texts:
I have a raster with the extent of some sinks. Now I need to delete the sinks smaller than 10 squaremetres, because they are not important for my project.

How could I accomplish that? (It's basically the same problem as here: Removing small "salt & pepper" polygons from layer in QGIS?, only for raster instead of vector data...)


texts: Rasterize shapefile to overlay on map uisng QGIS (or any other suggestion)

texts:
I'm developing an app to display a map in QGIS.
The map data is from Bing Map servers. I want to overlay a shapefile on the map. I want the same visual display we see on QGIS.
Like this
So my idea is to rasterize the shapefile.  But, the output is a raster-like this and all the point shapefile return a black image.

Anyone, have any idea to solve this?


texts: Can't multiply sequence by non-int of type 'float'

texts:
import numpy as np
import matplotlib.pylab as plt
from scipy import special
import math
class geotherm:
##    Relationship between temperature and depth
    def __init__(self,t0=10.0,q0=0.0565,qm=0.03,h=10000.0,a=0.000001,dt=1300.0,z=0.0,k=3.35,t=0.0):
##    This initiates class geotherm
        self.t0=t0
        self.q0=q0
        self.qm=qm
        self.h=h
        self.a=a
        self.dt=dt
        self.z=z
        self.k=k
        self.t=t

    def continent(self,x):

        **tc=self.t0+((self.qm**self.z)/self.k)+((((self.q0-self.qm)*self.h)/self.k)*[1.0-math.exp(self.z/self.h)])**
        return(tc)

    def oceanic(self,y):

        to=self.t0+((self.dt*special.erf)*(self.z/(2.0*np.sqrt(self.a*self.t))))
        return(to)

x=np.linspace(0.0,30000.0)
y=np.linspace(0.0,30000.0)
crust1=geotherm(t0=10.0,q0=0.0565,qm=0.03,h=10000.0,z=30000.0,k=3.35)
crust2=geotherm(t0=10.0,dt=1300.0,z=30000.0,t=((30.0*(10.0**6.0))*(math.pi*(10.0**7.0))))
crust3=geotherm(t0=10.0,dt=1300.0,z=30000.0,t=((60.0*(10.0**6.0))*(math.pi*(10.0**7.0))))
temp1=crust1.continent(x) ##############
temp2=crust2.oceanic(y)
temp3=crust3.oceanic(y)
plt.plot(x,temp1,'-r')
plt.plot(y,temp2,'-b')
plt.plot(y,temp3,'-g')
plt.xlabel('Temperature (C)')
plt.ylabel('Depth (m)')
plt.legend(['Crust 1','Crust 2','Crust 3'])
plt.show()

In line marked with ######  or ** is where i get an error


texts: Change Legend Right to Left Reading in QGIS

texts: I am a new QGIS user and i have a challenge to convert legend from right to left reading in QGIS like ArcGIS.


texts: Geoprocessing Service based on Python Fails with IOError: "SDE" does not exist Failed to execute

texts:
I have a Python Script that inserts X,Y Point in the SDE Point Feature Class. It works fine when executed in ArcMap 10.2, but it fails with IOError when published as Geoprocessing Task service in ArcGIS Server 10.2

It does not make sense to me why!?

Any ideas what might be and how to fix it?


texts:
I would like to create a new shapefile based on input.

My input is DATE parameter. This is my code for input parameter:

param = arcpy.Parameter(
displayName="TARIKH",
name="date_feature",
datatype="Date",
parameterType="Required",
direction="Input")

and then the value in this parameter will be analysed using this code:

  out_path = "C:/Last"
geometry_type = "POLYGON"
out_name = #DATEINPUT
result = arcpy.CreateFeatureclass_management(out_path, out_name,geometry_type)

The main point is, I don't know how to input all this code into toolbox code.

#

This is the full code which I don't know where to put and what to insert into an .pyt toolbox

import arcpy
arcpy.env.overwriteOutput = True

class Toolbox(object):
    def __init__(self):
        """Define the toolbox (the name of the toolbox is the name of the
        .pyt file)."""
        self.label = "Toolbox"
        self.alias = ""

        # List of tool classes associated with this toolbox
        self.tools = [Tool]

class Tool(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Tool"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):

        """Define parameter definitions"""
        param = arcpy.Parameter(
        displayName="TARIKH",
        name="date_feature",
        datatype="Date",
        parameterType="Required",
        direction="Input")
        #date_features.filter.list = ["Point","Polyline","Polygon"]

        #params = [date_features]
        return

    def isLicensed(self):
        """Set whether tool is licensed to execute."""
        return True

    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""

        self.param[0] = date_feature

        print "Your new shapefile sucessfull created"
        out_path = "C:/Last"
        geometry_type = "POLYGON"
        out_name = date_features
        result = arcpy.CreateFeatureclass_management(out_path, out_name,geometry_type)

        return

    def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""
        return

    def execute(self, parameters, messages):
        """The source code of the tool."""
        return


texts: Differences in the Select by expression between QGIS 2.18 and 3.4

texts:
I want to select in a population table the growth rate between two years greather than 1.5.

In QGIS 2.18 the following expression works fine

"POP_P2014" / "POP_P2000" > 1.5

With the same data table and with the same expression, it doesn't work in QGIS 3.4.

How should i build expression in QGIS 3.4?

In QGIS 2.18

In QGIS 3.4, don't work


texts: Configuring ArcGIS Desktop to use already installed Python instead of own installation?

texts:
Whenever ArcGIS Desktop is installed, it installs its own installation of Python 2.7 plus Numpy. Yet, I already have many different versions of Python installed in my machine and do not want to have ArcGIS' redundant new version of Python installed (nonetheless, in as a high-level folder as `C:\Python27').

How could I configure ArcGIS to use a Python installation that is already present in the computer somewhere else and then uninstall the one that comes with ArcGIS?


texts: What's difference between `ol.js` and `ol-debug.js` files in OpenLayers-3?

texts:
I run the sample code at here: http://jsfiddle.net/1a948faa/2/.

When I add the ol-debug.js to sample, it run successfully. But when I add ol.js file to sample, it does not work properly. What's the problem?

what's difference between ol.debug.js and ol.js files?