texts: Is it possible to, Click to zoom in and switch to vector layer beneath, on webpage to show GeoServer WMS layers via OpenLayers?

texts:
I have 2 vector layers in GeoServer
First is a district layer

Second is a state layer

When I make a Layer group of these layers in the GeoServer and showing that layer group on the web-page, using open layers “get-feature information” function, that shows attributes of both layers on the web-page, but I only want to restrict these features to the district layer only (I don't want to see the state layer features).
Is it possible to click over to select some state and zoom in to the district layer below, and the state layer doesn't show after that,
and when I  zoom out again, the state layer re-appears?

window.onload = init;

function init(){

    //Geoserver layer
    // wmsSource = indialayersource

    var indialayersource = new ol.source.TileWMS({
        url: "http://localhost:8080/geoserver/agrodss/wms",
        params: {"LAYERS":"agrodss:Rainfall", "tiled": true},
        serverType: "geoserver"
    })

    // wmsLayer = indialayer

    var indialayer = new ol.layer.Tile({
        source: indialayersource,
        visible:true,
        title: "ForAgrodss"
    })

        // hover

    var highlightStyle = new ol.style.Style({
      fill: new ol.style.Fill({
        color: 'rgba(255,255,255,0.7)',
      }),
      stroke: new ol.style.Stroke({
        color: '#3399CC',
        width: 3,
      }),
    });

  var vectorSource = new ol.source.Vector({
    format: new ol.format.GeoJSON(),
    url: function(extent) {
      return 'localhost:8080/geoserver/agrodss/ows?service=wfs&' +
             'version=2.0.0&request=GetFeature&' +
             'typeName=agrodss:india_boundary_updated_GCS&maxFeatures=500&' +
             'outputFormat=application%2Fjson' +
             'bbox=' + extent.join(',') + ',EPSG:4326';
    },
    strategy: ol.loadingstrategy.bbox
    });

    var vector = new ol.layer.Vector({
       source: vectorSource
    });
    // map.addLayer(vector);

    // view = myview

    var myview = new ol.View({
        center: ol.proj.fromLonLat([80, 22]),
            zoom: 4.5,
            maxZoom: 8,
            minZoom: 4,
      });

      var map = new ol.Map({
        layers: [vector, indialayer],
        target: 'js-map',
        view: myview,
      });

      var selected = null;
      var status = document.getElementById('status');

      map.on('pointermove', function (e) {
        if (selected !== null) {
          selected.setStyle(undefined);
          selected = null;
        }

        map.forEachFeatureAtPixel(e.pixel, function (f) {
          selected = f;
          f.setStyle(highlightStyle);
          return true;
        });

        if (selected) {
          status.innerHTML = '&nbsp;Hovering: ' + selected.get('name');
        } else {
          status.innerHTML = '&nbsp;';
        }
      });

      map.on('singleclick', function (evt) {
        document.getElementById('info').innerHTML = '';
        var myviewResolution = myview.getResolution();
        var url = indialayersource.getFeatureInfoUrl(
          evt.coordinate,
          myviewResolution,
          'EPSG:3857',
          {'INFO_FORMAT': 'text/html', 'FEATURE_COUNT': '5'}
        );
        if (url) {
          fetch(url)
            .then(function (response) { return response.text(); })
            .then(function (html) {
              document.getElementById('info').innerHTML = html;
            });
        }
      });

      map.on('pointermove', function (evt) {
        if (evt.dragging) {
          return;
        }
        var pixel = map.getEventPixel(evt.originalEvent);
        var hit = map.forEachLayerAtPixel(pixel, function () {
          return true;
        });
        map.getTargetElement().style.cursor = hit ? 'pointer' : '';
      });

    map.on('click', function(e){
        console.log(e.coordinate);

    })
}

I am trying to use Select Features by Hover of OpenLayers to select the state, then go to district layer.
But it ain't working.


texts:
I've installed ArcMap 10.3 and want to use Arcgis online from the desktop. At the beginning it was not possible to connect to Arcgis online. The menu was "grey" , so not available. ESRI support gave us some url to reference in our proxy and now we can access to Arcgis online menu. When I launch Arcgis Online, I've got a windows with an error "an erro occurred, check your internet connection" . The problem is that nobody can help us to find the issu. Esri support in France say that it is a problem with our computing infrastructure....

I used a tool "Fiddler Web" to see what happen when we launch Arcgis Online and I see the following url : www.arcgis.com:443

The port 443 is open in our proxy.

In Fiddler these lines appear when I connect to Arcgis online :

... but i don't know how to interpret it. Actually, it is the first time I use it!


texts: Accessing ArcSDE feature class with ArcPy?

texts:
I have a script that runs perfectly with shapefiles and GDB feature classes but I need to change it to run on feature classes stored on an SDE.  However I cannot figure out how to reference them correctly via ArcPy and I haven't been able to find a good resource.  Here is what I have so far:

C:/Users/cbunn/AppData/Roaming/ESRI/Desktop10.5/ArcCatalog/my.sde//FeatureDataset//FeatureClass

How should I change this path so it is correct and I can access it via ArcPy?


texts: How to create circular polygon and add it to shapefile as a layer?

texts:
I have such data of points which could be stored with their radii.

cdf = rbind(matrix(c(100, 200, 10), ncol = 3), matrix(c(400, 300, 20), ncol = 3))
di = c("1", "2")

spcs <- list()
for (c in 1:dim(cdf)[1]) {
  spc <- spCircle(radius = cdf[c,3], centerPoint = c(x=cdf[c,1], y=cdf[c,2]), spID = di[c])
  spcs <- c(spcs, spc)
}

Now, how to add it as a polygon (as other "normal" polygons) to the whole processing of creation of shapefile layers?

I do with typical polygons this way:

sps <- SpatialPolygons(spcs)
sdf <- SpatialPolygonsDataFrame(sps, data.frame(x = rep(NA, length(sps)), row.names = di))

rgdal::writeOGR(obj = sdf, dsn = title, layer = name,
                  driver = "ESRI Shapefile", overwrite_layer = FALSE, verbose = TRUE)

but here the format is not the same. For example:

  Error in SpatialPolygons(spcs) :    no slot of name "area" for this
  object of class "SpatialPolygons"

How to add it as polygon


texts: Bandmath error when calculating RVI in Landsat data

texts:
I'm using the LANDSAT/LC08/C01/T1_RT_TOA dataset. Using this I want to calculate the RVI of a region. This is done by dividing the Near Infrared band (B5 in the dataset) by the Red band (B4 in the dataset). I do this by firstly defining both bands as separate variables namely nir and red. Using this I do the following:

var rvi = nir.divide(red)

When doing this is keeps giving me the error:

  nir.divide is not a function

Is there any other way to do this bandmath?

https://code.earthengine.google.com/fabbbc2aa3288e6b8e1daad980d66655


texts: In QGIS 3.6, where is the "Enable 3D renderer" vector layer property?

texts:
In QGIS 3.4 I could enable the 3D renderer for a vector layer (properties/3D view/enable 3D renderer).
I can't find this option in QGIS 3.6 anymore.
How can I activate this again for a vector layer?


texts: How to split polygon exactly in half in MapInfo Pro?

texts:
Is there any way to cut a polygon in half in MapInfo Pro?

I want to split thin and long polygon into equal parts along.


texts: Creating my own map server - with Road speed and Reverse geo coding - using OSM data

texts:
Currently I'm using a few services for mapping/reverse Geo coding/road speeds

1 open.mapquestapi.com/geocoding - reverse geo coding (usually street name)

2 api.geonames.org - get POI name (e.g. University of Blah)

3 www.overpass-api.de - gets road speed

4 Mapbox - Mapping.

All the above data is OSM data (i think)

This worked fine with smaller numbers on dev, but now the userbase has grown, we are using our free quota and either pay, or do my own server with this info

This is a high level question, but if I was to create my own map server, could i have all this data on the one server, and have it return my custom styled maps (i like skobbler/mapbox streets style)
Road speeds, and POI/Road names ?

I'm a windows server guy, so I'll have to learn some new skills, so i thought it better to ask here about any road blocks I would hit with the above on one server as multiple services?

I guess i'll need a nightly import of OSM data to keep it up to date too.


texts: As python3 is getting standard more and more I wonder wether there is or will be support for python 3 in QGIS?


texts: Is it possible to read geojson geometry from ArcGIS Javascript API?

texts: I'd like to know if it is possible to read geojson geometries using the ArcGIS Javascript Api.


texts: Qgis Server and WCS service : problem to display raster layers

texts:
I'm using Qgis Server and I am experiencing a few problem.

I would like to display some raster layers ( for basemap) with other vector layers but I only obtain a white backgroung.

My situation :

I have one project ( qjs file) containing all the layer i want to retrieve with this url :

localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&SRS=EPSG:2154&REQUEST=GetMap&map=c:/myprojects/qgis/V3_dev.qgs&BBOX=320000,6300000,550000,6500000&WIDTH=1000&HEIGHT=1000&LAYERS=ORTHOPHOTO&FORMAT=image/png

ORTHOPHOTO is the group containing some raster layers : http://nsa34.casimages.com/img/2014/06/12/140612095507246249.png

But the only thing i got is a perfect white picture, no errors.
There is no problem with Bbox or EPSG because i can easily display vector layer.
I tested to directly select ortho1 (included in ORTHOPHOTO) but same result.

I'm quite puzzled because i read that since the 2.2 version of qgis, raster layer could be use in qgis server. Source (chapter Qgis Server) : http://docs.qgis.org/2.2/fr/docs/user_manual/preamble/whats_new.html

My configuration :

→ Windows 7 x64

→ Packages installed with OsGeo4w following this tuto : hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial (qgis server / gdal / fcgid)

→ Apache 2.4.9 with ''fcgid_module'' (and ''cgi_module'' too)

→ The V3_dev OWS properties : nsa34.casimages.com/img/2014/06/12/140612102742321017.png

What i tried :

→ Some re-installation

→ With the GetCapabilities request i can see the group ORTHOPHOTO queryable.

→ Qgis server on a ubuntu VM but same result.

→ i tried to convert raster layer into vector layer : layer quality fail

→ I read that someone have the same problem on CentOS. Source : www.forumsig.org/archive/index.php/t-38101.html

→ I recently discovered the GetCoverage request :

localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WCS&VERSION=1.1.0&CRS=EPSG:2154&REQUEST=GetCoverage&map=c:/myprojects/qgis/V3_dev.qgs&BBOX=320000,6300000,550000,6500000&WIDTH=1000&HEIGHT=1000&COVERAGE=ORTHOPHOTO&RESPONSE_CRS=EPSG:2154&FORMAT=image/png

and i obtain :

    The layer for the COVERAGE 'ORTHOPHOTO' is not found

→ i'm also wondering : Is it possible that some librairie (like gdal) is missing in the OsGeo4W installer ?

Hoping someone can help me :)

PS : Sorry for the french links


texts: Why would an SVG output from CartoDB look "squished" when the map doesn't?

texts:
I have a map of zipcodes in San Francisco that I plotted on CartoDB.The CartoDB view looks about like I expected:

But when I had CartoDB generate an SVG, the proportions are way off.

I took the same data to QGis and got the exact same distortion when I output an SVG. What on earth is going on here and how do I fix it?


texts: Getting all items for selected period using Leaflet.TimeDimension?

texts:
I use the leaflet plugin: leaflet.TimeDimension

Is it possible, when choosing a period of one year, to receive all elements associated with this year when displayed? Currently, when selecting a 1 year period, not all records related to that year are displayed.

this.map.options['timeDimensionOptions'] =
     {
         timeInterval: "1989/1991",
         period: "P1Y"
     };

 let tdWmsLayer = (L as any).timeDimension.layer.wms(this.selectedLayer.mapLayer.layer, {
      requestTimeFromCapabilities: true,
      //updateTimeDimension: true,
      setDefaultTime: true
    });

in the request, the times parameter is sent completely, when in theory you can only send a year. Or am I doing something wrong?

URL: http://localhost:8080/geoserver/TIS_DEVELOP/wms?service=WMS&request=GetMap&layers=geo_shp_wells_test&styles=&format=image%2Fpng&transparent=true&version=1.3.0&cql_filter=1%3D1&time=1990-12-31T19%3A00%3A00.000Z&width=256&height=256&crs=EPSG%3A3857&bbox=6261721.357121639,7514065.628545967,7514065.628545968,8766409.899970293

parameters:service: WMS
request: GetMap
layers: geo_shp_wells_test
styles:
format: image/png
transparent: true
version: 1.3.0
cql_filter: 1=1
time: 1990-12-31T19:00:00.000Z
width: 256
height: 256
crs: EPSG:3857
bbox: 6261721.357121639,7514065.628545967,7514065.628545968,8766409.899970293


texts: Converting Polygon to MultiPolygon with Shapely?

texts:
I'm writing code that loads data into a database. I have to do some validation/clean up of the data before inserting it. One of the requirements of the database is that this particular table only accepts multipolygons. (It's simpler to just make everything consistently a multipolygon than to try to handle the two different cases.)

I have the shape in the form of a Polygon object. I need to convert it to a multipolygon for insertion. (I would just use the SQL methods for this, but unfortunately, I'm using an ORM right now.)

How can I convert the Polygon object into a MultiPolygon object?


texts: Is it possible to export a video of a CartoDB Torque animation to a file, like in arcgis?  If not, what are my options for displaying the animation in a presentation.  Thanks for the help!


texts:
I've downloaded a data set from ESRI as part of EDN, and it contains world data in a folder such as this:

C:\Download\ESRI\EDN Data\DataMapsArcGIS2013_1\world\World Map.mxd

When I double-click this .mxd file, it opens up in ArcGIS 10.2, but nearly all of the data source links are broken. How can I fix these links? What is the data source for this map?


texts: Print and saving map with tiled and dynamic layers in ArcGIS using JavaScript?

texts:
I want to print this map. Can anyone please suggest to me how to print and save the displaying pap in ArcGIS using JavaScript?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title> World Street Map</title>
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css">
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" />

    <style>
      html,body,#map,.map.container{
        padding:0;
        margin:0;
        height:100%;
      }
    </style>
    <script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2"></script>
    <script type="text/javascript">
      dojo.require("esri.map");

      var map;

      function init() {
        var initExtent = new esri.geometry.Extent({"xmin":-17731,"ymin":6710077,"xmax":-12495,"ymax":6712279,"spatialReference":{"wkid":102100}});
        map = new esri.Map("map",{extent:initExtent});

       //Add the world street map layer to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
        map.addLayer(basemap);
        dynamicMapServiceLayer = newesri.layers.ArcGISDynamicMapServiceLayer("http://maverick.arcgis.com/ArcGIS/rest/services/World_WGS84/MapServer");

        dojo.connect(map, 'onLoad', function(theMap) {
          //resize the map when the browser resizes
          dojo.connect(window, 'resize', map,map.resize);
        });
     }
     dojo.addOnLoad(init);
    </script>
  </head>

  <body class="claro">
    <div id="map">
    </div>
  </body>
</html>


texts: QGIS and PostgreSQL viewing geom columns differently

texts:
I have a data set of 2 million points, my goal is to cluster the data using geohash codes. I have the geohash code at varying precisions for each point in their own columns.

I created a table for each geohash precision level and populated it with the data from the source dataset. I then turned the geohash code into a point.
This was done for 3 character geohash precision using the following SQL:

DROP TABLE IF EXISTS tbl_geohash3;

CREATE TABLE tbl_geohash3 AS
SELECT geohash3, COUNT(*) FROM location_tbl
GROUP BY geohash3;

ALTER TABLE tbl_geohash3
ADD COLUMN geom geometry(point, 4326);

UPDATE tbl_geohash3
SET geom = ST_SetSRID(ST_AsText(ST_PointFromGeoHash(geohash3, 3)),4326);

In the geometry viewer in Postgres everything looks fine. However when I load it into QGIS its as if its in the wrong projection. I checked the SRID of the newly created table and the source table and they're both correct. I also loaded the location table into QGIS to see if it was the source table but it was perfectly fine.

I dont know where I went wrong with this, can anyone help?

EDIT: I just loaded this layer into geoserver and then onto a webmap with openlayers and it worked totally fine. I'd say this is a QGIS problem.


texts: Drawing a line and getting the length of the line C#?

texts:
I am trying to get the length of a drawn line to a textbox but its throwing an NullReferenceException at var length = f.ToShape().ToGeometry().Length;.
what else should i use in the code to finish this exception. ?
Any way to fix it and get the length of the line to a textbox?
I am using Dot-Spatial 1.70

Code:

private void map1_MouseClick_1(object sender, MouseEventArgs e)
    {
        // digitizing
        if (amDigitizing == true)
        {
            DotSpatial.Topology.Coordinate c = new DotSpatial.Topology.Coordinate();
            System.Drawing.Point p = new System.Drawing.Point();
            p.X = e.X;
            p.Y = e.Y;
            c = map1.PixelToProj(p);

            myDigitizedPoints.Add(c);
        }
    }
    private void map1_MouseDoubleClick_1(object sender, MouseEventArgs e)
    {
        // Double click ends digitizing
        if (amDigitizing == true)
        {
            DotSpatial.Topology.Coordinate c = new DotSpatial.Topology.Coordinate();
            System.Drawing.Point p = new System.Drawing.Point();
            p.X = e.X;
            p.Y = e.Y;
            c = map1.PixelToProj(p);
            myDigitizedPoints.Add(c);

            amDigitizing = false;

            DotSpatial.Data.Feature f = new DotSpatial.Data.Feature(DotSpatial.Topology.FeatureType.Line, myDigitizedPoints);
            DotSpatial.Data.FeatureSet fs = new DotSpatial.Data.FeatureSet();
            fs.AddFeature(f);

            fs.Projection = map1.Projection;
            fs.Name = "Mine";
            //fs.SaveAs(GraphicsPathExt, true);
            //LineLyr = (DotSpatial.Controls.MapLineLayer)map1.AddLayer(GraphicsPathExt);
            LineLyr = (MapLineLayer)map1.Layers.Add(fs);

            var length = f.ToShape().ToGeometry().Length;
            textBox1.Text = length.ToString();
        }

    }


texts: How to calculate difference in elevation between a POINT and the surrounding cardinal directions?

texts:
I have a POINT shapefile (Rain gauges) and a 100m DTM in the same coordinate system.

Is there a method using QGis to calculate the difference in elevation between the elevation of each rain gauge point and the surrounding maximum height along the 8 cardinal directions (maximum distance from Rain Gauge 30km)?

  Software: QGIS
  Input: Rain gauge POINT Shapefile, DTM 100m grid,
  Output required: LINEAR Shapefile (with 8 lines for each Raing Gauge and Attribute table with the elevation difference between each Raing Gauge and hightest point on each cardinal directions and its cell distance)


texts:
I want to create the following symbology for a line layer.
But I don´t know how to create the black part for my line.

It´s a pink line in the background, with a black rectangles on top of it. The beginn and end of the rectangles are longer then the rectangle. The black geometry repeats itself every 2cm.


texts:
I'm doing a 2D hydraulic flood study of rivers in a 63 km2 basin. I have a RASTER of the topography (1x1 meters) that I have passed to TIN using ARCMAP. Giving a z=0.3 meters, I get a TIN network with too many triangles in areas where I do not require so much density. I am only interested in a high density close to rivers. Is it possible to edit, collapse, decrease the density of the TIN mesh using a feature such as a polygon?
Thanks.


texts: How can I add a custom-named output to TOC which is a managed data in ModelBuilder

texts:
I'm trying to make a model using the ModelBuilder. Everything is working properly, except the fact that I want to add the outputs to TOC with the specific layer name.
The problem is that in order to add an output to TOC (Table of Contents), the output should be marked as "add to display" and also as a Parameter at the same time.

Marking an output as a parameters, appears a saving directory option to the model dialogue box, which I don't want it to happen. I don't want to enable the final user to be able to edit the name or saving directory of the output. but I want the data to be displayed!

If I mark the "managed" option in addition to the "add to display" and "Parameter", the output will be added to the TOC with random name, ignoring the specific name.

Am I missing something? I would be thankful if you guys can help me out.

p.s: I am not using any iterators.


texts: ArcGIS 9.3 geoprocessing service output consideration

texts:
I'm developing geoprocessing service which do few processes with geographic data. I would like to get somehow geometry of those data and use it in my web aplication (JS ArcGIS API). Now I'm wondering how to (with best performance) return geometry from service to my application?
Now I'm trying manually access to feature geometry, and while iterating throught it I'm concatenate it's coordinates to string.
It is very slow method, because I've got about 60-90k vertex (avg) on polygon so concatenating it is taking to much of time.
Can anyone see other possibilities to return geometry of features from service to JS with better performance?


texts: Find the nearest point to take through GeoServer using GetFeatureInfo

texts:
We developed own street view functions with our 360 degree photos. We have lots of points to show photos take places on map. If click on these points, you can see photos as 360 degree like Google Street View. But if not click on these points, you can not see anything. Because, not get any data from GeoServer with GetFeatureInfo query.

I want to get data when clicked between two points, so I want to get nearest 360 degree point from WMS.

How can I do that?

GetFeatureInfo Query sample:

http://localhost:54761/handlers/WMSService.ashx?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=TEST%3AmaxCountyView%2CTEST%3AmaxStateView%2CTEST%3AmaxDistrictView%2CTEST%3AmaxRoadView%2CTEST%3AmaxStructureView%2CTEST%3AmaxNumberView%2CTEST%3ASTREET_SHP2_STREET_POINT_Points&STYLES=&LAYERS=TEST%3AmaxCountyView%2CTEST%3AmaxStateView%2CTEST%3AmaxDistrictView%2CTEST%3AmaxRoadView%2CTEST%3AmaxStructureView%2CTEST%3AmaxNumberView%2CTEST%3ASTREET_SHP2_STREET_POINT_Points&INFO_FORMAT=application%2Fjson&feature_count=10&X=50&Y=50&SRS=EPSG%3A3857&WIDTH=101&HEIGHT=101&BBOX=3712592.9784559594%2C4190009.7198761674%2C3712596.743835624%2C4190013.485255832


texts:
I am trying to merge data from a U.S. states shapefile with data on each state. I used this SQL query which is supposed to work:

 SELECT * FROM child_poverty_by_state
 UPDATE child_poverty_by_state
 SET the_geom = us_states.the_geom
 FROM us_states
 WHERE us_states.state = child_poverty_by_state.state

The table "us_states" which is the shapefile, doesn't auto-populate in the query. Not sure why, is there an error with my query?


texts:
I am writing a python script for batch map production and for every map the script replaces a text label called "Company". sometimes the name is way to long and it extends onto the map and off the map.

I have not been able to find any wrap labeling info on the internet.

So far i have tried manually editing the label in the MXD but there seems to be no wrap text option


texts: OpenLayers zoom using smaller increments

texts: Currently when the zoom control + and - are pressed, the map zooms a lot for each click. How to make the zoom increments smaller for each click.


texts: Combining different coordinate tables/maps into one table

texts:
I am working on a project which has now seen a change in the geographical boundaries, polygons, eg regions, whereas I have particular customer long/lat data relating to the old boundaries. How do I build a table that shows what old region the customer fell into and what region the customer now falls into?

Second linked to the above the old regions may fall into 1 or more of the new region, who to I build a table that shows the old region and what region or regions it may fall into and also show this on a map?


texts: Updating Field using Field Calculator Python

texts:
I am trying to update my Status field as seen below:

I want to change the Null and Existing values to Permanently Removed using the Python Parser; however, I am receiving an error.

Can someone explain what I am doing wrong?

def updateName(sCode):
    if sCode == Null:
       status= 'Permanently Removed'
    elif sCode == 'Existing':
       status = 'Permanently Removed'
    else:
       status = None
    return status


texts:
I want to use GeoServer WMS server for custom styling. Let's say I have an area as polygon in a shapefile, but I don't have this area's temperature as an attribute. From a web service I gather temperature points inside that area. Now I want GeoServer to color this area according to these dynamic temperature points.

Here is an example:

If it is possible, I even want to place these borders on image and some explanations about colors on right side.  How can I send these temperature points to a GeoServer WMS. And can I do some custom coloring according to these dynamic parameters?

I don't know how to convert these point data to area colors.

My next question is similar but without points, can I colorize a polygon with dynamic attributes which isn't on the shapefile.

Here is an example I want to colorize these polygons according to their product type, but as earlier question, these product types are gathered dynamically.

I hope these are possible.


texts: Unable to call otbApplication from python

texts:
I have been tryng to use some of OTB functions from python, but i am unable to import the module (otbApplication), even after to adding the PYTHONPATH to my basrc file. I am working in Ubuntu14.04, and i have been able to call the same functions from QGIS, but not from python, neither from my IDE (pycharm) or the command line.

What should i do?


texts: Specifying the "idp" and the "nmax" in the krige.cv function

texts:
I'm performing IDW interpolation using the idw R function from the gstat package.
For the purpose of determining what combination of "idp" and "nmax" produces the lowest RMSE in leave-one-out-cross validation, how can I specify the "idp" and the "nmax" that are going to be use in the krige.cv function?


texts: Force expression-based map item position onto second page in Atlas setup?

texts:
I created an atlas with two pages for each atlas feature, the first being for a map and the second page being for a table. I need to separate pages as the map is using all the paper space and the table is varying a lot.

As some maps are in portrait and some are in landscape (depending on atlas feature geometry), I specified the X and Y of each item (legend, maps, table, north arrow) according to the orientation of the atlas geometry.

Here is an example for one item:

For x: if(bounds_height( @atlas_geometry ) > bounds_width( @atlas_geometry ) ,'11','30')

For y:if(bounds_height( @atlas_geometry ) > bounds_width( @atlas_geometry ) ,'90','60')

Here is my problem: For every atlas feature, I would like this example item to be located on page 2. If I move it manually to page 2 it remains in page 1. If I deactivate the X and Y formula, I can manually move it to page 2.

My question: Is there a way to force item to be on page 2 while writing the formula for X and Y positions?

I have one idea but not very convenient, go beyond the first page border. For example for Y, in case of portrait, I can give a figure between 297 mm and 594 mm.


texts: Setting a polygon-fill ramp to have minimum and maximum values

texts:
Using the Carto web-tool I've set up a map to fill polygons based on the value of one of its attributes. However, due to outliers in the data the attributes range in values from 0 to >600, where as I want to set the colour bar to range from 6-48, with the values outside this range being the same colour as the min/max limits.

I believe this can be done by using a list of conditional statementes

#layer_name[ value <= 6] {
polygon-fill: #FF2BE3;}
#layer_name[ value <= 12] {
polygon-fill: #FF41CF;}
#layer_name[ value <= 18] {
polygon-fill: #FF58BC;}
...
#layer_name[ value > 48] {
polygon-fill: #00FFFF;}

But when using the updated carto web-tool the default formatting for polygon-fill is now:

#layer {
  polygon-fill: ramp([value], (#ffffb2, #fed976, #feb24c, #fd8d3c, #fc4e2a, #e31a1c, #b10026), quantiles);
  polygon-opacity: 0.4;
  line-width: 1;
  line-color: #ffffff;
  line-opacity: 0.1;
}

Is there a way to adjust the ramp function to provide lower and upper limits?


texts: Iterating over map layers in QGIS Python?

texts:
I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all layers.

I don't see anything in the API that provides easy access to this functionality and couldn't find a good online example but maybe I missed something?


texts: Check if feature class has at least 1 shape that overlaps raster

texts:
In ArcGIS 10.3.1 ArcObjects, Zonal Statistics As Table throws ERROR 999999: Error executing function. when the input feature class has no features that intersect the input raster (as nearly as I can figure out the cause, anyway).

Since I am executing this operation programmatically, I need to detect this situation and handle it differently in code. How can I efficiently determine if the feature class has at least one intersecting feature?


texts: Open a raster file with read and write permissions in rasterio

texts:
I am trying to write a function which will help me construct a rasterio memory file and return the dataset reader object so I can then play around with it as needed. I am trying to avoid with statements because I would like to allow the user to read and write as they deem necessary. This is what I have so far:

from rasterio import mask, features, warp
from rasterio.io import MemoryFile
import rasterio
import numpy as np

def create_memory_file(data, west_bound, north_bound, cellsize, driver='AAIGrid'):
    #data is a numpy array
    dtype = data.dtype
    shape = data.shape
    transform = rasterio.transform.from_origin(west_bound, north_bound, cellsize, cellsize)
    memfile = MemoryFile()
    dataset = memfile.open(driver=driver, width= shape[1], height = shape[0], transform=transform, count=1, dtype = dtype)
    dataset.write(data,1)

    return dataset
def close_memory_file(memfile):
    memfile.close()

data = np.array([[1,2,3], [4,5,6], [7,8,9]])
memfile = create_memory_file(data, 0, 2, 0.5)
memfile.read(1)

The last line throws an error:

Traceback (most recent call last):
  File "D:/11202750-002_RA2CE/Basis/common.py", line 214, in <module>
    memfile.read(1)
  File "rasterio\_io.pyx", line 209, in rasterio._io.DatasetReaderBase.read
rasterio.errors.UnsupportedOperation: not readable

The memfile apparently only has write permissions because of the following:

>>> memfile
<open BufferedDatasetWriter name='/vsimem/3c0572dd-a295-4f2b-a65d-22a404dd5d0f.' mode='w'>
>>> memfile.mode
'w'

I have tried various combinations of adding mode=r+, permissions=r+ to my memfile.open() call but it won't allow this.

How can I add the read/write mode at the level of the open statement?


texts: I understand that if ArcFM Object Viewer is installed on ArcGIS Server that read-only map services can be published with the ArcFM data.  In this scenario can you also publish ArcGIS Mobile applications from Server?  If so, does the ArcFM Object Viewer need to be installed on the mobile device with ArcGIS Mobile?


texts:
I have huge point clouds (Millions of points):

I need to create a shapefile with the boundary of this point cloud. When I was working with this 2 months ago I could do this somehow:

I'm pretty sure I was using the Minimum Bounding Geometry with the convex hull option. But when I try to recreate it I get the following result:

I've been trying to figure out what did I do differently, but no luck yet.

I have ArcGIS 10.2 with advanced license.


texts: ESRI ISurface.GetElevation is extremely slow compared to GlobalMapper

texts:
I'm using ISurface.GetElevation on a Raster to get the elevation for a specific lat/lon.

I have to do this for a huge set of datapoints.

Currently i'm testing with a dataset of 10.000 items which takes Esri over 30 seconds but is executed by GlobalMapper within half a second.

Is there any other way to quickly retrieve the elevation (bi. interpolated if needed) using Esri ArcObjects function ?

I'm working in C#

Thank you for your help!


texts: Running Different Versions of ArcGIS and Python?

texts:
As we know, there are few versions of ArcGIS (9.x,10) and Python(2.x,3.x) are in use.
Issues are facing when we run scripts/toolbox of arcgis since the script written in one version of python and the python installed with arcgis is different version.

How to identify python script version so that we can directly execute and save time?
How to convert the existing python script to the installed python version on the system and get result without hassle of programming?
Is there any procedure for ArcGIS to take python version 2/3.x as default so that, we can install multiple versions of python and change default version to run according to our requirement?


texts: ArcGIS print service not showing images or text in layout template?

texts:
Steps using ArcGIS 10.2:

with arcmap create a simple map. Edit it to include an image and a text.
save said map in the templates folder
close arcmap. reopen and create a new blank map using the template created in previous steps. The new map correctly inherits text and image.
create print service
when consumed, via js api, only the map, not the image or the text, shows.


texts: Scripting the mapping of style columns attributes in QGIS?

texts:
In a vector layer is it possible to tune up/scripting the style columns attributes to map "Label" column to a specific attribute field/column instead of being populated with same content as the "Value" column? I'm working on QGIS 2.14.

We have symbology by categories and symbols in a XML created based on a key field ("ID_UCF" [type integer]) which is used to classify the style attributes - match to symbols from file -  but this way we have the legend of the map taking the "ID_UCF" codes as symbol labels and we need those labels as a description of those codes. This description/text is given by a column present in the attribute table of the label ("DSCR_UCF" [type text]).

How can we change the content of style column "Label" - in this case "Legend" to assume the descriptions?

We have been looking at qgis.core such as rendererV2 class but could not find how to deal with the issue.


texts: How to handle duplicate id's when using the as_sp function in the R osmar package

texts:
Sometimes when I want to convert a subset of ways from an osm file loaded with the osmar package, I run into an error complaining about duplicate row names. The following code run on this file in attach throws this error:

Error in `row.names<-.data.frame`(`*tmp*`, value = c(4067932, 4296467,  :
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘123074181’, ‘154043350’, ‘171826984’, ‘176273732’, ‘196520271’, ‘202157002’, ‘24240315’, ‘24913519’, ‘284493291’, ‘304517627’, ‘35556702’, ‘38210407’, ‘4399491’, ‘4840974’, ‘4840977’, ‘60333308’, ‘61583424’, ‘67627350’, ‘67627353’, ‘68711084’, ‘72157174’

This is the code:

  osm_data <- get_osm(complete_file(), source = osmsource_file('extract.osm'))

  hw_ids <- find(osm_data, way(tags(k == "highway")))
  hw_ids <- find_down(osm_data, way(hw_ids))
  ways <- subset(osm_data, ids = hw_ids)
  ways <- as_sp(ways, "lines")

I suppose this is because of SpatialLines objects with the same osm_id ? How do I avoid this problem ?


texts: Converting Raster to vector and creating polygons based on each pixel using QGIS

texts:
I want to convert a raster file (100x100m pixel size) which contains population counts as pixel values. I need a vector based file of the 100x100m grids and the population as attributes.

I tried different conversion methods in QGIS, but there will always be pixels merged together.

Is there a way to create a vector grid and assign the raster values to them?


texts:
I am trying to create a slope map in ArcMap out of a DEM.
I used the Slope Tool (Spatial Analyst), selected my DEM as input and degrees as an output result.
There I got the message that "The Z units of the output geographical spatial reference are undefined. A default Z factor of 1 was used". I pressed ok and I got this result:

As I can understand (this is the first time I use the slope tool, I'm new to ArcGis Suite) almost all my values are within the range of 89.6 - 89.9 degrees something that is clearly wrong, as my study area is this one:

I tried to create more classes in Symbology tab but I couldn't select more than three in Natural Breaks (Jenks) classification.
I am able to create 32 classes at Equal Interval option but this also doesn't change anything.
I tried my luck with Unique Values and I was asked to create them and I pressed ok but all the values are around 89.9.

I got the DEMs from Nasa Reverb, I connected two of them with Mosaic to Raster, created a shapefile (I selected the same projection, WGS 84 for the shapefile) and clipped my study area. Then I played with classes and colors in order to be as naturally looking as possible.
I created a break at 0 Value in order to color the sea blue.
Right after that I used the slope tool.

Any ideas for the slope degree values to be calculated correctly?


texts:
Is there any website or web service where I throw a polygon postgis and he show me on the map this polygon.

Example:

I put this

POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))

and the service show me the polygon on a map?

I don't want to create a full application, only want see the polygons that the Mondrian/Pentaho give me and I'd like to see the polygon on a map. If exists some plugin to pentaho that do this, would be perfect.


texts: Lossless conversion from shapefiles to XML/JSON/Text

texts:
I'm a software developer and I need to create a custom tool that imports ESRI shapefiles (shp + shx + dbf), manipulates the content and then exports new shapefiles.
To avoid a complex binary reading of the 3 formats, I'd like to convert the input files into a "well known" textual format (JSON, XML, plain text, ...) and I want to be able to revert the conversion.

I tried to use gdal/ogr2ogr to convert the shapefiles into CSV but the output seems to only include the content of the database (dbf file). This means that, if I try to convert the CSV back into shapefiles, I lose all the polygon coordinates.

I then tried to convert to GeoJSON, which was much better but a few data appear to be missing again (like shape boundaries and polygon indexes).

Is there an option in gdal for a "lossless" conversion between shapefiles and any humanly readable format?


texts: Adding WFS info popups on three WFS layers in Openlayers

texts:
Am doing a project using OpenLayers + Geoserver and am having four WFS layers that am using to display grids for each(schools,towns,hospitals).

I wanted to know whether its possible to display featureinfo popups for the WFS layers when clicked on map.

If so, how should I do it?


texts: Inserting fake data in ArcGIS database automatically?

texts:
I am making a demo database for property search web app. I want to insert fake names (Ethiopian names), geographical location, and other user information.

How can I populate the fields with fake data in ArcGIS 10.3 automatically?

I know this is possible in python Faker library.

Or from watching smart TV don't they collect humongous data?


texts: Resize raster resolution with Gdal_translate or Gdalwarp

texts:
I am trying to change my resolution from 10m x10m raster cells to 25m x 25m raster cells.
So far I figured that both gdalwarp and gdal_translate can do this (from python).

subprocess.call('gdal_translate -tr 25 25 -r bilinear ' + inputfile +' '+ outputfile, shell=True)
subprocess.call('gdalwarp -tr 25 25 -r bilinear ' + inputfile + ' ' + outputfile, shell=True)

However, I do run into 2 problems for both GDLA methods.

First problem: The output band rendering colors are shifted from hillshade to singleband grey. How can I fix this? I tried using gdaldem hillshade, but this did not work.

subprocess.call('gdal_translate -tr 25 25 -r bilinear ' + inputfile +' '+ outputfile, shell=True)
subprocess.call('gdaldem hillshade ' + outputfile + ' ' + outputfile +'_hillshade', shell=True)

My next problem is that the output file has extrapolated values outside of the original raster extent. See figure below.

Image of the 10m x10m resolution input raster

Image of the 25m x25m resolution output raster - The extent of the output raster is bigger than the input raster and the raster is shown in singleband grey.


texts:
I am trying to insert a scale bar that when printed, will equal to an exact amount in inches when a ruler is brought onto the paper. I have set my projected scale to 1:12,650 so 1 inch will equal 0.2 miles. Seems like this should be a very simple thing to do, especially when working with maps but ArcMap makes it seem like it's not possible. I understand I can bring to the ruler part at the top of my layout and measure from there, but that won't give me an exact like I am looking for.

Any ideas on how or if this is even possible?


texts: How can I change QGIS GPS tracker symbol?

texts:
I may look stupid, but can't the find place where I can change GPS live tracking symbol. I use GPS tool in fieldworks with forest orthophotos and default symbol that displays my location (black circle with inner cross) is very hard to follow.

I'm using at moment QGIS 2.99.0


texts:
I rasterized a shape. The resulting raster (lets call it raster 1) has a different extent.

I made a virtual raster with the original polygon and I tried to multiply the virtual raster  with raster 1 selecting the virtual raster's extent using raster calc... but I can't get the raster 1 to change the extent... does anyone know how to fix that?

In the picture, the blue part shows the difference between the original vector and the resulting raster.


texts: Assigning a vector to a field in feature class (UpdateCursor)

texts:
I don't know if my mistake is of a general nature. I come from R where it is very easy to store a vector in a matrix column. So now I (new to coding with arcpy) am desperately trying to do the same thing in ArcGIS.

I have a point feature class to which I have added a new field ("new_ID"). I want this new field to be filled with a sequence of numbers from 1 to [number of items in my FeatureClass].

Question: Is it possible to assign a vector to the new field?

The source of my problem is: I need to move and sometimes delete points in a feature class. After deleting them the column OBJECTID obviously doesn't contain a straight sequence anymore.
For example: my points feature class contains 10 points, I delete point number 5, so my column OBJECTID goes like: 1,2,3,4 , 6,7,8,9,10 (5 is missing). For specific reasons I need a straight sequence of numbers. In that case after the deletion of point number 5: from 1 to 9.

I couldn't find any help in the search section. So I wonder if this problem ever occured to someone else? Am I just still to much in R? Would you solve this issue in ArcGIS completely differently? Or am I just overlooking something crucial?

I'm also unsure about which tool to use. UpdateCursor? CalculateField? JoinField?

Here's what I tried:

>>> sum = arcpy.GetCount_management("my_featureClass")
sum = int(sum.getOutput(0))
input_field = range(1, sum + 1)

>>> cursor = arcpy.UpdateCursor("my_featureClass")
for i in curs:
    i.new_ID = input_field
    curs.updateRow(i)

ValueError: Row: Invalid input value for setting

>>> cursor = arcpy.UpdateCursor("my_featureClass")
for i in curs:
    i.new_ID = input_field[i]
    curs.updateRow(i)

TypeError: list indices must be integers, not Row

>>> cursor = arcpy.UpdateCursor("my_featureClass")
for i in curs:
    i.new_ID = int(input_field)
    curs.updateRow(i)

TypeError: int() argument must be a string or a number, not 'list'

I understand why all three don't work but I don't see a solution.


texts: How to use QgsOverlayAnalyzer class in pyQGIS?

texts:
I am very new to Python scripting in QuantumGIS, so bear with me please.

I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) to automate the intersection between different layers (I have plenty of intersections to do).

However, I can't get it to work in the python console.. assume I want to intersect layer1 with layer2, and write the results in C:\shapefile.shp, I am trying something like this with no success:

QgsOverlayAnalyzer.intesection(layer1, layer2, "C:\shapefile.shp", false, 0)

The error I make must be quite serious, as the message I get is:

NameError: name 'QgsOverlayAnalyzer' is not defined

Any help on this is very much appreciated.

Dom


texts: Pipeline and electric power grid data for Southern California?

texts: Does anyone know where I can find GIS shapefile or other data for the electric transmission line system as well as water/natural gas and other pipeline systems for Southern California? Notably San Diego county?


texts: What am I doing wrong here? Everything is working fine, except that the layer control is not showing at all.. hhLayer and wpLayer are L.geoJson(); in case that helps.


texts: Calculating area of polygons in EPSG:102022 in QGIS?

texts:
I am trying to calculate the areas of administrative regions in Uganda, using the EPSG:102022 projection. They are polygons. But everything I do produces areas in degrees rather than meters, giving results with small decimal values. I'm using QGIS 2.18 on a Mac. It should be so simple, but I'm at my wit's end. Does anyone know the secret?

I have tried:
-Using Vector/Geometry Tools/AddGeometryColumns and $area in fieldcalculator
-Using Layer and Project CRS
-Turning off on-the-fly re-projection
-Turning off the Render toggle
-Saving and loading new .shp files with the EPSG:102022 projection
-Changing all the defaults in Settings/Options/CRS to EPSG:102022
-Running Singlepart to Multipart and the reverse
-Updating QGIS
-Restarting my computer

There have been many similar questions posted, and none of the answers or comments in them are working for me:
Area is calculating wrong using $area in field calculator (QGIS 2.8.1-Wien)
How to calculate polygon areas in QGIS?

In case you want the file: https://drive.google.com/file/d/0B5fZYKTx5SCbWmFuQkVpYVBXbFU/view?usp=sharing


texts: Creating Series of Rasters that displays Standard Deviation from Mean using ArcGIS Spatial Analyst?

texts:
I have 100 rasters of raw rainfall data in which the pixels each represent rainfall for that particular pixel on the landscape for a single year during the 100 year period. I have also created a raster that calculated the mean rainfall received in each pixel over those 100 years.

From these raw data rasters, I want to create a new set of 100 rasters (one for each year) that displays the standard deviation from the mean of each pixel (of the entire 100 years) for each pixel.

I have a feeling this will be likely solved with python coding, which I have a little bit of experience in, but I am unsure of what tool to use? It seems like Cell Statistics is on the right track, since it focuses on individual cells, but doesn't achieve what I am looking for.

Any other ideas on how to tackle this?


texts: Unable able to toggle layers in ArcGIS Online on/off?

texts:
I recently published a map as a service from ArcMap for Desktop to ArcGIS Online. I wanted to provide a web map for our customers to access and to interact with. The layers that I uploaded were a combination of vector (Roads, Waterbodies) and raster layers (Elevation, Land use).

However, after I published the layers, my expectation is that the user will be able to toggle on/off the layers as I do in the Desktop environment. That is not the case. I'm not sure why in ArcGIS Online I am unable to do so?

I haven't found another question that assists in me trying to figure out the answer as well as I have tried re-uploading using different approaches, to no avail.


texts: Calculating raster data in vector area using ArcGIS Desktop?

texts:
I have two layers. One is a layer of USA ecoregions (there are 9 ecoregions). It is not raster (so it's vector?). The other layer is the National Land Use Data set (so I know where there's agriculture, forests, ect.) and it is raster data. Sooooo.... I don't know how to analyze the land use types in each ecoregion because the two files are in different formats.

I attempted:  ArcToolbox -> Conversions -> raster to polygon, but when my polygon appeared it had no land use types in it.

I attempted: ArcToolbox -> Conversions -> polygon -> raster   but I waited and it did not finish calculating in a timely manner.

I am trying to identify the amount of Evergreen forest (part of the land use raster data) per ecoregion.


texts: Defining Bertin1953 projection in QGIS 3.18.2 Zürich

texts:
How to define the Bertin 1953 projection in QGIS 3.18.2?
I tried to define a custom projection by setting the following:

This seems to be valid, but when I press the OK-Button, I get this mysterious error-message:

I am using QGIS 3.18.2 on Windows:


texts: Deploying QGIS settings in an enterprise environment

texts:
Are there any recommendations to manage and deploy various settings in QGIS (GUI-settings like visible plugins/toolboxes etc., settings in options, print compositions ...) to hundreds of clients / users?

Automated software installation is done so far (distributing QGIS via OPSI), but this comes with a standard configuration of the gui, which has by far too many options for a normal user, who only wants to see and print spatial data.


texts:
I am using ArcGIS for Desktop 10.1. I am trying to merge a few 16bit rasters by Mosaic to New Raster. The problem is it makes me do only a 8bit output making me lose pixel data bigger than 255 and classifying them as 255. Also, it makes the mosaic only if I choose PNG as output format. I need a 16BIT mosaic as output, like the input rasters, but it gives me back always Error 999999.
Michael, honestly I'm making a huge mess with the mosaic dataset... even though spatial reference and bands are the same... let's keep trying with Mosaic to New Raster.. this is one of the raster I am using for the mosaic...


texts: Extract related tables of a feature class to excel?

texts:
I have a feature class and a bunch of table connected to each other with relationships (please see the scheme of them down below). My goal is to extract the attribute table of fc as well as all related tables (TB1 to TB9) of selected rows to excel sheet of their own.

Is it possible to manage that?

Model builder or a custom script examples are much appreciated.


texts: Why I can't see a security tab in the Workspaces section of GeoServer 2.17.2?

texts:
I installed the last version of GeoServer. According to GeoServer documentation, I should be able to modify the security of the workspace with a dedicated tab on Edit Workspace, when I click on a workspace name. However, as you can see in the snapshot, my GeoServer is not showing the security tab. How can I enable this tab?

In GeoServer documentation, Edit Workspace clearly has a security tab
Geoserver document link about workspaces


texts: Automatically update field when value in related table is changed

texts:
i have set up a 1:n relation in QGIS. The parent layer contains trees (point geometry) and some basic informations about. The related table contains measurements which should be carried out to keep the tree healty. In the "Measurements"-table each measurement has a numeric priority (ranging from 1 to 5). I want to achieve that as soon a measurment was carried out and a worker ticks a box in the attribute form (boolean column "Done") of the "Measurement"-table the field "Priority" which exists also in in the main table is updated with the highest priority of the remaining measurements.

I assume this can be done using "actions". But is there a way where the user does not have to proactively execute the action so the procedure is fully automated?

The tables are in a geopackage if that matters.


texts: Getting fractional count of pixels in raster map using QGIS?

texts:
I have a raster map consisting of 22 land cover classes (LCC). Each pixel is 300 x 300 meters in dimension and contain one of the 22 LCC. I need to make 1 km x 1 km cells in the parent grid and count the fraction of each land cover class present in that grid.

So I am thinking, in whichever 1x1 km grid the center of each 300x300 m pixel lies, we assign that pixel to the corresponding grid. So, as shown in the figure, if I want to count the fraction of LCC 1 present in the 1x1 km grid, I simply add the number of pixels present in the grid and divide it by the total number of pixels present in the grid. So for LCC 1, we have 3/9 as the fractional count in the drawn grid. The fraction of LCC 16 is 1/9, and so on.

I want to perform this task in QGIS to which I am very new.

I would probably also need to worry about the fact that for 3000m, 6000m, and similar distances, the boundary of large pixel will pass from the middle of the small pixels. In that case how would we decide the location of small pixels?


texts: CSV to Layer from a Delimited Text File in QGIS

texts:
enter image description hereI am importing a CSV file into QGIS using the official instructions on their page: http://www.qgistutorials.com/en/docs/importing_spreadsheets_csv.html. For some reason, the x & y coordinates are showing up on QGIS in the wrong place. I have checked the coordinates in Google Maps and they correctly present the locations I want to see in Tanzania.

Can you please explain what I am doing wrong by reviewing the attachment.


texts:
Is there any way to use a cursor to delete a field using ArcPy?

I understand there are ways to use a cursor to delete records but I'm looking for a way to delete a field using a cursor.


texts: QGIS 2.18: Filter line-layer by QgsExpression

texts:
I have a line layer on which I want to run a filter within a python script.
I am trying to achieve this via QgsExpression and QgsFeatureRequest.

Below you see the same filter that I want to apply in the python script as well:

In my python script i have an id to search for. But before I can filter by id, I have to cut the From and To string from the id so that I get all id with the specified number. Then I apply a request which you see in the code snippet below. But I get no results. I am not entering the for loop which loops through the results:

# trim edgeid (cut From and To)
edgeid_trimmed = edgeid_out.replace('From','')
edgeid_trimmed = edgeid_trimmed.replace('To','')

# get azimuth of edge (graph)
filter_edgeid_exp = QgsExpression('\"id\" LIKE \" ' + edgeid_trimmed + '%\" ')
request2= QgsFeatureRequest(filter_edgeid_exp)
request2.setLimit(2)

for j,feat2 in inputGraph.getFeatures(request2):
    print "found edges with requested edgeid"
    if j == 0:
        edge1_id = feat2.attributes()[idx_edgeid]
    else:
        edge2_id = feat2.attributes()[idx_edgeid]

However, I do not believe the expression in the QgsExpression(...) is wrong. So what else could be the problem here?


texts:
I'm converting a raster data to vector data.

The problem is similar to this:
How to smooth large vector polygons from Raster

But what I need to know is how can I handle out the gaps that are formed between the polygons?

I want the gaps to be filled with the polygon near to it.


texts: QGIS Plugin -> QgsVertexMarker points missing: Anyway to find out which points are not visible?

texts:
I am trying to plot live feed of three GPSs running at 10 hz using my own QGIS plugin. I was using QgsRubberband initially which worked fine. I recently added QgsVertexMarker to plot every data points on the canvas.

# Adding vertex Markers
self.vertexMarker=QgsVertexMarker (self.canvas)
self.vertexMarker.setColor(self.lineColor)
self.vertexMarker.setIconSize(2)
self.vertexMarker.setIconType(QgsVertexMarker.ICON_BOX)
self.vertexMarker.setPenWidth(3)
self.vertexMarker.show()
self.vertexMarker.setCenter(p)
self.vertexMarkers.append(self.vertexMarker)

The code runs fine but at 10Hz data seems to cause some missing point specially when zoomed in and out quickly.
In the image you can see 03 GPS markers and its trail created using rubberbands and vertexmarkers. If you look closely you can see missing vertexMarker points in the Red and Green streams. I can assure you that data is not missing and it did receive the points.

I used
self.vertexMarkers_tpv[-1].isVisible()
self.vertexMarkers_tpv[-1].isVisibleTo(None)

to verify the vertexMarker are set to be visible and visible to Scene(I think). Each time it return True but somehow still the points are missing

  bool QGraphicsItem::isVisibleTo(const QGraphicsItem * parent) const

`Returns true if the item is visible to parent; otherwise, false is returned. parent can be 0, in which case this function will return whether the item is visible to the scene or not.An item may not be visible to its ancestors even if isVisible() is true. It may also be visible to its ancestors even if isVisible() is false. If any ancestor is hidden, the item itself will be implicitly hidden, in which case this function will return false.

In short, I know at lower data rate say 5Hz things works fine but as soon as data rate is 10Hz I start to lose points. If there is a way that I can tell if certain point is not plotted (feedback mechanism), I can re-plot the points?

EDIT: the same behaviour can be seen with the rubberband. its just hard to identify with 10Hz data


texts: Using SearchCursor and ArcPy to add message?

texts:
This Validates that all Polygons have a map unit. verify that the absence of a Map unit is caught by the check... here we test for the empty string or the python "None" type. Verify that this is how an empty MapUnit will be reflected in the script. I would like the script to also message more than one object id if more is null or empty.

How would I go about that?

Right now it just prints out one record but I would like it to print out all that are empty or null.

with arcpy.da.SearchCursor(MapUnitPolys, ['SHAPE@', 'MapUnit', 'OBJECTID']) as cursor:
    for row in cursor:
        #arcpy.AddMessage(str(row[1]))
        # Does this Polygon have a map unit
        if row[1] == "" or row[1] is None or row[1] is 'NULL':
            arcpy.AddMessage('Polygon OBJECT ID:{} is missing map unit... exiting.'.format(row[2]))
            sys.exit(1)


texts: Is there a way to have a choropleth map in Excel reading data from a sheet?

texts:
Is it possible to have a solution similar to ESRI maps for office in which I want basically a geojson file or any file for that matters to render a choropleth map based on data in a sheet?

Tried already this tutorial http://www.clearlyandsimply.com/clearly_and_simply/2012/09/faster-choropleth-maps-with-microsoft-excel.html but I have a to do this in a way that can be dynamic. I was thinking exporting to geojson and loading on LeafletJS and be able to display it within Excel, is this even possible?


texts:
I am using QGIS 2.18.0 on win 7.
Found out about this great tutorial:

http://blog.sourcepole.ch/2014/09/02/share-and-manage-your-data-with-qgis-cloud-and-wfs-t/

Does this still work? I am expecting that after publishing, anyone can alter the data?


texts: ST_Contains and ST_Intersection in PostGIS can not get the right result

texts:
I have two polygons n1 and n2, both are valid geometries.

I want to test the functions st_contains and st_intersection in PostGIS. I imported n1 and n2 into postgis, then I execute the following SQL:

select  st_contains(n1.geom,st_intersection(n1.geom,n2.geom)) as contains_,
        st_within(st_intersection(n1.geom,n2.geom),n1.geom) as within_
 from n1,n2

I think the both results should be True,but it is False. In my opinion, the  intersection of n1 and n2 should be inside n1 or n2. So what's wrong with my test?


texts:
I'm having issues with installing GDAL on a fresh install of Centos7 using the ELGIS repo. Here's my commands and output:

sudo rpm -Uvh http://elgis.argeo.org/repos/6/elgis-release-6-6_0.noarch.rpm
sudo yum install -y gdal

Here are the console errors:

--> Finished Dependency Resolution
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libCharLS.so.1()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libhdf5.so.6()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libnetcdf.so.6()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdap.so.11()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdapclient.so.3()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libxerces-c-3.0.so()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdapclient.so.3()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libhdf5.so.6()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libCharLS.so.1()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libmysqlclient.so.16()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdapserver.so.7()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libfreexl.so.1()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libxerces-c-3.0.so()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libmysqlclient.so.16()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libcfitsio.so.0()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libpoppler.so.5()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libgta.so.0()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libcfitsio.so.0()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libnetcdf.so.6()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdapserver.so.7()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libarmadillo.so.3()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libgta.so.0()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libfreexl.so.1()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libdap.so.11()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
       Requires: libarmadillo.so.3()(64bit)
Error: Package: gpsbabel-1.4.4-1.el6.x86_64 (elgis)
       Requires: libshp.so.1()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
       Requires: libpoppler.so.5()(64bit)

Is there another repo I need to install to make this work?


texts: Is there a way to tell PostGIS ST_Reclass to use double precision types?

texts:
I have a raster of slopes with one band with decimal data type (32BF- 32 bit float) values from 0-90 degrees.
I use ST_Reclass to reclasify the values to 8 categories:

ST_Reclass ( raster, 1, '[0-1):0,[1-3]:1,(3-7]:2,(7-12]:3,(12-17]:4,(17-25]:5,(25-35]:6,(35-90]:7','32BF', 0 )

The first category is always empty, returns zero count whatsoever, so my guess is that it only works with the whole numbers. Is there a way to tell the reclass function that I want it to look at my data as they are decimal numbers?


texts:
I've done a fair bit of searching, but cannot find anything on this.
When I export an SRTM dataset as a Geotiff from Global Mapper and bring it into QGIS 3.18.1 I need to place a colour legend bar. The legend in GM is fine (see below) but of course when I bring it into QGIS it comes in as a 3 band raster. Placing a legend in the QGIS print layout results in a legend for each band.
Is there a way to get a combined colour bar in QGIS? I'm not happy with any of the colour palettes available in QGIS if I bring it in as a single band.


texts:
I have a problem with intersection function. I built my query following http://manual.linfiniti.com/en/postgis/geometry.html,  5.7 section.

I made my clip object, a red linestring frame:

But after the clip(intersect) operation, something is wrong:

query:

create table roads_clip as
select st_intersection(a.geom, b.geom), b.*
from clip as a, roads as b
where not st_isempty(st_intersection(st_setsrid(a.geom,23700),
  b.geom));

Roads layer contains multiline object and intersection cut roads where intersects the red frame.

I would like a result similar to this:


texts: Programmatically adding field to shapefiles and inserting shapefile name in every row of field?

texts:
situation

We have a folder containing 1 sub-folder for every participant in a study. The subfolders are named with the participants' ID, e.g., 1000, 1001, 1002, 1003. Every participant folder contains a shapefile (and associated files) of the same name (e.g., 1000.shp, 1001.shp, etc). Each shapefile has several points.

challenge

We need to add a column called "PID" to every shapefile. Then we need to add the participant's ID (i.e., the file name, 1000, 1001, 1002) to every row.

For instance, in the folder "1000", there is a shapefile called "1000.shp". In the associated data table, we need to add a column called "PID". Then we need to insert the value "1000" for every row in this new PID column.

question

Is there a way to automate this process?

program/languages

I work with ArcGIS, QGIS, and R. I use R extensively, but not for spatial work. That said, I might have an easier time understanding a programmatic approach in R if one exists.


texts: Does ArcPy (Standalone) have option like Spatial filter?

texts:
I want to get the polyline features intersecting with a polygon geometry and having a particular field values in ArcPy standalone script.

There is another link for similar subject but it is not for standalone script.
Does ArcPy have a spatial search function for geometry?

Does ArcPy have a similar option for SearchCursor like Spatialfilter with whereclause, searchGeometry and relation?


texts: Trying to create a 5km circular buffer around a point. Comes out oval. If I change shp crs it dissappears, if I change basemap crs it stretches it. Something to do with CRS and I know its simple but can't work it out!


texts:
I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. I have already rendered vector tiles, but not able to get bounding box of the vector tile. Here is my sample code:

      var gridsetName = 'EPSG:4326';

      var gridNames = ['EPSG:4326:0', 'EPSG:4326:1', 'EPSG:4326:2', 'EPSG:4326:3', 'EPSG:4326:4', 'EPSG:4326:5', 'EPSG:4326:6', 'EPSG:4326:7', 'EPSG:4326:8', 'EPSG:4326:9', 'EPSG:4326:10', 'EPSG:4326:11', 'EPSG:4326:12', 'EPSG:4326:13', 'EPSG:4326:14', 'EPSG:4326:15', 'EPSG:4326:16', 'EPSG:4326:17', 'EPSG:4326:18', 'EPSG:4326:19', 'EPSG:4326:20', 'EPSG:4326:21'];

       var baseUrl = 'http://localhost:8080/geoserver/gwc/service/wmts';
        var style = '';
        var format = 'application/vnd.mapbox-vector-tile';
        var infoFormat = 'text/html';
        var layerName = 'cite:OPE_MAP_SpatelSpeed';
        var projection = new ol.proj.Projection({
            code: 'EPSG:4326',
            units: 'degrees',
            axisOrientation: 'neu'
        });

   function constructSource() {
            params = {
                'REQUEST': 'GetTile',
                'SERVICE': 'WMTS',
                'VERSION': '1.0.0',
                'LAYER': layerName,
                'STYLE': style,
                'TILEMATRIX': gridsetName + ':{z}',
                'TILEMATRIXSET': gridsetName,
                'FORMAT': format,
                'TILECOL': '{x}',
                'TILEROW': '{y}',
                'VIEWPARAMS': 'ispercent:1;R:0000FF;zoomlevel:' + getzoom() + '',
            };

            var url = baseUrl + '?'
            for (var param in params) {
                url = url + param + '=' + params[param] + '&';
            }

            url = url.slice(0, -1);

            var source = new ol.source.VectorTile({
                url: url,
                format: new ol.format.MVT({}),
                projection: projection,
                tileGrid: new ol.tilegrid.WMTS({
                    tileSize: [256, 256],
                    origin: [-180.0, 90.0],
                    resolutions: resolutions,
                    matrixIds: gridNames
                }),

                wrapX: true
            });

            return source;
        }

  var layer = new ol.layer.VectorTile({
            style: simpleStyle,
            source: constructSource()
        });

  map.addLayer(layer);

sample request call using wmts service:'http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=cite:OPE_MAP_SpatelSpeed&STYLE=&TILEMATRIX=EPSG:4326:9&TILEMATRIXSET=EPSG:4326&FORMAT=application/vnd.mapbox-vector-tile&TILECOL=300&TILEROW=139&VIEWPARAMS=ispercent:1;R:0000FF;zoomlevel:7'.

My layer cite:OPE_MAP_SpatelSpeed is generated using SQL view of geoserver in which i have to pass few viewparams to fetch the data accordingly. e.g viewparam ='zoomlevel:4;func:1'

My problem is along with viewparams i have to pass bounding box of the requested tile.
Does there is any way to get bounding box coordinates of the requested vector tile Or how can we calculate the bounding box on the basis of tile column and row number??

I have read about getTileCoord() function in openlayers but this function is not working in my case.


texts: How to set the visibility range of layers on CartoDB using CartoCSS?

texts:
I would like to customise the visibility of different layers on a CartoDB webmap so that they appear and disappear at distinct zoom levels.

How is this achieved?


texts:
I'm currently working with PostgreSQL and CartoDB to display X and Y coordinates converted to a geom. My shp files have been created and are displayed through CartBD.

When I try and run a map view, the points are displayed in relation to each other accurately, they're simply in the wrong position on a global map.

As you can see in the image, the points are there, but they should be within the bounds of Washington DC. The SRID's I have used are 4326, 2248, 2804, and 2893.

Some example points are below:

"blocksiteaddress" | "blockxcoord" | "blockycoord"
"2516 - 2599 BLOCK OF NAYLOR ROAD SE" | "402548" | "133051"
"10 - 199 BLOCK OF DANBURY STREET SW" | "399075" | "128889"
"1700 - 1799 BLOCK OF I STREET NW" | "396480" | "137054"

Is there a method for obtaining or deciphering what ESRI/SRID code would best fit my data?


texts: Need clarification on GeoServer Meta-tile

texts:
GeoServer WMS meta-tile is often recommended to be used to overcome problems such as:

point symbols close to tile edges are cut
labels are duplicated

I just need some clarification here:  WMS meta-tile does not completely guarantee that such problems gone. WMS meta-tile only reduces them. Hence, in term of point symbols, symbols close to tile edges are still cutted but the occurrence of this is much reduced.

Is it right?


texts: Does QGIS offer the possibility to identify overlapping features in a single WMS layer?

texts:
I work in QGIS 2.10.1-Pisa and use the 'Identify feature' tool to get the feature info of building polygons found in a single layer of a WMS.
Some of these building polygons overlap.

When I select the 'building' layer and click on the intersecting part of these overlapping polygons, I expect QGIS to return multiple objects with their respective details (as I'm used to see in ArcMap). However, the 'Identify Results' window only shows one of the polygons at this location.

Does QGIS offer the possibility to identify overlapping features in a single layer? I checked the documentation but couldn't find an answer.


texts: Can I specify half-open scale ranges in rule-based QGIS layer styles?

texts:
In QGIS 2.16.1's rule-based symbology as well as in its rule-based labeling, it's possible to enable a "scale range" to which the visibility of the result of the respective rule (be it a symbology style or a label style) shall be limited. However, it seems that these ranges always require both a minimum and a maximum scale.

What can I do if I want a rule to apply to all scales above a certain scale (i.e. more "zoomed in"), but not below (more "zoomed out")? The logical way would seem to be to leave out the maximum or set it to 1 : +∞ or at least to something ridiculously large like 1000000 : 1 (= 1 : 0.000001), but the QGIS UI seems to allow none of these and resets the value to the last one entered that is ≤ 1 : 1.

(And no, 1 : 1 is not the largest (most "zoomed in") scale that might occur in QGIS as you can easily verify by zooming further in on your map.)

So, is there a way to specify only a minimum scale and have a rule apply to all scales above it?


texts: List all active extensions with ArcObjects

texts:
I am building an ArcGIS 10 Addin that dumps out as much debug information about a system that I can get. I am currently trying to query which extensions are active in the ArcMap session. The following code is to query on the active ESRI extensions, but does not show the 3rd party extensions. Any ideas of what I need to do to get the information on 3rd party extensions?

public string Extensions
{
   get
   {
      var aoi = new ESRI.ArcGIS.esriSystem.AoInitializeClass();
      var extensionsEnum = aoi.GetProductExtensions(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
      var licenseCode = extensionsEnum.Next();
      var ret = "";
      while(Convert.ToInt32(licenseCode) != -1)
      {
         if(aoi.IsExtensionCheckedOut(licenseCode))
            ret += aoi.GetLicenseExtensionName(licenseCode) + ",";
         licenseCode = extensionsEnum.Next();
      }
      return ret+Environment.NewLine;
  }
}

Here is the working code:

public string Extensions
{
   get
   {
      var extensionManager = (IExtensionManager) ArcMap.Application;

      var ret = "";
      for (int i = 0; i < extensionManager.ExtensionCount; i++)
      {
          var extension = extensionManager.Extension[i];
          var config = extension as IExtensionConfig;
          if(config == null || config.State == esriExtensionState.esriESEnabled)
              ret += extension.Name + ",";
      }

      var jitExtensionManager = (IJITExtensionManager) ArcMap.Application;
      for (int i = 0; i < jitExtensionManager.JITExtensionCount; i++ )
      {
         var extensionUid = jitExtensionManager.JITExtensionCLSID[i];
         if(jitExtensionManager.IsLoaded(extensionUid))
         {
            var extension = ArcMap.Application.FindExtensionByCLSID(extensionUid);
            var config = extension as IExtensionConfig;
            if (config == null || config.State == esriExtensionState.esriESEnabled)
               ret += extension.Name + ",";
          }
       }

       ret = ret.Substring(0, ret.Length - 1);
       return ret+Environment.NewLine;
    }
 }


texts: Skipping undefined elements when getting catchment area

texts:
I have a follow-up question on Population in upstream area (looping over FeatureCollection). I want to calculate the number of people living in the upstream area of stations in rivers. This code works in principle:

var stations = ee.FeatureCollection('users/basins/stations');
var hydro = require('users/gena/packages:hydro');
var PopCount2000= ee.Image('CIESIN/GPWv411/GPW_UNWPP-Adjusted_Population_Count/gpw_v4_population_count_adjusted_to_2015_unwpp_country_totals_rev11_2000_30_sec');

var UpstreamPop = stations.map(function(feature){
    var props = ee.Feature(feature).get('GEMS_Stati')

    var geom = ee.Feature(feature).geometry()

    var catchmentsSelected = hydro.getCatchments({outlet: geom, level: 6})

    var union = catchmentsSelected.union();

    var catchment_Pop2000 = PopCount2000.reduceRegion({
      geometry: catchmentsSelected,
        reducer: ee.Reducer.sum(),
    })

    return ee.Feature(null, catchment_Pop2000).set('GEMS_Stati', props)
})

Export.table.toDrive({
  collection: UpstreamPop,
  description: 'UpstreamPop',
  fileFormat: 'CSV'
});

However, some of the stations are not inside the defined catchment areas. Therefore, "catchmentSelected" can not be defined. When running the code I get the error message  "Element.get: Parameter 'object' is require". One of the 'problem stations' is for example this one:

stations.filter(ee.Filter.eq("GEMS_Stati", 'CHN00009'))

How can I run over all stations and skip the stations that are not in the catchment area?


texts:
I just installed a brand new copy of QGIS 1.8 Lisboa and all of the associated software on a Windows Vista PC using the Windows Osgeo4W QGIS installer, and I get this message:

"The Plugin Installer has detected an obsolete plugin which masks a newer version shipped with this QGIS version. This is likely due to files associated with a previous installation of QGIS. Please use the Plugin Installer to remove that older plugin in order to unmask the newer version shipped with this copy of QGIS."

I did have an older copy of QGIS but I uninstalled it and I am 99% certain that I successfully deleted all of the associated files and directories.  I notice that the Osgeo4W directories created by the OSGEO4W installer include several versions of QGIS (including 1.0 and 1.4), but I am a novice user and don't know how to figure out which plugin is causing trouble, or if this could be a bug in the Osgeo4w installer.

Thanks!


texts: CartoDB SQL API styling individual polyline returns

texts:
I am creating a web mapping application that will return appropriate routes based upon ST_length query on a cartoDB dataset.  So far, the code below successfully maps those routes (and clears any others that may have previously been selected):

What I would like to know is how to style the individual routes as they come in to make it easier for the user to tell which is which.  At the moment they are all the same colour, like this:


texts: Styling by SLD according to multiple field

texts:
I have a shapefile which have two fields say it is "level" and "type".

Now we want to style the map according to the value of the level and type fields.

Generally we use something rule based symbol to style the layer like this:

rule
  level=1
    style....
  level=2
    style...

However once there are multiple fields to be filtered it may change to this:

rule
  level=1 and type=1
    style....
  level=1 and type=2
    style...
  level=2 and type=1
    style...
  level=2 and type=2
    style...
  level=3 and type=1
    style...

It seems like we have to specify all the possibility of the composition of different field. Think about if there are 10+ distinct values of each field, there will be 10*10*10 kinds of rules which will be a hard job.

How do you handle this?


texts: Invalid geometry error after polygonizing a GeoTIFF file

texts:
I wanted to clip an OSM vector layer with the boundaries of a raster image--a GeoTIFF file. I was able to polygonize the raster and obtain its boundary in a vector format. But I am getting a error about the vector layer having invalid geometry when I try to clip the OSM layer with the polygonize vector layer. So let me walk you through what I did.

I took a GeoTIFF image and polygonized it using this code from a previous post.

gdal_translate -b mask -of vrt -a_nodata 0 test.tif test.vrt
# Note the  -a_nodata 0 doesn't seem to work when the mask is input, so do another pass
gdal_translate -b 1 -of vrt -a_nodata 0 test.vrt test2.vrt
gdal_polygonize.py -q  -8 test2.vrt -b 1 -f "ESRI Shapefile" testdata.shp

I get the corresponding image when I import the data to QGIS

However, when I go to clip the OSM layer with the new boundary layer, I get this error about an invalid geometry.

I tried to fix this inside of QGIS, but not sure how to proceed. I tried to use the "Validate Geometry" tool, but that did not fix the invalid geometry issue. Any suggestions about how to either correct the original GDAL code to make valid geometries, or how to fix the subsequently generated polygons?


texts:
Very beginner in QGIS, I want to do split Features using PyQGIS. I have written this code so far it giving me polygon of the layer but i don't know how to split it through coding?

layer = iface.activeLayer() //get active layer
for f in layer.getFeatures():
  geom = f.geometry()
  print geom.asPolygon()//get polygon

As picture suggested, a big polygon contains small polygon i want to split all small polygons in the same layer.


texts: Address locator returns no objects found

texts:
Trying to build an address locator for the following feature case

But unfortunately when I use find locations it finds no object

What might be the issue here ?


texts: Getting WMS address from ArcGIS Online service?

texts:
Was wondering if there was a way to get a WMS service address/feature/functionality from an ArcGIS online service, to provide Tile functionality?

i.e. If I want to use this ArcGIS online service (assuming all licenses are gotten)  https://services.arcgisonline.com/arcgis/rest/services/USA_Topo_Maps/MapServer/  In a (Android) Google Maps API as a Tile Service, how would I go about getting the correct URL to use to point to the service?


texts: Generalizing polygon file while maintaining topology in QGIS?

texts:
I have a polygon Shapefile, which I need to generalize. How can I generalize the poligons and ensure that there are no topological errors like "slivers".

I already tried:

Vector -> Geometry Tools  -> polygones to lines
Vector -> Geometry Tools  -> simplfy geometries ...
here I can already see on the screen, that I am producing overlaps and gaps
nevertheless now I try
Vector -> Geometry Tools  -> lines to polgones

and here the program show an error and crashes


texts:
I need to identify the roofs of buildings using a satellite image, something like what is available in OSM  (something like the image).

Is there anyway to do this in Qgis, R, Arcmap?


texts: Manually configuring coordinate reference system of QGIS?

texts:
I am using qgis valmiera on windows 7 pro 64 bit.

How do I manually configure CRS. that is user defined coordinate system, so that i can manually enter the values of projection?


texts: no layers after connected to Postgres using GDAL 2.1 c++ API

texts:
I connect to Postgres using GDAL 2.0 API using the function GDALOpenEx() as below. But when I use poDS->GetLayerCount(), it just returns 0. My Postgres(v9.5) has a database name postgres, and the schema public contains 3 tables with data. What is wrong?

#include <ogrsf_frmts.h>
bool read_data_from_postgis()
{
    using std::string;
    GDALAllRegister();
    GDALDataset* poDS;
    string source = "PG:host=192.168.1.11 port=5432 user=postgres password=abcd dbname=postgres";

    poDS = (GDALDataset*)GDALOpenEx(source.c_str(), NULL, NULL, (const char* const*)"LIST_ALL_TABLES=YES", NULL);
    if (poDS == nullptr)
    {
        std::cerr << "connection FAILED.\n";
        return false;
    }
    std::cout << "Connected to Postgres.\n";
    std::cout << poDS->GetLayerCount() << std::endl;  // return 0!!

    return true;
}


texts: changing negative pixel spacing to positive

texts:
I have a bug with one application that does not handle negative pixel spacing values. Therefore I would like to change the negative pixel values of my images (geotif) into positive values (while keeping the georeferencing, of course.

I've tried with gdalwarp and gdal_translate but the output still remains in negative values. My workaround was to create a tfw, ten "manually" edit it to get positive Y values and changing the origin to lower left instead of upper left. However, I would like to know if there is an easier (and faster) method to achieve this. If possible using gdal.

EDIT: I don't want to flip the images : I want an output that is georeferenced with positive pixel spacing in X and Y (so the origin should be at the bottom left) but pixels mustn't move. I've tried editing the geotransform but this does not modify the row order.


texts: I have a problem with my leaflet map, whenever I zoom in/out or drag the map it bounces back to the original state. How do I disable this effect?


texts:
I'm trying get get intersections between one straight line and some contour lines. Using the SQL below:
DROP TABLE IF EXISTS v_line;
SELECT st_geomfromtext('linestring(103.492217095662 30.9300260311043,103.494817217263 30.9200436767033)',4326) as geom INTO v_line;
SELECT a.gid,a.height, ST_AsText(ST_Intersection(b.geom, a.geom))
FROM contour_cb9eba as a,v_line as b
WHERE ST_Intersects(b.geom,a.geom);

But the query takes tens of seconds to finish. I have tuned the postgresql, doesn't help. I have create index on contour table, doesn't help. the Explain is below:
Nested Loop  (cost=0.14..665.47 rows=37 width=44)
  ->  Seq Scan on v_line b  (cost=0.00..23.60 rows=1360 width=32)
  ->  Index Scan using contour_cb9eba_geom_idx on contour_cb9eba a  (cost=0.14..0.41 rows=1 width=746174)
        Index Cond: (b.geom && geom)
        Filter: _st_intersects(b.geom, geom)

the explain analyze is below:
Nested Loop  (cost=0.14..665.47 rows=37 width=44) (actual time=245.343..4629.091 rows=23 loops=1)
  ->  Seq Scan on v_line b  (cost=0.00..23.60 rows=1360 width=32) (actual time=0.011..0.013 rows=1 loops=1)
  ->  Index Scan using contour_cb9eba_geom_idx on contour_cb9eba a  (cost=0.14..0.41 rows=1 width=746174) (actual time=114.466..803.730 rows=23 loops=1)
        Index Cond: (b.geom && geom)
        Filter: _st_intersects(b.geom, geom)
        Rows Removed by Filter: 40
Planning time: 0.235 ms
Execution time: 4629.272 ms

The contour table has only 82 rows but with many vertices up to almost 80000.
Is there any way to make ST_Intersection faster?


texts: How to delete specific line in Text elements using ArcPy?

texts:
I work with several maps (in folder named "aa") and the text boxes in the layout view are:

I try to delete,using Arcpy, the empty line in the this text properties box

so my result will be one line only:

By the way, i have also an empty line in this text box:

this is my python code:

import arcpy
from arcpy import env

env.workspace = r"G:\desktop\Project\aa"
for mxdname in arcpy.ListFiles("*.mxd"):
    print mxdname
    mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\aa\\" + mxdname)
    for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
        elm.text = elm.text.replace(' ', 'free zn space')
    print 'done'
    mxd.save()
del mxd

but there no changes in the maps and i get this result:

>>>
landUse.mxd
done
1
>>>


texts: Custom python scripts do not appear in SEXTANTE QGIS

texts:
Custom python scripts do not appear in Scripts menu in SEXTANTE plugin unless they are either empty or are as simple (and useless) as:

##foo=group
##input=raster

OS is openSUSE 12.3; QGIS 1.8 and Master both demonstrate the same behaviour.

I was told that the issue may be caused by insufficient permission rights for the scripts folder. The path to the script's (for Master in this case) is that is defined by default: /home/username/.qgis2/processing/scripts. For both 'processing' and 'scripts' folders I have the following permissions: drwxr-xr-x. For the scripts in 'scripts' folder the permissions by default are -rw-r--r--, but even if I enable execution rights manually to be -rwxr-xr-x this doesn't affect their appearance in SEXTANTE scripts. So I suppose that permissions doesn't seem to cause trouble here...

Please advise me how to overcome this issue.


texts: I need to find a package in R or source code in R that performs batch geocoding using Bing, Yahoo, OpenStreetMap. Do you have any suggestions?


texts: Publishing model with custom script containing call to .exe on Geoprocessing server

texts:
I have a ModelBuilder model that uses a custom python script, and within the script there is a call to a command line interface (CLI) executable. The model runs fine on my local desktop, but when I go to publish the results to a GP server, I get the error:

My first question is:

What's the difference between a model that uses a custom python script, and a python toolbox?

I've successfully published a python toolbox that contains a call to the same _cli.exe, but for other reasons needed to try converting the tool to a model.

My second question:

What are my options, if any, for using a tool on a GP server that calls the .exe?

The machine running the GP server already has the program associated with the cli.exe installed.


texts: Is the Mercator projection or the Gall-Peters projection of the world more accurate?

texts:
I've been researching the concept of Eurocentrism, an ideology that views the world from a very European perspective. It's seen in literature, in academia, in world history, and perhaps even in cartography, as I've just found out.

I found information on two types of world maps, the Mercator Projection map and the Gall-Peters Map. Supposedly, the Mercator Projection map is inaccurate, and an example of the political influences on map design. The Gall-Peters projection map as I've read, was a sort effort to counter that. The idea is that in the Mercator map, Europe is seen as a much larger land mass and appears reasonably large compared to the Gall-Peters projection, which shows Europe as a much smaller mass, almost insignificant, when compared to regions like Africa.

So my curiosity brought me here. What is the accepted map projection of the world among Geographic Information Specialists and Cartographers and experts operating in related fields? Is the relation between the map projections and Eurocentric perspectives too much of a stretch? Is it neither? I'd love to hear from you all.

Much thanks.


texts: How to test if Osmosis is installed on openSuse?

texts:
update; thanks to the answer i have done some more

i teste like you recomended;

linux-wyee:/home/martin/gis/test/test2/a_repo # :~> cnf osmosis
linux-wyee:/home/martin/gis/test/test2/a_repo # cnf osmosis

Das Programm 'osmosis' was found here:
  * osmosis [ Pfad: /usr/bin/osmosis, Repository: zypp (gis_-_osmosis) ]

Try installing with:
    zypper install osmosis

well just wondering - does this mean i have to install it!!?

love to hear from your

btw- do i need postgis and - yes i guess i have to install postgresql too.
Note; i have a apache / lamp allready up and running on my opensuse 12.1.

I am pretty new to GiS and to Linux. I try to install Osmosis on my openSuse 12.1 System.

Here what i have in YAST:

linux-wyee:/home/martin # zypper lr -d
#  | Alias                                       | Name                                        | Aktiviert | Aktualisieren | Priorität | Typ    | URI                                                                                | Dienst
---+---------------------------------------------+---------------------------------------------+-----------+---------------+-----------+--------+---------------------------------------------------------------------------------------+-------
 1 | Aktualisierungen-für-openSUSE-12.1-12.1-1.4 | Aktualisierungen für openSUSE 12.1 12.1-1.4 | Ja        | Ja            |   99      | rpm-md | http://download.opensuse.org/update/12.1/                                             |
 2 | UpdatedApps                                 | KDE UpdatedApps Repo                        | Ja        | Ja            |   99      | rpm-md | http://download.opensuse.org/repositories/KDE:/UpdatedApps/openSUSE_12.1/             |
 3 | gis_-_osmosis                               | gis - osmosis                               | Ja        | Ja            |   99      | rpm-md | http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.1/             |
 4 | openSUSE-12.1-12.1-1.4                      | openSUSE-12.1-12.1-1.4                      | Ja        | Nein          |   99      | yast2  | cd:///?devices=/dev/disk/by-id/ata-TSSTcorp_CDDVDW_SN-S083C_m1L3456789KLMNOP,/dev/sr0 |
 5 | packman-x86_64                              | packman-x86_64                              | Ja        | Nein          |   99      | rpm-md | http://packman.inode.at/suse/12.1/                                                    |
 6 | repo-debug                                  | openSUSE-12.1-Debug                         | Nein      | Ja            |   99      | NONE   | http://download.opensuse.org/debug/distribution/12.1/repo/oss/                        |
 7 | repo-debug-update                           | openSUSE-12.1-Update-Debug                  | Nein      | Ja            |   99      | NONE   | http://download.opensuse.org/debug/update/12.1/                                       |
 8 | repo-non-oss                                | openSUSE-12.1-Non-Oss                       | Ja        | Ja            |   99      | yast2  | http://download.opensuse.org/distribution/12.1/repo/non-oss/                          |
 9 | repo-oss                                    | openSUSE-12.1-Oss                           | Ja        | Ja            |   99      | yast2  | http://download.opensuse.org/distribution/12.1/repo/oss/                              |
10 | repo-source                                 | openSUSE-12.1-Source                        | Nein      | Ja            |   99      | NONE   | http://download.opensuse.org/source/distribution/12.1/repo/oss/                       |
linux-wyee:/home/martin #

Regarding the above mentioned listing of repos - can we say that I have osmosis installed yet?

How can i test if osmosis is installed?

Can this be tested on commandline - in terminal? How?


texts:
I am writing a qgis plugin to display spectral information stored in a geodatabase (Spectre Viewer). For this, I need calibration factors to get from channel values to energies. I want the end users to be able to set their own calibration factors that will vary depending on the layer and field name selected to plot the spectra.

So I need to store some persistent data. I would prefer to either store it in the directory where the plugin is stored, store it in the active project or store it in the general QGIS settings. I do see pros and cons of all those designs.

The data I want to store will be a tree structure:

Layer1 -- field1_1 -- [set of numeric calibration values ]
       \- field1_2 -- [set of numeric calibration values ]
Layer2 -- field2_1 ...

Are there any way to store custom data in the QGIS project file or in general QGIS settings?

For a while I was thinking about storing the data as a json file in the plugin directory, then I discovered that this file was erased when I update the plugin, which kind of makes it useless. I can of course save the file  anywhere the user running qgis can save a file, but I  feel that would be a bit too much "messing around where I am not supposed to be messing around".


texts:
I am using QGIS to create 3D visualizations using plugin "Qgis2threejs Exporter".
My goal is to share this with others. Right now it runs fine on my computer browser. How do I make it "sharable"?
I tried writing the output to my Onedrive "Public" folder but it does not work on other devices. Is this possible?


texts: Conversion of OSM building to elevation raster

texts:
I have a roof as an OSM building, which I need to convert to an elevation raster to be used for QGIS calculation, with a raster resolution of 9pts/sqm.

Typical OSM building would be: http://city.informatik.uni-bremen.de/~jeff/complex1.osm

However, I'm not able to find a way to convert this OSM building file to a geotiff raster for QGIS. I tried to convert it to shapefile, but I always loose the z elevation.

Would you have any clue on how to perform this conversion ?


texts: Does QGIS run on Windows Surface with Win RT OS?

texts: I was wondering if anyone has had any success running QGIS on the Windows Surface tablet? Specifically with the Windows RT OS.


texts:
I use GDAL 2.2.1, released 2017/06/23 on Windows 10. It was install with pre-compiled packages. I usually use gdalwarp, gdal_translate or gdal_grid as commands for single use, or with Python bindings for larger programs.

I haven't found a way to use Windows GPU, even with a few options I try such as -wo "USE_OPENCL=TRUE". The graph on my GPU stays still and flat (0.0%). Here is an example of code to resample an image:

gdalwarp -r cubicspline -tr 4.5e-5 4.5e-5 -ot Int16 -te  3 41 8 45 -multi -wo "USE_OPENCL=TRUE" DEM_75m.tif DEM_5m.tif

During the processing, RAM is used at 200Mo, 20% of CPU and of course 100% of hard-drive usage. 0% GPU.

Should I re-install GDAL with new build parameters, or is there a way of using it as it is?