texts:
My goal is to use mapcache to generate a ZXY tileset. This tileset can then be used directly by the client with no server requirement.

The reason for mapcache is that I have a set of mapserver map files that contain all of my styling.

I have configured mapcache.xml as follows:-

<cache name="disk_test" type="disk" layout="template">
    <template>/tmp/disk_test/rbwm_mastermap/{z}/{x}/{y}.{ext}</template>
</cache>

<tileset name="test_zxy">
    <source>MY MAPFILE SOURCE</source>
    <cache>disk_test</cache>
    <grid>ZXY</grid>
    <format>PNG</format>
    <metatile>1 1</metatile>
    <metabuffer>10</metabuffer>
    <expires>3600</expires>
    <auto_expire>2678400</auto_expire>
</tileset>

<grid name="ZXY">
    <size>256 256</size>
    <extent>-20037508.3427892480 -20037508.3427892480 20037508.3427892480 20037508.3427892480</extent>
    <srs>EPSG:3857</srs>
    <units>m</units>
    <resolutions>2000 1000 500 400 200 100 50 25 20 10 9 8 7 6 5 4 3 2.5 2 1.5 1 0.3 0.2</resolutions>
</grid>

The following request creates a tile in 20/77961/104498.png

SERVICE=WMS&VERSION=1.1.1&
REQUEST=GetMap&
LAYERS=test_zxy&
WIDTH=256&HEIGHT=256&
FORMAT=image/png&
SRS=EPSG:3857&
TILED=true&
DPI=72&
MAP_RESOLUTION=72&
FORMAT_OPTIONS=dpi:72&
TRANSPARENT=TRUE&BBOX=-79492.34278900176286697,6713979.65721099823713303,-79236.34278900176286697,6714235.65721099823713303

My calculations show that this is wrong as it should be closer to:-

20/522208/348614.png

Am I doing something wrong in my grid or template?


texts: Downloading GPdatafile from ArcGIS Server?

texts:
I want to download a GPdataFile from a GIS server.

In fact, I am using the PrintTask Service, which generates my map instance in various formats.

I have the url of the specific file on the sever, and I want to force the browser to download it immediately after the PrintTask callback finishes, as if I had content disposition enabled.

Which service could I use to fetch that file from the server?

I am using ArcGIS Server 10.2.2.


texts: Leaflet Search Control Plugin return text search without removing autocomplete

texts:
I am using https://github.com/stefanocudini/leaflet-search to search through some geojson. It works well but I am trying to return the text the user enters into the search to build a dynamic query. How do I capture the text without disabling the autocomplete?
states_layer= new L.geoJson(states).addTo(map);
var controlSearch = new L.Control.Search({
    position:'topright',
    layer: states_layer,
    propertyName: 'name',
    initial: false,
    zoom: 11,
    marker: false,
});
map.addControl(controlSearch);

Code works good -- I was looking through the source code and tried to implement the filterData option.
filterData: function(text,records){
        console.log(text);
        console.log(records);
        }

This printed out the entered text and records but it took away the important autocomplete functionality from the layer search.
Update

Update 2 using filter data return records
filterData: function(text, records) {
  console.log(text);
  console.log(records);
  return(records);
}

breaks the autocomplete

Update 3
added
    filterData: function(text, records) {
      records = this._defaultFilterData(text, records);
      console.log(Object.keys(records));
      console.log(records);
      return(records);
    }

which helps but this is not what I am looking for. I need when the user selects 1 record or types in the name fully and presses enter or the search icon -- I need that text or 1 record chosen.
I am trying to avoid writing a custom autocomplete search bar, anything in the source code worth tinkering?


texts: Disabling TextSymbol Scaling on Zoom in/out (ESRI JavaScript API)

texts: I am looking for a way to disable text scaling when a user zooms in/out on a map with a TextSymbol on it. It this possible?


texts: Why does not equal length of line in DIRECTION/LENGTH with length of line in MEASURING in OpenLayers 2.13?

texts:
My map projection is: "EPSG:900913", display projection is "EPSG:4326" and units is "m", however does not equal the length in Direction/length with the length is calculated in measuring in OpenLayers, in fact OpenLayers show the length more than the actual length when I use measure control. I've set the option geodesic: true to my measure control.

For example:

the enter length is: 100m

the length after measuring is: 85.29m

Define measure control:

 measureLine = new OpenLayers.Control.DynamicMeasure(OpenLayers.Handler.Path);
measureLine.geodesic = true;

function insertDirectionLength(drawType) {
    var values = parseInput(
    window.prompt(
            "Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length"
    )
     );
     if (values != null) {
         var controlKey,key;
         for (key in controls) {
             controlKey = controls[key];
             if (drawType == key) {
                  controlKey.insertDirectionLength(values[0], values[1]);
             }
         }
     }
 }

How to resolve this problem?


texts: I am trying to edit the precision of my area attribute in QGIS 2.0. It is currently at 0 but I want to change it to 3. I have not been able to find the answer to this anywhere. Is there a way to edit the properties of an attribute, or do I need to create a new column and plug the data into the new column.


texts:
I would try Gdal 2.1, does someone knows if it is available for windows ?
For example I would try those WMTS features :
http://www.gdal.org/frmt_wmts.html


texts: Creating new lines along specifically selected existing lines using QGIS?

texts:
I have tried to find a solution for this everywhere, with no result...
My problem is that I want to be able to manually draw a line that automatically snaps to a line (creating an exact copy of the other lines geometry) that's on another layer (using something like this: How to create a line with start and end points which are in another layer in QGIS?).

See example in attached image. This is how it would look if just using the snapping option. I will loose a few percent of length in the new lines compared to the lines in the other layer, and will later have to compensate that loss of length in some calculation (something I'd rather not do).

I need to manually select which lines that should be created, therefore I can't use any automatic method that creates lines for the whole map (if such should exist).

Is there any way to alter the lines afterwards, to match the other layers' lines? Or perhaps a plugin tool that I haven't yet found, that can help me in the manual creation of these lines?


texts: Is there an equivalent to "Build Balanced Zones" from ArcGIS Pro in QGIS?

texts:
"Build Balances Zones" was introduced in ArcGIS Pro 2.4 and allows a kind of spatial clustering with the help of genetic growth algorithm:

  The Build Balanced Zones tool uses a genetic algorithm to create
  spatially contiguous zones in your study area based on criteria that
  you specify. You can create zones that contain an equal number of
  features, zones that are similar based on a set of attribute values,
  or both. There are also options to select zones with approximately
  equal areas, that are as compact as possible, and that maintain
  consistent summary statistics (such as averages and proportions) of
  other variables.

Is there an equivalent to this in QGIS? I tried "Attribute Based Clustering", but this gives quite different results. Apart from that I did not find any similar tools.

I would like to use it on a population map, creating zones with 1 Million people in each zone. Similar to a census map, but worldwide.


texts: Making Great Circle Arcs which look good on Web Mercator map?

texts:
I'm trying to create a map, with data indicating some flights, and want to use Great Circle Arcs, to connect the source and destinations.

Basically, I want to do something similar to the famous Facebook map:

I used the functions given in this post: https://gis.stackexchange.com/a/5205/442, (i.e. this blog article: http://anitagraser.com/2011/08/20/visualizing-global-connections/) and I could get lines, but they cross the International Date Line, as well as bunch up, at the poles:

@underdark, has mentioned in the linked blogpost that these lines need need to be split, but I don't know how to split them automatically in PostGIS.

Additionally the bunching of the lines near the poles need to be resolved as well.

How do I do both of these, when I have the point locations for start and end of these flights?


texts: Why does the 32-bit version of QGIS 3.4 works better (does not regularly crash) than the 64-bit on my 64-bit W10Pro laptop?

texts:
I was initially using the 64-bit version then it started crashing. First, it crashed whenever expressions/Python was involved. Then, it crashed when I was closing it. This happens in both the 64-bit 3.4 and 3.10 LTR versions.

Even when installed through the OSGEO4W installer, the problem persists.

Also, is it true that with the 32-bit, I'll be using half the RAM?


texts: Automatically updating ModelBuilder tools when submodels are modified?

texts:
I have some pretty complex ModelBuilder tools I have developed that contain a lot of nested sub-models.  These submodels are sometimes modified, such as in value lists or code blocks, but the tools using them don't update their behavior unless I delete the modified submodel from those tools, then copy it back in and reconnect everything.  This can be particularly tedious for sub-models that have a lot of parameters.

Is there any way to tell a parent tool to automatically "refresh" its connections to sub-models it uses so that any changes in the sub-model are integrated into the parent model?


texts: can you convert multiple shapefiles to a single dxf using ogr2ogr?

texts:
I would like to create a dxf from several shapefiles using ogr. The only way I can see to do this would be to create the dxf from one file and then convert the others to the same file using the append option. However when I try this I get an error. Here is my statement:

ogr2ogr -f DXF E:\test\augusta.dxf E:\test\100yrflood.shp -append

And this is the error I get:

ERROR 1: Layer '100yrflood' does not already exist in the output dataset, and cannot be created by the output driver.

Incidentally, I also have columns called 'layer' and 'color' which are standard cad fields that I have populated and would like to carry over to the dxf. The layer field translates but the color field doesn't, I get this error:

ERROR 1: DXF layer does not support arbitrary field creation, field 'Color' not created.

Can anyone help?


texts:
I'm building a public transit service in South Africa, and I initially started the project on PHP and MySQL. I've managed to get far  with the simple stack, with:

Routing algorithm in PHP
Data storage as coordinates in MySQL
front-end in WordPress
JS for Google Maps and a REST API for mobile apps (incomplete)

My question based on the above is: I want to move away from using PHP in the back-end, and I'd like to know what alternatives there are.

I'm fairly inexperienced, and used PHP as it's the only server-side language that I currently know. I've seen that a lot of map/routing applications use Java and Python, and am thinking of moving in that direction in future.

I'm finding myself having to do a lot of geographic calculations, and as my data grows I find myself reinventing the wheel. Would a PostGIS + PgRouting setup benefit me?

A working demo of the project can be found at http://rwt.to.

The project has subsequently went live.


texts: Transfer Data from Database to Leaflet POP UP

texts:
How can I show data from a database to leaflet in a pop up?

Here is my code in php select command:

<?php
$db = new PDO('mysql:host=localhost;dbname=poi', 'root', '');
$sql = "SELECT name,user_date,user_time,address,lat,lng,icon_name FROM tblmarker";

$rs = $db->query($sql);
if (!$rs) {
    echo "An SQL error occured.\n";
    exit;
}

$rows = array();
while($r = $rs->fetch(PDO::FETCH_ASSOC)) {
    $rows[] = $r;
    $name[] = $r['name'];
    $user_date[] = $r['user_date'];
    $user_time[] = $r['user_time'];
    $address[] = $r['address'];
    $icon_name[] = $r['icon_name'];
}
print json_encode($rows);
$db = NULL;
?>

and here is my code in showing the marker in the map from database:

function getInfo() {
        $.getJSON("get_info.php", function (data) {
          for (var i = 0; i < data.length; i++) {
            var location = new L.LatLng(data[i].lat, data[i].lng);
            var marker = new L.Marker(location,{icon:Icon1});
            var ll = marker.getLatLng();

          marker.bindPopup("$name
$user_date
$user_time
$address
$icon_name").addTo(map);

             }
        });
      }

I thought it works because when I refresh it the marker from my database shows in the map but when I click the marker for the pop up the pop up shows only is like this.

$name
$user_date
...

What's wrong with my code? Am I missing something?


texts:
I have tried to use v.clean and v.clean.advanced (by GRASS GIS) within a script in QGIS, and was not able.

I followed instructions here:, but was not able to do so. I got message: "No module named grass.script".

Any hint or reference to any source about how to do this?


texts: Function to find annual maximum outcome for twelve years of monthly image bands in Earth Engine

texts:
I have a feature collection of about 80,000 tiles, and I am trying to calculate the annual maximum drought severity index score for each tile using TerraClimate data. TerraClimate is an image collection, so I started by transforming it into a stack of images.

var drought_M = ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE").select("pdsi")
.filter(ee.Filter.date('2000-01-01', '2012-12-31'));

//This function creates a stack of images from the image collection
function newCollectionToImage(collection){
var stack = ee.Image(collection.iterate(function(img, prev) {
return ee.Image(prev).addBands(img);
}, ee.Image(1)));

stack = stack.select(ee.List.sequence(1, stack.bandNames().size().subtract(1)));
return stack;
}

//This function renames the image collection bands
var drought_M_rename = drought_M.map(function(img){
var y = ee.String(ee.Date(img.get('system:time_start')).get("year"));
return img.set("year",y).rename(y);
});

//Apply the function to create a stack of images
var droughtImageStack = newCollectionToImage(drought_M_rename);

How would I take this stack of images (or the image collection) and perform an image reduction that produces the annual maximum score?


texts: Finding coordinates of max n values of raster layer using GeoTools

texts:
I have a Geotiff file which is published as a raster layer in Geoserver.
I need to be able to calculate the coordinates of the max n values that are inside a given polygon.
I have found a WPS called gs:RasterZonalStatistics which returns the max value in a raster layer. But I need to modify its code to return the coordinates of the max value. And further more to return the coordinates of the max n values.
I have searched the geotools code, and found the two classes: org.geotools.process.raster.RasterZonalStatistics and org.geotools.process.raster.RasterZonalStatistics2. I've tried to understand their code and to find the place where I should change but with no success.
Where is the real logic of calculating the max value?


texts: Difference between outcome of REST query through browser and through cURL

texts:
I am working with the geoserver rest interface to automate the config of all layers, stores etc.
One thing I noticed was that when using a browser and navigating to a layer the outcome is something like the information below:

Sample url: http://SomeServer/geoserver/rest/layers/SomeLayer.html

Layer "SomeLayer"

    Name: SomeLayer
    Default style: StyleInfoImpl[layerStyle]
    Available styles: []

When using the same url but through cURL I get:

curl -v -u user:password -XGET http://SomeServer/geoserver/rest/layers/SomeLayer -H  "accept: application/xml" -H  "content-type: application/json"

<layer>
  <name>SomeLayer</name>
   <type>VECTOR</type>
  <defaultStyle>
    <name>LAyerStyle</name>
  </defaultStyle>
  <resource class="featureType">
    <name>SomeLayer</name>
  </resource>
  <enabled>true</enabled>
  <queryable>true</queryable>
  <metadata>
    <entry key="GWC.autoCacheStyles">true</entry>
    <entry key="GWC.metaTilingX">4</entry>
    <entry key="GWC.metaTilingY">4</entry>
    <entry key="GWC.gutter">0</entry>
    <entry key="advertised">true</entry>
    <entry key="GWC.enabled">true</entry>
    <entry key="GWC.cacheFormats">image/png,image/jpeg</entry>
    <entry key="GWC.gridSets">EPSG:4326,EPSG:900913</entry>
  </metadata>
  <attribution>
    <title>Bla</title>
    <href>https://www.some-url.org</href>
    <logoWidth>0</logoWidth>
    <logoHeight>0</logoHeight>
  </attribution>
</layer>

When using cURL I get much more attributes such as "enabled", "Queryable" and "Metadata".

Is this normal behaviour, am I missing something when navigating to the layer information in a browser?
I am using geoserver 2.12, but I have noticed this behavior already in 2.1.


texts: Calculate mean EVI for multiple polygons across an image collection in Google Earth Engine

texts:
My goal is to calculate mean EVI for a collection of polygons for each image in an image collection.

My collection of polygons is a GEE feature collection (called 'polys') and I'm using the Landsat 8 EVI image collection.

I've been able to create a script that executes this task for a single polygon in this feature collection, posted below and link here.

My question is how do I take this script and scale it up to execute the task for my whole collection of polygons? Script I'm working on is also below and here.

Everything runs smoothly up until step 4 (mapping a reduceRegion/(s) function across the image collection), where earth engine returns a 'computation timed out' or an 'earth engine memory capacity exceeded' error. I've tried breaking both the image collection and the feature collection into smaller chunks with no success. I wonder if exporting a task to my google drive could be a solution, but I'm unsure of how to write the correct code for this.

Scripts:

1) Mean EVI for a single polygon for each image in a collection (works):

// 1. Filter 'polys' feature collection by property 'Name'.
var NU009 = polys.filterMetadata('Name', 'equals', 'NU009');

// 2. Get Landsat 8 EVI collection and filter to NU009.
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_EVI')
                            .filterBounds(NU009)
                            .filterDate('2014-01-01','2018-12-30');

// 3. Clip each Landsat image to the area covered by NU009.
var l8_clip = l8.map(function(image) {
   return image.clip(NU009);
  });

// 4. Calculate mean EVI for NU009 in each image.
//Define a function that calculates mean EVI for NU009.
//Returns an image collection where each image has a new property,
//'meanEVI'.
var reducer = function(image) {
   var meanEVI = image.reduceRegion({
     reducer: ee.Reducer.mean(),
     geometry: NU009.geometry(),
     scale: 30,
     bestEffort: true
    });
   return image.set('meanEVI', meanEVI);
 };

//Map the reducer function over the image collection.
var l8_reduce = l8_clip.map(reducer);
print(l8_reduce);

2) Mean EVI for all polygons for each image in a collection (computation times out):

// 1. Filter 'polys' by size.

// Define a function that calculates area of each polygon.
// New property 'GEE_Area' is in square meters.
var feature_area = function(feature) {
  var area = feature.geometry().area();
  return feature.set('GEE_Area', area);
};

polys = polys.map(feature_area);

// Filter polys by their GEE_Area.
// Must be greater than 30 square meters (900m) to be sufficiently
//represented by a Landsat pixel.
var polys_filtered = polys.filterMetadata('GEE_Area', 'not_less_than', 900);

// 2. Get Landsat EVI image collection.
var l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_EVI')
                                .filterBounds(polys_filtered)
                                .filterDate('2014-01-01','2018-12-31');

// 3. Clip each Landsat image to the area covered by all polygons.
var l8_clip = l8.map(function(image) {
  return image.clipToCollection(polys_filtered);
});

// 4. Calculate mean EVI for each polygon in each image.

// Define a function that calculates mean EVI for all polygons using
//'reduceRegion' method.
var reduceRegion = function(image) {
  var meanEVI = image.reduceRegion({
    reducer: ee.Reducer.mean(),
    geometry: polys_filtered.geometry(),
    scale: 30,
    bestEffort: true
  });
  return image.set('meanEVI', meanEVI);
};

var l8_reduceRegion = l8_clip.map(reduceRegion);
print(l8_reduceRegion);

// Alternative to above function:
// Define a function that calculates mean EVI for all polygons using
//'reduceRegions' method.
var reduceRegions = function(image) {
  var meanEVI = image.reduceRegions({
    collection: polys_filtered,
    reducer: ee.Reducer.mean(),
    scale: 30});
  return meanEVI;
};

var l8_reduceRegions = l8_clip.map(reduceRegions);
print(l8_reduceRegions);


texts: Aligning different vector features and vector features with rasters

texts:
I am fairly new to GIS and I encountered this problem concerning projections. Maps don't align despite having the same projections (according to the Properties - XY Coordinates).

I already tried with Define Projection, for maps without projections already defined, and Project, for maps with already defined projections. I encountered this problem when combining feature classes and also with combining feature classes and raster.

I suppose, as a beginner, I'm missing something basic. How can I solve this issue?


texts: How to select and zoom in features from a QGIS Python Plugin

texts:
I'm very new to Python. I'm trying to find a way to select and zoom to the features from a QGIS layer.

I've created a plugin and built a custom form. I have 3 values from the form which I need to place in a query but as I'm new, I don't know how.

aExchange = self.dlg.EXCHANGE_1141_CODE.currentText()
aPCP = self.dlg.BT_OBJECT_CLASS.currentText()
aObject = self.dlg.BT_OBJECT_ID.text()

The filter on the Attribute table is like this:

"EXCHANGE_1141_CODE" = 'IH' AND "BT_OBJECT_CLASS" = 'PCP' AND "BT_OBJECT_ID" = '10'

I've tried:

alayer.SetSubSetString ('EXCHANGE_1141_CODE = \'IH\'')

but this seems to just change the filter on the layer source which isn't what I want.

I want to be able to search for a feature and go to it. How can I do it with PyQGIS?


texts: How to Zoom Google Maps Javascript API to level 25

texts:
Cannot Zoom Google Maps Javascript API  after 1:564 (zoomlevel: 20) in Mapstore. Can anyone help me to solve this cause my layer keeps on zooming but the map is stuck at zoom 20, I want to zoom it to 25.

here is my config.json

{
  "map": {
    "projection": "EPSG:900913",
    "units": "m",
    "center": {
      "x": 1250000.000000,
      "y": 5370000.000000,
      "crs": "EPSG:900913"
    },
    "zoom": 5,
    "maxExtent": [
      -20037508.34, -20037508.34,
      20037508.34, 20037508.34
    ],
    "layers": [{
      "type": "google",
      "title": "google map",
      "name": "SATELLITE",
      "source": "google",
      "group": "background",
      "visibility": false
    }]
  }
}


texts: How to select features in layer using dataset statistics (stdev and mean) and ModelBuilder?

texts:
I am trying to solve following problem. I need to select features from the shapefile by attribute in Model builder. The attribute should be a statistics which you can calculate by the tool :"Summary statistics". This creates new table with mean and stdev from the original shapefile attribute table. I need to use those numbers in the selection of features of the original layer.
Is there some way, how to do this?

Practically I am trying to do a very easy procedure, a lot of people do in the ArcMap regullarly. To classify feature by the standard deviation. Take the range of features above the specified stdev level and make a new layer of this.
Shame that there is not such tool like Reclassify for rasters which would work for the features as well where the only thing you should do is to load layer symbology and say that one of the classes is preserved and the others are lost.


texts: Selecting specific filenames nested within several folders?

texts:
I have hundreds of shapefiles that are stored in separate folders, which are nested within several other folders. Among the shapefiles I only need the ones that are named 'POINT*.shp'

How do I get these specific shapefiles so I can then add fields, calculate fields, etc.?

If there is a better option than os.walk, please tell. I'm only beginning to learn python, so this is very new to me.


texts:
I've created an SQL script that selects a given set of polygons ("v_rag_RenouvellementClaim") that are completeley within a specified buffer ("v_rag_RenouvellementClaimGrtr25000_Buffer") using PostGIS ST_Within. The code works but is very slow to display as a table or as a layer in QGIS 3 (over 3 minutes). The result outputs just under 20000 records.
Is there a more efficient way to get this to display/run?

I'm using QGIS 3, PostgreSQL 9.6 and PostGIS 2.3

CREATE OR REPLACE VIEW "GestionPropriete_Staging_RnvlmntClaims"."v_rag_RecClaim_Within4500mBuffer_25000" as
SELECT
    "v_rag_RenouvellementClaimGrtr25000_Buffer".tit_no || '_' || "v_rag_RenouvellementClaim".tit_no as uid, --concatenates the Allocation Claim number to the Reipient Claim number as UID
    "v_rag_RenouvellementClaimGrtr25000_Buffer".tit_no as "Alloc_Claim",
    "v_rag_RenouvellementClaimGrtr25000_Buffer".geom,
    "v_rag_RenouvellementClaimGrtr25000_Buffer"."1_renewal_cre_cu" as "Alloc_Credit",
     "v_rag_RenouvellementClaim".tit_no  as "Rec_Claim",
     "v_rag_RenouvellementClaim"."1_renewal_cre_cu",
     ABS("v_rag_RenouvellementClaim"."1_renewal_cre_cu")  as "Rec_abs_Credit_1stRenw" -- returns the absolute value of the 1st renewal credit value.
    FROM "GestionPropriete"."v_rag_RenouvellementClaim", "GestionPropriete"."v_rag_RenouvellementClaimGrtr25000_Buffer"
        WHERE "v_rag_RenouvellementClaim"."1_renewal_cre_cu" < 0 AND -- selects the values where the 1st renewal cost is less than 0
            st_within("v_rag_RenouvellementClaim".geom, "v_rag_RenouvellementClaimGrtr25000_Buffer".geom)


texts: Distance between GPS travel route and country border

texts:
I have no idea how to, or even is possible in some way, but maybe there is an app, software or someone of you have any idea how to! Please note, that I have no skills in coding or programming.
I will travel around my own country's (Latvia) borders as close as possible, but before I do that, I need some data: min, max, and average distance between my route and border along the whole route.
I guess it could be two gpx tracks – one is my route, other country borders. It means that in every meter of my route the closest point to the border should be found and measured.
I guess I did make myself clear, picture for visual in the link:
https://ibb.co/m6L3Z4c
Outcome could be in any format, as long as there is a result with data.


texts: Leaflet display PHP data on GeoJSON popups

texts:
I want to display data from my database which I get in JSON format with getJSON function. I want to display these data on all GeoJSON features based on a condition.
I am trying to do that with the onEachFeature function which is called as a property of the GeoJSON. How will I fit a jQuery funtion in a JS function? Because I compare variables that I need from both functions. Currently I have no luck managing this.

This is the JavaScript code:

var rbu_layer
$.getJSON("getdata.php", function(data) {
        var length = data.station_code.length;
        var station_code = [];
        var localid = feature.properties.localId;
        for (var i = 0; i < length; i++) {
            station_code[i] = data.station_code[i];
            if (station_code[i]==localid) {
                var popupContent = localid + "
" + station_code[i];
            }
        }
});
function onEachFeature(feature, layer) {

    if (feature.properties && feature.properties.popupContent) {
        layer.bindPopup(feature.properties.popupContent);
    }
    layer.bindPopup(popupContent);
}
var map = L.map('map').setView([51.505, -0.09], 3);

rbu_layer = L.geoJSON(rbd, {
    onEachFeature: onEachFeature
}).addTo(map);
map.fitBounds(rbu_layer.getBounds());

EDIT: I managed to do a workaround but still havent succeeded .Iam closer though

var map = L.map('map').setView([51.505, -0.09], 3);
var rbu_layer

function addData(data,map) {
    rbu_layer = L.geoJSON(rbd, {
        onEachFeature: function(feature, layer)  {
            var length = data.station_code.length;
            var station_code = [];
            var localid = feature.properties.localId;
            for (var i = 0; i < length; i++) {
                station_code[i] = data.station_code[i];
                if (station_code[i]==localid) {
                    var popupContent = localid + "
" + station_code[i] + "Hello";
                }
            }
            if (feature.properties && feature.properties.popupContent) {
                layer.bindPopup(feature.properties.popupContent);
            }
            layer.bindPopup(popupContent);
        }
    }).addTo(map);
    map.fitBounds(rbu_layer.getBounds());
}

$.getJSON("getdata.php", function(data) {
    addData(data,map);
});


texts: Changing font size, when using the Easy Custom Labeling plugin?

texts:
I’m using the Easy Custom Labeling plugin. Useful plugin, but when I want to change the font size with the Layer Labeling Settings. Nothing changes, I can only change font size manually for each label?

Also changing it in the attribute table is not possible, as only one integer value is allowed. Removing the column and adding a new one for two integers, does not work either?

I am using QGIS 1.8.0 Lisboa


texts:
I've loaded a v.large shapefile (~2GB) into Spatialite in QGIS and a non-spatial table (from a csv, 8 MB) in there as well (via the QSpatialite GUI).

They have successfully been joined in QGIS. They also display as a relation (because there is a one to many relationship between a polygon and 1 or 5 records in the table).

As far as I know there is an index for the polygons.

Whats the most efficient way to create a new joined layer? To pass on to another user.

(Does the Layer|SaveAs dialog work for adding a Spatialite layer to an existing db? It doesn't time out for me as there is too much data)


texts: AGOL webhook to Integromat/Google Sheets

texts:
I have a feature layer in AGOL.
Whenever edits are made to features in the layer, I want to POST those edits/attributes to an external system for testing purposes.

In this case, the external system is Integromat (that points to a Google Sheet).

How can I set up an AGOL webhook and point it toward Integromat/Google Sheets?

Related:
Create a hosted feature service webhook


texts: Calculate Field - Why does the field populate with the same number, but prints correclty?

texts:
Why does the field populate with the same number, but prints correclty?

import arcpy
import rivers
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"C:\Data"

import math
def sinuosity(shape):
    channel = shape.length
    deltaX = shape.firstPoint.X -shape.lastPoint.X
    deltaY = shape.firstPoint.Y -shape.lastPoint.Y
    valley = math.sqrt(pow(deltaX, 2) + pow(deltaY, 2))
    return channel/valley

fc = "streams.shp"
new_field = "Sindex"
with arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"]) as cursor:
        for row in cursor:
            oid = row[0]
            shape =row[1]
            si = rivers.sinuosity(shape)
            print (f"Stream ID {oid} has an sinuosity index of {si:.3f}")

arcpy.AddField_management (fc, new_field, "DOUBLE" )
arcpy.CalculateField_management(fc,new_field, si)


texts: Doing average for image collections changed spatial resolution in GEE

texts:
I tried to calculate the averaged map for a satellite product in a month using GEE, but after I exported the result, I found the spatial resolution was changed into 1 lat/lon deg, and the native resolution is ~500m.
var mcd = ee.ImageCollection("MODIS/006/MCD43A3").filterDate('2004-01-01', '2004-01-31').select('Albedo_BSA_shortwave')

var clim_mcd = mcd.reduce(ee.Reducer.mean());

var myScale1 = mcd.toBands().projection().nominalScale().getInfo()
var myScale2 = clim_mcd.projection().nominalScale().getInfo()
print(myScale1)
print(myScale2)

code
and the results show

How can I fix this issue and export the averaged image result with the native resolution?


texts: QGIS adding additional (excess) map detail

texts:
I'm having a problem with QGIS (3.2.3-Bonn) which I hope the collective wisdom here can help with.

I'm currently trying to make a base map with GPS data on top. So far so good. I found a decent basemap, put it at the scale I wanted (which only had the big cities on and other major features). and added in some locations. However, when I export it, all of the map details are exported - including every single place name and other minor details on the map.
I really don't want to have all of these places on, I just want what I see in the Print Layout to be what gets converted to an image but have no idea how to do this.

To highlight this I've attached a figure, on the left is a print screen of the Print Layout (and is exactly what I want to export). On the right is the same image when I export it with all the place names annoyingly added and all text now shrunk.


texts: Attaching dojo events in ArcGIS Javascript API 3.29

texts:
I am trying to do same job for two different events on map using dojo on() function.

map.on('extent-change', function (event) {
//code goes here
}

and

map.on('zoom-end', function () {
//same code goes here
}

Is there any way that I could attach the events or do the same thing for both without writing the code again?


texts: Support for PostgreSQL / PostGIS Inherited Tables in MapInfo/QGIS

texts:
Does anyone know if MapInfo and QGIS will support inheritance in a PostgreSQL/PostGIS database?

I would like to make use of inheritance but need to make sure the software I use will work with them.

From the book PostGIS in Action I have found the following, but am unsure if MapInfo or QGIS will be supported or not:

  Inheritance works seamlessly with OpenJump, GeoServer, and MapServer. Any tool that polls the standard PostgreSQL metadata should end up treating parent tables like any other.

EDIT

I have had a look at the Paris example in Chapter 3 of PostGIS in action. I have a parent table called paris, and 3 child tables called paris_linestrings, paris_polygons and paris_points. These show up as follows on the Add PostGIS table dialog (I don't have any lines in the linestrings table yet, so that's why the paris table doesn't show lines yet) :

In MapInfo, the tables show up in the list when opening a DBMS table. I can't get them to map as I haven't set up the MapCatalog and added the relevant data to each table to allow MapInfo to show the spatial data. But I can open the tables in a browser view and see the attribute data and it seems to be correct.

All I need to do now is set up some triggers to put the correct spatial type into the correct child table when added to the parent.


texts: Combining information from one raster with another raster

texts:
I have two rasters, A and A1.

Raster A is the image below that is greenish and has the following attribute table:

The table has two fields that I need: Value and class_name

Raster A1 is the image that is purplish and has the attribute table

A1's table has information on the part of raster A that is missing. This has been coded as 999999 in A1's table which I have circled in yellow below

My task is to fill in the missing part of A with the information in A1 (the Value in A1 that has been coded 99999). In other words, I need to expand the attribute table of A with another row for 9999999 found in the raster A1.

What is the quickest method to do this?

I have tried the Sample tool and it takes too long (I have to do this for over 10 rasters). I have tried Mosaic, but it does not give me both Value and class_name fields in the attribute table of A.


texts: Creating circle around point with size relative to field attribute in QGIS

texts:
I'm using QGIS to create tree surveys. When I return to the office and download my tree points into QGIS I would like to create an expression that uses the "DBH" (a field collected numerical attribute field) to create a circle around each point relative to the size of the "DBH". So that, X "DBH" >>> (X*12)*1.25 CRZ where CRZ is the radius of the circle.
Is there an expression I can add to the symbology that would do this?


texts: Stop snapping from occuring with inserted text?

texts: I'm having trouble with text and scale bars in layout mode on arcgis snapping. I want to move the text freely. It's not necessarily snapping to inserted margins either. I've tried guides and it won't fix the problem. I've turned off snapping and that hasn't done anything. I also hold the space bar/shift and that won't work. Lastly, I tried converting to graphics and that didn't do anything. Any ideas on what's happening?


texts: Extract Raster from WCS in QGIS with Cell Snapping and Resolution Matching Original Raster

texts:
I am trying to extract a subset of data from WCS Coverage. I right-click the coverage > Export > Save As. This brings in this dialog box.

But when I export it does not snap the raster cell to the original raster and the cell size changes as well. See this:

Is there a way in QGIS to get raster data from WCS for a particular area and have cells exactly the same as raw data?
Request sent by QGIS is:
http://localhost:8080/qgis-server/WCSServer?SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCoverage&FORMAT=GeoTIFF&COVERAGE=dem&BBOX=11878792.03174479678273201,7007814.11248470470309258,11882060.6795082800090313,7011082.79411716014146805&CRS=EPSG:2283&RESPONSE_CRS=EPSG:2283&WIDTH=1000&HEIGHT=1000


texts: How to combine two rasters into one layer?

texts:
I need to combine two raster layers into one. Layer A has soil information for the entire state, but contains gaps. Layer B contains soil information for Layer A's gaps. What's a simple way to combine these two rasters into one "seamless" layer? Both layers have the same four values (1 - 4) and are the same pixel size, type, etc.

I don't want to create a mosaic dataset, I want one actual layer.


texts:
I've done some "Googling" on this but can't quite figure it out. Is it possible to run a script that uses Arcpy on a Mac?

I have Parallels so it works for me but my co-workers do not.


texts:
I have 3 shp layers, representing the coastline of South Africa, the harbour area and the study area.
I first loaded the coastline and the harbour area, and put them into the WGS 84 - UTM 35S (EPSG 32735). The problem comes with the third layer. Although it has a .prj file, QGIS asks to select the SCR. Whatever I select, the layer either do not appear on the scream, or does, but kilometers away from the place it should be.
I tried to export or save the file and the project in different SCR, but in vain... It seems that the coordinates are different, but I cannot manage to change them: for the first two layers, the coordinates look like 27.85, -32.56 and for the third one, it looks like 127627, -3864621 (but the project SCR is the same - EPSG 32735).
Does anyone have an idea of how to fix this?


texts: Writing query in "Select_analysis" to compare string from one column with another column?

texts:
I have a shp file (s.shp) with column "A" and column "B". I try copy from this file only that rows where string value from column "A" is part of string value from column "B" e.g.

A
0.1
0.2
0.3

B
0.12
0.21
0.43

The output file should have two rows first and second.

I try make:

import arcpy
source='c:\\MY\\s.shp'
output='c:\\MY\\o.shp'
arcpy.Select_analysis(source,output,"\"B\" like '%'||\"A\"||'%'")

but I have a error :(

  ERROR 000358: Invalid expression "B" like '%'||"A"||'%'

I use ArcMap 10.1.


texts:
I'm currently editing a table of a hosted feature layer in ArcGIS Pro. I cannot edit the table without receiving this error, which blocks my edits. There are no joins to it.
What I can remember doing leading up to this error is deleting a column with no values and cutting and pasting the text in random fields here and there. I can't say exactly what caused it.
I noticed that I can still edit the attributes in AGOL, however, and the edits are saved when I refresh the table in Pro.
Update table row.
Update table row failed.
The row contains a bad value.
[LORecyclingLocations_full]The row contains a bad
value. [Notes]An expected Field was not found or
could not be retrieved properly. [(class name:
LORecyclingLocations_full, oid: 6)]An expected Field
was not found or could not be retrieved preoperly.
[(class name: LORecyclingLocations_full, oid: 6)]

EDIT: It apparently had something to do with the field I was working on at the time. Because I moved on to another field making edits and I'm not receiving the error??


texts:
I'm trying connect to geoserver via rest protocol by gsconfig-py3 in python3 ,I get this error, but when I type "http://localhost:8080/geoserver/rest" in  browser I can see these items moreover when I click on each of them I can see content of them:

for more information I'm using:

OS LMDE 3 X64 (Debian 9),
GeoServer 2.15.0,
Python version:3.7.3

Geoserver Configuration API

about/manifest
about/status
about/version
fonts
index
layergroups
layers
namespaces
resource
security/acl/catalog
security/acl/layers
security/acl/rest
security/acl/services
security/masterpw
security/roles
security/self/password
security/usergroup/groups
security/usergroup/users
services/wcs/settings
services/wfs/settings
services/wms/settings
settings
settings/contact
styles
templates
workspaces

But when I try connect to geoserver via gsconfig-py3
for example below code:

from geoserver.catalog import Catalog
cat = Catalog("http://localhost:8080/geoserver/rest", username='admin', password='geoserver')
topp=cat.get_workspace("topp")

I get this error message:

Traceback (most recent call last):
  File "/home/killercode/Desktop/test_version.py", line 3, in <module>
    topp=cat.get_workspace("topp")
  File "/usr/local/lib/python3.7/site-packages/geoserver/catalog.py", line 945, in get_workspace
    candidates = [w for w in self.get_workspaces() if w.name == name]
  File "/usr/local/lib/python3.7/site-packages/geoserver/catalog.py", line 940, in get_workspaces
    description = self.get_xml(rest_url)
  File "/usr/local/lib/python3.7/site-packages/geoserver/catalog.py", line 158, in get_xml
    text
geoserver.catalog.FailedRequestError: Tried to make a GET request to http://localhost:8080/geoserver/workspaces.xml but got a 404 status code:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>

HTTP ERROR 404

Problem accessing /geoserver/workspaces.xml. Reason:

    Not Found

Powered by Jetty:// 9.4.12.v20180830

How I can fix this problem?


texts: How do I create a custom map with subtle details for a localized place?

texts:
I've worked with google maps for android previously.

But, now I need to build custom maps for a place such as a home, showing bedrooms, kitchen and living room, or a factory, displaying all the departments. I would like to use these maps in an android application. How do I achieve this objective?


texts: Drag issue on an OpenLayers map inside a draggable div

texts:
I am new here, so I hope I am doing it right. I have a similar question as Drag issue on an OpenLayers map inside a jquery ui draggable div

But I need to go a step further. I have created a setup with kolor PTP, with an OSM (mapstraction) map inside a window (about 400x700px) on top of the whole viewer (which is the whole screen). I have enabled dragging on this mapwindow, no problem. I have also created a 'click' event for the map to get coordinates, no problem. As long as I don't drag the mapwindow, it works perfectly. But if I drag this mapwindow to the other side of my screen and try to get coordinates, it gets the wrong coordinates. Like that the map is created on top of the whole screen and you can only see the part inside the mapwindow. If you drag this mapwindow, and click inside the mapwindow, it converts the new mouse coordinates to a LatLon as if the map hasn't moved at all. But it did, if I drag the mapwindow, the map gets dragged along nicely.

I have tried to capture everything in DIVs and set draggable on and off for some parts, but to no avail.

Anybody?


texts: Mistake in Oriented Minimum Bounding Box Tool?

texts:
I have used the OMBB (Oriented Minimum Bounding Box) Tool in QGIS to calculate OMBBs around polygons. However, there must be a mistake in the tool as all the yellow boxes in the picture below are calculated to have angles (= bearing) of around 90 degrees, but I can tell they have different orientations, and some of them are clearly not oriented in 90 degree direction.

Some other orientations seem to be calculated correctly - however, sometimes the long and sometimes the short sides of the boxes are used for the orientation/angle.

Any thoughts on how I can make the tool work properly or ideas for other QGIS tools or pyqgis scripts I could use?


texts:
I am very new to geoserver and SLD.

I am trying to put labels on my heatmap layer using SLD but the labels are not showing up in the preview. I found this example to implement it which looked straight forward yet it is not showing up.

Developing a Web Map Server Using GeoServer

I have been searching online and i haven't seen anything to help me troubleshoot this problem.

Here is my SLD:

<Rule>
        <RasterSymbolizer>
        <!-- specify geometry attribute to pass validation -->
          <Geometry>
            <ogc:PropertyName>wkb_geometry</ogc:PropertyName></Geometry>
          <Opacity>0.6</Opacity>
          <ColorMap type="ramp" >
            <ColorMapEntry color="#FFFFFF" quantity="0"
              opacity="0"/>
            <ColorMapEntry color="#FFFFFF" quantity="0.02" label="nodata"
              opacity="0"/>
            <ColorMapEntry color="#4444FF" quantity=".1" label="nodata"/>
            <ColorMapEntry color="#FF0000" quantity=".5" label="values" />
            <ColorMapEntry color="#FFFF00" quantity="1.0" label="values" />
          </ColorMap>
        </RasterSymbolizer>
        <TextSymbolizer>
            <label>
                <ogc:PropertyName>aqi</ogc:PropertyName>
          </label>
       </TextSymbolizer>
       </Rule>

Here is a screenshot of the layer attributes:


texts: Get the distance from line to given geo point at given degrees

texts:
I have added another picture for better understanding. I haven't written any code as of now.
My requirement is to calculate the distance from given point (pinned location in above map) to given degrees i.e. 295.5,303.75 and 315.25.
There is another white line on map which is lee zone line. I don't have destination point too i.e. points marked in blue color on map.
These are intersection points of red line and white line.

My understanding is I have draw a polyline from pinned point in given degree and then get the intersection point i.e. blue circle. Then use this intersection point is as
destination point. After that I can easily find out distance from pinned point to this destination point.
But I'm not sure if I'm going right direction or not.


texts: How to import sextante(processing) for QGIS 1.9 (2.0)

texts:
In the current QGIS development snapshot the SEXTANTE toolbox has been merged into QGIS and is now known as "processing". This is a good step, but the previous import command doesn't work anymore.

from sextante.core.Sextante import Sextante # returns an import error

How can i import the sextante bindings in current development versions and the upcoming QGIS 2.0 ?


texts: Spatial join polygons to polygons when completely only works from context menu

texts:
I am trying to perform a spatial join between city polygons and county polygons. When a city is completely within a county I would like to add the county name to the city polygon. Some cities do not fall completely within a county and I would not like to join them. The join works in ArcMap if I right click the city shapefile and select join, join based on spatial location, and then click the radio button next to "Each polygon will be given the attributes of the polygon it falls completely inside of in the layer being joined. If a polygon falls..." However, if I open the spatial join tool and then execute the join with "COMPLETELY_WITHIN" match option it will fail with no error message if background processing is on or hang at 37% of final step if background processing is off. I have also tried adding both shapefiles to a geodatabase before joining and executing Python script outside of ArcMap but this also fails.

I suspect the options for the join executed from the context menu must be different than the join I am creating with the spatial join tool (the join is successful from context menu, but not from spatial join tool). Is the join executed from the context menu the same join I am executing from the spatial join tool?


texts: Postgis geometry column with different srid

texts:
I have a table that has geometry column named the_geom. I set SRID value to 29903. And I used Openlayers api to view data on map. I set map srid as 29903 and works well.

But if I need to show my data on google map or another map api that SRID is 4326 or else, should I change my database geometry column SRID.

How can I use multiple SRID for a geometry?


texts: Extract characters inside parentheses in QGIS

texts: I have a shapefile of the buildings on my college campus.  It has a "name" field that includes the name of the building and then in parentheses the building's campus address (i.e. Health and Counseling Services (71)).  I want to create a new field, "number", that is only the number within the parentheses (i.e. '71'). I am working in QGIS with regular expressions but I can't quite get it right. Any help would be greatly appreciated!


texts: Merge single points to multi point geometry

texts:
Is it possible to transform a point shapefile in single part geometry to a shapefile with multi-point geometry based on an attribute.
e.g. in the file are 50.000 records in 700 categories, now I want to create a multi-part geometry point file.

The result should be a shapefile with 700 records (=categories in the former shape).

Is this possible in QGIS, Spatialite or something else?


texts: How to break a string line with many values to a single field?

texts:
I don't speak English very well...

I have this case, for FID in field "CPFS*" exists some codes. I need in field "identifica" only one.
For exemple:
to [FID = 0 identifica = 00417549210],
to [FID = 1 identifica = 75434180291],
to [FID = 2 identifica = 03258000220]
...

I did by this code:

But this gave to me the field "identifica" in the exemple image... Does someone have other idea?

with arcpy.da.UpdateCursor(feature, ["CPFS_CNPJS", "identifica"]) as cursor:
    for row in cursor:
    lista = row[0].split(",")
    for i in range(len(lista)):
        row[1] = lista[i]
        cursor.updateRow(row)


texts: Looking for a data source for all villages, towns and cities in the world

texts:
So, I've been working with Geonames data dumps, but I am finding that they are either not complete enough (cities > 1,000 population), or too complete. Here's an example of being too complete:

damaya@deepthought:~/Downloads$ grep Portland allCountries.txt | grep OR | grep PPL
5724937 East Portland   East Portland       45.5154 -122.66037  P   PPL US      OR  051         0   17  20  America/Los_Angeles 2006-01-15
5743422 North Portland  North Portland      45.61039    -122.70343  P   PPL US      OR  051         0   5   13  America/Los_Angeles 2006-01-15
5746545 Portland    Portland    Gorad Portlend,PDX,Portland,Portland i Oregon,Portlandas,Portlandia,Portlando,Portlant,Portlend,Portlenda,bo te lan,bwrtland  awryghwn,port land,portalainda,portalanda,portlant,portlendi,poteullaendeu,potorando,pwrtlnd,pwrtlnd  awrgn,Πόρτλαντ,Горад Портленд,Портланд,Портленд,Պորտլենդ,פורטלנד,بورتلاند، أوريغون,پورتلند، اورگن,पोर्टलंड,पोर्टलैंड,போர்ட்லன்ட்,పోర్ట్ లాండ్,ಪೋರ್ಟ್‌ಲ್ಯಾಂಡ್,พอร์ตแลนด์,პორტლენდი,ფორთლენდი,ポートランド,波特蘭,포틀랜드    45.52345    -122.67621  P   PPLA2   US      OR  051         583776  12  15  America/Los_Angeles 2011-05-14
5746560 Portland Heights    Portland Heights        45.50567    -122.70315  P   PPL US      OR  051         0   220 226 America/Los_Angeles 2006-01-15
5753495 South Portland (historical) South Portland (historical)     45.48762    -122.6826   P   PPLQ    US      OR  051         0   87  96  America/Los_Angeles 2011-12-11
5760038 West Portland   West Portland       45.45484    -122.7326   P   PPL US      OR  051         0   185 187 America/Los_Angeles 2006-01-15
5760039 West Portland Park  West Portland Park      45.44679    -122.72565  P   PPL US      OR  051         0   197 200 America/Los_Angeles 2006-01-15

Now, I live in Portland and I don't know a single person who considers East Portland a different location than Portland. I need something that covers a town as small as Napakiak, AK, but doesn't break things down to such a level that you end up with all of these Portlands. Is there any way to extract from Geonames just the towns and cities that would be written on a letter delivered via post (i.e., nobody would send a letter to East Portland, OR, but someone would send a letter to Napakiak, AK). The problem here is that Napakiak is a PPL, but so too is East Portland. Does Geonames have any designation saying the place is (I don't know the term here) something you'd find on a delivered letter?

Another example of an issue here is Gaston, OR. Here's what it looks like in allCountries.txt:

7173478 City of Gaston  City of Gaston      45.43566    -123.14372  A   ADMD    US      OR  067         637 81  78  America/Los_Angeles 2013-03-08

The thing is, I don't know anyone who refers to it as "City of Gaston," and it's not even a PPL, it's an ADMD. I just want Gaston, OR; Portland, OR; Milwaukie, OR; Lima, MT (pop 221); Napakiak, AK, and so on.

EDIT: I am using data from geonames.org.


texts: Reading a EPSG:4326 WMS layer into a Web-Mercator OpenLayers 3 map

texts:
I'm a bit stumped trying to read a EPSG:4326 WMS into a OpenLayers 3 project that's using the default 3857 (Web Mercator) projection.

I'm trying to pull a WMS layer that only supports EPSG:4326, but the projection option for ImageWMS appears to be "experimental" (http://openlayers.org/en/master/apidoc/ol.source.ImageWMS.html).

Lets say I have the below. The second layer is WGS84, but the first is 3857. How do I get it to work? Is this possible with OL3? I've not found any examples with it yet.

var layers = [
  //Default 3857 layer
  new ol.layer.Tile({
    source: new ol.source.MapQuest({layer: 'sat'})
  }),

  //This layer is in WGS84 (EPSG:4326)
  new ol.layer.Image({
    extent: [0, 40, 10, 50],
    source: new ol.source.ImageWMS({
      url: 'http://demo.boundlessgeo.com/geoserver/wms',
      params: {'LAYERS': 'topp:states'},
      serverType: 'geoserver'
    })
  })
];

var map = new ol.Map({
  layers: layers,
  target: 'map',
  view: new ol.View({
    center: [-10997148, 4569099],
    zoom: 4
  })
});


texts: Joining several fields into single field using ArcPy?

texts:
I'm trying to create this result (see the first row below):

using this data (see the selected row):

As you can see, the two vector tables have a common field, that relate themselves, the input is "gridcode" and the output must be "id_group".

I'm not expert and I've expent too much time trying to get a solution, nevertheless I can't find anyone.

The pictures are just an example, because the real shapefiles are from around 1M of features.

I was trying to implement this solution from Comparison between two fields of two tables using ArcPy cursors? without success, perhaps because I it takes so much time to create the dictionary.

import arcpy
from time import strftime

print "Start script: " + strftime("%Y-%m-%d %H:%M:%S")

def_agrupada = r'neighbours'
deff = r'entry_data'

fields_deff = ["gridcode", "data", "Shape_Area"]

list1 = [r[0] for r in arcpy.da.SearchCursor(deff, fields_deff)]
list2 = list(set(list1))
list2.sort()

dicc = {}
for f in list2:
    dicc[f] = [r[:] for r in arcpy.da.SearchCursor(deff, fields_deff) if r[0] == f]
dicc

print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S")


texts: openlayers - filter mapserver WMS with runtime substitution

texts:
I am new to runtime substitutions with Mapserver.

I have a Openlayers map where I show a mapserver WMS.

Now, I'd like the user to choose a value from a dropdown list, and filter the WMS with his/her choice.

The LAYER of my mapfile looks like:

mapfile

LAYER
  NAME zone
  TYPE POLYGON
  CONNECTIONTYPE ogr
  ...
  FILTER ('[vitigni]' = '%vitigni%')
  VALIDATION
    "vitigni" "^[a-zA-Z\-]+$"
  END
END

In my HTML I have:

myol.html

var wmsSource1 = new ol.source.ImageWMS({
    url: 'http://localhost/cgi-bin/mapserver/mapserv.exe?map=//nbgis01/mapserver/umbe/mapfile/test10_runtimesubstitution.map',
    params: {
        'LAYERS': 'cantine',
        'CRS': 'EPSG:3857',
        'BBOX': '870510,5559757,1360294,5868524',
        'WIDTH': '800',
        'HEIGHT': '500',
        'FORMAT': 'image/png'
    },
    projection: 'EPSG:3857',
    serverType: 'mapserver',
    imageExtent: imageExtent
});

What is the way to filter this WMS with (e.g.) a form?

I tried with the below code, but I only got mapserv(): Web application error. Traditional BROWSE mode requires a TEMPLATE in the WEB section, but none was provided.

myol.html (again)

    <form name="mapserv" method="GET" action="http://localhost/cgi-bin/mapserver/mapserv.exe?">
        <input type="hidden" name="map" value="//nbgis01/mapserver/umbe/mapfile/test10_runtimesubstitution.map">
        <select name="vitigni">
            <option value="Groppello">Groppello</option>
        </select>

        <input type="submit" value="Click Me">
    </form>

When I submit the form the request generated is http://localhost/cgi-bin/mapserver/mapserv.exe?map=%2F%2Fnbgis01%2Fmapserver%2Fumbe%2Fmapfile%2Ftest10_runtimesubstitution.map&vitigni=Groppello.

I need the page to display my openalyer map with my WMS filtered with "vitigni"="Groppello".

Just as a sidenote: the map with and without filter works correctly. If I display the whole layers I can visualize everything correctly. If I copy the request and append &vitigni=Groppello, I am able to visualize only the layer I want, but in another webpage.


texts: Listing all functions available in QGIS's Virtual Layer

texts:
How can I get automatically a list of all functions available for usage in QGIS's Virtual Layer?
From my own understanding/experience and the QGIS Documentation, QGIS's Virtual Layer employes a mixture of functions provided in PostGIS, SQLite, SpatiaLite and the Functions of QGIS expressions. (I hope I did not miss anything vital.)
I have seen several topics What spatial functions are available to shapefiles as “virtual layers” in QGIS DB Manager? and Virtual layers for QGIS (GitHub), unfortunately, in none of them, I could find the solution to my concern.


texts: Calculate the target point by using initial coordinate, bearing angle and distance

texts:
I need to calculate the target coordinate by using the initial coordinate, bearing angle and distance. I came across this on how to calculate it. Then I construct the code in C#, but it seems I can't get exact location correctly. I use below code this my answer:

Target latitude :6.34374176458679
Target longitude : 206.297566445544

When I use the application from the website i mention it get this:

Destination point:  03° 10′ 28″ N, 103° 08′ 15″ E /Lat:3.174444° Lon:103.150833°
Final bearing:  040° 24′ 37″

That are most accurate. Has anybody used this kind of method?

EDIT:

        //bearing angle
        double rad = 40.41;
        rad *= Math.PI / 180;

        //angDist = distance/radius
        double angDist = 0.717 / 6371;

        Console.WriteLine("Angular distance:" + angDist);

        double latitude =  3.169416;
        double longitude = 103.146690;

        latitude *= Math.PI / 180;
        longitude *= Math.PI / 180;

        double lat2 = Math.Asin(Math.Sin(latitude)*Math.Cos(angDist)+Math.Cos(latitude)*Math.Sin(angDist)*Math.Cos(rad));

        double forAtana = Math.Sin(rad) * Math.Sin(angDist) * Math.Cos(latitude);
        double forAtanb = Math.Cos(angDist)-Math.Sin(latitude)*Math.Sin(lat2);

        double lon2 = longitude + Math.Atan2(forAtana,forAtanb);

        double finalLat = latitude + lat2;
        double finalLon = longitude + lon2;

        finalLat *=  180 / Math.PI;
        finalLon *=  180 / Math.PI;

        Console.WriteLine("Target latitude :" + finalLat);

        Console.WriteLine("Target longitude : " + finalLon);

        // supposely final answer should be Lat:3.174444° Lon:103.150833° (using the movable-type website)

        Console.ReadKey();


texts: Importing a Tracked Line Geometry (from LineString) in a CSV into QGIS (3.4)

texts:
I'm very new to GIS work and I hope this is the right place to post this. I haven't been able to find/understand an explanation on how to deal with my issue so I hope that I'm not asking an already answered question.

I have a CSV file with a LineString with up to several hundred coordinates from a tracked line collection using a Trimble R1 receiver. An example looks like this:

{"type":"LineString","crs":{"type":"name","properties":{"name":"EPSG:4326"}},"coordinates":[[-121.909104624079,56.0290861839679,474.87293563851],[-121.909151121436,56.0290460319473,473.438320804134].... etc]}

I would like to use this LineString as the geometry for the lines when they're imported into QGIS (3.4), is there a way to do this by converting them into a wkt format or some other way to import this information into a layer that's relatively non-labour intensive (i.e. not separating out each point coordinate into its own column)?

When I add it as a layer using the add delimited text layer and set the geometry as a wkt and select the correct column in the csv none of my lines appear in the layer. It doesn't seem like my LineString format is recognized as a WKT.


texts: Issues with toggling layers with mapbox.js

texts:
I am having issues with toggling map layers with mapbox.js. Using the code from [https://www.mapbox.com/mapbox.js/example/v1.0.0/layers/] it pulls the basic mapbox base maps ex. mapbox.outdoors or mapbox.satellite as toggle layers, but the polygons on the personal map layer does not appear. I know that the map can be pulled by itself, but when I try to add it to a toggling map, the polygons do not appear. I am not sure if it is a problem with the code itself that isn't allowing my personal map to show, or if there is an issue with my mapbox map.

My github repository is https://github.com/beyeraut/mappingmv/blob/gh-pages/attempt.html

Any ideas are welcome!


texts: Exporting 16bit tiff sattelite imagery with the stretch/colour-balance applied by Arcmap?

texts:
Problem:

I have 16-bit satellite GeoTIFFs from DigitalGlobe (QuickBird/WV2), which I wish to share with a colleague that does not have access to GIS software.

When loaded into ArcMap, these sattelite images display fine and have a natural colour scheme.

When loaded into Photoshop, these rasters appear black and need manual stretching/editing/colour-balancing of the RGB bands to be visible. My end result is a raster with the wrong colours.

How does one export these 16bit satellite images from Arcmap, maintaining the colour balance/stretch applied by Arcmap, so it is possible to view in Photoshop and other non-GIS image editing software with the same display as in Arcmap?

Attempted solutions:

I have attempted two solutions (writing Arcmap's stretch to file by exporting the tiff and changing PS's settings to automatically stretch the tiff) with little luck..

1.  Write the colour balance/stretch applied by Arcmap to file by exporting the tiffs, making the images visible in other software (Photoshop).

Unfortunately, when the tiffs are exported post-colour balancing and are loaded in PS they still appear black - meaning any colour balancing done in Arcmap does not display in the tiff file once exported to PS.

2. Replicate how ArcMap displays these rasters in Photoshop by changing photoshop's settings - so all images are automatically loaded into Photoshop with the same stretch / colour balance as in ArcMap.

I could only change the colour balance for each image, a tedious guesswork that led to images with the wrong hues of colour and contrast levels.

Note: I've tried GIMP, Ifranview, Photoshop etc and all image editing software displays these 16-bit GeoTIFFs as black. Only ArcMap automatically displays them in the correct colour balance. I need to give these images to someone without ArcGIS, so they need to be visible in PhotoShop, but I also need to retain the high-resolution of the original 16-bit TIFF format, so can't convert to another image format like JPEG.


texts: Scale Text-Annotations according to Map/Composer-Scale

texts:
Is there a way to set the size of the QGIS Text Annotations to map units so that they get resized when I choose different scales?

I wrote a litte script as a workaround which scales the annotations in the QGIS canvas so that they get smaller when I zoom out.

Screenshot: annotations at target scale:

Screenshot: smaller annotations when zoomed out:

That's the script I use in the QGIS console:

from qgis.gui import QgsTextAnnotationItem

def scale_annotations():
    target_extent=10000
    current_scale=iface.mapCanvas().scale()
    scale_factor=target_extent/current_scale
    all_annotations=[]
    for item in iface.mapCanvas().items():
        if isinstance( item, QgsTextAnnotationItem ):
            all_annotations.append(item)
    #print all_annotations
    for i in all_annotations:
            curr_scale=i.scale()
            i.setScale(scale_factor)
    iface.mapCanvas().refresh()

try:
    iface.mapCanvas().extentsChanged.disconnect()
except:
    print "kein disconnect"

iface.mapCanvas().extentsChanged.connect(scale_annotations)

But this of course won't scale the annotations in the MapComposer if I want to print multiple layouts with different scales.

Screenshot: annotations too large in PrintComposer:

So is there a way to get the annotations scale in Canvas and MapComposer depending on the chosen scale?


texts: How do I convert my png tiles to mapbox’ pbf files?

texts:
I am trying to use my self hosted maps in Mapbox GL, but I only get errors or black screens. My JS code is:

            var map = new mapboxgl.Map({
        container: 'map',
        style: {
            "version": 8,
            "sources": {
                "osm": {
                    "type": "vector",
                    "tiles": ["http://ip-to-my-host/tiles/dunkel/{z}/{x}/{y}.png"]
                }
            },
            "layers": [
                {
                    "id": "background",
                    "type": "background",
                    "paint": {
                        "background-color": "#41afa5"
                    }
                }, {
                    "id": "water",
                    "type": "fill",
                    "source": "osm",
                    "source-layer": "water",
                    "filter": ["==", "$type", "Polygon"],
                    "paint": {
                        "fill-color": "#3887be"
                    }
                }
            ]
        }
    });

I copied this code more of less from https://www.mapbox.com/mapbox-gl-js/example/third-party/
Now I get the js error messages:

I am not sure what do do now. What am I doing wrong?

How do I convert my pngs to it? It seems to work with the pbf files I downloaded.


texts: Moving geodatabase from SQL Server 2008 R2 Express to SQL Server 2012 Enterprise

texts:
I am able to successfully move an ArcSDE geodatabase from one SQL Server 2008 R2 Express to another SQL Server of the same version using the restore backup method. Now I tried to move it the same way to an SQL Server 2012 Enterprise. But it does not work. If I connect to the geodatabase on SQL Server 2012 via ArcCatalog I only see Tables no Feature Classes. The user and logins of the two DBs are same.

How do I move the geodatabase?


texts:
On my layer the setting of the labels is:

But all the labels do not appear, as if there was a limit on the number.

Sample with some features

Sample with all features:

some labels have disappeared such as 1, 3, 4.

Do you have an idea why?


texts: Can shaded relief be "blended" with DEM colour ramp in ArcGIS to produce a more visually dramatic result?

texts:
Not being able to use true transparencies with ArcGIS colour ramps where only solid colours are allowed has me always wondering about how to improve the look of the surface in my maps without resorting to time-consuming post processing techniques. (For example the basic graduated black colour ramp typically used with hillshade does not have levels of transparent black but rather shades of grey and solid white where 100% should be.  A as a result, it is not possible to overlay a hillshade without impacting the colours of the features under the hillshade; overlaid colours will appear washed out)

In this discussion @matt wilkie provides a link to GDAL's gdaldem for producing a hillshade without Spatial Analyst using. He also includes a link to Terrain Data Tutorial which shows how to how to use gdaldem to build a "composite hillshade with hypsometric tinting".

Can ArcGIS (Spatial Analyst, 3D Analyst) be used to produce a similar "blended" product?


texts: Request Sentinel1 data with sentinelhub API doesn't work

texts:
I'm trying to acess Sentinel1 images using sentinelhub API with Jupyter lab notebook.
I'm getting error messages and I don't understand why I get them.
This is how I try to acess umages with IW (as mentioned in the documentation, with specifcying asc or desc):
import os
import datetime
import numpy as np
import matplotlib.pyplot as plt

from sentinelhub import MimeType, CRS, BBox, SentinelHubRequest, SentinelHubDownloadClient, \
    DataCollection, bbox_to_dimensions, DownloadRequest,WmsRequest, WcsRequest, MimeType

#define bbox:
bbox_coords_wgs84 = [-44.763, -6.782, -44.583, -6.896]
bbox = BBox(bbox=bbox_coords_wgs84, crs=CRS.WGS84)

#request:

s1_request = WmsRequest(
    data_collection=DataCollection.SENTINEL1_IW,
    layer='TRUE-COLOR-S1-IW',
    bbox=bbox,
    time=('2020-11-01','2020-12-06'),
    width=512,
    config=config
)

s1_data = s1_request.get_data()
plot_image(s1_data[-1])

>>>DownloadFailedException: Failed to download from: *link*
with HTTPError:
400 Client Error: Bad Request for url: *long url*

Server response: "Layer TRUE-COLOR-S1-IW not found"

I also tried specifying:
s1_asc_request = WmsRequest(
    data_collection=DataCollection.SENTINEL1_IW_ASC,
    layer='TRUE-COLOR-S1-IW',
    bbox=bbox,
    time=('2020-11-01','2020-12-06'),
    width=512,
    config=config
)

s1_asc_data = s1_asc_request.get_data()
plot_image(s1_asc_data[-1])

>>>---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-12-2bc6f9148c34> in <module>
      9
     10 s1_asc_data = s1_asc_request.get_data()
---> 11 plot_image(s1_asc_data[-1])

IndexError: list index out of range

I don't know why I get thise errors; it seems like I do almost the same as in the tutorial. What is my mistake? Why do I get those errors?
My end goal: to be able to import Sentinel1 images (vh and vv)


texts: PyQGIS 2.0 API problem reading attributes

texts:
Im reading some attributes from shapefile features in a loop. According to this:

http://nathanw.net/2013/06/13/new-qgis-20-api/

I should be able to reference my attributes (and getting native python datatypes) like this:

for feature in myLayer.getFeatures():
   geom = feature.geometry().asPoint()

   #features have attribute called 'name'
   print feature['name']
   print feature.name

The first print statement simply prints a generic QVariant object address, second one fails saying there is no method named name on the QgsFeature object. Essentially it behaves like the old API, whilst im using 2.0.1.

Why?


texts: How to calculate scale from zoom level in Google Earth Engine?

texts:
I found the following formula on the interwebs, including on some google group from someone claiming to work at Google:

var scale = 156543.03392 * Math.cos(mapCenter.lat * Math.PI / 180) / Math.pow(2, mapCenter.zoom)

I understood that it's the right one for Google Maps API, but I'm not sure the same applies for layers added on a ui.Map object on Google Earth Engine. I don't exactly understand where the initial constant comes from, so it would be nice if someone has an explanation.

I suspect that the values the above formula yields are not accurate because when I try to export a map at that scale, I get an error 400 "User memory limit exceeded.", which is odd considering that the map has already been rendered. I am either missing something important, or the above formula is not correct for calculating this scale.

I would like to be able to export an ee.Image that has been added as a layer, at the same scale it is rendered in a ui.Map in the code editor.

P.S. WARNING: Do not use the above formula in google earth engine, maps, or in some other place. When compared with the method provided in the answer, i.e. getScale(), it gives different results. Not only that there's a difference between the formula above and getScale(), but the difference is not constant. This means that not only the initial constant is wrong, but also the rest of the formula. The differences changes independently both with zoom level, and with latitude.

Moral of the story and note to future self stumbling over my previous question:

Do not program when tired, but if you do, check the documentation again while better rested
Do not copy-paste code that you do not fully understand


texts: Is it possible to convert regular JSON to GeoJSON?

texts:
My apologies if this is a repeat question, I searched here and couldn't find an answer. I have JSON data I've exported from Openpaths.cc which contains lat and lon values. However, the data is not in GeoJSON format so can't be read by OGR2OGR. Could anyone point me in the right direction on how to convert my data to GeoJSON? I'd ultimately like to display it with Leaflet. Here is what the data looks like:

[
{
    "lon": -73.97,
    "device": "iPhone3,3",
    "version": "1.1",
    "t": 1381167616,
    "lat": 40.66,
    "alt": 67,
    "os": "6.1.3"
},
{
    "lon": -73.96,
    "device": "iPhone3,3",
    "version": "1.1",
    "t": 1381171200,
    "lat": 40.66,
    "alt": 45,
    "os": "6.1.3"
}

]


texts: Scale parameter of the GetMap function within RgoogleMaps

texts:
Within the R library called "RgoogleMaps", there is a function called "GetMap" which is used to save a georeferenced image file. The library's manual suggest that the SCALE parameter supposed to be used to obtain high-quality (i.e. high spatial resolution) images. However, regardless the value I use for the SCALE parameter the size of the spatial resolution, hence the size of the image, does not change?!

Sample R code to obtain the map centered at the given lat-lon coordinates with a SCALE value of 20 is as follows:

lat = 39.864849;
lon = 32.733805;
center = c(lat, lon);
MyMap <- GetMap(center, size=c(640,640), destfile="HU_Test.png", zoom = 12, maptype="satellite", RETURNIMAGE = TRUE, GRAYSCALE = FALSE, NEWMAP = TRUE, SCALE = 20, verbose = 1);

I would be grateful if you could help me obtain high-quality georeferenced images by using the GetMap function (or any other R function).


texts:
Is there any way to download all airports in Europe from OSM?

What I'm looking for is the Airport perimeter, (lines or polygons, dosn't matter)

I know that I could download all Europe, and then filter by attributes, but what I ask is if is there any way for do it directly.

Some kind of 'where', where I can ask for download ONLY the data

where column Aeroway is not null


texts:
I downloaded a shapefile where admin(country) and province of the world are located (http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/).

For each country, you can see the provinces as an extra polygon (Brazil yellow highlighted):

Based on this I want to create a shapefile that only contains the countries.
Since its a pretty big shapefile, I want to do this with postgis.
*Note that I tried doing this in QGIS which caused the programme to crash.

SELECT c.admin, ST_Union(geom) AS geom
FROM contry_province_natural_earth_world_data c
GROUP BY c.admin;

That query results this (here you see the resulting polygon Brasil):

Obviously the geometry of the original shapefile is not an exact topolgy. I thought about using ST_ExteriorRing to get only the outline. I am not sure what the result would look like. I tried, but using ST_ExteriorRing() results in: ExteriorRing: geom is not a polygon when I try it on one geometry.
Fixing the input geometry I could try to snap neighbouring polygonlines, but how to do this for every polygon? ST_Snap() only works on two input geometries (as far as I understand the documentation). I somehow need to say "Snap every polygon to each other that is within a distance of XY".


texts: Creating a haze mask in Google Earth Engine

texts:
I created a cloud-free median composite for a selected time and location from Landsat 5 SR imagery. Unfortunately, significant portions of the composite appear hazy and for the hazy pixels, the red, green, and blue band values are twice what they should be. I would like to apply a haze mask similar to the various cloud masks available but using the sr_atmos_opacity band. Unfortunately,  attempts to modify existing cloud mask codes (e.g., like the one below) have failed to do anything.

How do I mask pixels from the collection when sr_atmos_opacity is >0.3 (or 300 unscaled)?

var cloudMaskL457 = function(image) {
     var qa = image.select('pixel_qa');
     var cloud = qa.bitwiseAnd(1 << 5)
              .and(qa.bitwiseAnd(1 << 7))
              .or(qa.bitwiseAnd(1 << 3));
};
var dataset = ee.ImageCollection('LANDSAT/LT05/C01/T1_SR')
              .filterDate('1990-05-14', '1990-09-14')
              .map(cloudMaskL457).filterBounds(geometry);
  return image.updateMask(cloud.not());
};


texts:
I have been successful in using the GeoServer API to create workspaces and data sources, but I believe the documentation is quite buggy, since I cannot use the "roles" endpoint, for reference: https://docs.geoserver.org/latest/en/api/#/latest/en/api/1.0.0/roles.yaml
I looked at:
How can I add new ROLES and USERS through REST in GeoServer? so it appears I'm not the only one with this issue.
When I call either GET to /roles or /security/roles I simply get:
statusCode: 200

<title> Geoserver Configuration API </title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>

Geoserver Configuration API

workspaces

namespaces

styles

layers

layergroups

reload

reset

about/manifest

about/version

about/status

settings

settings/contact

services/wms/settings

I've tried sending an email to the email listed on the api documentation page but received a "returned to sender".
We are using geoserver 2.11.1


texts: Qgis3 APIbreak : QgsFeedback instead QProgressDialog while using QgsRasterCalculator

texts:
I upgraded my Qgis to 3.0.1 and I try to upgrade some of the plugins I wrote.

I have a plugin which uses GDAL/rastercalculator from several raster layers to get new informations.

With Qgis2 api it was easy to add a progress dialog to the process :

progress = QProgressDialog("Calcul", "Annuler", 0, 100,self.dockwidget)
calc = QgsRasterCalculator(formula, output_path, 'GTiff', map.extent(), map.width(), map.height(), entries)
calc.processCalculation(progress)

Qgis3 api uses a QgsFeedback instead of a QProgressDialog (see https://qgis.org/api/api_break.html).

Does anyone knows how to use QgsFeedback to create a progress bar ? I couldn't find any example.

Update 2019/03/07 :
I found a way to do it :

feedback = QgsFeedback(self.dockwidget)
progress = QProgressDialog("Processing...","Cancel", 0, 100, self.dockwidget)
progress.setWindowModality(Qt.WindowModal)
progress.setMinimumDuration(500)
feedback.progressChanged.connect(progress.setValue)
progress.show()
calc = QgsRasterCalculator( formula, output_path, 'GTiff', slope_map.extent(), slope_map.width(), slope_map.height(), entries)
calc.processCalculation(feedback)

Now it works.


texts: I have a very large DEM (about 115Gb). I cannot work with it on my computer. I need to clip a river catchment from this DEM. I work in GIS. How can I do this?


texts: Python Script within ArcMap running GME Command passes a double forward slash when writing the log file

texts:
I thought I made some serious headway there today. My script works perfectly fine when run from a Python Shell, but in ArcMap, whether the script is run from the Python Command line, or within a toolbox, GME fails/produces an error when loading. Another person is experiencing the identical behavior and has a thread started on the ESRI Forums.
Here is a screenshot of his error, my OS seems to cut off more of the error:

Has anyone else experienced this error? Are you able to execute GME commands from within an ArcMap session? There is only one config file which, while related to logging, I don't believe has any bearing on this. I'm not aware of any other switch when you execute GME from a command line which disables logging.


texts: Computing Walking and Cycling Isochrone maps using QGIS & pgRouting?

texts:
Just installed QGIS as I believe I should be able to produce walking and cycling isochrones from a specified point. I have done this pretty easily before using ArcMap, however, I am really struggling with QGIS.

From what I have read, I should be using PGRouting and OSM2PGrouting mapping (which I have installed). I haven't really used SQL before and seek a dummies guide to doing these isochrones. I have read about various ways, most detailing SQL which I am struggling with.


texts: Measuring areas, lengths in specific regions (Australia, South East Asia)?

texts:
I'm in need to find a suitable projections to measure correctly areas and lengths  for 2 areas of interest.

I want to measure both factors for:

First region Australia & New Zealand (1st region),
Second region  - South East Asia defined as: Bornero, Honkong, Indonesia, Macao, Malyasia, Philipines, Singapoure, Thailand, Taiwan, Vietnam.
(minlon: 94.89, minlat:-11.34, maxlong:141.056, maxlat:26.46)

In regards to Australia & New Zealand:

Equal area projection:
I could find two suitable projection to measure areas in Australia
GDA94 / Australian Albers (EPSG:3577) and the Australian Albers (EPSG:17365).

What about having a proper projection to measure areas at once in Australia and New Zeland?

Is there any ready to use projection to do it or should I customize one of currently available, if so the question is how?

How does such projection measure area of relatively small shapes like shapes of the buildings in country?

Does the area of interest the projection is applicable for somehow correspond to the size/ area of the object I would like to measure?

Equidistance projection

Does the term distance correspond to the length in my understanding?

For example I want to measure the length of each road I do have in the Australia's dataset I work with, but reading the definitions of equidistance projections I'm a litlle bit confused while in fact they're saying:

Equidistant conic projection - It has the useful property that distances along the meridians are proportionately correct,
Equidistant conic projection -  It has the useful properties that all points on the map are at proportionately correct distances from the center point.

What about measuring the length?

Does the equidistance projection work for that, if not what would be the best option to go for region1/ region2 from my definition?


texts: QGIS, creating a mbtiles file from a custom shape

texts:
I wonder if anyone can be of assistance, I am attempting to create a .mbtiles file from open street map data with open sea map data laid on top of it. I have been able to create the file successfully but I appear to be struggling to create a .mbtiles file from a custom shape, namely a shapefile -  that is, I can set the extent to cover a rectangular area, either by dragging the rectangle out, or selecting the current canvas, but if I choose a shape file the extents get set to odd numbers, its really small, and I don’t get the output I was expecting.

Now, it appears that an extent is just a rectangle, so can I achieve what I want? Or is that simply not possible using the generate XYZ tiles exporter. Is it possible at all?


texts: Mapping Rainforest Deforestation in Peru

texts:
I'm working on a project on the the rainforest deforestation in Peru. This is related to the work of http://www.coolearth.org/our-mission but I am not affiliated with the organization.

I'm hoping to produce several thematic maps visualizing the chronology and rate of logging, the displacement of villages/people and CO2 released into the atmosphere (and any other data I find that might be relevant--suggestions welcome here too!). Does anyone know where I could find this data?

Also does anyone have any advice on how to best map/represent these variables? I will be using QGIS, so any suggestions for plugins or tools would be welcome!


texts:
This whitepaper about NASA's Nebula project, describes how cloud computing was used by NASA's Short-term Prediction Research and Transition Center to identify damage scars left by tornadoes.

Since then, Nebula was open-sourced to create OpenStack.

Have there been any geospatial applications run in OpenStack by non-governmental entities?


texts: Reprojecting script runs without errors in Spyder and ArcGIS Pro script tool but desired outcome is not reached

texts:
I am new to Python and am attempting to write a script where the desired spatial reference is found on my Counties.shp and the other feature classes are in other projected coordinate systems.
The code runs without failing in Sypder and runs without error as a script tool as well. However, when the script tool is executed the desired outcome is not reached the feature class remains in its original coordinate system.
After some reading, I believe that I need to add arcpy.Project_management() using (fcCurrent,fcOut,targetSr) for the tool to run but when I try to add it after the fcOut = line I get this error:

ExecuteError: ERROR 160228: The user does not have permission to execute the operation.
Failed to execute (Project).

#establish spatial reference of selected feature class
targetDesc= arcpy.Describe(targetFc)
targetSr = targetDesc.SpatialReference
targetSrName = targetSr.Name

arcpy.env.workspace = folderWorkspace
fcList = arcpy.ListFeatureClasses()

# List current feature classes in folder
for fcCurrent in fcList:
    fcCurrentDesc = arcpy.Describe(fcCurrent)
    fcCurrentSr = fcCurrentDesc.SpatialReference
    fcCurrentSrName = fcCurrentSr.Name

for fcCurrentSrName in fcCurrent:
    if fcCurrentSrName != targetSrName:
        print ("Error Matching Spacial reference")
else:
    print ("Spatial reference matching succesful")

for fcCurrentSrName in fcCurrent:
    if fcCurrentSrName == targetSr:
        continue

else:
    # Output feature class and projected name
    fcOut = os.path.splitext(fcCurrent)[0]
    print (fcOut +"_projected.shp")```


texts: SPDLib spdinterp Error: Two file paths should have been specified (e.g., Input and Output)

texts:
I am using spdinterp from the SPDlib to produce a digital terrain model using the following command:

spdinterp --dtm --topo -r 50 -c 50 --overlap 10 -i NATURAL_NEIGHBOR -f HFA -b 1 /Users/aaron/data/1158-30-46.spd /Users/aaron/data/1158-30-46_dtm_1m.img

Which yields the following error:

0: -r
1: 50
2: -c
3: 50
4: -f
5: HFA
6: -b
7: 1
8: /Users/aaron/data/1158-30-46.spd
9: /Users/aaron/data/1158-30-46_dtm_1m.img
Error: Two file paths should have been specified (e.g., Input and Output). 10 were provided.

Clearly, two file paths were included in the command. "10 were provided" is quite puzzling.

I'm running the binary version of SPDLib for Mac OS. How can I resolve this error?

edit:

When I set the -i and -o switches, the -i switch appears to conflict with the -i interpolator switch. I get the following error:

PARSE ERROR: Argument: -i (--interpolator)
             Argument already set!


texts: QGIS slow on show attribute table of a large shapefile and dies on showing selected

texts:
Using 3.8.2 Zanzibar 64 bits I am mystified by being able to load the attributes of an approx 1e6 features shapefile (even if it takes a bit of time), but waiting forever to show the attributes of the selected (sub)set of around 25.
Compu is ryzen 2700x with 32 GB memory.
IMO this should be as basic as it gets. What happens here, anyone?


texts:
Does anyone know if it could be possible to fill the field of the layer for which the form is open with some data from another layer by clicking on one of its object?

As an example, let's say I have a layer with some streets and another one with some buildings. In the first there is the name of the streets for each line, and in the other a field referencing the name of its adress' street. I would like to be able, instead of writing eveytime the name of the street related, to simply click on the linear object of the street and fill the field of the building that fit.


texts: Is it possible to add style to CSS icons/marks in Geoserver style?

texts:
In my Geoserver set up, I have a style that references a custom icon in my data_dir.

Is it possible to add CSS values to alter the image, rather than changing the image itself and uploading a new copy to data_dir to reference? Such as adding an outline or doing more than just adjusting the size.

[group = 'group1'] {
  /* @title Group1 */
  [coordinate_type = 'exact']{
  mark: url(group1.png);
  mark-mime: "image/png";
  mark-size: 24px;
 };


texts: Converting Ellipsoidal Heights to GDA2020 Z co-ordinates?

texts:
I need to convert UTM 50 X/Ys in GDA2020 at sea level, to GDA94 MGA UTM 50 coordinates.

I've used the  '7-parameter similarity transformation' from the GDA2020TechnicalManualV1.1.1 paper, and this is working well. I get the same results as the example section 3.1.1. ( Happy to supply the Java code if anyone wants).

That is:

GDA94 coordinates of Alice Springs (ALIC)
Latitude (DD) Longitude (DD) Ellipsoidal Height (m) -23.6701239 133.8855133 603.3466
X Y Z -4052051.7643 4212836.2017 -2545106.0245

is equivalent to;

GDA2020 coordinates of Alice Springs (ALIC)
X Y Z -4052052.7379 4212835.9897 -2545104.5898
Latitude (DD) Longitude (DD) Ellipsoidal Height (m) -23.6701101 133.8855216 603.2489

My question is how to convert the Ellipsoidal Height, into the Z co-ordinates.

The centre of our area of interest in this case is lat/long -19.82, 119.35, and we can assume everything is at mean sea level.

What would be a suitable Z GDA2020 to feed into the conversion? And how can we calculate it for other surveys.


texts: Algorithm to scan a road network geometry using directions service

texts:
Let's suppose there's a Directions Service which, given a pair of points, returns the geometry, along the network, which best connects those points (which are previously projected - "snapped" - to the nearest road.

How could I solve the problem of, given a bounding polygon and a pair of initial points, perform iterative Directions Requests in order to find every road branch inside the bounding polygon?

I imagine, for example, for every route given, to take its endpoints, generate a circle of new points around it, request routes from the endpoint to each of these new points, and removing duplicate segments (this sounds tricky).

Is there any well-known way to perform this action, with no previous knowledge of either network geometry or topology?


texts: getsubcurve from multipart polyline using ArcObjects/ArcPy?

texts:
I have code which analyzes multipart polylines (roads) from the beginning towards the end. The algorithm "moves along" the road.

My multipart polylines include circular junctions and branches so they can't be represented by simple polylines. The problem is that when my code proceeds along the multipart polyline, it jumps from one part to the the other, completely remote part. Since my code uses "GetSubcurve" method, I thought defining consecutive order of parts would solve my problem. Even though I created multipart polylines by adding geometries in desired order (in python), the problem still exists.


texts: Show 100K results of complex query on map without using graphics?

texts:
I need to show all 100K points on the map without using any sort of clustering.
Since they are too much they cannot be shown using a graphics layer.
since they are result of a very complex Oracle text query in cannot be applied in a dynamic layer.
The only way to show so much graphics on a may is via an image since the DOM can't stand that much graphics.

So, to sum up, I want to:
(Apply a complex query and get 100K points) --> (pass the IDs or lat/lon in a service) ---> get the generated image layer

Any suggested solutions ? (ORACLE 12g, ArcGis 10.2)


texts: ArcGIS tool to connect colinear polylines

texts:
I have a SHP file with thousands of polylines. Many are colinear (i.e., Line-A Endpoint-1 is same location as Line-B Endpoint-2). Sometimes they are colinaer across an intersection (as in image below), sometimes it is simpler with no intersection. In the image below, the attribute table shows 4 polylines are highlighted; I want it to just be 2 polylines.

I need to simplify the SHP file by connecting (merging) the colinear lines. Ultimately, I will be converting the lines to vertices (using arcpy.MultipartToSinglepart_management() and then arcpy.FeatureVerticesToPoints_management()).

Using ArcGIS 10.7 Advanced License.

What tool (ArcPy-friendly) should I use to automatically connect colinear lines?


texts:
I have to make a thematic map with an attribute table with duplicated features but different attributes. See below:

FEATURE   ATTRIBUTE
-------------------
1         bl
1         gr
2         gr
2         re
3         re
4         bl
5         ye
5         ye

Does anyone knows how to paint a feature (polygon) with the corresponding colors? I mean like  for feature 1 paint half blue and half green, for feature 2 half green half red... Thanks.


texts: Programmatically determining version of ArcGIS API for Python?

texts:
I would like to obtain the version of ArcGIS API for Python for logging/diagnostic purposes.

Is there a way to determine this before a connection is made?

I know that once I have the GIS object, I can obtain the version but I seek a way to obtain that information earlier in the script.


texts: How can I repeat processing routine in QGIS, to a batch of Landsat images?

texts:
I have a batch of about 50 landsat 8 geotiff scenes that I want to process in QGIS to compare them. Basically, I need to make simple band math and change color scales.

Is there a way to make something equivalent to an excel macro/vba, or other repetition solution?


texts: QGIS 2.x - 4 colors theorem - TopoColour and Map Coloring plugins

texts:
I try to use TopoColour or Map Coloring plugins to color my polygon layer:
Both of them doesn't work or I do something wrong. Maybe somebody knows any other plugins which color shapes according to 4 color theorem?


texts: How to query features of raster layers hosted on GeoServer that are added to Mapbox?

texts: Currently working with Mapbox gl js. I know for OpenLayers there's a function called GetFeatureInfo to do this, but is there a similar one for Mapbox? What I want to do is whenever the user clicks on a point in the map, which is a Mapbox style, it will show the data from the currently added layers at that point. I used this example to add the layer from GeoServer to my Mapbox map: https://www.mapbox.com/mapbox-gl-js/example/wms/


texts: Instructor led Web mapping development courses?

texts:
I have been messing around with programing for a while now and have gotten proficient with Python and have some interest in HTML 5 and Javascript. I have recently received a request for an IRD (essentially a proposal to do research and development) from my employer for developing a trial web mapping application to be used as a tool for marketing web mapping services to clients and have functional use within the company. The API I have targeted is the ArcGIS Javascript API which relies heavily on the Dojo toolkit and have a targeted budget of $20,000 which includes time and materials. Since I am very interested in this subject area I have no problem spending most of the budget on training and developing in my free time; although I will really be the only person working on this.

What exactly will I have to know to be able to produce something that is functional and presentable? Also, if you can recomend any instructor led programs out there that I can put in my budget?

I know there are a lot of free courses offered out there but I have to have something to show at the end of this so I would rather go with some training that is instructor led.

My idea is to create a pretty standard web map with some of our larger clients data displayed in layers that can be turned on and off. One of the key concepts is the ability to print the current view to a standardized template. The demand for this functionality comes from our project managers who often times will need a hard copy map as an exhibit in a meeting but wait until the last minute to tell us in the GIS dept. With just 3 full time analysts this can be a major issue.

I also plan to use this project as a jumping off point to get into much more advanced development, so the more I can learn the better.


texts: Selecting line between two polygons using MapInfo?

texts:
Just wondering if its possible to extract a line that between two polygons - hopefully the image illustrates this well - I want to extract Line A-B. I'm using MapInfo.

Currently I've used the Intersect function but it results in the entire polygon being selected. I realize there may be a few steps required here.