texts: Converting rasters to polygons through cell centers

texts:
With arcgis, it is possible to convert a raster image to a polygon representing the boundary of the raster using the Raster To Polygon tool.

The output polygon will follow the cell edges of the raster.

I'd like to create a polygon which follows the centres of the raster's edge cells.

Any idea how to do this?

I'm agnostic as to whether it uses arcgis, postgis, python, C, whatever...

The input can be an Esri 'Raster Dataset' or any gdal-supported format...


texts: GDAL Planet data request returns "HTTP error code: 411"

texts:
I've been able to successfully download Planet scenes through the Open California initiative without any issues until yesterday. Here is an example where I'm trying to get the metadata of a scene:

gdalinfo "PLScenes:ITEMTYPES=PSScene4Band,SCENE=20180601_181054_1029,ASSET=analytic_sr" -oo API_KEY=$MYAPIKEY

Here is the error output:

  ERROR 1: HTTP error code : 411
  ERROR 1: <!DOCTYPE html>

    <meta charset=utf-8>
    <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
    <title>Error 411 (Length Required)!!1</title>

411. That’s an error.

POST requests require a Content-length header.  That’s all we know.

This happens with any GDAL related request from the Planet API, whether getting metadata via gdalinfo or trying to download via gdal_translate. I am using GDAL v2.2.2, and a colleague confirms that they are still able to successfully download scenes via GDAL.


texts: Gdal RasterIO error about Too few parameters

texts:
I want to get the value using GDAL RasterIO in C++, there is my code. howveer there is a bug that error C2660: “GDALDataset::RasterIO” and there are too few
parameters

            GDALRasterBand* poRasterBand;
            poRasterBand = pDataset->GetRasterBand(1);
            int nXsize = poRasterBand->GetXSize();
            int nYsize = poRasterBand->GetYSize();
            int xSize=1;
            int ySize=1;
            GDALDataType dataType =poRasterBand->GetRasterDataType();
            float *pBuf = new float[nYsize * nXsize];

            pDataset->RasterIO(GF_Read, 0, 0, nXsize, nYsize, pBuf, nXsize,nYsize, dataType, 0, 0);
            std::cout<<pBuf<<std::endl;
            delete[] pBuf;
            std::cin.get();
            std::cin.get();
            return 0;


texts: How to check which geometries in a GeoDataFrame are within the bounds/limits of the projection/coordinate system?

texts:
Is there a pre-built function that I can use to identify which of the geometries in a GeoDataFrame fall within the bounds of a CRS?
I'm asking because, currently, GeoPandas allows me to create points that are wildly outside of a CRS' bounds.
For example, WGS84 (EPSG:4326) has the following bounds:

x_min=-180, x_max=180, y_min=-90, y_max=90

However, I can create POINT (-500 900) and GeoPandas won't throw any kind of error.
Similarly, the Texas State Mapping System (EPSG:3081) has the following bounds:

x_min=334235.2323, x_max=1651722.6917, y_min=428079.3639, y_max=1608994.9702

However, I can create POINT (-50000000 70000000) and GeoPandas won't throw any kind of error.
Here's a quick example (in code) of what I'm talking about.

import geopandas as gpd

test_1 = gpd.GeoDataFrame({'my_id':[1,2,3]},
                          geometry=gpd.points_from_xy([-180,180,-500],
                                                      [-90,90,900]),
                          crs='epsg:4326')

test_2 = gpd.GeoDataFrame({'my_id':[11,12,13]},
                          geometry=gpd.points_from_xy([334235.2323,
                                                       1651722.6917,
                                                       -50000000],
                                                      [428079.3639,
                                                       1608994.9702,
                                                       70000000]),
                          crs='epsg:3081')

Notice how in GeoPandas allowed the creation of both GeoDataFrames without any hiccups.
So, my question is: is there an easy way to identify geometries that fall outside of a CRS' "legal" bounds?


texts:
I am trying to cluster a set of LineStrings (made out of lat/lon Points) with the help of HDBSCAN (using the "haversine" metric). The objective is to define the most "usual" path.

I have only managed to create clusters (polygons) from the original Points so far and I still have to reconstruct the path from the identified clusters which is not easy.

Therefore, I am wondering if there is an efficient way to cluster the LineStrings.


texts: ImportError: No module named pandas in Python window of ArcMap after installing with pip?

texts:
I have downloaded pandas from this site then unzipped it in site-packages and run python setup.py for installing pandas.

Pandas was installed successfully.

After that I tried importing pandas into the Python window of ArcMap and it gives me the following error.

>>> import pandas
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named pandas


texts: How to set up geoserver with lattest jetty version ? Problem with geoserver web archive version

texts:
Context : I was first using geoserver as a standalone (platform independent binary) version on Ubuntu.
Almost everything is fine. But the jetty version it is built on is really old (6.8.1) and deprecated according to the eclipse website (we are now at ver. 9 : http://download.eclipse.org/jetty/)

So I decided to remove this installation of geoserver, upgrading my java installation (from opendjdk-7 to openjdk-8), and installing latest jetty version.

Under the webapps/ directory of jetty, I have now extracted the latest stable geoserver web archive (2.8.1) (http://geoserver.org/release/stable/).

And again, everything is almost fine, except that when I shutdown jetty server, and start it again after some time, geoserver is just like it was the first time accessing it : I have to reset all passwords, parameters, layers, and so on...

Question : How do I make every changes on geoserver permanent just like it was with the standalone version?


texts:
I'm looking for help getting the correct shapefile.

I'm working off of the files provided by the canadian government at http://geobase.ca/geobase/en/search.do?identifiant=&region=mb&produit=nhn&language=en

These are identified as all the shapefiles that touch inside the Manitoba border. I've joined these files together and am attempting to clip them by another shapefile we have of the Manitoba border (Another tech created this by getting the entire Canadian border and cutting it down)

My issue is, every time I clip it, the file returned always appears to be blank, despite the lengthy time it takes to create the file. I'm entering the input layer as the water layer, and the clipping layer as the border layer.

We are working out of QGIS.  I personally have little to no GIS training.

Also I should note that I have made sure that the CRS match and I've also fixed all validity errors.


texts: Calculate percentage of land cover within a buffer in meters, not decimal degrees

texts: I am trying to calculated the percentage of land cover within a buffer area (3000m) around my coordinates. My output is in decimal degrees but I want it in meters or at least that I can calculate the percentages of land with the buffer. The projection system I used is WGS_1984 the data is for Africa. Does anybody know a different projection system in meters for Africa or another way I can calculate this?


texts: How to add or delete one category in Categorized Symbol Renderer PyQGIS QGis 3.x

texts:
I need code for add o delete Categorized Symbol in QGIS 3

category = ?

More information: https://qgis.org/pyqgis/3.4/core/QgsCategorizedSymbolRenderer.html


texts: Getting end points of polygon using GeoTools?

texts:
I am trying to get the end points of a polygon which presents a building in a shp file.

Do you know if there is any function in geotools or the steps that i have to follow to do this?

i find a relative question: how would one get the end points of a polyline?
But it is not what i need.


texts:
I have a little problem. I started to learn JavaScript and Leaflet not so much time ago, and now I can work with layers, but creating controls that I need is to hard for me right now.

So, I created tile layer based on polygon shapefile (it is really big, around 14 000 000 points. GeoJSON, TopoJSON - can't display it in browser, shapefiles I prefer not to use) and now I try to recreate the bicycle again. I want to create dynamic legend. One part of legend use for detecting of color and displaying type of polygon by color (hex). Another part use for 3-5 dominate colors of chosen map in different positions. So I show some pieces of code:

1) http://jsfiddle.net/DV9Bw/1/

2) Second part is look like (As I think I can use it) http://lokeshdhakar.com/projects/color-thief/

How to create legend that I describe?

As I understand it, I should create canvas tile layer and then get pixel color...

Sorry for my English! I haven't practice for a long time =)

So... this is a part of code to get color, but it doesn't work when I change position on map... What I am doing wrong???

var map = L.map('map').setView([51.505, -0.09], 13);
var tl = L.tileLayer('http://c.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: 'Map data &copy; OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox',
    maxZoom: 18
}).addTo(map);
tl.on('tileload', function(tile, url){
    var top = $(tile.tile).css("top");
    var left = $(tile.tile).css("left");
    var url = $(tile.tile).attr("src");
    createCanvas(top, left, url);
});
var ourCustomControl = L.Control.extend({
  options: {
    position: 'topleft'
    //control position - allowed: 'topleft', 'topright', 'bottomleft', 'bottomright'
  },
  onAdd: function (map) {
    var container = L.DomUtil.create('div', 'leaflet-control-custom');
    return container;
  }
});
map.addControl(new ourCustomControl());
function findPos(obj) {
    var curleft = 0, curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
        return { x: curleft, y: curtop };
    }
    return undefined;
}
function rgbToHex(r, g, b) {
    if (r > 255 || g > 255 || b > 255) {
        throw "Invalid color component";
    }
    return ((r << 16) | (g << 8) | b).toString(16);
}
$('#map').on("mousemove", "#canvas",function(e) {
    var pos = findPos(this);
    var x = e.pageX - pos.x;
    var y = e.pageY - pos.y;
    var coord = "x=" + x + ", y=" + y;
    var c = this.getContext('2d');
    var imageData = c.getImageData(0, 0, this.width, this.height);
    var pixelArray = imageData.data;
    var p = c.getImageData(x, y, 256, 256).data;
    var hex = "#" + ("000000" + rgbToHex(p[0], p[1],p[2])).slice(-6);
    $('.leaflet-control-custom').html(coord + "
" + hex).css("background", hex);
});
function createCanvas(top, left, url){
    var canvas = $('<canvas />').attr({
        id: "canvas",
        width: 256,
        height: 256,
        class: "leaflet-tile leaflet-tile-loaded"
    });
    canvas.css("top", top);
    canvas.css("left", left);
    var ctx = $(canvas)[0].getContext('2d');
    var image = new Image();
    image.onload = function() {
        ctx.drawImage(this, 0, 0);
    };
    image.crossOrigin = "Anonymous";
    image.src = url;
    ctx.drawImage(image, 0, 0);
    $(".leaflet-tile-container").append(canvas);
}


texts: Using network analyst new closest facility to calculate certain routes but not others?

texts:
I'm working on calculating a variety of distances between many points using network analyst using ArcGIS 10.2. Using the new closest facility option, I have 100,000 facilities and 100,000 incidents, and I want to calculate specific routes: Location 1 to Location 1, Location 2 to Location 2, etc. I don't care about calculating Location 1 to Location 3 or 4 - I only care about the distance between the corresponding locations.

I'm planning on using a workaround, where I set the "facilities to find" under Analysis Settings to 100,000, and then just deleting out all of the irrelevant results once the model is finished. This would be much more efficient, though, if I could only calculate the 100,000 I care about, instead of the 10 billion it will calculate otherwise. Is there an easy way to restrict this, either by using new closest facility or some other Network Analyst capability? Thanks.

The screenshot shows my (probably) flawed method that I've been trying to use in a test case I did before doing the 100,000 - when I have 5 facilities and 5 locations I ask the model to find five facilities, which gives me 25 routes, and then I delete all the irrelevant ones.


texts: Leaflet (R) addPopup with coordinates and properties


texts: Difference in ONS area and area calculation in GIS-software

texts:
I have an official shapefile from the ONS (Office for National Statistics) in the BNG (British National Grid) projection.

It has an st_areaha attribute column - I understand this is the area in square meters. When I calculate the area using the attribute calculator in QGIS or ARCH (in a BNG projection), I get similar results between softwares, but different from the official attribute column. See below (in square km for easier numbers):

(NOTE: The grey column is just a test to see if projecting to WG48 would get closer areas numbers, but that isn't it either, so do ignore.)

Any ideas on why the official / calculated area values are so different?


texts: Opening ArcGIS Pro application from ArcGIS Pro Project (.aprx) file using ArcPy?

texts:
I need to open an ArcGIS Pro project (.aprx) file in the ArcGIS Pro application inside of an arcpy script.

Does anyone know of a way to accomplish this?

I am using ArcGIS pro 2.4.1.

By open, I mean having the application actually open up on my screen. Similar to opening it from the start menu but utilizing the script instead.


texts: ArcMap 10.6.1 - "Error repairing the data layer" & "Error opening feature class"

texts:
I opened a file I had been working on in ArcMap 10.6.1, and all of my layers have red exclamation points next to them. All of the data is on my computer in the same folder.

I right-clicked, Data > Repair Data Source, and all of the original files are immediately shown in the same folder they have always been in. If I click the correct file and click "Add", I get the error - "Error repairing the data layer".

So I tried just re-adding the files, but I get another error. "Open Failed - Error opening feature class - Whitespace is not allowed at this location", and another - "Warning - Could not add specified data object to the map".

A different file gave a different error, "Number of shapes does not match the number of table records".

One of my files - a polyline layer with two features - works just fine, but the rest are broken.

The only thing that has changed between when I last opened it and now is fairly significant. My antivirus thought a system file was suspicious, so I opted to replace it instead of ignore it. The replacing didn't go well, and my computer would no longer boot up. I took it to a shop that reinstalled Windows. I don't see why it would affect the ArcMap files, but figured I should provide context. None of my other files on my computer have been changed.


texts: Turf operations download result shp, kml, csv, gml

texts:
I have temporary layers as a result of turf operations and I now I have the options of download as a JSON file, I would like now the option of download it as a shp, kml, csv or gml.

Is or are there any option?


texts: QGIS Gazetteer Search/ Connection to SQL Server

texts: Is there anyway to connect an Microsoft SQL Server Spatial Dataset to QGIS (2.14) to enable a Gazetteer search, similar to the Gazetteer search function in Cadcorp?


texts: Turning GeoDataFrame of x,y coordinates into Linestrings using GROUPBY?

texts:
I have a dataframe of X,Y coordinates that represent points along the paths taken by several different entities. Pseudo-data here, but it is roughly of the form:

entity_id   lat   lon   time

1001        34.5  14.2  4:55 pm
1001        34.7  14.5  4:58 pm
1001        35.0  14.6  5.03 pm

1002        27.1  19.2  2:01 pm
1002        27.4  19.3  2:08 pm
1002        27.4  19.9  2:09 pm

What I would like to do is group these points by entity_id, and then arrange the points sequentially in time to create a LineString object for each entity_id. The output will be several lines/paths, with each corresponding to an entity_id.

I can do this by looping through each entity_id and each point in entity_id and using the instructions provided here, but is there a faster/more efficient way to do this leveraging GeoPandas or Shapely, perhaps with groupby?


texts: Why does ArcGIS model not recognize Z value column?

texts:
My ArcGIS model used to handle .XYZ files well, but now it fails to recognize Z-value column as such - it either recognise no field at all, or it offers some defaults such as "OID".
Since the last successful run, I changed workspace and resolution of target raster (I doubt anything of it caused the problem, and I tried it with the same settings as before, and no joy here).
Do anyone have any idea what to do?

Here is a snapshot of my model:

My data is classical .XYZ file, with no header.

EDIT: doing the same outside the model (running the two tools used in my model manually, with intermediate multipoint feature class preserved) worked. This means the problem is not in the data (the same space delimited XYZ file from the very start), but in the model.

Some parameters:

Coordinate system: S-JTSK_Krovak_East_North (it suits the data; this is default, can be changed if the data were different)

Intermediate feature:
- type: multipoint
- managed
- path: blank -- AFAIK this should be necessary for sharing the model, and it shouldn't make problems as it's "managed" - but when I used the model for the first time, and successfuly, the path was set.

The rest shouldn't matter, these are mostly constants relevant to data and the results I need.


texts: SharpMap & BruTile library: Method not found

texts:
I'm using SharpMap 1.1 and BruTile 0.12.0 in my project. when I try to add a Tilelayer to the map the program stops with an unhandled exception of type System.MissingMethodException.

Map.BackgroundLayer.Add(new TileAsyncLayer(BruTile.Predefined.KnownTileSources.Create(BruTile.Predefined.KnownTileSource.BingHybrid), "OSM"));

  An unhandled exception of type 'System.MissingMethodException' occurred in SharpMap.dll

  Additional information: Method not found: 'Void BruTile.Cache.MemoryCache`1..ctor(Int32, Int32)'.

How can i do that without errors?


texts: Incorrect DEM contour extraction interval

texts:
I re-wrote this post from an original one and need new answers please!

I'm using Qgis 2.18.15 to extract 1' contours from a DEM created from my drone using photogrammetry software.

My main question is how can I reduce the error in calculating these contours?

The steps to do this:

Upload the geotiff DEM CRS ESPG:3857(meters)

Next I re-project the data to the local code EPSG: 32048 which is in feet.

(PROBLEM) The DEM's from the software always come in without any values z values.

(SOLUTION) Raster's  (properties > styles) set Render Type: Singleband Grey. Set min and max to 0 - 255. Contrast enhancement: Stretch to MinMax

I'm not sure why but I've changed the values many times and this range always seems to encompass all of the data in the DEM. Is there a reason for these values like some kind of default?

Next I need to re-scale this raster so I find a scale factor between the QGIS DEM and the original data from the software. The min max range specified in the software is 7.41ft to 65.29ft.

I set this to have a 0 min so the range becomes 65.29' - 7.41' = range 0 to 57.88. So for a scale factor I take 57.88 / 255 = 0.226980392156. I plug this into the raster calculator and get this:

(PROBLEM) The range of values should be the same as the feet found above (0 to 57.88) but after being scaled it comes in as 0.457592 to 57.8223.

The math here using the raster calculator does not make sense.
 255 x 0.226980392156 = 57.88 not 57.8223 and 0 x 0.226980392156 = 0 not 0.457592

Continuing with the values I extract 1' contours now that it is scaled

Why does the scale factor math using the raster calculator not make sense?
Also, is there a way to explain the min max range 0 to 255 that I've found works well when the DEM comes in without z values?

I need to be as accurate as possible with this data and I know there are multiple places in this process which can skew the data.


texts: How to reproduce contour-style labeling with rasterVis::contourplot?

texts:
I am currently working with a digital elevation model (DEM) of Mt. Kilimanjaro, Tanzania. The referring raster grid can be downloaded from DIVA-GIS (Country: Tanzania; Subject: Elevation). After extraction in the current working directory, I define an 'extent' object used to crop the countrywide DEM by the geographic extent of interest as follows:

# Required packages
library(raster)
library(rgdal)

# Spatial extent of Mt. Kilimanjaro, TZ
kili <- data.frame(x = c(37, 37.72), y = c(-3.4, -2.84), id = c("ll", "ur"))
coordinates(kili) <- c("x", "y")
projection(kili) <- CRS("+init=epsg:4326")

# DEM
dem <- raster("TZA_alt.grd")
dem_kili <- crop(dem, kili)

Now, I would like to plot contour lines representing isohypses in a vertical spacing of 500 meters. Of course, this can easily be done using contour from the built-in graphics package:

levels <- seq(1000, 5000, 500)
contour(dem_kili, levels = levels)

So far, so good. Unfortunatelly, I am looking for a way to combine a 'spplot' object showing MODIS-based NDVI in the Mt. Kilimanjaro region with labeled contour lines derived from this very DEM.
I already tried to specify sp.layout = list("sp.lines", rasterToContour(dem_kili) inside spplot, but this approach offers no possibility to draw labels associated with the particular contours. Executing contour(dem_kili, ..., add = TRUE) after sp-plotting the NDVI raster does not display any contour lines at all (I guess because spplot is lattice-based and contour is not).

The status quo is that I am using contourplot from the rasterVis package along with as.layer offered by latticeExtra to combine the visualized NDVI data with labeled contour lines. Without the preceding levelplot (which replaced the initial spplot call), my code looks like that:

library(rasterVis)
contourplot(dem_kili, at = levels, margin = FALSE)

The problem I am facing now is that I do not like the label style created by contourplot. Is there a way to replicate the contour-style labels, e.g. no labeling of small contours (for instance near the upper right corner) and interruption of the contour to avoid intersection of labels with lines?
Or is there a way to combine the output of contour including the really nice label style with spplot/levelplot that I am not aware of?


texts:
Does anyone have any experience trying to locate weeds in agricultural drone images?

I am currently using Dztesaka classification tool to find weeds.  It works pretty good.  But there may be some ways to further improve this.

I have been working on this for some time now and have came up with a decent solution.  Maybe 70-80% accuracy or higher.

The Dzetsaka classifier is a simple and powerful tool to use for this.  Just draw the polygons over each class to teach it.  Then run classifier.


texts: Select records from shape that do not match another table's values

texts:
New to the forum, so I apologize for my bad English and if I'm being inconvenient somehow! I read answers that are similar to my question but none of the ones I found fits my case.

I have a shapefile that results from an Intersect between a polygon shp and a point shp. So my resulting shp is a point one! One of the field in my intersect resulting shp is "species_names" (let's call it shp.spcNames). And I've got a CSV table imported to my GDD that contains only 1 column with over 600 text record (let's call it tbl.spcNames).

Now, I want to create a shapefile that contains only records in which shp.spcNames is different from all tbl.spcNames. In the end I want to have a point shapefile that contains all the info from my initial intersect shapefile minus the records in which shp.spcNames are present in my table's tbl.spcNames field.

How do I do that?


texts:
I would like to cut out a roof of building from a TIFF. I have the TIFF and the layer and I will show below. I have found a code but it contains not enough co-ordinates.
My TIFF with layer:
I would like to cut out a roof.

My code:
from osgeo import gdal
bbox = (xmin,ymin,xmax,ymax)
gdal.Translate('output_crop_raster.tif', 'input_raster.tif', projWin = bbox)

My raster data and buildings layer:


texts: Calculate date field by adding 12 hours to existing date field

texts:
I am trying to convert the following code to python. DATE_VAL is a date field. I want to add 12 hours to the date. I have ArcGIS Desktop 10.4.1 and python 2.7.1.

arcpy.CalculateField_management("all_reports.gdb\\lsr_reports6", "NEW_DATE", "DateAdd(\"h\", 12, [DATE_VAL])", "", "")

Not working:

arcpy.CalculateField_management("all_reports.gdb\\lsr_reports6", "NEW_DATE", "!DATE_VAL! + datetime.timedelta(hours=12)", "PYTHON_9.3", "")


texts: Deleting columns from joined attribute table in QGIS

texts:
After joining the attribute tables from two layers, I have a lot of duplicate columns on my table, making it hard to read.

However, when in "edit" mode, I am unable to select and delete columns.

Is there a way to do this?


texts: How to display two WFS layers at the same time from MapServer?

texts:
I'm using OpenLayers, I have two WFS vector layers. When I show only one layer, it works. But doesn't work when I'm trying to show two WFS layers at the same time.

How to show two WFS layers together?


texts:
When is it appropriate to use the ArcGIS Server REST API vs. the SOAP API and vice-versa?  What do you see as the advantages of one over the other?

For example, the SOAP service can be consumed as a Service Reference to integrate into Visual Studio.  Is there anything available that would give you that level of integration with REST?

More info: ArcGIS GIS Services


texts:
I have a Tablet 10.1 notes on which I installed QGIS Android (v. 2.8) and a Garmin GPS 62 stc. So I tried to do the "live GPS tracking" by connecting through the USB cable the GPS to Tablet.

Next, from the menu of QGIS I went to "GPS information" and I clicked on the "Autodiscover" but I always get the message "unable to connect to the GPS."
So I tried with the other options: internal, serial device, gpsd, but always the same message.

I would be grateful if you help me understand what is wrong and if you can indicate me the steps I need to do to be able to do live tracking.


texts:
Have a polygon in table 2 with its id, no and geometry. In table 1 I have polygons with the same fields. The polygon in table in intersects with a few polygons from table 1.What I am trying to do is clip of the polygons which overlap polygon from table 2 and insert the same fields and geometry in table 3

insert into table 3
select a.store_id,b.store_id,a.store_number,a.client_id,sdo_geom.sdo_intersection(b.geometry,a.geo metry,0.005)
from table_1 a, table_2 b
where b.store_id=34746
and sdo_anyinteract(b.geometry,a.geometry)='True';

When I do run this I dont get any output. Where would I be going wrong


texts: pyqgis - Filter layer (LIKE) with variable

texts:
I want to filter a layer with a variable and a LIKE condition.

The filter attribute is a timestamp column of Spatialite table. The table has also a join.

I successfully can filter this vector layer with:

layer_subset = layer.getFeatures( QgsFeatureRequest().setFilterExpression ( u'"acq_dat" LIKE \'27.06.2017%\'') )

The 27.06.2017 is the part of the timestamp string 27.06.2017 11:11:11.

Currently I'm writing a small plugin for exporting Shapefiles based on different dates. With a combo box the user can choose a date und this will be the variable for the filter.

I tried this:

layer_subset= layer.getFeatures( QgsFeatureRequest().setFilterExpression ( u'"acq_dat" LIKE \'%s%\'' % acq_dat ) )

But I get the error:

Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: not enough arguments for format string

How can I set a filter variable with a LIKE condition?


texts: Adding additional nodes to network in Grass GIS

texts:
I have created a network in Grass GIS (using v.net, nodes option). I then want to "disrupt" the network (i.e., create some road blockages) and add in nodes to the new line ends where road blockages have occurred.

However, I want to keep the category values from the original network the same (so I can compare the network before and after disruption). I've tried a couple of ways of doing this but with no success so far.

For example, copying the nodes from the original network (using v.extract) and then using v.net, connect option to add in these nodes to my disrupted network.

Does anyone know how to add in new nodes to an existing grass network? I'd prefer to not have to do this manually, as there are thousands of blockages.

Thanks in advance for any help!


texts: Cannot fix QGIS after upgrade to Ubuntu 13.04 Raring

texts:
I have following problem. After upgrade to 13.04 I had problem with PyQGIS mentioned here.

I followed almost all advices described there, finally removed QGIS (had 1.8 Lisboa) and added the Ubuntugis repository again:

$ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install qgis

But still have problem with broken dependencies:

Následující balíky mají nesplněné závislosti:
 qgis : Závisí na: qgis-common (= 1.7.4+1.7.5~20120320-1.1) ale 1.8.0-1~quantal3 se bude instalovat
        Doporučuje: qgis-plugin-grass ale nebude se instalovat
        Doporučuje: python-qgis ale nebude se instalovat
E: Nelze opravit problémy, některé balíky držíte v porouchaném stavu.

in English:

The following packages have broken dependencies:
      qgis: Depends on: qgis-common (= 1.7.4 +1.7.5 ~ 20120320-1.1) but 1.8.0-1 ~ quantal3 will be installed
             Recommended: qgis-plugin-grass but will not install
             Recommended: python-qgis but will not install
     E: Unable to correct problems, some packages you have in damaged state.

However I cannot fix it. I do not need Grass, but qgis-common seems to be important.

Any idea what I could do?

thanks


texts: How to customize polyline label offsets in QGIS?

texts:
I have a polyline layer in QGIS representing hectometers along a railroad. I have added labels to this layer representing the hectometer number:

However, the project I am currently working on requires for the labels to be placed like this:

I have the following labeling settings on my layer:

I have tried fiddling around with the settings, but I can't seem to find a way to do this. I also thought of labelling a hidden point layer and offsetting the label from the point instead, however since the railroad itself (black) changes orientation quite a bit the rotation value for each offset point label would have to be different, which is not feasible for the number of features in the hectometer layer.
How can I achieve the above labelling in QGIS?


texts: react-leaflet runtime background color in divIcon

texts:
I'm using react-leaflet to build up my UI.
  const divIcon = L.divIcon({
    iconSize: [40, 40],
    className: 'home'
  })

  return <Marker position={position} icon={divIcon}>
    <Tooltip>{capitalize(tooltip)}</Tooltip>
  </Marker>

I have a marker produced as a divIcon. I wish to change the background color of the div.  But leaflet only allows that to be performed via css, as described in [1].
The solution offered by @IvanSanchez relied on  marker.getElement() processing after the marker was created, but that's not an option with react-leaflet
.
Any thoughts/suggestions on how to do this in react-leaflet
please?
[1]. https://github.com/Leaflet/Leaflet/issues/5231


texts: Solving java.lang.RuntimeException: No osm2po-GraphFile?

texts:
I tried to use osm2po as a library and write a simple routing program based on the sample code at (http://osm2po.de/)

However, when I try to load the .pbf file into the data structure "Graph". The eclipse, the IDE that I used, shows the error message as following:
"Exception in thread "main" java.lang.RuntimeException: No osm2po-GraphFile"

Can anyone tell me what's going wrong when I try to load "C:\taiwan-latest.osm.pbf"?

//===========
the full code of the simple routing program is listed below:

public static void main(String[] args){

    File graphFile = new File("C:\\taiwan-latest.osm.pbf");
    Graph graph = new Graph(graphFile);
    DefaultRouter router = new DefaultRouter();

    // Somewhere in Hamburg
    int sourceId = graph.findClosestVertexId(25.033839f, 121.565064f);
    int targetId = graph.findClosestVertexId(25.040135f, 121.560328f);

    // Possible additional params for DefaultRouter
    Properties params = new Properties();
    params.setProperty("findShortestPath", "false");
    params.setProperty("ignoreRestrictions", "false");
    params.setProperty("ignoreOneWays", "false");
    params.setProperty("heuristicFactor", "1.0"); // 0.0 Dijkstra, 1.0 good A*

    int[] path = router.findPath(
            graph, sourceId, targetId, Float.MAX_VALUE, params);

    if (path != null) { // Found!
        for (int i = 0; i < path.length; i++) {
            RoutingResultSegment rrs = graph.lookupSegment(path[i]);
            int segId = rrs.getId();
            int from = rrs.getSourceId();
            int to = rrs.getTargetId();
            String segName = rrs.getName().toString();
            System.out.println(from + "-" + to + "  " + segId + "/" + path[i] + " " + segName);
        }
    }

    graph.close();
}


texts: I have a database in PostGIS, is possible using CartoDB? or I need another map server?

texts:
I have a data base in PostgreSQL/PostGIS, and I want to offer to my users a way of visualize it, Is it CartoDB the best option? It is possible? Or which is the best option around?

(Please provide links to tutorials or something similar)


texts: Use categorized style to vary textures in QGIS

texts: I'm using categorized style to show landownership on a parcel layer on QGIS (parcel layer is polygons). Is there a way to vary by fill pattern rather than color other than changing each one individually?


texts: How to add units in a column of numbers in QGIS

texts: I am wondering if there is a way to add unit (m,ft etc) in a column of numbers in a attribute table in QGIS.  I want to do this so when I post the text the units can be posted as well. I am working with pressure data so i would like to the Kpa after the number.


texts: Adding many columns (to many layers) using QGIS?

texts:
The label toolbar uses fields in the attribute table of vector layers to fine tune labeling (Data defined labeling). That's the main reason i'm looking for that, but it may have more applications.

I'd like to automatically add some format columns instead of adding them manually every time.

Do you know a plugin or a way to do this manipulation automatically on multiples layers ?

I tried to get the QGIS tool "Add a field to attribute table" into a quick model which works properly, but it creates a new memory layer. And I'd like just new fields.

##Add_ETIKT_Field=name
##myvlayer=vector
##myvlayer=output vector
outputs_QGISADDFIELDTOATTRIBUTESTABLE_2=processing.runalg('qgis:addfieldtoattributestable', myvlayer,'ETIKT_Y',1,15.0,4.0,None)
outputs_QGISADDFIELDTOATTRIBUTESTABLE_1=processing.runalg('qgis:addfieldtoattributestable', outputs_QGISADDFIELDTOATTRIBUTESTABLE_2['OUTPUT_LAYER'],'ETIKT_X',1,15.0,5.0,myvlayer)

What I'm looking to automate is :

Open the attribute table
Edit button
Field Calculator button
Add Column + Type + length + Precision

It seems there's some ideas in QGIS manual, but I'd love to avoid coding anything, or at least at minimum go through the modeler.

  Adding and Removing Fields

  To add fields (attributes), you need to
  specify a list of field definitions. For deletion of fields just
  provide a list of field indexes.

if caps & QgsVectorDataProvider.AddAttributes:
    res = layer.dataProvider().addAttributes([QgsField("mytext", QVariant.String), QgsField("myint", QVariant.Int)])

if caps & QgsVectorDataProvider.DeleteAttributes:
    res = layer.dataProvider().deleteAttributes([0])


texts:
I have a GeoTIFF file and a shapefile. I want to clip the GeoTIFF file using the polygons defined in the shapefile in such a way that it produces a separate output for each polygon (which is different from the gdalwarp usecase, which produces a single output by default).

Furthermore, I want to do this in an efficient manner. Iterating over each polygon and calling gdalwarp will reload the GeoTIFF each and every time, which is something I want to avoid.

If some tool (or some options of gdalwarp) exists to solve this use case, it would be very interesting to know.

EDIT: The piece of code that we are currently using:

def cut_region(fname, ids, output_folder, input_pic, input_shape):
    photo_name  = input_pic + fname + ".jp2"
    shape_name  = input_shape + fname + ".shp"
    raster = gdal.Open(photo_name)
    projection = raster.GetProjectionRef()

    for id in ids:
        output_name = output_folder + fname + '/' + str(id) + ".tif"
        output = gdal.Warp(output_name,
           raster,
           format='GTiff',
           cutlineDSName=shape_name,
           cutlineSQL="SELECT * from " + fname + " where ID='" + str(id) + "'",
           dstSRS = projection,
           cropToCutline=True,
           multithread=True,
           dstAlpha=True
        )


texts: Save Feature is not working for Line feature and Polygon Feature

texts:
I am using following code to save feature but that is not working for Line feature and Polygon feature to save new feature on the relevant layer type. But the same code is working on Point feature ( after changing of Handler type).

drawline=  new OpenLayers.Control.DrawFeature(wfs_layer, OpenLayers.Handler.Path, {
});

modifyFeatureControl = new OpenLayers.Control.ModifyFeature(wfs_layer, {
});

map.addControl(modifyFeatureControl);

drawline.events.register("featureadded", this, function(e) {
        FeatureObject=e.feature;
        console.log(FeatureObject);
        modifyFeatureControl.selectFeature(e.feature);

        modifyFeatureControl.activate();
        saveStrategy.save();
        modifyFeatureControl.deactivate();
        drawline.deactivate();
});
map.addControl(drawline);
drawline.activate();

Edit:

following is my WFS transaction

http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 151.1367417453871 -33.72644189139304 151.14000331155546 -33.73500768904365 151.14322196237302 -33.72993969538848 151.1367417453871 -33.72644189139304 151.14686976662688 -33.72688804779375 151.14729892007222 -33.73152793687197 151.15081797830058 -33.72856557510649 151.15081797830058 -33.72856557510649 151.14686976662688 -33.72688804779375 Source


texts: How to combine two `GridCoverage2D` to make a new `GridCoverage2D`

texts:
I was wondering if there is any GeoTools code example which combines two GridCoverage2D to make a third new GridCoverage2D?

I can find examples for reading pixels from GridCoverage2D or writing a GridCoverage2D to a file (as in gs:StoreCoverage in GeoServer), but I cannot find Java code for, e.g. doing an arbitrary math operation with two GridCoverage2D to generate a third GridCoverage2D.

Anyone know of such examples?

(I am only interested in, e.g. reading pixels out of a GridCoverage2D and then create/write to a new GridCoverage2D).


texts: Problem in using Levelplot "at" with stack files in R

texts:
I am trying to plot multiple raster files using the function levelplot in R. All these raster files have different scales and I would like to set the code so that it takes the min and the max per each raster file considered
So far I have done the following
files_stack <- stack(all_files)
   nlev <- 200
   my.at <- seq(min(files_stack), max(files_stack),length.out = nlev + 1)
   levelplot(files_stack, margin = FALSE,at = my.at)

but I get this error 'Error in seq.default(min(files_stack), max(files_stack), length.out = nlev + 1) : 'from' must be of length 1'
If I set a precise scale range, such as:
my.at <- c(seq(0,0.012,length.out = nlev + 1))

then the code works. Any idea how to set the code so that it automatically understands the min and max of each raster file considered?
Any idea how to do it?


texts: PlanetScope and Rapid Eye: Asset Type and Band Classification from Planet Labs

texts:
I have been trying to get weekly downloads for a region of interest from the PLANET API and I had a couple of questions regarding the asset types

I have been consistently getting much less number of PlanetScope OrthoTile Analytic(PSOrthoTile Analytic) compared to Rapid Eyes OrthoTile Analytic(REOrthoTile) for the same time periods. If I understand it correctly and the same areas are being mapped everyday shouldn't I get a consistent number of scenes from PSOrthoTile as well and much more. Am I missing something here, should I be looking into different asset type instead of using "PSOrthoTile Analytic" or "REOrthoTile Analytic" to include NIR band and daily imagery?
The REOrthoTile seems to be calibrated meaning I can generate False Color Composites and derive indices from the RE product however for the PSOrthoTile Analytic is the 4th Band NIR because I cannot seem to create a FCC or do any band math using existing setup such as NDVI for example since the value is pure DN and stretched upto the 16bit maxima.

I look forward to some insight and maybe someone has a working example they would like to share.

After clarification on the first point, I do understand that RE has been functional much longer and hence their archival data is richer for older time periods.
In terms of Analytic versus Visual imagery I wanted to point out that I downloaded both analytic and visual imagery and they both seem to have only 3 bands and one transparency band.

I have tried this with multiple scenes and target and standard selections within the analytic images. So you can see why there is the confusion. This means I have only 3 bands available within the analytic band which I cannot use to create false color composites or to perform NDVI. I look forward to your thoughts.The scenes id shown here is "20160803_013818_0c43_analytic" and visual from open California


texts: ArcGIS 10.2 Changing 'null' to 'zero' in attribute table?

texts:
I have a table (Excel, csv) with county names and three additional column headings. I would like to ensure that everything under the three additional headings have a zero rather than a 'null' value.

I do not know Python (I see Python as an answer in other questions).


texts: GIS with UI options? Creating a Map based WebApp fast

texts:
I want to build a WebApp which is basically a map with points of interest, filters, and a list of those points. Something really similar to AirBnB, or any other map based app.

Of course, I could just take Google Maps API and build what's around. But I guess a lot of people already did that, and may be I could use their work to make mine faster. Here's what I need :

Adding multiples POI
A list of POI that are showed on the map
A way to filter POI
Most have a behavior to handle a lot of POI
Have to work on desktop, mobile and tablet

I already know one template that can do nearly all of this, it is call Bootleaf. But before programming, I would like to know if you know other tools that might work better.

Disclaimer : this is a copy/paste from this question on Programmers, which the community didn't feel it was the right place. I hope GIS SE better suit it.


texts: (FATAL) ComputeImagesStatistics: Cannot open image QGIS

texts:
QGIS version: 3.16.2-Hannover
QGIS code revision: f1660f9da5
Qt version: 5.11.2
GDAL version: 3.1.4
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'ComputeImagesStatistics' starting…
Input parameters:
{ 'il' : ['C:/Users/srfst/Documents/Thesis/Nikos Neuropublic/Qgis/OTB Trainning/Πειραματικός αγρός.tif'], 'bv' : 0, 'out' : 'TEMPORARY_OUTPUT' }
2021-03-22 00:10:39 (INFO) ComputeImagesStatistics: Default RAM limit for OTB is 256 MB
2021-03-22 00:10:39 (INFO) ComputeImagesStatistics: GDAL maximum cache size is 404 MB
2021-03-22 00:10:39 (INFO) ComputeImagesStatistics: OTB will use at most 4 threads
2021-03-22 00:10:39 (FATAL) ComputeImagesStatistics: Cannot open image C:/Users/srfst/Documents/Thesis/Nikos Neuropublic/Qgis/OTB Trainning/Πειραματικός αγρός.tif. Probably unsupported format or incorrect filename extension.
Execution completed in 0.26 seconds
Results:
{'out': 'C:/Users/srfst/AppData/Local/Temp/processing_JFoxJX/07e24f0ef0184fc08c2ba87cc8a7b6bd/out.file'}
Loading resulting layers
Algorithm 'ComputeImagesStatistics' finished
How can I fix this?


texts: Change symbol size in legend for FeatureLayer (ArcGIS API for JavaScript)

texts:
I'm learning how to create web applications using the ArcGIS API for JavaScript. I have a map that is displaying both an ArcGISDynamicMapServiceLayer (which includes two layers) and a FeatureLayer. I have successfully added a Legend using esri/dijit/legend, and it shows all the information I want. I then added code to my CSS file to further format the legend (to change font/size etc for titles and names). Ex:

.esriLegendLayer {
     font-size: 12px;
     font-family: 'Roboto', serif;
}

I was also able to successfully change the size of the legend symbols for the ArcGISDynamicMapServiceLayer using the following css code:

.esriLegendLayer img {
    width: 20px;
}

However, this does NOT effect the legend symbols for the FeatureLayer.

I want the symbols sizes to be the same throughout the legend. In the image above, you can see they are not, because the code is only altering the size for ArcGISDynamicMapServiceLayer symbols (top) but not FeatureLayer symbols (bottom).

I have tried unsuccessfully to find a way to change the symbol size for the FeatureLayer as well. I don't want to change the size of the symbol as displayed on the map, just on the legend, and I want to be able to set the size regardless of the size that was used when the service was created. This is important so we can have a general template that will result in the same general consistant look for the legend regardless of what layers/services are included.


texts: Difference between ArcObjects SDK for Java and ArcGIS Runtime SDK for Java and ArcGIS Engine

texts:
What is the difference between ArcObjects SDK for Java and ArcGIS Runtime SDK for Java and ArcGIS Engine.

I have ArcGIS Desktop 10.1 on my laptop. What do I need to create ArcGIS desktop applications (arcmap and standalone) in Java? Do I need to purchase a license for creating applications? License is $1500, I can't afford it.

I am confused with the terminology.


texts: How to Create SLD Label with Non-Latin Languages

texts:
I create a OpenLayers WMS Layer  with my map server url.
I want to Style this with SLD_Body. I defined My SLD_Body and want to labeling it.

but My Label Map is with non-Latin language and after executing the program , the labels is shown with Question mark(????).

Is there any way to display labels in My language??

this is my code:

        var wmsm = new OpenLayers.Layer.WMS("wms", mapurl,
      {
          layers: Mylayers,
          format: 'image/png',
          "SLD_BODY": sld },
          {"reproject":"true"}
        );


texts: Use Dojo to load modularized widget config files

texts:
I've taken a basic webmap 'ESRI HomeButton' and I'm trying to create a modularized webmap setup from it. I want to break down this simple webmap to have it utilizing a module system with config files and more. Then I can take other single-use webmaps and breakout the widgets into separate files much more easily and approach everything very much like the FlexViewer environment.

The problem I am having is that in my widgetHomeButton.js file, I took the HomeButton.js code and added in three lines...

In my require, I added "widgets/homebutton/config" to point to my config.js file. I should mention I have a package.js file that sets up the folders so that 'widgets' points to package_path + "path/to/widgets" just like in the example.

In my function, I added widgetConfig as the variable to store the config.js file contents, which happen to be JSON style data.

Then in the HomeButton widget code I added a single line of code that reads...

console.log( widgetConfig );

And all I get are errors. Any ideas what I am doing wrong?


texts: What is the maximum, allowable field length for a FacilityID field in a Cityworks geodatabase?

texts:
Over the past couple of months, I have seen a few esri-geodatabases and they seem to be either a text field with a length of 20 or 30.  Is 30 the maximum field length?

Clarification:
The answer I'm looking for is if there is a Cityworks-specific constraint on the text field length in the esri geodatabase.


texts: Changing shapefile longitude from -180-180 to 0-360 in R

texts:
I have a world shapefile. I am reading the shapefile using readOGR() function from rgdal package. The shapefile which I have has Greenwich as the prime meridian. I got the world shapefile from this link.
library(rgdal)
library(raster)

Shapefile <- readOGR("Directory of Shapefile")

The CRS of this shapefile is given below.
> crs(Shapefile)
  CRS Arguments:
   +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0

I have to convert this shapefile into a similar world shapefile as shown below.
The longitudes of output shapefile should range from 0 to 359 where the latitude remains the same.

Is there some way to do this thing in R?
My output shapefile should look something like as shown as above.


texts:
I'm having issues with the translation of my Qgis plugin.

static const QString sName = QObject::tr( "Editeur Monoscopique 3D" );

MyClass::MyClass( QgisInterface * theQgisInterface ):
    QgisPlugin( sName)
{
        QSettings tSettings;
        QString qsUserLocale = tSettings.value( "locale/userLocale", "" ).toString();

    if ( ( qsUserLocale != "fr_FR" ) && ( qsUserLocale != "fr" ) )
    {
            QString qsTranslationPath = ":/prefix/en_US.qm" ;
            QFileInfo tFileInfo (qsTranslationPath) ;
            if (tFileInfo.exists())
            {
                    //QTranslator translator;
                    if (m_tTranslator.load( "en_US", ":/prefix" ) )
                            qApp->installTranslator(&m_tTranslator);
            }
    }

}

The problem is that sName is declared before installing the translator qApp->installTranslator(&m_tTranslator); and so its text is not translated !
How can I fix this?


texts:
I downloaded a grib2 file containing GFS data.
I need to get wind and temperature from altitudes ranging from 1000 ft to 42000 ft

I know the grib2 (GFS) only have data for specific "isobaricInhPa" pressure, that does not correspond exactly to the altitude I want.

Is there any way to interpolate the data?

(any solution based on a .net library would be a plus)


texts: Convert PyQGIS processing script to plugin and get same user interface

texts:
I have written a PyQGIS processing script that can be used from Toolbox. I would like to convert this to plugin and publish. The script is taking input and output from the user through processing algorithm built-in parameter Ccasses.

If I convert this to plugin using the Plugin Builder 3 plugin. Will it generate the same user interface? If not what is the right way of converting a toolbox script to plugin?


texts:
I work for a survey company doing gas lines GIS. We use QGIS.

We create hand drawn sketches of pipelines containing all sorts of information including: materials used, skew numbers of equipment installed, exact location from a datum ( 0 point), etc. what we would like to do is use QGIS to replace the hand drawn portion of the job. Basically, create, in the GIS program, the drawing, have symbology present each pipe/material location and be able to select that location and have a dialog box populate with the location attributes: skew numbers, material used in that exact local.

Are there any plugins for this?


texts:
I am trying to import my ESRI-shapefile with OGR2OGR to an existing mysql table. This works fine but unfortunately only the featureID and the geometry data is exported. How do I add the labels of the different polygons? These are stored in the .dbf-File if I am not mistaken. I am using the following command:

ogr2ogr -f MySQL MYSQL:Polygons,host=localhost,user=user,password=user,port=3306 -nln route -a_srs EPSG:4326 -append /home/Fields3.shp

if using ogrinfo on the file it tells me:

INFO: Open of `Fields3.shp'
      using driver `ESRI Shapefile' successful.
1: Fields3 (Polygon)

How can I get the addition information into Mysql? The Shapefile is created using Qgis 2.0 with standard settings.


texts:
Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs ";

Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";

alert(feature.geometry.getVertices()[0].x);
alert(feature.geometry.getVertices()[0].y);
var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);

//Define the source Coord Sys
var src = new Proj4js.Proj("EPSG:4326");
//Define the destination Coord Sys
var dst = new Proj4js.Proj("EPSG:2322");

var gk=  Proj4js.transform(src, dst, point);
alert(gk);

i can get x and y cordinates but when i convert them to epsg 2322. x will change but y is always zero.

i found thats code but it is not converting correct

  Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs";
        Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
        Proj4js.defs["GOOGLE"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";
        Proj4js.defs["EPSG:900913"] = Proj4js.defs["GOOGLE"];

        //Define the source Coord Sys
        var src = new Proj4js.Proj("EPSG:900913");
        //Define the destination Coord Sys
        var dst = new Proj4js.Proj("EPSG:2322");
        var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);
        Proj4js.transform(src, dst, point);


texts: ModelBuilder: How to incorporate wildcards?

texts:
Background:

At ArcGIS Desktop 10.7.1, I have created a simple tool that iterates recursively through a folder, selecting all polygon feature types.

The input folder will always be two located two folders above the location of the tool.  Accordingly, I have incorporated %currentworkspace%\..\..\SOME_INPUT_FOLDER as the iterator's input, as shown below.  Note that in my example I have hard-coded the input folder's name, SAMPLE_PROJECT.

This model works correctly.

Problem:

I need to replace the hard-coded folder name with a wildcard, so that the model will run no matter the name of the input folder.

I have used both * . * and * as wildcards for the input folder name (see below).  Both result in errors that scroll by too fast to read (although it think they say something about an invalid input).  I have to kill Arc with the task manager to stop the scrolling errors.

My question:

How do I incorporate a wildcard folder name?


texts: GPS points displaying in the wrong place

texts:
I'm trying to help a student by importing an excel table of Lats and Longs into Arcmap, but they are displaying in the wrong location - I am also a bit suspicious of the coordinates.  I imported the points as WGS 1984.

They used a Garmin GPS with the settings saying:

Position format:  hddd*mm.mmm'
Map datum: WGS 84
Map Spheroid: WGS 84

An example of the co-ordinates are below.  I have also attached a copy of how the data is showing - the red circle is where the data should be.

I would have expected the Lats to be in the regions of 55.9 and the Longs in the region of -3.0 to -3.1

lattitude, longitude

56.932, -3.355

56.931, -3.356

56.931, -3.359

56.933, -3.362


texts: Scale and fit GeoJSON to the SVG map with d3-geo

texts:
I am trying to follow the excellent tutorial by Mike Bostock on medium with my own data.

Instead of a GeoJSON of California, I am trying to fit a small parcel somewhere in Norway to the map.

My input GeoJSON file is here, and looks like this:

Instead of using geproject to California Albers, I thought it would be better to use Transverse Mercator:

  geoproject 'd3.geoTransverseMercator().fitSize([960, 960], d)' < se.json > se-transverse.json

The result of the project is [here]4, and it gave me the result I was hoping and expecting; all coordinates within the fitSize([960, 960] size. I am now wondering what I am missing to map this to scale. The resulting SVG I am getting after doing

  geo2svg < se-transverse.json > se-transverse.svg

is:

Which is just a tiny dot. It's the polygon, but not at scale. I thought the fitsize parameter fixed this, but there must be something else I am doing wrong.


texts: Best way to clip a large raster ECW file ?

texts:
I am trying to clip a large ECW (details below) but the raster file is too big to be processed entirely.

Some details of the ECW below

Driver: ECW/ERDAS Compressed Wavelets (SDK 5.0)

file size: 50gb
Size is 450000, 565081
Pixel size: 0.15 0.15
COLORSPACE=RGB
COMPRESSION_RATE_TARGET=9
VERSION=2
Number of bands: 4

The area I want to clip is roughly a 1/5 of the original file.

Here are the methods I have tried out with no success:

Used Arcgis to save the ecw to tiff / other formats... (I quickly gave up)
Used Qgis and its clipper tool... the file creation stayed stuck at about 40%.
Used gdal_translate out of OSGeo4W with other options than Qgis. (Tried that thinking that MAYBE freeing some memory not using Qgis would the trick)
Used gdal_retile thinking that I would cut the image into pieces and grab the one I wanted. The command
    "gdal_retile -ps  10000 10000 -of ecw -tileIndex tile.shp -targetDir input.ecw
This crashed even quicker"

Does anyone have an idea?

For info I run windows 7 64bits on an i5-3470 3.2Ghz with 16gb of ram.


texts:
I have a catalog that contains different coordinates system definitions.
I have a web interface where one should be able to see a given coordinate system extent in a google maps view.

My question is:

Given a CRS well known text, for example:

PROJCS["NAD_1983_CORS96_StatePlane_Missouri_East_FIPS_2401",GEOGCS["GCS_NAD_1983_CORS96",DATUM["D_NAD_1983_CORS96",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",250000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-90.5],PARAMETER["Scale_Factor",0.9999333333333333],PARAMETER["Latitude_Of_Origin",35.83333333333334],UNIT["Meter",1.0],AUTHORITY["ESRI",103397]]

How do I find out this CRS bounds in Lat long for example?


texts:
I wish to apply one raster (GeoTIFF) as a mask to another raster. How can I do this using GDAL tools? I'd be happy to achieve this as a virtual raster because these images are large.

Will it be necessary to customise a .vrt using a text editor, i.e.,  is there no way in gdalbuildvrt to insert a <MaskBand>? Or is the simplest approach to use gdal_calc.py to multiply the rasters together?


texts: mapbox styling of vector tiles with many features in openlayers 4

texts:
I am trying to process a vector tile source in OpenLayers using the VectorTile layer and source in OpenLayers 4.1.  The backend is serving pbf (mvt-based) tiles from an mbtiles source.  The tiles have many tens of thousands of features in some cases.

I am using the ol VectorTile layer and source, and the 'ol-mapbox-style' library to process the styles.  OpenLayers bogs down with anything other than a very simple point style - like a simple circle fill color.  Even adding a stroke slows it down, and complex data-defined styles will stall out and lock the browser (coloring based on feature attribute values).

Leaflet and mapbox-gl both process the same data without a problem.

Here is the code I am using to create the layer and apply the styling.

  var tilegrid = ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 22});
  var vLayer = new ol.layer.VectorTile({
    source: new ol.source.VectorTile({
      format: new ol.format.MVT(),
      tileGrid: tilegrid,
      tilePixelRatio: 8,
      url: "https://mydomain.www/myFeatureLayer/{z}/{x}/{y}.pbf",
    }),
    opacity: .73,
  })

  olms.applyStyle(vLayer, glStyle, 'sourceLayer').then(function() {
    self.map.addLayer(vLayer);
  });

Does anyone have insight on processing/styling large numbers of features in OL4, using a mapbox tile source, and mapbox style definitions?

I will note - after writing this, I did remove the olms library, and made the styling a very simple OpenLayers style:

  var vectorStyle = new ol.style.Style({
    fill: fill,
    stroke: stroke,
    image: circle
  });

That lets the map move again even with all these features - almost as performant as a regular map, though a bit laggy - but it would be much better if I could leverage the mapbox native styling.


texts:
Is it currently possible to download the AOI area associated to a planet account as a shapefile or kml. I think Open California follows state boundary but for other accounts with different AOI limits this would help when we are drawing regions near the AOI limit as a bounding box or cutoff. This would specifically help when drawing a smaller region of interest outside the framework of planet explorer (for example: in geojson.io or as a shapefile limit if using QGIS or ArcMap) to be used in the API.

Also I may be wrong on this but the Planet Explorer Beta does not show the AOI limits which was available in the scene explorer. However it allows us to copy the curl code which can then be modified to create a json file with filters. So an easy way might be to include the AOI limit in planet explorer as well.


texts: How to Edit Popup using Openlayers Text Layer?

texts:
I  am creating a map with about 1000+ points using Openlayers. Currently when I click on one point's icon, the description for the point shows up in a popup, and to exit the popup I need to click on the same point's icon again. Is there a way to modify the code for this so that I can press a close button or I can click anywhere on the map so that this popup will close again? I know there is a way if I am just using a regular popup but I am using an Openlayers.layer.text layer.

var pois = new OpenLayers.Layer.Text( "Frequencies",
            { location:"./frequencyrange.txt",
              projection: map.displayProjection
            });
    map.addLayer(pois);

I use this code to add the text layer. Within the text file would be the following columns: lon lat title description icon iconSize iconOffset. Is there another column that I should add for the popup? I have tried a column that was supposed to modify the size of the popup but it did not work for me. So, so far I have not been able to modify the popup except for what is in it.


texts: standalone script using grass7:v.clean gives erro

texts:
I am writing a standalone script using QGIS processing plugins. everything works but after adding a new command it gives me some errors. The command is as folloing:

processing.runalg("grass7:v.clean",
                BK3,
                2,
                dgarc,
                None,
                -1,
                0.0001,
                BK4,
                BKerror)

dgarc is a float number and is equal to 1.BK3 and BK4 are string and are correctly defined. many other processes working with the same strings. The error is as following:

Error: Wrong parameter value: None


texts:
I am working with some State Plane projections from Colorado.  I have looked them up on spatialreference.org and they are the following:

ESRI:102254: NAD 1983 HARN StatePlane Colorado Central FIPS 0502
ESRI:102654: NAD 1983 StatePlane Colorado Central FIPS 0502 Feet

I am wondering how I reference this coordinate in QGIS or FWTools using an EPSG code.  When I load this data it comes up as a User 10000 value.

Any help would be great.
Thanks...


texts:
I need to label contour lines in QGIS 2.14. I've tried a few things, including Choosing only one contour line to label in QGIS? but it labels with the IDs instead of altitude.

EDIT: I've created the contour lines using this method : loaded an MNT (RGEALTI from IGN in France that contains altitude data), then menu raster / extraction / contour
Here's the MNT image:

Labels window:

![enter image description here

EDIT: using ELEVATION instead of ID doesn't display the altitude

EDIT: I went again through the process of extracting contour lines (raster/extraction/contour lines) but this time I added a name to the attribute as suggested below by Gabriel C. And there is an error during the process.
Here's the attribute table of the layer:


texts: Projecting Bavarian NAS data using ogr2ogr?

texts:
up to December last year I used the following command to convert Bavarian NAS data to shapefiles:

"C:\Program Files\QGIS 2.18\bin\ogr2ogr.exe" "ESRI Shapefile" -skipfailures -s_srs "+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs" -t_srs EPSG:31468 NASdata.xml

The projection then was Gauss-Krueger. Since January 2019 the projection has changed to ETRS89 / UTM.

Now I wonder if it would be enough to simply replace the EPSG with "EPSG:25832" in the above command or is there anything else that must be replaced or added?


texts: Clipping algorithm that can make one layer with no overlapping polygons from N polygons

texts:
I am looking for an algorithm description / pseudo code for an algorithm that can take N simple polygons and return a new set of polygons that all have been clipped such that there is no overlap in the set of polygons.

Each input polygon will have a value attribute that should be summarized such when looking at the result set, the accumulated value can be read for each new polygon.

Any hint on how to implement it would be nice. I am working in javascript and have operations like intersect,union,different from JSTS library, alternative turf from mapbox could also be used.


texts: From trajectory of GPS points to multiline segment?

texts:
Given a trajectory as a sequence of GPS points I would like to create a smooth linestring representing a path where a car drove. The data is stored in postgresql: the input trajectory in a table, where each row represents an individual GPS point, the output in a table, where each row represents the whole smooth tragectory. All points are stored in WGS84.

My approach for this would be the following:

implement everything in C++
retrieve the whole trajectory from the DB, convert it to UTM32N (as this is where the trajectories are coming from), flatten the points with the help of GDAL library
compute a some sort of approximate spline
linearize the approximate spline
transform it back to WGS84
send the data back to Postgres

What would be the best tools/libraries to use for approximate splines and linearization?

Java/C++/Postgis solutions are preferable, as currently we are using only these subsystems.

I suppose this is a very common task people need to do in gis environment, however I haven't found close matches to similar questions on gis stackexchange.

An alternative would be to:

collect all points into linestring
ST_LineToCurve
apply Bezier smoothening to the curve
ST_CurveToLine


texts: Migration from ArcSDE (SQL Server) to PostGIS (PostgreSQL)

texts:
We've got all the geospatial information of our company within an ArcSDE Database (over SQL Server):

points (locations of the antennas),
lines (elevation, rivers),
polygons (protected areas, houses).

We consume these data with ArcGIS Desktop and with ArcGIS Server.

We are planning to migrate all the information to PostGIS (over PostgreSQL), and wonder if there is any documentation/webpage to follow some steps, and some considerations to keep in mind. Is it very hard to export the Data Model?

I've been investigating and been doing some tests with GDAL-Python scripts to read from SDE and write into PostGIS, but any experience will be appreciated.

By the way, we plan to consume the information from PostGIS with ArcGIS Desktop (along with QGIS) and GeoServer.

Thank you very much in advance.


texts: Using custom shortcut keys in ArcGIS while table of attributes is active window

texts:
I have a custom button which is made using python add-in.

I add this button in arcgis desktop and assign a new short-cut key for this button.

The problem is this button should be used while table of attributes is active.
But short-cut key only works when main acrmap window is active.

Is there any way to assign short-cut keys for custom buttons and make them work while table of attributes is active?


texts: Emptying memory after calling Geoprocessing service?

texts:
I'm following this sample for ADF libraries

http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/samples/Web_Applications/ArcGIS_Buffer_Geoprocessing/ee05ac98-384b-4dbe-b8e3-8d741180dc9a.htm

I'm practically drawing a circle around a point with a geoprocessing service. The radius is about 20 km.

The code is working fine, but the "Clear" routine isn't. Every time I clear the map from the previous data, the memory of the buffer service isn't cleared too and I get this

The code of the "Clear" routine is the same of the sample, but isn't working:

// Clears features from all graphics layers in the resource specified by _graphicsResourceName
protected void ClearGraphics()
{
    // Retrieve the resource and clear its graphics dataset
    ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource graphicsMapResource =
        Map1.GetFunctionality(_graphicsResourceName).Resource as
        ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource;
    graphicsMapResource.Graphics.Clear();

// This won't work too
GeoprocessingResourceManager1.GetResource(0).ClearState();

// Refresh the resource and copy the map's callback results to the callback results collection so
// the graphics are removed from the map
Map1.RefreshResource(graphicsMapResource.Name);
_callbackResultCollection.CopyFrom(Map1.CallbackResults);
}

This should be simple but I can't figure out how to solve this.. the only solution I found is to restart the IIS server which is obviously very bad

Can someone please help me out?


texts: Simplify/generalize Polygons and keep topology of different layers PostGIS/QGIS

texts:
i have some polygons of a country, states, districts, communities and i want to simplify the geometry.

i already simplified the geometry of each layer  but afterwards of course it doesnt fit with the geometry of the higher or lower administrative level.

i tried https://trac.osgeo.org/postgis/wiki/UsersWikiSimplifyPreserveTopology
and mapshaper.org.

any idea?


texts: Finding centre line of irregular polygons with QGIS?

texts:
I have a set of irregular and curved polygons which I would like to find the centre line of them. I've found some solutions for this problem such as Voronoi polygons but It doesn't work for me. It generates a zig-zag line with too many vertices. I used another solution creating centre lines joining the middle vertices from the short sides but it works well for straight polygons only but not for curved polygons.
Adding points along the centre lines with QGIS

Ideally, I would like a simple central line for each polygon with 2 vertices only. Either using QGIS/Graphical Modeler or Python.
My target is adding points to the centre line every 3 metres, as you can see on the  image.


texts: Transforming GeoJSON data to turf.polygon?

texts:
I want to transform GeoJSON multipolygon to turf.polygon for find point within polygon but it can't read property from GeoJSON.

Is there any way to do that?

This is my polygon data in GeoJSON:

    var RG = {"type":"FeatureCollection",
"name":"RG_0",
"crs":{"type":"name","perties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},
"features":[{
    "type":"Feature",
    "properties":{"OBJECTID":"1","LEFT_FID":"102","RIGHT_FID":"96",
    "Shape_Leng":17608.111100099999,
    "created_us":null,
    "created_da":null,
    "last_edite":null,
    "last_edi_1":null},
    "geometry":{
        "type":"MultiLineString"
        ,"coordinates"[ [ 107.74439, 15.13785 ],
                        [ 107.74435, 15.13789 ],
                        [ 107.74422, 15.13817 ],
                        [ 107.74406, 15.13853 ],
                        [ 107.74405, 15.13887 ],
                        [ 107.74396, 15.13959 ],
                        [ 107.74384, 15.14019 ],
                        [ 107.74361, 15.14078 ],
                        [ 107.74439, 15.13785 ]
                        [-46.653,-23.543],
                        [-46.634,-23.5346],
                        [ 107.4142, 14.4278],
                        [-46.613,-23.543],
                        [-46.614,-23.559],
                        [-46.631,-23.567],
                        [-46.653,-23.560],
                        [-46.653,-23.543]]

This is my code:

            var points = turf.points([
                [ -46.620,-23.545 ],
                [ 107.4142, 14.4278 ],
                [ 107.5644, 14.3850 ]
            ]);
            var searchWithin = turf.polygon(RG.features.geometry.coordinates);
            var ptsWithin = turf.pointsWithinPolygon(points, searchWithin);
            console.log(ptsWithin);

and this is my error:

OK.html:205 Uncaught TypeError: Cannot read property 'geometry' of undefined


texts: ArcGIS JavaScript API popup-show all attributes

texts:
I'm publishing services to ArcGIS server and I want to test them out in a simple HTML web map. I would like to create a pop-up window to test if the attributes are coming through. Since I will be doing this with many feature services I don't want to make a static info template. Here is the code I am using:

var infoWindow = new InfoWindowLite(null, domConstruct.create("div", null, null, map.root));
        infoWindow.startup();
        map.setInfoWindow(infoWindow);
        map.infoWindow.resize(200, 75);

        //adds information about Alameda County
       var template = new InfoTemplate();
        template.setTitle("<b>${STATE_NAME} - ${STATE_ABBR}</b>");
        template.setContent("${STATE_NAME} is in the ${SUB_REGION} sub region.");

        //adds the border around each of the states
        var featureLayer = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3", {
          mode: FeatureLayer.MODE_ONDEMAND,
          infoTemplate:template,
          outFields: ["STATE_NAME" , "SUB_REGION", "STATE_ABBR"]
        });
        map.addLayer(featureLayer);

Where it says "template.setTitle" and "template.setContent" as well as "outFields" is there a way to use a generic index like the first three fields for each feature class?


texts: Embedded Geofence and standalone geofence

texts:
I am using 2.11.0 version of both Geofence embedded and Geofence standalone applications running in different ports. In embedded, for a user, I am able to provide both read and write access for a workspace.

But, in geofence standalone application, I am not able to give write access for that particular workspace.If admin is enabled for that user, then that user is provided with full admin access(all workspaces are visible like admin user)

Is it possible to provide both read and write access for a particular workspace using standalone geofence (like embedded geofence) ?


texts: Importing Tilemill produced mbtiles to CouchDB

texts:
I'm using MapProxy to seed a CouchDB with tile images on a FreeBSD server.

My workflow is Tilemill -> mbtiles export -> mapproxy seed -> CouchDB.  For zoom levels 10 - 17, rendering takes ~ 2-3 days, but produces a quite small db file @ ~2mb.  I attribute this to the large spaces with no data and the use of link_single_color_images: true

In an effort to speed the rendering process up, I have tried rendering with mapnik.xml as my source instead of the mbtiles produced by Tilemill.  All good with a tremendous speed up, but at the cost of a database that is 20x larger due to MapProxy producing a tile for every z/x/y.  Most of the thousands of tiles produced are transparent with no data.

Aka link_single_color_images: true does not seem to be working with Mapnik source, but does with mbtiles as a source.

Is there a way to use link_single_color_image with Mapnik?


texts: Find Selected Feature in Attribute Table

texts: I'm familiar with how to select a feature by highlighting it in the attribute table, but can you do the reverse? Click a feature on the map, and have it become highlighted in the attribute table?


texts: How to create georeferenced dataset from georeferenced satellite image?

texts:
I downloaded a nighttime light composite satellite image (https://ngdc.noaa.gov/eog/dmsp/downloadV4composites.html#AVSLCFC) which uses a scale for light intensity from 0 (no light) to 63 (max light). I cropped it to Chinese boundaries, using a boundary shapefile in QGIS.

Because I want to use the night time light as proxy for econ activity in Chinese cities, the ultimate goal is to have a datset of 3 columns (latitute, longitude, light intensity) for each raster of my satellite image, so that I can then allocate light aggregates to Chinese cities (I have a shapefile of all Chinese city-level admin regions).

So far, I have tried the following in R:

install.packages("magick")
library(magick)

i <- image_read('satellite.tif') # read in the image
i_array <- as.integer(i[[1]]) # save as array (list)

I then converted the array into csv format to have a better look at it.

write.csv(china_sat_array, file = "china_sat_list.csv")

Unfortunately, the csv file only contains zeros and sometime the value 255 (which is the value for missing data in the original tif image).

Does anyone have an idea what I'm doing wrong or an alternative how to end up with the desired three columns?


texts: Exporting whole map from ArcMap to GeoTIFF not just current view?

texts:
I like to export my whole map which is composed of both raster and vector data to geotiff (or other raster format) in ArcMap 10.1. If I select file->export, only the current view is exported. I want to export the whole map in for instance the 1:100 000 scale.

Does anyone know how to do this?


texts: How to iterate "Cost Path as Polyline" tool using ArcPy?

texts:
I have an optimization GIS problem to be solved. I want to use genetic algorithm to solve it in Python so I have to iterate  my script many times. Recently i have realized that "Cost Path as Polyline" tool which i have used in my script, results in empty feature classes, However when I implement the tool manually in ArcMap 10.6.1, it works properly with the same datasets. My script is too long to write it down here. The following code is similar to my code and leads into the same problem.
Do you know why this happens or know a solution?

import random
import arcpy

arcpy.env.workspace=r'G:\PTest.gdb'
arcpy.env.outputCoordinateSystem=arcpy.Describe("Wetland").spatialReference
arcpy.CheckOutExtension("Spatial")

def createlines():
    fcname="points1"
    i=1
    while arcpy.Exists(fcname):
        fcname="points"+str(i)
        i=i+1

    arcpy.CreateFeatureclass_management('G:\PTest.gdb',fcname,'POINT')
    cursor = arcpy.da.InsertCursor(fcname, ["SHAPE@XY"])
    for t in range(4):
        cursor.insertRow([(random.randint(1263153,1275580),random.randint(792226,804579))])
    arcpy.sa.CostPathAsPolyline(fcname,
                                'cost_distance',
                                'cbacklink_raster',
                                'lines_'+fcname,
                                'EACH_CELL',
                                'OBJECTID')

for x in range(4):
    createlines()


texts:
I have an icon that 4px by 4px and I use it as a marker. However I want to display it larger than 4x4, lets say 40px x 40px for example. Here is my code
var iconStyle = new ol.style.Style({
                image: new ol.style.Icon(({
                    size: [40, 40],
                    offset: [-20, -20],
                    //anchor: [0.5, 1],
                    src: "/images/historymarker.png",
                    opacity: 1,
                    id: num + "_" + x
                }))
            });
            marker.setStyle(iconStyle);

However the icons comes out as it original size, Is there a way to resize it? I thought that size would have done it.


texts: How to modifiy how selection highlights are displayed?

texts:
I have got a layer of points that are showed with a little symbol. When I select one, a red square comes around it. The problem is that these points are inside other layers (polygons) and some of them are red too. I would need to change the color of this square and the width, so that it becomes easily visible.

I could not find anything related to this in the documentation, neither in the asked questions.

I already tried this, but it doesn't affect the red square that remains exactly the same.  My selection colour is setted to Blue under the Project's properties and the square is still red.

And one thing that could be really useful for me, would be to have the width of the square's lines increased.

Do you have an idea for that?


texts: Attribute names changed in symbols after running distance tool

texts:
I'm struggling to understand why names in one column of my attribute table are changed into symbols after performing the distance to nearest hub (line to point) tool in QGIS 3. My reference shapefile I perform the tool with has a series of GPS points, and a name (in French) for each point as shown below:

The encoding is set as UTF-8
Then, once the tool has finished running I have this in my attribute table:
The encoding is still set to UTF-8 but now where all the tonic accents are, I have those symbols appearing. Any insight on what I may be doing wrong?


texts: Geometry Operands - BBOX vs Within - What's the difference?

texts:
What is the difference between the "BBOX" and "Within" spatial operators.

Can anyone please shed some light?


texts: Can you set a QGIS print composer to render the map as default?

texts:
I have set up a number of templates for the print composer in QGIS.

In the Print Composer, there is the option to have the map image displayed in 3 ways:

as a blank rectangle with no updates until it is output
as a manual refresh based on cache
as a rendered refresh

When my templates are opened, the map image loads as a blank rectangle by defualt, is there a way either in QGIS settings or in the template itself to force the map image to load as "Cache" or "Render" without having to manually change this?


texts: Convert Google Street View urls from OLD to NEW

texts:
My website accepts google street view links as submissions.
Google has updated the url format some months ago.

Does anybody know how the old format is converted into the new format (and vice versa)?

There are some parts obviously in common, others I cannot associate.
Here is an example of what the urls look like.

OLD:
https://maps.google.com/maps?ll=8.253284,-75.570099&spn=0.18,0.3&cbll=8.253284,-75.570099&layer=c&panoid=5_ZZUCFHDYJsB1ZUtJbNYg&cbp=,42.83,,3,4.169998

NEW:
https://www.google.com/maps/@8.253284,-75.570099,3a,15y,42.83h,85.83t/data=!3m4!1e1!3m2!1s5_ZZUCFHDYJsB1ZUtJbNYg!2e0


texts: How to create a FeatureCollection with the values stored in an Array on Earth Engine?

texts:
I applied an unsupervised classification to a collection of Sentinel 2 images and used ReducetoVector() within a loop to obtain each class of the Unsupervised classification as a different object.

Afterwards, I was able calculate the mean of Reflectance inside each different class obtained using ReduceRegion() wihin another loop, and I have those values stored into an array.

I want to export those values to my Drive as a CSV file but to do that using 'Export.table.toDrive' it seems that I need to create FeatureCollection with the values stored in the array, and that's what I'm not being able to do. Here's a bit of the code:

var mediana = colecao.median();
var regiao = ee.Geometry.Polygon(lagoa);

//treinamento
var treinamento = mediana.sample({
  region: lagoa,
  scale: 10,
  numPixels: 5000,
});

//define o tipo de cluster que será usado e parametros de treinamento
var agrupamento = ee.Clusterer.wekaXMeans(15,20).train(treinamento);

//diz qual cluster usar na imagem
var resultado = mediana.clip(lagoa).cluster(agrupamento);

//separando cada classe de cluster
var poly = [];
for (var i = 0; i < 11; i += 1){
//define o contador
var contador = ee.Number(i);
var subset = resultado.select("cluster").eq(i).selfMask();
poly[i] = subset.reduceToVectors(null, lagoa, 10);
//Map.addLayer(subset.randomVisualizer(), {}, 'only_'+i.toString());
}

var media_p = [];
for (var i = 0; i < 11; i += 1){
media_p[i] = mediana.reduceRegion(ee.Reducer.mean(), poly[i], 10, null, null, false, 1e13);
print('media_p'+i.toString(), media_p[i]);
}

Export.table.toDrive({
collection: TBD,
description:'media_clusters',
folder: 'GEE',
fileFormat: 'CSV',
});

I've tried quite a few things and none of the worked. Can somebody guide me on how to proceed? Thank you.

Here is a link to the full code if needed: https://code.earthengine.google.com/72926cb481767d1b58ed7e31cf52c611


texts:
I am using Qgis 1.9 . I have downloaded a plugin "mm  qgis", however When I run this plugin I am getting following error:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:\Documents and Settings\15491/.qgis2/python/plugins\mmqgis\mmqgis_dialogs.py", line 525, in run
    message = mmqgis_geometry_convert(self.iface, layername, newtype, splitnodes, savename, 1)
  File "C:\Documents and Settings\15491/.qgis2/python/plugins\mmqgis\mmqgis_library.py", line 1154, in mmqgis_geometry_convert
    layer.dataProvider().select(layer.dataProvider().attributeIndexes())
AttributeError: 'QgsVectorDataProvider' object has no attribute 'select'

Python version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.9.0-Master Master, 1a723b4

Python path: ['C:\Documents and Settings\15491/.qgis2/python/plugins\sextante_taudem', 'C:\Documents and Settings\15491/.qgis2/python/plugins\sextante_animove', 'C:\Documents and Settings\15491/.qgis2/python/plugins\sextantelwgeomprovider', 'C:\Documents and Settings\15491/.qgis2/python/plugins\sextanteexampleprovider', 'C:\Documents and Settings\15491/.qgis2/python/plugins\sextante', 'C:\Documents and Settings\15491/.qgis2/python/plugins\permaclim', 'C:/OSGeo4W/apps/qgis-dev/./python', 'C:\Documents and Settings\15491/.qgis2/python', 'C:\Documents and Settings\15491/.qgis2/python/plugins', 'C:/OSGeo4W/apps/qgis-dev/./python/plugins', 'C:\OSGeo4W\bin\python27.zip', 'C:\OSGeo4W\apps\Python27\DLLs', 'C:\OSGeo4W\apps\Python27\lib', 'C:\OSGeo4W\apps\Python27\lib\plat-win', 'C:\OSGeo4W\apps\Python27\lib\lib-tk', 'C:\OSGeo4W\bin', 'C:\OSGeo4W\apps\Python27', 'C:\OSGeo4W\apps\Python27\lib\site-packages', 'C:\OSGeo4W\apps\Python27\lib\site-packages\PIL', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32\lib', 'C:\OSGeo4W\apps\Python27\lib\site-packages\Pythonwin', 'C:\OSGeo4W\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Documents and Settings\15491\.qgis2\python\plugins\mmqgis/forms', 'C:\OSGeo4W\apps\qgis-dev\python\plugins\fTools\tools', 'C:\Documents and Settings\15491\.qgis2\python\plugins\pdokbaggeocoder/forms']
 what is the mistake?


texts: Dissolve polygon by attribute or featurecollection by property in Google Earth Engine?

texts:
I would like to dissolve a polygon/featurecollection in GEE to run some statistics by the country level. I have tried union and dissolve and cannot find a solution. Union dissolves everything to get the boundary of all polygons. How can I dissolve by a property in GEE? It would be similar to dissolve by attribute in ArcMap/QGIS.

//Purpose: Dissolve featurecollection by a property

//Name WDPA variable
var WDPA = ee.FeatureCollection("WCMC/WDPA/current/polygons");
print(WDPA.first(), 'WDPA'); //28 properties
Map.addLayer(WDPA, {}, 'WDPA'); //adds featurecollection to map

//Union using the property
var WDPA_union = table.union('ISO3'); //ERROR: Invalid argument specified for ee.Number(): ISO3
print(WDPA_union.first(), 'WDPA Union by ISO');
Map.addLayer(WDPA_union, {}, 'WDPA Union by ISO');

//Dissolve using the property
var WDPA_dissolve = WDPA_ISO.dissolve('ISO3'); //ERROR: Cannot read property 'dissolve' of undefined
print(WDPA_dissolve.first(), 'WDPA Dissolve by ISO');
Map.addLayer(WDPA_dissolve, {}, 'WDPA Dissolve by ISO');

link code


texts: Seeking Literature on coordinate transformations?

texts:
I am looking to hone my skills in the theory and the mathematicas involving the projections systems, projection transformations ( from xy to uv, φλ and vice versa).

Can you share the books/pdfs/online-references that you have read and found them useful?


texts: ST_Covers: Geography Implementation is not working, Geometry Implementation taking too long

texts:
I have a query: (This query uses geographical implementation of ST_Covers function)

SELECT ST_Covers(ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89)))'),ST_GeographyFromText('POINT(20 30)'));

When I run this query it should return true but it returns false. I don't know whats wrong with PostGIS (or with this query). When I change the geographical implementation with geometrical one, and rearrange the query to be like below:

SELECT ST_Covers(ST_ASTEXT(ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89)))')),text('POINT(20 30)'));

This query works as it should, returning true:

I can use this query to be content but the problem is when database is large it takes too much time. Can someone tell me

how to make query 1 to work right (as intended, returning true)? or
how to make query 2 work fast with large tables?

(please do not suggest that i should remove ST_GeoGraphyFromText('MULTIPOLYGON(((179 -89,179 89,-179 89,-179 -89,179 -89) because it only represents geographical data that will be replaced by data from the column of table )

Other values which fail with query 1, are (5 5) (10 10) (-10 -10) (and many more)


texts:
This is a bit of a cry for help as I’m still quite new to this.

I am looking to create a thing that can validate some specific parameters for TIFF and TFW files, preferable using python, FME or something similar.

It is a TIFF file
TIFF file size – This should be equal to or greater than 46MB – Equal to or less than 47MB
TIFF dimensions – they should be 4000 * 4000 pixels in size
It has three colour bands
It has an associated, valid TFW file

I’ll roughly have to check 100 TIFF and 100 TFW files at a time.

The TIFF and TFW files have the corresponding 1KM grid reference as their names, for example I have TQ7926.tif and TQ7926.tfw.

What would be the best way to achieve this? I’m happy to answer any questions to assist with the answering of my question.

My python GDAL knowledge is pretty poor, so i've had ago in FME.
See my fmw here

I'd really appricate any feedback on it or suggestions to make it quicker/tidier/better. It needs to be used on a directory of folders containing TIFFs


texts: Highlight duplicates at nearest distance

texts:
I have a point shapefile with several names and there are a lot of duplicate names in the data.
I want to highlight the nearest duplicates in the data.
How can I solve that in QGIS?


texts:
I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App using xml. The datasource come from spatialite 4.0. My tiling script can render polygon and point features correctly but linestring are just not displayed. The tiles are empty, without error. I can see the background of the tiles, but no trace of any lines when zooming in and out.

Does anybody have an idea what could be the problem?


texts: Creating a layer with selected values (divided by commas) from another layer - query or model needed

texts:
I have a very large dataset in ArcMap 10.6 and I would like to create a subset that selects only rows that have specific attributes (some of them with special characters) from a field that in my case has a list of multiple codes and words.

Example:

Let's say that I want a dataset that contains only the rows with the code BMX-3000 and INDEX-AB, but not other values.

Can anybody suggest me a relevant code query or model creation steps?


texts: Why do the components loaded by using WMS and WFS from GeoServer not the same?

texts: I have tried to load shape files into GeoServer, but by loading into QGIS, the WMS and WFS versions are not the same. The WMS version seems like correct. They are both loaded by using WGS84. Do you have any suggestions?


texts: Merging attributes from parcels within a census tract

texts:
I am working with land parcel data and Arcmap 10.1. Each land parcel has a code (1,2,3,4) depending on the type of water supply source that it uses. I am trying to take a tally of each code within each census tract. I've been able to devise a very primitive method to do this:

Load parcel layer (points) and census tract layer (shapes)
Select one census tract, and use "Selection by Location" to select all parcels that fall within the census tract.
Open attributes table
Copy and paste into Excel
Use Excel to get the sum

There are around 4000 census tracts, and I would have to do this for every parcel. I then tried spatial join. However, there are too many data points for the computer to handle.

Once I can get a spatial join, then it would be very simple. I have other data that is much more manageable, and I tried spatial join and tallying up the data by forming a new field on the attributes table, and it worked.

The main problem is that spatial join is taking way too long.


texts: Return all results within a 2km,5 and 20km radius of a specific lat/long point?

texts:
I am using the below query for calculation but I don't know how to pass
the radius first time I need 2 km and in second query need 5 km and so
on:

SELECT *
FROM pwd_roads AS r
WHERE ST_Distance_Sphere(r.geom, ST_SetSRID(
        ST_MakePoint(75.083333, 29.583333), 4326)) < 8


texts: How to stop ArcGIS Python script printing warnings and other outputs to the console

texts:
I've written a Python script using arcgisscripting to do various processing steps on some data. I'm planning to run it from a stand-alone command-line window (ie. not within ArcGIS at all) and, as such, have a number of print commands in my code to show its status.

However, when I run it from the console I also get a number of other things printed to the console including warnings (such as a warning that my data has no projection) and the full output of the Nearest Neighbour calculation command. These aren't needed, and will clog up the output (I'll be running this as a batch job with the output piped to a file).

Is there any way to get rid of these? I was hoping for a gp.quiet = true command or a gp.silent = true, but can't seem to find any of those. Any ideas?


texts: How to display tiles from a GeoWebCache cache directory in Leaflet?

texts:
I'm trying to publish the cached data in geoserver with a leaflet. However, the data does not appear when publishing the cached data.

var map = L.map('map').setView([55.42, 53.50], 6);

    var wmts = L.tileLayer('C:/Program Files(x86)/GeoServer 2.15.1/data_dir/gwc/web/{z}/{x}/{y}.png', {
        wmts: true,
    });
    wmts.addTo(map);

the data I have cached (I got the images until the 10th zoom):

where could i have made a mistake ?


texts: Setting transparency in background colors of neatline fame?

texts: Is there an easy way to set transparency levels in background colors of a neatline frame or any other frame for that matter in ArcGIS?


texts: How do I convert IGb08 coordinates into an ECEF frame?

texts:
I'm relatively new at GPS positioning, and have come across precise orbital calculation files here. I've parsed the sp3 files and gotten the values into something I can work with, but I don't know much about the coordinate systems used. Is there a simple way to convert from the IGb08 or IGS14 system to the ECEF system that GPS uses? I'm working in Python, and any libraries or code would make life easier.

I've looked at the ITRF website, but don't know what SINEX files are, or what they're talking about, really.


texts:
https://underjollyroger.github.io/EarlyIllinoisLandcover/#9/41.5774/-88.0609
Why are there coordinates showing up in the url of this repository? And is there a way to get rid of them? The repository is a leaflet map that was exported via the qgis2web plugin in QGIS. I'm using a Mapbox API key for the geocoder and the map tiles.


texts: Reprojecting a raster to match another raster using GDAL

texts:
How do I automatically reproject a map in GDAL (or using gdalwarp/gdaltransform etc.) to match the projection of another map? I do not want to read the projection manually and give it as input.

Basically, I would like to do something like:

gdalwarp -source map1.tif -get_projection_from map2.tif -output out.tif


texts: ArcGIS Enterprise Registered Database Changed - Update Source Without Republishing All Layers?

texts:
I have around 50 feature and map layers published in ArcGIS Enterprise (the same would apply for ArcGIS Online) that reference registered PostGIS database. The database will be migrated (same names, same structure, just the host will change). My hope is to avoid republishing every single layer one by one using Overwrite Web Layer or comparable sharing tool in ArcGIS Pro.
I researched everything possible and tried it out -  available ArcGIS tools like "Manage Registered Data Stores" and updating the host in there. That does not update it in the published web service (that one still points to the old data store).

I played around with ArcGIS Assistant's "Update the URLs of Registered Apps and Services" function but that one also keeps the web service pointing to the old data store.

Is there a way to update my new database host without having to republish all of the ArcGIS Enterprise layers? Maybe programatically.