texts: Python: distance of point to polygon border

texts:
I want to measure the distance of a point(lat,long) to a the border of a Polygon.
So I have created the polygon with the coordinates.

from shapely.geometry import Polygon, Point
Polygon(zip(lon_list, lat_list))
pol.exterior.distance(some_point)

This gives me some value but no idea what it actually tells me (meters??). Any advice on how to get this.
Any advice on how to calculate the distance from a point to the border of a polygon in Python properly? Or getting the closest point of the border from the starting point would also be more than enough.


texts:
I have made a script for multiple clipping raster images with a shapefile as follow:

##Clip Multiple Rasters with Vector=name
##Utilities=group
##RASTERS=multiple raster
##VECTOR=vector
##OUTPUT=folder

import os
import processing

lddLrs = RASTERS.split(';')
for lyr in lddLrs:
    processing.runalg('saga:clipgridwithpolygon', str(lyr),VECTOR,OUTPUT+"/clip_"+ str(os.path.basename(str(lyr))))
    processing.load(str(OUTPUT + "/clip_" + str(os.path.basename(str(lyr)))))

It was working perfectly, but now I am having problems with the 'processing'

The error is the following:

2018-09-15T10:41:39 2   Uncaught error while executing algorithm
            Traceback (most recent call last):
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute
                self.processAlgorithm(progress)
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\script\ScriptAlgorithm.py", line 378, in processAlgorithm
                exec((script), ns)
              File "<string>", line 13, in <module>
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 75, in runalg
                alg = Processing.runAlgorithm(algOrName, None, *args, **kwargs)
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\core\Processing.py", line 252, in runAlgorithm
                processing.alghelp(algOrName)
              File "C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 68, in alghelp
                print unicode(alg)
            IOError: [Errno 9] Bad file descriptor

Any suggestion to solve it?


texts: Find distance of a point relative to a line in geographic coordinates

texts:
Suppose there is a spherical rectangle for which I have the lat, long coordinates for each corner. Additionally this rectangle has a center line for which I know the lat, long coordinates of the start, mid and end point (see image below)
If you're given a lat, long of a new point (orange circle) is it possible to find the lat, long of the orthogonal intersection with the center line? I know this is pretty easy using cartesian coordinates. But I'd prefer to stick with geographic coordinates since I need to get a very precise distance measurement.

EDIT: So far the only idea I have is to make a grid referenced to the edges and interpolate between them. I plotted the result and it's a little bit off. I'm using the answer from this question


texts: dojo/request a png image array buffer using NodeJS, and return the image to the client

texts:
I am attempting to request a png image using NodeJS and dojo/request from an ArcGIS Server REST feed, and return the image to the client.

I need nodeJS to add a token to the request as a query parameter as my services are secured and I want to control their security through node and not on the resource server (ArcGIS Server 10.3). Without nodeJS in the picture, the png loads in the browser. This is an (open) example of a call returning a png image, using their standard REST feed: https://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/MapServer/1/images/257104fa1b21d7b483c160ee8f3943bb

I am using dojo/request to access this resource. It seems the png image is coming back to node fine, however when I res.send() back to the client, I get a 'not an image' in Fiddler. I can see the PNG header, and the IHDR and IEND in the hexview, however it is apparent that the encoding (? or other) is not the same as when the resource is returned directly from the ArcServer. When the png is received on the client returned from node, the content-length is a little less than when the same png comes directly from the ArcServer. (Node is attempting, by its default, to use Transfer-Encoding: Chunked. I set content-length to the length of the response, so it sends at one time, which I believe is the behaviour the client is expecting.)

ESRI (ArcGIS Server) have a new sample stub out which does exactly what I want to do, however they are using esri/request (built on dojo/request) client side, and leverage Blob library to create the correct response for the client. https://developers.arcgis.com/javascript/jssamples/data_requestArrayBuffer.html

We can see they use handleAs: "arrayBuffer", which I have tried on dojo/request and it seems to make no difference to the content of the returned png. When they receive the response, they make a new Blob and then read it as data URL with FileReader (which I have a node side implementation of) and directly use that result as the png.

I have tried ad-nausuem to replicate this, but it seems that node does not have a reliable Blob library (I have tried "Blob" with no luck) and I read that in node you are supposed to use Buffers instead. No matter what I pass to fileReader, I get the error "Cannot read as File" (I have tried all fileReader methods). The fileReader library: https://www.npmjs.com/package/filereader

ESRI code:

esriRequest(url, {handleAs: "arrayBuffer"}).then(function(response) {
    reader.readAsDataURL(new Blob([response], {
        type: "image/png"
    }));
    //reader.result is png ready to use client side
});

My attempts:

//tried handleAs: "arrayBuffer"

//tried npm Blob library

request(url, {handleAs: "arrayBuffer"}).then(function(response) {
    var reader = new FileReader();
    reader.addEventListener("loadend", function() {
         res.setHeader('Content-Type', 'image/png');
         res.setHeader('Content-Length', reader.result.length);
         res.send(reader.result);
    });
    reader.readAsDataURL(new Blob([response], {
        type: "image/png"
    }));
});

I am using node package filereader and Blob, with no luck creating a blob to pass to fileReader. If nodeJS uses Buffers instead of Blob, given that the content returned by the service appears to be an ArrayBuffer png, how do I pass that back to the client, through node?

I have also attempted to use ArrayBuffer to Buffer methods (through Uint8Array) however once I have the png in buffer form I can never read it.

In short, I just want to proxy the png from its source to the client, adding a token query parameter.

Comments welcome to improve the question.

Cross posted:

https://stackoverflow.com/questions/34341327/dojo-request-a-png-image-array-buffer-using-nodejs-and-return-the-image-to-the

https://geonet.esri.com/message/575847#575847


texts:
Is ArcMap 10.7.1 a 32- or 64-bit application?
I am familiar with 64-bit ArcGIS Pro, but not ArcMap.


texts: How do I add a CartoDB layer to a MapBox map?

texts:
I'm having some trouble adding a CartoDB layer to an L.mapbox.map, I thought it was a pretty simple thing to do in the HTML but it's just not working and I don't know why. My CartoDB layer has vector tiles whose info window opens to a clickable link. My map is a MapBox map that has imagery and streets layers from my MapBox account and the mapbox.places geocoder control.

The code is below and I am hoping someone out there can help me figure out my mistakes because all I am getting is a grey screen and it's a puzzle I'm having a nightmare trying to solve.

<meta charset=utf-8 />
<title>Tiles Map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-   scalable=no' />

<link href='https://api.tiles.mapbox.com/mapbox.js/v2.2.1/mapbox.css' rel='stylesheet' />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />


texts: GEOS geoprocessing error when using difference tool in QGIS

texts:
I am using QGIS version 3.14.0. I have about 20 polygon .shp-files with overlaps between files. All are in the same projection. I've been using the difference tool to remove the overlaps and then merge the files to create one shapefile. This process works well for about 6 files, then I get an error that says:

GEOS geoprocessing error: difference failed

I've tried to restart the process at the dataset that causes the error, and am able to continue for a few years until the error comes up again. Online research suggests two things:

Geometry or topology is causing the error.
The difference tool may be maxing out computer memory causing a failure.

Has anyone else worked through this error before and has a fix?


texts:
I have massive problems with my ArcGIS 10.3.1 installation since a week. My ArcMap crashes on start without any message. ArcCatalog crashes in opening the customize-dialog opening the tab commands.

Last thing i have done before the problem orccurs was to install the odac because i want to create an ole db connection to an oracle-service.

Now i deinstalled the odac, cleared the user-templates(mxt and gxt a.s.o), i deinstaled arcgis, cleaned up the registry, installed arcgis 10.3 again, installed arcgis 10.3.1 but nothing helped. My Win 7 is up to date, what can i do, i'm very frustrated.


texts: All contours are not getting converted to shapefile in python

texts:
I am trying to create isoline plot for a weather parameter. Inputs are Lat, Lon and Value. They are read from csv file. When I plot the contours using matplotlib, the code works fine and generates desired output. In addition I want to generate shapefile of this contours instead of image plot. When i tried to generate a shapefile only few of the contour lines are getting written to shapefile.

import os
import numpy as np
import pandas as pd
from matplotlib.mlab import griddata
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
from shapely.geometry import mapping, Polygon, LineString,MultiLineString
import fiona

# set up plot
plt.clf()
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, axisbg='w', frame_on=False)

# grab data
data = pd.read_csv('Filename.csv', sep=',')
norm = Normalize()

# define map extent
lllon = -180
lllat = -90
urlon = 180
urlat = 90

# Set up Basemap instance
m = Basemap(#projection = 'merc',llcrnrlon = lllon, llcrnrlat = lllat, urcrnrlon = urlon, urcrnrlat = urlat,resolution='h', epsg=4326)
# transform lon / lat coordinates to map projection
data['projected_lon'], data['projected_lat'] = m(*(data.CLON.values, data.CLAT.values))
# grid data
numcols, numrows = 100, 100
xi = np.linspace(data['projected_lon'].min(),data['projected_lon'].max(), numcols)
yi = np.linspace(data['projected_lat'].min(),data['projected_lat'].max(), numrows)
xi, yi = np.meshgrid(xi, yi)

# interpolate
x, y, z = data['projected_lon'].values, data['projected_lat'].values, data.PRES.values
zi = griddata(x, y, z, xi, yi)

# contour plot
cs = plt.contour(xi, yi, zi,zorder=4)
plt.show()

#Create a shapefile of contours with linestring
lenvar = (len(cs.collections))   #number of contours
print(lenvar)
lines = []  # Empty list for contour sections

for i in range(lenvar):
  n = i
  p = cs.collections[i].get_paths()[0]
  v = p.vertices # getting the individual verticies as a numpy.ndarray
  x = v[:,0] #takes first column
  y = v[:,1] #takes second column
  line = LineString([(i[0], i[1]) for i in zip(x,y)])  #Defines Linestring
  lines.append(line) #appends to list

schema = {'geometry': 'LineString','properties': {'id': 'int'}}  # sets up parameter for shapefile

 with fiona.open('ConShp.shp', 'w', 'ESRI Shapefile', schema) as c:  # creates new file to be written to
 for j in range(len(lines)):
  l = (lines[j])   # creates variable
  print(l)
  print(type(l))
  c.write({'geometry': mapping(l),'properties': {'id': j},})

I want to generate SHP file similar to plot file generated by python matplotlib.


texts:
I have extracted pixel value ( pixel value=200 for snow) from MOD10A2 snow product for my study area.
Since MOD10A2 product is distributed every 8-days. i.e., 9th Jan, 17th Jan, 25th Jan,2nd Feb,.... I need to have daily snow cover area to input for the model.
However, some papers have mentioned about the linear interpolation technique to determine the snow cover area of missing days between to give date.
I am looking for your kind help to solve my problem, so I have the snow  cover area on daily basis to get snow depletion curve.


texts:
I'm following the steps on this page:

"https://github.com/mapsme/omim/blob/master/docs/MAPS.md",

"https://github.com/mapsme/omim/blob/master/docs/INSTALL.md"

When I run this line "omim / tools / unix / generate_mwm.sh source.pbf any_random_string_asdf" I do not have an error, then I run qt and maps.me application is opened but when I click on the route nothing happens.

What do I have to do?

In this link "github.com/mapsme/omim/blob/master/docs/INSTALL.md" , below the page says this:

The version and file sizes of all mwm and routing files should be put into data / countries.txt file.

I do not know what changes to make.


texts:
I have a grid of cells with different values:

I would like to analyze a group of 5 cells to check if they have the same values (group S1 and S3 display same value for all cells, not S2). This analysis would be for each cell from which the following cells (spatially very close) would form a group if they share the same value.

I thought about doing it first by using a square grid from which I compare (with Python) the value of a cell at (i,j) position, with those at (i,j+1), (i,j+2) ... on same line, and at (i+1,j), (i+1,j+1) ... (i+2,j), (i+2,j+1) ... and so on, for other lines. However, the grid is not a square.

I am looking for an alternative by using Python or other methods. Is it possible to do it using the cell coordinates instead (neighborhood analysis)?

(the end of the study would be to plot a point in the middle of the square group)


texts: Converting GML to Geodatabase Feature Classes?

texts:
I have a series of XML files containing GML tags such as :

<gml:posList srsDimension="2">454780.3125 525867.9375 454762.0625 525994.5625

and I need to convert these into ESRI feature classes.

How would I start to import them?


texts: QGIS constrain move by vertex along an x or y axis

texts:
In QGIS, is there a way to constrain a 'move by vertex' along the x or y axis?

In the picture below, I would like to constrain the edit movement along the y-axis  as shown in the bold red dashed line. (THIS IS WHAT I WANT.)

The default 'floaty' behavior is shown by the thin red line & NOT what I want in this case.


texts: Seeking for a solution to convert GeoTIFF to 3d WKT

texts:
I am trying to convert some DEM in .tif image to polygon geometries representing 3 dimensional triangles that is Well-known text (WKT) - 3D (x, y, z)

I was able to use SAGA to convert my GeoTIFF image to TIN, but what really wanted is a WKT format as stated above.

How do I do this is in QGIS, SAGA, GDAL, PostGIS or any other open source solution?


texts: Finding point on line closest to other point: unexpected results

texts:
I'm basically trying to do the same thing as outlined here: Finding the point closest to a point on a near feature

However, the results I'm getting with the queries suggested in the accepted answer don't make sense. Here's a screenshot of (a part of) my data, a bunch of points and lines:

The first step is to find the line closest to a given point:

select "p"."id"  pid,
"l"."id"  lid,
min(Distance("p"."geom","l"."geom")) as distance
from "net_clipped" p, "ver01_l_clipped" l
group by pid
order by pid;

The results contain only one line id and the distance seems to be wrong:

pid    lid       distance
1      724       3.19983e+07
2      724       3.19995e+07
... and so on

The actual distance of the points to the next line should be just a few meters.

The data came from two shape files that I imported into a spatialite database using QGIS' database manager. They look fine in both QGIS 2.14 and ArcMap 10.3. I'm running the queries with QSpatiaLite.

What's wrong here?


texts: How to set decimal precision in shapefile via javacode

texts:
we are using the below code :

    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.setName("Location");

    String wkt =  "GEOGCS[" + "\"GCS_WGS_1984\"," + "  DATUM[" + "    \"D_WGS_1984\","
    + "    SPHEROID[\"WGS_1984\",6378137,298.257223563]],"
    + "  PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
    + "  UNIT[\"Degree\",0.017453292519943295,AUTHORITY[\"EPSG\",\"9122\"]],"
    + "  AXIS[\"Lat\",NORTH]," + "  AXIS[\"Long\",EAST],"
    + "  AUTHORITY[\"EPSG\",\"4326\"]]";

    CoordinateReferenceSystem crs = CRS.parseWKT(wkt);
    System.setProperty("org.geotools.referencing.forceXY", "true");
    builder.setCRS(crs);

    builder.add("the_geom", Point.class);

    builder.length(15).add("ID", Long.class);
    builder.length(4).add("FEATTYP",Integer.class);
    builder.length(1).add("IMPORT",Integer.class);
    builder.length(3).add("ARNAMELC",String.class);
    builder.length(240).add("NAME",String.class);
    builder.length(150).add("STNAME",String.class);
    builder.length(3).add("STNAMELC",String.class);
    builder.length(15).add("HSNUM",String.class);
    builder.length(10).add("POSTCODE",String.class);
    builder.length(15).add("MUNID",Long.class);
    builder.length(11).add("MUNCD",String.class);
    builder.length(100).add("MUNNAME",String.class);
    builder.length(100).add("BUANAME",String.class);
    builder.length(25).add("TELNUM",String.class);
    builder.length(25).add("FAXNUM",String.class);
    builder.length(70).add("EMAIL",String.class);
    builder.length(150).add("HTTP",String.class);
    builder.length(70).add("COMPNAME",String.class);
    builder.length(15).add("CLTRPELID",Long.class);
    builder.length(6).add("RELPOS",Double.class);
    builder.length(50).add("EXTPOIID",String.class);
    builder.length(15).add("ADDRPID",Long.class);
    builder.length(7).add("SUBCAT",Long.class);
    builder.length(2).add("GAL",Integer.class);
    builder.length(1).add("POSACCUR",Integer.class);

    final SimpleFeatureType LOCATION = builder.buildFeatureType();
    return LOCATION;
}

I need decimal precision value in RELPOS column as XXXXXX.XXX (6,3). how can i do from java code can any one suggest


texts: QGIS EPSG value differs from ArcGIS and spatialreference.org

texts:
Background:

I have both QGIS 3.4.1 and ArcGIS Desktop 10.6.1 installed on the same laptop, Windows 10.

I have a polygon shapefile that is projected to Lambert Conformal Conic.  Arc states that the shapefile's EPSG value is 102004.  Here's a screenshot from the Arc Layer Properties:

spatialreference.org agrees with Arc; 102004 is Lambert Conformal Conic:

So far, so good!

Problem:

QGIS states that this layer's EPSG value is different: 100027.  Here's a QGIS screenshot:

But wait, there's more!  spatialreference.org does not have an entry for 100027.  Here's a screenshot:

Question:

Why doesn't the QGIS EPSG value match Arc and spatialreference.org?  What does the 100027 value represent?


texts: What is the relation between geotools and hibernate-spatial ( differences and similarities)

texts: I know that hibernate-sapatial is supposed to be an abstraction for the db . And from what i understand there is some kind of possibillity to do that with geotools? ( to what extent i do not know). Someone please clarify this.


texts: QGIS 3.0 XYZ Tile 'OpenStreetMap' Text is Too Small to See

texts:
I installed QGIS 3.0 (standalone 64 bit installer) and added the standard XYX Tile layer 'OpenStreetMap' that was part of the install. It loads fine except the text is too small to see. Not sure if the small text size is caused by my high DPI (3200x1900) screen resolution? I also tried:
1. Adding my own XYZ Tile layer (instructions used were from here: http://www.xyht.com/spatial-itgis/using-openstreetmap-basemaps-qgis-3-0/) but the result was the same.
2. Adding a Google Maps layer (instructions used: http://www.geodose.com/2018/03/how-to-add-google-maps-layer-QGIS-3.html) and again, the text is too small to be usable.

Both OSM and Google Maps render the text at a readable size in my web browser (Chrome) so the issue is with QGIS 3.0 and not OSM or Google Maps.

Update - 1 April

I've had some suggestions to use high resolution (retina tiles). I tried the suggested links but the text in the maps were still too small. The links no longer work (it appears the services are no longer available) but I'm also not certain I used the correct URL either.

Can someone provide me with a URL to a working high resolution Open Street Map service.

Update - 7 April - Screen grab of the text size of in an XYZ tiles layer relative to other fonts.


texts: GDB file and USA Base Map.mxd not in the same directory ArcObjects

texts:
I am trying to open a address locator in ArcObjects by following this tutorial: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_an_address_locator/0001000004pm000000/

The code sample has this line:
String workspacePath = @"C:\UnitedStates.gdb";

I talked to an analyst and they told me to find the sample in this folder
"C:\Program Files\ArcGIS\DeveloperKit10.0\Samples\data\Usa"

And that has a file called USA.gdb

However my "USA Base Map.mxd" file is located here, Z:\ESRI\DataMaps10\usa

It seems like ArcEngine should use the same map / data to do both geocoding and projections... right?  Am I doing something obviously wrong?


texts:
I created a plugin using the QGIS Plugin Builder with QGIS 3.2 and tried to compile it afterwards with the OSGeo4W Shell. In the Shell I navigated to the directory my plugin is installed (C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\MYPLUGIN) and typed in the following lines:

pyrcc5 -o resources.py resources.qrc

But I get an error, that pyrcc5 can not be found. But the batchfile is located in the Python 36->Scripts folder in the QGIS 3.2 folder.

I am using Windows 10.

How do I solve or workaround the error?


texts:
I am rendering vector tiles and the roads are made up of many line segments. Each segment has a line layer and symbol layer in the vector tile.

I am getting repeated labels along main roads made up of many segments as shown below. Is there a way to space them out further?

I've tried using:-

padding: [100,100,100,100]

But this seems to have no effect. I'm using Openlayers 4 and have also tried in Openlayers 5 with same problem.

Style is essentially this:-

{padding: [100,100,100,100], text: "A19",  placement: "line", fill: ..., stroke: ..., font: ...}


texts: ArcPy - MapDocument CURRENT error in 10.4

texts:
I'm running 10.4 and occasionally get an error when running scripts with the line;

mxd = arcpy.mapping.MapDocument("CURRENT")

Error message:
CreateObject cannot open map document

Note "Always run in foreground" is checked and so is "Run python script in process"

When I try to run the same line of code in the ArcMap Python window, ArcMap crashes.

Anyone else having this issue?


texts:
I have some regions that I have defined and all the public transit in the State, shown here:

The blue blobs are the regions, points are the bus/tram stops, and the lines are the routes.

I want to calculate how many other regions each region can access. The way I could think to do it is to spatial join the regions to the routes and then spatial join the routes to the region and getting a sum of the join count, but this would lead to the same regions being counted.

So that doesn't work. Then I thought maybe I could use a field calculation to calculate the reachable regions. So I was able to join the "Region_ID" number, "Trip_Id" number, to the stop points. But I still have the same problem with duplicates inflating the connectivity count.

Does anyone have any ideas to solve this problem?


texts: Is there an App available for QGIS to collect data in the field - Not Roam as does not work on iPads

texts:
I would love an app which works similar to Arc's Collector App for QGIS.

On Collector App you can:

"Collect and update data in the field, log your current location, and put the data you capture to work so you can make more informed and timely decisions. Use maps anywhere to ground-truth your data, make observations, and respond to events. You'll improve the efficiency of your field workforce and the accuracy of your GIS.
Download maps to your device and work offline.
Use GPS to create and update map data.
Collect points, lines, and area features.
Fill out easy-to-use map-driven forms.
Find places and get directions.
Track and report areas you visited."


texts: Curved arrows in QGIS using geometry generator

texts:
I use QgGIS 3.10 and this tutorial https://anitagraser.com/2019/05/04/flow-maps-in-qgis-no-plugins-needed/.

I am able to create lines of varying thickness and color depending on the weight of the flow in a virtual layer.

I try to create arrows and eventually create curves

So I try to introduce the expression of the tutorial but without success.
Note that the expression introduce a middle point in each line (but no curve and arrow)

Note that when I use the arrow symbol, the width of the line is not configurable with the assistant.


texts: Output pdf map size issue when no simple fill solid symbology

texts:
The size of the output pdf map increases enormously when the symbol of a polygon isn't set to "simple fill" + "solid". A4 output results:

simple fill solid = 7 Ko
simple fill BDiagonal = 1'766 Ko
line pattern = 598 Ko

Does someone experiences the same problem and find a solution?

It seems that it isn't a vector/raster output pdf issue.

QGIS 2.14 and 2.18 produce the same output map size.

Steps to reproduce the issue

open qgis;
create New polygon Shapefile Layer;
select a 10'000 scale;
draw a simple polygon;
Project > New Print Composer > Page size A4 > Add new map;
Export as PDF (vector and then raster) with a simple fill solid symbology;
Export as PDF (vector and then raster) with a simple fill BDiagonal symbology;
Export as PDF (vector and then raster) with a Line pattern fill.


texts: Seeking border data which is classified as Coastal and Land?

texts:
I am trying to operate regressions over two parameters - (1) Ratio of length of coastal border to land border (2) Average Military Expenditure through 1996-2016 for each country.

For parameter (2) will use the database given by SIPRI(Stockholm Peace Institution) which is available in following link : https://www.sipri.org/databases/milex

However, since I am an quite novice to the field of Geographic informations, so keep losing my times to find the required and proper data for para (1).

For clarification coastal border means measured total length of border where it faces with sea  while land border means measured total length of border where it faces with land.

I prefer the csv type of database, but the format would not be big problem and also I am willing to handle and experience some geo-specific data formats too.

Where could I get the border data which is classified as Coastal and Land?

I am basically using Python with NumPy and Matpolib.


texts: Calculate distance from a point to a MultiLineString geometry - PYQGIS

texts:
I'm trying to calculate the distance from a point to the closest river in my QGIS plugin. But I receive this message: MultiLineString geometry cannot be converted to a point. Only Point types are permitted. I can understand the cause of this message, but I don't know how to calculate the distance from a point and a MultiLineString geometry.

This is my code:

def getPointFromFeature(self, featureID, layer):
  expr = QgsExpression("Id = '"+featureID+"'")
  selection = self.selectionByExpr(layer,expr)
  geom = selection[0].geometry().asPoint()
  return geom

def getDistances(self, geom1, geom2):
  d = QgsDistanceArea()
  d.setEllipsoid('WGS84')
  measure=d.measureLine(geom1, geom2)/1000
  measure=round(measure,1)
  return str(measure)

def getRiversDistances(self, featureID):
  layerFiumi = self.getLayerFiumi()
  layerBeni = self.getLayerBeni()
  geomBene = self.getPointFromFeature(featureID, layerBeni)
  expr = QgsExpression("type = 'river'")
  selection = self.selectionByExpr(layerFiumi, expr)
  d = {}
  for river in selection:
    d[river[1]] = self.getDistances(geomBene, river.geometry().asPoint())
  return str(d)


texts: Joining attributes by the biggest overlapping areas

texts:
I have two layers and I want to join the attribute of them together in QGIS. Unfortunately, the overlapping layer (The Blue one) ist not very precicse, so there are parts that overlap on small areas.

If I join the attributes together (-> join type: intersects/one to many), I get multiple overlapping attributes. But i only want the attributes with the biggest overlaping area, which would be those:

If join the attributes together with the one to one method, I often get the attribute of the small overlapping parts, which i dont need/are wrong. I know I can get the mean attributes of all overlapping areas with the Join Attributes by Location (summary) function, which is partly a solution to my problem.
But what I really want is to only join the attribute with the biggest overlapping area. Any idea how to do this?


texts: Extract values from feature class to points

texts:
I am using ArcMap 10.3.1. I have a polygon feature class along with a point feature class. I want to extract values from one field of my polygon feature class to my points.

To specify, I have a geologic map (so basically a polygon feature class) with a RockType field in its attribute table. I have a bunch of points and I want to know what the RockType of each point is based on the polygon feature class that has the RockType field.

I know of the Extract Values to Points and Extract Values to Table tools, but those both require raster datasets, which I do not have. I'm wondering whether extraction by feature class is possible in ArcMap. If so, what tools/codes do I need to perform this task?


texts: How to change the value tof the use tag in a svg file

texts:
I am working in C++/QT4.5 with the qgis c++ api 2.8.2

I have a svg file that contains different form tag by Id

When i want the first form i place the id name in the use xlink:href="#formname" ....

Is it possible to change dynamically the formname with qgis or display another form with the same svg file ?


texts:
I'm something of a beginner to remote sensing.

I've got an NDVI time series, from 2002-2016. I've smoothed the data using an excel spreadsheet with the formula yt =  (-2xt-3 + 3xt-2 + 6xt-1 + 7xt +  6xt+1 +  3xt+2  - 2xt+3)/21. Now, I don't understand that - equations baffle me - I trust it works though, because I'm told it does.
Using MODIS NDVI 16 day combined data extracted from Google Earth Engine!

Unfortunately, I've got gaps in my NDVI time series, and those gaps correspond with very low or negative NDVI values in the smoothed time series.

I've tried to read about methods to fill gaps in NDVI time series. Chen et al. (2004) proposed a method (https://www.sciencedirect.com/science/article/pii/S003442570400080X). Kandasamy et al. (2013) called that an Adaptive Savitsky Golay filter. But I must be honest, the mathematics and equations serve only to confuse me! I came to Remote Sensing from a background in environmental management rather than science, so to me those papers are sadly about as useful as hieroglyphics.

Given my mathematic incompetence, could somebody please give me either:

a) an equation to paste into Excel which could accomplish Chen et al.'s (2004) method

or

b) tell me what method I should use to fill the gaps in my NDVI time series?

Essentially - how should somebody who can't turn an equation on a page into a formula in excel fill the gaps in an NDVI time series?


texts: I'm working on GeoNode 2.8 and I would like to change the authorization on layers. For example, actually people who are logged can see all the maps and layers but if they are not they can't see it. I would like to change it in the code to be able to let everyone see layers etc.


texts:
I am using the Select by Location tool to select certain polygons on my shapefile layer.

I start by having a given point as my Selecting Feature and that its relationship is completely_ contains.

After I run the tool the first time, I get the polygon feature that my point is in (lets call it Polygon A).

When I run another select by feature tool that its relationship is boundary_touches my Polygon A, I get a layer that also contains Polygon A and the features that share boundaries with it.

Is there a way I can prevent this from happening?

Meaning that every time I run the select by location tool it doesn't select polygons from the previous time.

Or is there a tool or a way that will allow me to join multiple layers together and remove duplicate features?

I have tried the Union tool as well as the Intersect tool.

Any suggestions?


texts: Collaborative map editing using local openstreetmap server

texts:
I tried to make a collaborative web-map solution. that is allowing multiple users to edit map features and enter data collaboratively.
I read that OpenStreetMap give this solution.

I've installed a local osm server using switch2osm tutorial.
Now I can see a map canvas on a web page.

But, How can I manage map data. I mean:

Defining features categories.
Defining users as editors.
Assigning privileges to users according to geographic area.

Is there any other open source solution, more easy to set up and meet my requirement?


texts: problem in loading outputs from processing tool (sextante)

texts:
hopefully some of you have got an answer to what happens to me when i run (so far) all the processing tools for carrying out raster analyses.

This is the type of message i receive from QGIS (2.0.1 Dufour).

Notice that i am running qgis on windows 7 and i have checked SAGA, it is activated and all items are ticked "on".

Suggestions are welcome :)

Many thanks!


texts:
I have multiple GDBs from an earlier process. Each GDB contains a single feature class (FC).
I want to copy (FeatureClassToFeatureClass) each FC into a "Main" GDB for later processing in a single place.
I thought nesting a for loop like below would work. It runs, but doesn't produce a result or an error, so it's unclear why it's not working.
I am using Python 2.7.14 in a Windows Server environment, running with ArcGIS Desktop Advanced (10.6).
#Import modules
import arcpy
import os

#Target GDB
outGDB = r"E:\Jamie_Temp\Main_GDB.gdb"

#LIBRARIES
#Set workspace
arcpy.env.workspace = r"E:\Jamie_Temp\Test_Files"

#Find GDBs
inGDB = arcpy.ListWorkspaces()

for gdb in inGDB:
    inFCs = arcpy.ListFeatureClasses()
    for fc in inFCs:
        arcpy.FeatureClassToFeatureClass_conversion(fc, outGDB, fc.strip("_point"))

The idea being here that it:

Finds the name of all GDBs in the workspace and assigns them to inGDB
Loops through each GDB found in inGDB and list the FCs inside, assigning them to inFCs
Copy the FCs found to Main_GDB.gdb


texts:
My root issue is that I have elevation values in NGVD 1929 that need to be related to a DEM which has elevation values in NAVD 1988.

Is there a way that I can convert elevation from one data to another en masse?

I have searched online for a solution but so far have only come up with an app that will give you the difference between the two elevations at a single point.


texts: How to create an isotype map, where each symbol represents a number (eg. 50) from data in the attribute table?

texts:
I am trying to represent data of numbers of people in different areas of a city. Using graduated size creates different bubbles based on size, but this misrepresents data if the areas are not of the same size. For example, Alexandra township is a small area but has a high number of people, so the bubble is large, but Soweto is another township but the areas are distinct within the township so it only has a series of small bubbles. Even though Soweto has overall a larger number of people, Alexandra looks like it has the most people. See the picture below:

Thus, I want to create one symbol - like a human shape - that represents a constant number (50), so that if Alexandra has 200 people, it is represented as 4 of these symbols, and if different areas in Soweto have 50 each they are shown as 1 human symbol. Is it possible to do this in QGIS without manually creating new points?


texts: Define layer names in Earth Engine Image export

texts:
I'm trying to export an image from Earth Engine but found that each layer in the .tif export is automatically named using the band index. I want the layer names to be set using band name, rather than band index.

This isn't an issue of the fileNamePrefix argument in Export.image.toDrive(), as I don't need to set prefixes for multiple images; instead I want to export a single raster with  layer names defined according to band name. Here is the javaScript code for reproducing my problem, and further down is a quick R script demonstrating the layer naming issue:

// Generate Region of Interest
var ROI = ee.FeatureCollection('TIGER/2016/Counties')
  .filter(ee.Filter.eq('NAME', 'Waldo'));

// Create clipping function
var clipper = function(image){
  return image.clip(ROI);
};

// Create a QA mask function
var masker = function(image){
  var mask = image.select('SummaryQA').lte(1);
  return image.updateMask(mask);
};

// Compile the data
var ndvi = ee.ImageCollection('MODIS/006/MOD13Q1')
                  .filter(ee.Filter.date('2001-01-01', '2001-12-31'))
                  .map(clipper)
                  .map(masker)
                  .select('NDVI');
print("MOD13Q1 NDVI Image Collection", ndvi);

// PREPARE DATA FOR EXPORT
// Stacking function by Tyler Erickson
// https://gis.stackexchange.com/a/254778/67264
var stackCollection = function(collection) {
  // Create an initial image.
  var first = ee.Image(collection.first()).select([]);

  // Write a function that appends a band to an image.
  var appendBands = function(image, previous) {
      var dateString = ee.Date(image.get('system:time_start')).format('yyyy-MM-dd');
      return ee.Image(previous).addBands(image.rename(dateString));
  };
  return ee.Image(collection.iterate(appendBands, first));
};

var ndvi_img = stackCollection(ndvi);
print("ndvi_img", ndvi_img);

// Export the data
// See https://developers.google.com/earth-engine/exporting
Export.image.toDrive({
  image: ndvi_img,
  description: 'MOD13Q1_NDVI',
  scale: 1000,
  region: ROI,
  fileFormat: 'GeoTIFF',
  formatOptions: {
    cloudOptimized: true
  }
});

When I load the data and check layer names in R...

myraster = raster::stack("MOD13Q1_NDVI.tif")
names(myraster)

...the layer names are "MOD13Q1_NDVI.1", "MOD13Q1_NDVI.2", "MOD13Q1_NDVI.3", etc. Instead, names(myraster) should return "2001-01-01", "2001-01-17", "2001-02-02", etc.


texts: Why is interpolation adding too much heat

texts:
I am interpolating geo data using qgis.  The data is in the form of lat,lon,count. The path of the collected data is shown as a mostly transparent line. The resulting heatmap it produces is shown.  The map at label 1 is green, but at label 2 has started to shift to yellow (the colors go from white->green->yellow->orange->red).  I dont understand why, it should be all green up there as either no data was collected, or at best it was low measurements. A similar color shift is seen at label 3 and 4.  Most of the data collected at the west edge is "low" measurements as seen in the green wedge at label 4.  But at label 3, it again is shifting towards yellow.  I dont understand why.

The interpolation was created with the following settings:

Interpolation attribute:value, type:points
Method:IDW coefficient:2.0
cols:300, rows:300
(resulting cell size x:0.07934, y:0.01678)

Colors:

0:white
13:Green
25:Yellow
37:Orange
50:Red

I have placed the data file here:datafile

Peter


texts: Error (-51), Extended Error 102 with Create Database User (Data Management Tools -> Geodatabase Management ->Create Database User)

texts: I'm trying to Create Database User so I can register my sde geodatabase data with ArcGIS Server. I can see in my Server Manager that the user does exist, but does not belong to any of the Windows AD groups associated with the ArcGIS server.  The database server is MS SQL 2014.


texts:
I have a script I am using to save out layers automatically and would like some help with understanding where my files are being saved out to.

In my current code, the file that I am processing is being picked up in the arcpy.env.workspace.

But the layers that I am saving out are being saved in the same place. How do change where the files are being saved ?

import arcpy
from arcpy import env

#Variables which need to pick for this are the attribute that you are going to   filter the layers on

# This is where the file is being picked up from
arcpy.env.workspace = "U:\\Script\\layers_Files\\"
# The file to be processed
Source_File = "feilds_template.shp"

Company_Bulk_Company_List = [row[0] for row in arcpy.da.SearchCursor   (Source_File,"HC_TYPE")]
UniqueCompany = set(Company_Bulk_Company_List)
print UniqueCompany

 # Getting the list out
 for company_query in UniqueCompany:

 #env.workspace = "S:\\AppsData\\GIS\\PROJECT\\COMPANIES\\SHAPEFILES\\"

    out_layer0 = str(company_query)+"lyr"
    in_layer = out_layer0
    out_layer = in_layer +"lyr"

 #MakeFeatureLayer variables
    in_features = "IHS_FEILDS_AREAS.shp"

    where_clause = '"HC_TYPE" = ' + "'" + company_query + "'"
    print where_clause
    workspace = " U:\\Script\\layers_Files\\"

    try:
    # Execute MakeFeatureLayer
        arcpy.MakeFeatureLayer_management(in_features, out_layer0, where_clause, workspace)

    # Execute SaveToLayerFile
         arcpy.SaveToLayerFile_management(in_layer, out_layer, "ABSOLUTE")
    except:
        print arcpy.GetMessages()


texts: I have some points result query in MySQL database which is GeoJSON and I want to show these points on a Google map. I need to get this result with AJAX and deliver them to Google Maps. Can anybody write a code to do this?


texts: How can I leverage ArcGIS Online sign in credentials/dialog box in a python add-in for Desktop?

texts:
When a user has signed in to their ArcGIS Online account in ArcGIS for Desktop (File > Sign In) they have access to their AGOL maps and services and have the ability to publish services and run GP tools that need access to AGOL resources.  For example, if I am already signed in to AGOL and open the Share Package tool, the username and password parameters are greyed out because the tool recognizes that the user is already authenticated.  My assumption is that the tool recognizes the authenticated session and uses the stored token in its request to upload a package.  Is that at all accurate?

Is it possible to achieve this with python/arcpy?  I would like my add-in to recognize if the application (ArcGIS Desktop) is already authenticated or not, and if so, use the valid token to make future calls to AGOL using the REST API, for example.  If the user has not signed in, it would be nice to have access to the small Internet Explorer window that prompts the user for their AGOL credentials when they are using File > Sign In (see image).  I believe this method uses OAuth 2.0.

Either way, if my add-in needs access to a user's AGOL account to complete its job, how can I use an existing authentication (if the user has already established one with File > Sign In) without having to build my own dialog to ask the user for their username or password?  Going along with this point of not wanting to request a username and password from the user...the Sign In To Portal (Server) tool is a legacy tool at 10.2.  The documentation prompts the user to use the File > Sign In method.

I have also posted this question on GeoNet with no responses as of yet.


texts:
I need read/write geometry object from PostGIS.

Is there C++ library to do this?


texts:
I am trying to mosaic several rasters into single big raster in R. Using script that posted in https://stackoverflow.com/questions/15287807/how-can-i-create-raster-mosaic-using-list-of-rasters
But, I have received a warning message and error message.

rasters1 <- list.files("F:\\MOD15A2_LAI_1km\\MOD15A2_LAI_2009",
                      pattern = "mod15a2.a2009001.*.005.*.img$",
                      full.names = TRUE, recursive = TRUE)

mos1 <-mosaic(rasters1, fun=mean)

It was reporting error as below

Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘extent’ for signature ‘"character"’

Then I tried another version.

rasters1.mosaicargs <- rasters1
rasters1.mosaicargs$fun <- mean

But here some warning message as below

Warning message:
In rasters1.mosaicargs$fun <- mean : Coercing LHS to a list

I have ignored the message then continued

mos2 <- do.call(mosaic, rasters1.mosaicargs)

but here same error mentioned in as an above

Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘mosaic’ for signature ‘"character", "character"’


texts: Building PostGIS 3.0 and PostgreSQL 12 with confidence on Ubuntu 18.04?

texts:
I have failed in all previous attempts to build PostGIS on macOS, centos, or ubuntu in a manner that results in the creation of the address-standardizer and the reverse geocoder.
I have tried all the 'make from the cli' guidance available to diligent searches over many years. I believe the obstacle has consistently been the exclusive focus of erstwhile guides on the step-wise, sequential operations that they are themselves familiar with (this includes all versions of the PostGIS manual).
I'm now pursuing the 'build with eclipse-cpp' options because I'm tired of working with partial advice for exceedingly detailed command-line operations. And picking through the one-off questions about 'why doesn't this work for me' questions to find some contextual perspective (the essential missing piece) provides details that are simply too difficult to aggregate into principles.
So, could someone confirm for me whether it's sane to imagine that I can install a PostgreSQL.org binary or GitHub repo of PostgreSQL on Ubuntu 18.04 server, along with the 'server development' packages? And then follow the PostGIS manual's build instructions absolutely precisely, and then have a working address-standardizer and reverse-geocoder extension that actually works?
Or is there a more reliable (absolutely reliable?) manner to go about this insanely fragmented body of overlapping, underlapping, disjointed instructions?
anybody?


texts:
I am using code from the emapr lab to learn to use LandTrendr to get mean NDVI values per year for a geometry. I am trying to export the generated list from earth engine to Drive.  The list only contains Year, Original NDVI and Fitted NDVI values.  The error I am getting is- "Unknown element type provided: object. Expected:  ee.Image, ee.ImageCollection, ee.FeatureCollection or ee.Element."  How can I convert a list in order to export it to drive as a csv?

A link to the code I am using.

The end bit of my code:

var yearSummary = getSummary(yearBandStack, aoi, summaryScale).toArray();
var rawSummary = getSummary(rawBandStack, aoi, summaryScale).toArray();
var fitSummary = getSummary(fitBandStack, aoi, summaryScale).toArray();
var chartArray = ee.Array.cat([yearSummary, rawSummary, fitSummary], 1).getInfo();
chartArray = [['Year', 'Original', 'Fitted']].concat(chartArray);

print(chartArray)

Export.table.toDrive({
  collection: chartArray,
  folder: 'Test_Folder',
  description:'test_chartArray',
  fileFormat: 'CSV'
});


texts: Issue while reading raw satellite data using GDAL Python

texts:
I have a raw satellite imagery (non-georeferenced). I am trying to read this raw data (.L-4 file) (3 bands) using GDAL using the following code:
from osgeo import gdal

src_ds = gdal.Open( "INPUT.L-4" )

img_bands = []

for band in range( src_ds.RasterCount ):
    band += 1
    print ("[ GETTING BAND ]: ", band)
    srcband = src_ds.GetRasterBand(band)

    img_bands.append(srcband.ReadAsArray())

Now with this above code I am able to read the raw image. But the issue is: In the list, 3 elements are getting appended but only first 2 elements are showing as array type while the third element is showing as "NoneType".
Why is one band coming as NoneType and not as an array?


texts: Polyline "breakage" calculation in MapInfo?

texts:
I am a novice MapInfo user, with a basic to moderate knowledge of queries and SQL.

My work entails doing risk assessments for shipping traffic based on AIS-tracks (radio-based vessel information system), which are represented as polylines in the dataset. However, some of the polylines are broken, due to missing AIS-coverage. I use several datasets, each of which have different places with broken tracks, and would like some way to quantify the deficiencies of each, as to make it easier to decide which dataset is best for a given location.

I am wondering if it is possible to use MapInfo to calculate what percentage of polylines enter an area (in this case a 1X1 nautical mile box in a grid of Europe) but does not exit the box afterwards, and then give that box a given color based on the percentage?


texts: I try to use the NDVI Based Emissivity Method to calculate the LSE. But the function almost applied over surfaces composed by soil and vegetation. Over surfaces like water, ice, or snow did not describe carefully. Can anyone tell me how to calculate the emissivity of snow and water in Landsat images?


texts: Create line from two points, two different feature class

texts:
I'm attempting to automate this in ModelBuilder in ArcMap. I have one feature class with one point (Start) and one feature class with multiple points (Destinations). I want to iterate through the Destinations so I create multiple lines from the Start point to each Destination point.

I was looking at possibly extracting the XY coordinates and then using "XY To Line", but that wants the xy to be in one table (or feature), not two. Is there a simpler way of connecting two points?


texts:
I'm working on a project to get the maximum elevation along a 10-mile wide corridor. To accomplish this I've loaded raster elevation data into a PostgreSQL database, and used the PostGIS extensions to give me the desired result.

I have two different resolution data sources (both from the USGS) available: a 100-meter resolution dataset, which can return a result from a roughly 627 nautical mile long line in about 3 seconds, and a 2-arcsecond resolution dataset, which takes closer to 10 minutes.

My question is, given that I am just looking for the maximum elevation over a large area, what, if anything, am I loosing by using the lower-resolution data? For example, could the 100 meter data "jump over" a ridge, giving lower elevations on either side and missing the higher elevation of the ridge top? Or would the lower resolution data "interpolate" the area between points somehow, such as the values being the maximum elevation in a 100-meter by 100-meter block, such that the ridge would be taken into account?

Keep in mind that I only care about the maximum elevation here - I don't care where exactly it is, so in that regard resolution is of little consequence (within reason). I just need to know that the maximum elevation I get from the dataset truly is the maximum elevation in that area.

EDIT: Both data sets come from the USGS. The 100-meter dataset is this one: https://nationalmap.gov/small_scale/mld/elev100.html, while the 2-arcsecond dataset is pulled from the DEM's available at http://viewer.nationalmap.gov/basic


texts: Using datatype option from writeRaster with ascii files

texts:
I have to build a 8 bits raster as ascii (.asc).  I'm trying to use R writeRaster fonction, however it is not working:

Reproducible example:

library(raster)

rr <- raster(matrix(sample(1:100, 100),10,10), xmn=0, xmx=10, ymn=0, ymx=10)

writeRaster(rr, "D:/temp/test_tif.asc", datatype="INT1U", overwrite=T)
dataType(raster("D:/temp/test_tif.asc"))
 [1] "INT4S"

This is not working, however when using tif, the same script works:

writeRaster(rr, "D:/temp/test_tif.tif", datatype="INT1U", overwrite=T)
dataType(raster("D:/temp/test_tif.tif"))
 [1] "INT1U"

Any idea why it isn't working for asc?


texts: Extract Raster Values to Matching Points in a FeatureCollection

texts:
I am trying to extract time series data to a set of points that I have uploaded to GEE as an asset. The catch is that I only want to sample the raster layer that aligns temporally with a given point. I do not want the entire time series extracted to every point.
For example, if I have two points dated 1/10/2020 and 3/16/2020, I am hoping to end up with a shapefile or table containing the original points and a singular raster value for each point, with raster values extracted from the image that matches the date of the indivdual points. Is it possible to do something like that?
// REFORMAT DATES FOR ALL POINTS IN THE SHAPEFILE
var BurnPermits = BurnPermits.map(function (feature) {
  return feature.set('system:time_start', ee.Date(feature.get('DATE')))
})

// PRINT ATTRIBUTES TO SEE IF DATE IS FORMATTED CORRECTLY
Map.addLayer(BurnPermits)

var Permits2020 = BurnPermits.filterDate('2020-01-01','2020-12-30')
print(Permits2020)
print(TestPermit)

var GRIDMET_2020 = GRIDMET.filterBounds(AOI).filterDate("2020-01-01","2020-12-31")
//print(GRIDMET_2020)

// This function adds a band representing the image timestamp.
var addTime = function(image) {
  return image.addBands(image.metadata('system:time_start'));
};

var GRIDMET_w_TIME = GRIDMET_2020.map(addTime)
print(GRIDMET_w_TIME)

// FUNCTION TO EXTRACT GRIDMET VALUES TO POINTS THAT ALIGN TEMPORALLY
var ExtractToPoint_ByDate = function(ft){
  // CREATE GEOMETRY FROM FEATURE
  var ft_geometry = ft.geometry()
  // DEFINE START AND END DATES
  var start_date = ft.get('DATE')
  // USE START AND END DATES TO FILTER GRIDMET COLLECTION
  var image_for_permit = GRIDMET_w_TIME.filterDate(start_date,'2020-12-31').first()
  // CREATE A NEW POINT FILE THAT HAS THE GRIDMET VALUES EXTRACTED
  var permits_w_GRIDMET = image_for_permit.sample({
  region: ft_geometry,
  scale: 4000,
  geometries:true
});
  return permits_w_GRIDMET
}

var Permits_w_GRIDMET = Permits2020.map(ExtractToPoint_ByDate).flatten()

// REFORMAT DATES FOR ALL POINTS IN THE SHAPEFILE
var Permits_w_GRIDMET = Permits_w_GRIDMET.map(function (feature) {
  return feature.set('DATE', ee.Date(feature.get('system:time_start')))
})

print(Permits_w_GRIDMET)

Full Script Here


texts: Programmatically change field heading type in qgis2web plugin

texts:
I have a dozen layers each with more than a dozen fields. When I run the qgis2web plugin, there are 3 options on how each field can be displayed (no label, inline label, and header label).
I do not want to manually go through over a hundred fields and setting their field style.
Is there a way, once the map is exported using Leaflet, to change the field display using some code?


texts: Import raster data from PostGIS and publish in GeoServer

texts:
I am using GeoServer 2.3.3, PostGIS 2.1 and PostgreSQl 9.1.  The Image Mosaic JDBC extension is also installed correctly.

I am trying to import raster data from PostGIS and publish in GeoServer but facing an error.I followed the following tutorial.

I have imported the raster to PostGIS using raster2pgsql, the command I used is:

raster2pgsql -M -I -C -e -Y -F -s 4326 -t 128x128  -l 2,4 geo_liss.tif public.raster_table | psql -U postgres -d postgis_test -h localhost -p 5433

I have even verified whether the image is imported into database correctly or not, by downloading it using gdal_translate.

http://docs.geotools.org/latest/userguide/library/coverage/pgraster.html

These are my XML configuration files...

rasterdata.pgraster.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ImageMosaicJDBCConfig [
  <!ENTITY mapping PUBLIC "mapping"  "mapping.pgraster.xml.inc">
  <!ENTITY connect PUBLIC "connect"  "connect.pgraster.xml.inc">
 ]>

 <config version="1.0">
  <coverageName name="oek"/>
  <coordsys name="EPSG:4326"/>
  <!-- interpolation 1 = nearest neighbour, 2 = bipolar, 3 = bicubic -->
  <scaleop  interpolation="1"/>
<axisOrder ignore="false"/>
  &mapping;
  &connect;
</config>

connect.pgraster.xml.inc

 <connect>
 <dstype value="DBCP"/>
 <username value="postgres"/>
 <password value="postgres"/>
 <jdbcUrl value="jdbc:postgresql://localhost:5432/geo"/>
 <driverClassName value="org.postgresql.Driver"/>
 <maxActive value="10"/>
 <maxIdle value="0"/>
 </connect>

mapping.pgraster.xml.inc

  <spatialExtension name="pgraster"/>
  <mapping>
  <masterTable name="mosaic" >
          <coverageNameAttribute name="name"/>
          <maxXAttribute name="maxx"/>
          <maxYAttribute name="maxy"/>
          <minXAttribute name="minx"/>
          <minYAttribute name="miny"/>
          <resXAttribute name="resx"/>
          <resYAttribute name="resy"/>
          <tileTableNameAtribute  name="tiletable" />
  </masterTable>
  <tileTable>
      <blobAttributeName name="rast" />
  </tileTable>
  </mapping>

I have stored these XML configuration files in the GeoServer data directory under the coverages folder.

When I try to use the image mosaic JDBC plugin to import the raster data through JDBC database, it gives an error, i.e.  "Could not list layers for this store, an error occurred retrieving them: Argument "value" should not be null."

I have imported the raster data by giving the path of oek.pgrasterlxml in the URL required

As it doesn't work, I tried to import data in PostGIS database using import data in GeoServer. I have provided the SRS also. The data is imported correctly, but when I view it using OpenLayers I am unable to view, instead the WMS is providing an exception report:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd">
  <ServiceExceptionReport version="1.1.1" >
      <ServiceException>
  illegal bbox, minX: 0.0 is greater than maxX: -1.0
      </ServiceException>
  </ServiceExceptionReport>


texts: Display lines which share segments by offsetting them only where they overlap?

texts:
Background:

As part of a route selection process I have multiple route options which often share segments. I need to keep the underlying data correct while displaying all routes in a way that they don't obscure each other.

Desired Result:

I would like to do this by offsetting the different routes, but only where they share segments with other routes, something like this (taken from another SE question):

What I've Tried:

Giving each route an offset in its symbology works OK when the routes are overlapping but this method breaks down when they are not because the route is now being shown in the wrong place.

I tried following this answer to a similar question:
https://gis.stackexchange.com/a/141627/98170 but the result is the same as manually applying offsets as above.

This question and answer look great: Display overlapping polyline segments as multiple lines with offsets? but it is for Leaflet not QGIS.

This answer https://gis.stackexchange.com/a/239370/98170 is almost there but I don't want it to pinch back in at each vertex and I don't know how it would work when the lines are no longer overlapping.

I've tried messing around in the geometry generator but to no avail also.

Any help with this would be much appreicated.


texts: Copy / paste table attribute qgis to excel lose colum order

texts:
When I copy data from a table attribute to excel the order of column is randomly.
E.g.
If in Qgis the order of column is column_a, column_b, column_c, column_d in excel is column_a,  column_c, column_b,column_d

I've tried to change past format destination but with no result


texts: How to fix: JTS TopologyException: Found null DirectedEdge

texts:
How can I fix a: TopologyException: Found null DirectedEdge?

Initially (sadly), the geometry is invalid.
But then when applying a geom.buffer(0) st_valid(my_geom) returns true.

Still there are problems with the geometry and I keep getting the exception.


texts: Calculate pixel coordinates for each pixel in raster? EPSG:27700 (British National Grid)

texts:
I have some Met Office rain radar files (NIMROD binary files). These contain raster data where each pixel is a 1km grid square. I am trying to calculate the geographic position of each of these pixels so that I have the coordinates of each position recorded in a separate file. Using this I can then programmatically work out which catchment (polygon) the pixel belongs in.

Broadly I am asking how best to do this.

I have some information about the data. It is a grid 2175 by 1725. Each pixel is a 1km square. I am given the bounding box which is in EPSG:27700 (British National Grid) projection. The values are apparently -404500 1549500 1320500 -625500. These seemed strange to me as they appear to be outside the BNG bounds?

start northing 1549500.0, start easting -404500.0

Is it too simplistic to simply take the distance between the two easting bounds (for example) and decide by the number of pixels in the row? This should locate the centre of the most far west pixel if I am not mistaken. Then it would be a simple matter to move through the row. I want to end up with a matrix of the coordinates for each pixel.

Alternatively would it be possible to take the most east bound and somehow add 1km west (the result being given as the new easting value)?

The ultimate idea is that I have a catchment polygon within the UK and I want to identify each raster pixel which falls over this area or otherwise intersects the area. I have several of these polygons. I don't want to use a GIS tool as I don't need to visualise it. I just need to know what pixels intersect which polygons.

You can see above my initial thoughts about how to go about this but if my approach is too simplistic due to the nature of project please let me know.


texts: Qgis 3.x: Python error when adding scripts to processing toolbox

texts:
When I add a script (any script) to QGIS 3.x I get the following Python error:

NameError: name 'Uitvoermap' is not defined
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\script\ScriptAlgorithmProvider.py", line 111, in loadAlgorithms
    alg = ScriptUtils.loadAlgorithm(moduleName, filePath)
  File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\script\ScriptUtils.py", line 68, in loadAlgorithm
    spec.loader.exec_module(module)
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "C:\Users\michi\AppData\Roaming\QGIS\QGIS3\profiles\default\processing\scripts\garmin.py", line 6, in
    Uitvoermap += "\\"
NameError: name 'Uitvoermap' is not defined

Python versie: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS versie: 3.4.4-Madeira Madeira, f6ddc62fdb

Python pad:
C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python
C:/Users/michi/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/michi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.4\bin\python37.zip
C:\PROGRA~1\QGIS3~1.4\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib
C:\Program Files\QGIS 3.4\bin
C:\PROGRA~1\QGIS3~1.4\apps\Python37
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\Pythonwin
C:/Users/michi/AppData/Roaming/QGIS/QGIS3\profiles\default/python

The script works for others. I tried other proven scripts with the same result.


texts: Are ArcGIS *.lyr and *.mxd data format specs published?

texts: Are the binary formats of *.lyr and *.mxd files published?


texts: Supervised Classification doubts and tips

texts:
I'm trying to work with supervised classification but I have a few questions.

I see some tools for this: SCP, DTZEKA, SNAP, eCog. Right how I'm using SCP, does anyone using SCP too? Do you like it? Suggest another tool?
which classification you think is the best? Random Forest? Max Likehood?
Which RGB composite is the best for using?
Can I select one AOI in an RGB composition and another AOI in another RGB composition? Or I have to select all AOI in the same RGB composition?
After finishing my classification, QGIS took more than 15 hours to polygonize and didn't finish, is there any solution for this?
I'd like to automatically extract a feature that right now I'm extracting visually tailing dams (water pixels surrounded by soil ones). Does anyone suggest?


texts: Plugin QGIS Error "QTextEdit.setPlainText(QString): not enough arguments"

texts:
I try to make save as button but i got this error message when try to save file in my directory

File "C:\Users\Mr.Pakde/.qgis2/python/plugins\condition\conditiondialog.py", line 80, in saveAs
    self._save( _filename )
File "C:\Users\Mr.Pakde/.qgis2/python/plugins\condition\conditiondialog.py", line 68, in _save
    f.write( 'Rekomendasi :' + str(self.ui.textRec1.setPlainText() ) )
TypeError: QTextEdit.setPlainText(QString): not enough arguments

this is my code

        Smpan = self.ui.btnSave
        QtCore.QObject.connect(Smpan, QtCore.SIGNAL('clicked()'),self.saveAs)

    def Compare1(self):
        input1 = self.ui.lineInput1.text()
        input2 = self.ui.lineInput2.text()
        compare = ''
        if input1 == input2:
            compare = 'Data dapat digunakam'
        else:
            compare = 'Data tidak cocok'
        self.ui.textRec1.setPlainText(compare)

    def _save(self, simpan):
        f = open( simpan, 'w' )
        f.write( 'Input 1 :' + str(self.ui.lineInput1.text()) )
        f.write( 'Input 2 :' + str(self.ui.lineInput2.text()) )
        f.write( 'Rekomendasi :' + str(self.ui.textRec1.setPlainText()) )
        f.close()
    def savefile(self):
        if self.simpan:
              self._save( "%s" % self.simpan )
        else:
              self.saveAs()

    def saveAs(self):
            tulis = QtGui.QFileDialog(self).getSaveFileName()
            if tulis !="":
                _filename = "%s" % tulis
                self._save( _filename )


texts: Hack to identify clusters after pointStacker

texts:
I'm implementing a clustering solution using the PointStacker Transformation. It works great, but I would like to get information about individual features that the cluster point consists of.
I figure out that it is impossible to do this, because algorithm keeps only geom, count and countUnique in output. Are there any hacks to get this information? I found approaches based on server-side clustering with PostGIS dependent on zoom level, but in my case tables with points are editable and clusters must redrawn dynamically.
The only idea is to use ST_ClusterDBSCAN inside each time I request to db or mouseclick with the map with PointStacker Transformation from Geoserver on client-side. However there are discrepancies in results caused by cellSize in pixels for PointStacker Transformation and distance in projection unit for ST_ClusterDBSCAN.
Any ideas?
EDIT:

this is my grouped by type and clustered data at scale ~20k. I would like to get the information about all the 2 (7) records in db. Moreover, my table with points is editable so the number of objects in cluster could change to 3 (8) records.


texts: creating a right angled rectangle on google maps from a line

texts:
I have an application where the user draws a line, then automatically the software should create a rectangle where the line intersects the midpoint of two adjacent sides of a right angled rectangle. See below, the red line is user drawn and the purple rectangle is calculated. My algorithm almost works, in some directions the rectangles aren't right angled. I want to know why, there is a fair amount of approximation in my code, which should be fine based on the scales I use (a few km). I shouldn't have to worry about the curvature of the earth.

Anybody know how I can improve my code?
Here are my references:
calculate points
lat and long to meters

        public static MapRectangle CreatMapRectangle(BalingZone zone, double thickness)
    {
        MapsCoordinate rectpoint2;
        MapsCoordinate rectPoint1 ;
        MapsCoordinate rectPoint3 ;
        MapsCoordinate rectPoint4 ;

        var point1 = zone.Coordinates[0];
        var point2 = zone.Coordinates[1];

        var latitudeDiff = LatitudeDiffToMeters(point2.Latitude - point1.Latitude);
        var longitudeDiff = LongitudeDiffToMeters(point1.Longitude - point2.Longitude, point1.Latitude);
        var slopeB = longitudeDiff / latitudeDiff;

        double latOffset = thickness * (slopeB / Math.Sqrt(1 + slopeB * slopeB));
        double longOffset = thickness * (1 / Math.Sqrt(1 + slopeB * slopeB));

        double p3Lat = CalculateLatitude(point1.Latitude, latOffset);
        double p3Long = CalculateLongitude( point1.Longitude, p3Lat , longOffset);
        rectPoint1 = new MapsCoordinate(p3Lat, p3Long);

        double p4Lat = CalculateLatitude(point1.Latitude, -latOffset);
        double p4Long = CalculateLongitude(point1.Longitude, p4Lat, -longOffset);
        rectpoint2 = new MapsCoordinate(p4Lat, p4Long);

        double p5Lat = CalculateLatitude(point2.Latitude, latOffset);
        double p5Long = CalculateLongitude( point2.Longitude, p5Lat , longOffset);
        rectPoint4 = new MapsCoordinate(p5Lat, p5Long);

        double p6Lat = CalculateLatitude(point2.Latitude, -latOffset);
        double p6Long = CalculateLongitude( point2.Longitude, p6Lat , -longOffset);
        rectPoint3 = new MapsCoordinate(p6Lat, p6Long);

        return new MapRectangle(rectPoint4, rectPoint3, rectPoint1, rectpoint2, thickness);
    }

    //use the quick and dirty estimate that 111,111 meters (111.111 km) in the y direction is 1 degree (of latitude)
    // and 111,111 * cos(latitude) meters in the x direction is 1 degree (of longitude).

    private static double LatitudeDiffToMeters(double latitudeDiff)
    {
        return 111111.0 * latitudeDiff;
    }

    private static double LongitudeDiffToMeters(double longitudeDiff, double latitude)
    {
        return 111111.0*Math.Cos(latitude)*longitudeDiff;
    }

    private static double CalculateLatitude(double latitude, double offset)
    {
        return latitude + offset/111111.0;
    }

    private static double CalculateLongitude(double longitude, double latitude, double offset)
    {
        return longitude + offset/(111111.0*Math.Cos(latitude));
    }
}


texts: Using Offline map in Google Maps API for Android without copying tiles to mobile device?

texts:
I want to use my own tile maps in google maps api for android .The tile maps are created using ArcGIS for server 10.2 . The cache size is about 400 megabyte .I can't copy the cache in mobile devices because i want to create small size apk . Is there any solution to use the caches in google map api for android?

I use ArcGIS Desktop and server 10.2 for caching  and google maps api .

I don't want use rest service of ArcGIS server service .

Is there amy api's that i can use for my purpose?


texts: How to navigate through a vectorgrid with arrow keys in QGIS

texts:
I have a written a python-script below which creates a vector grid based on the resolution of a .tif image (satellite imagery).

import processing

layer = iface.activeLayer()

#define parameters for the qgis vectorgrid algorithm
xmin = (layer.extent().xMinimum())
xmax = (layer.extent().xMaximum())
ymin = (layer.extent().yMinimum())
ymax = (layer.extent().yMaximum())
extent = "{0},{1},{2},{3}".format(xmin,xmax,ymin,ymax)
pix_xy= (layer.rasterUnitsPerPixelX() + layer.rasterUnitsPerPixelY())/2
gridsize = (((layer.width() + layer.height())*pix_xy)/2)/8

#create grid
processing.runandload('qgis:vectorgrid',
                  extent,
                  gridsize,
                  gridsize,
                  0,
                  None)

This vector grid contains an attribute table with, among other things, an ID field.

I would like to navigate through the vector grid cells/feature by keyboard arrows (or other keys). For example if down key is pressed, it selects the vector gridcell/feature below. I have no clue how to do this in the Python console.

I'm working with QGIS 2.18.14


texts:
I am a relatively new convert to the GeoNetwork (on 2.6) and presently setting up a server in the UK but have been having issues with the crs code used in , I think this is where I need to make the changes but please correct me if wrong!

What I am trying to do is to project the data in the "mapViewer" and "mapSearch" (within config-gui.xml) in a projection other than epsg:4326, which for my region is epsg:27700 (the UK), so that when a viewer looks at the map the data are projected in a manner familiar to the viewer.  However, when I set the crs code to 27700 I find that the map elements of GN do not load.  I would be very grateful if somebody could please assist as I have tried many different options and appear to be getting nowhere - are there some other files that I should be modifying?

Many thanks in advance for any assistance with this.

Mark


texts: ogr2ogr SHP to MSSQL import leaves geometry column empty

texts:
I am trying to import a Shapefile with polygon features into MSSQL database with this command:
ogr2ogr -f "MSSQLSpatial" "MSSQL:server=***;uid=***;pwd=***;database=***" "D:\GeoData\processed\usage_land.shp" -a_srs "EPSG:4326" -nlt "POLYGON" -nln "import_usage" -progress -skipfailures

Import does work so far but the geometry column ogr_geometry stays NULL.
Any ideas how to get this feature working? Which command am I missing?


texts: Loading spatialite tables into GeoPandas GeoDataFrame

texts:
Using information from here, I am trying to load a result of a SQL Python selection into a Geopandas geodataframe. I know pyspatialite is not longer maintained, so have tried using the dbapi2 module from sqlite3. When I run the line:

df = gpd.GeoDataFrame.from_postgis("SELECT name, Hex(ST_AsBinary(geometry, 27700)) as geom FROM table;", conn, geom_col='geom')

I get an error: no such function: ST_AsBinary. I thought that that was a basic Python command. Am I missing something?


texts: Getting GeoJSON properties to appear in popup on feature click in OpenLayers 3?

texts:
I have a map with a base layer and a geojson cluster layer. I want to be able to click an individual feature on the map and have the contents of the properties be displayed in a popup. I currently have just the position working in the popup but I would like to get information like the name of the feature and various other things. This is my code that gets me a location popup:

var element = document.getElementById('popup');

var popup = new ol.Overlay({
element: element,
positioning: 'bottom-center',
stopEvent: false
});
map.addOverlay(popup);

// display popup on click
map.on('click', function(evt) {
var feature = map.forEachFeatureAtPixel(evt.pixel,
  function(feature, layer) {
    return feature;
  });
if (feature) {
var geometry = feature.getGeometry();
var coord = geometry.getCoordinates();
popup.setPosition(coord);
coord = ol.proj.transform(coord, 'EPSG:3857', 'EPSG:4326');
$(element).popover({
  'placement': 'top',
  'html': true,
  'content': ('
Location:
'+coord)
});
$(element).popover('show');
} else {
$(element).popover('destroy');
}
});

This works fine but I would like to get the other properties. I have tried feature.get('property here') instead of feature.getGeometry(); and geometry.getCoordinates(); but that made it so the popup never appeared and the only thing I was getting in firebug was an error in the ol.js b.slice() is not a function. So basically my question is: Is there a clear cut way to display all GeoJSON properties of a feature in a popup? I got my popup using the null island example here

And here is an example JSON feature:

 {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[0.13138000,49.475577]},"properties":{"name":"227006760","speed":"55","Nav_Status":"5"}}]}


texts: How to visualize route layer on ArcPy Jupyter Notebook (ArcGIS)

texts:
I tried to visualize the route between two points using ArcPy in a Jupyter notebook. The network module is activated in my Esri account. Even though it visualizes the map I can't see the route on that as the tutorial shows.

Here is the code I used. I guess the problem with visualization. However I can see the following message on the console.

  [esri.views.LayerViewFactory] Failed to create view for layer 'Terrain3D, id:worldElevation' of type 'elevation'

(I tried with both Windows and Linux environments and the result is still the same )

from copy import deepcopy
from datetime import datetime
from IPython.display import HTML
import json
import pandas as pd
from arcgis.gis import GIS
import arcgis.network as network
import arcgis.geocoding as geocoding

user_name = 'user'
password = 'pw'
my_gis = GIS('https://www.arcgis.com', user_name, password)

route_service_url = my_gis.properties.helperServices.route.url
route_service = network.RouteLayer(route_service_url, gis=my_gis)

stops = '''-3.203062,55.906437; -3.190080,55.935570'''

route_layer = network.RouteLayer(route_service_url, gis=my_gis)
result = route_layer.solve(stops=stops,
                       directions_language='en-US',
return_routes=True,
                       return_stops=True, return_directions=False,
                       return_barriers=False,
return_polygon_barriers=False,
                       return_polyline_barriers=False)

my_map = my_gis.map('Braidburn Valley', zoomlevel=13)
my_map


texts: QGIS - Is it possible to bypass an inaccurate WMS bounding box provided by server metadata?

texts:
In QGIS,
is there a way to bypass / ignore an inaccurate WMS bounding box provided by server metadata?

Indeed, for a specific WMS layer I am using, the bounding box provided by server metadata does not match the underlying data's extent (some data exist out of the "official" bounding box delivered by metadata request). Thus, I would like to prevent QGIS from using the inaccurate metadata so that I can see all of the data.


texts: Add XY coordinates same values as Latitude Longitude

texts:
I tried adding XY coordinates to longitude and latitude values I created in a csv file, and got to the point of having the csv converted to shapefile and in the correct coordinate system. I didn't manage to do it through Add XY Coordinates from Data Management, but doing it manually by adding geometry as someone suggested on another thread. The problem is that the output coordinates are the same as the latitude and longitude values

and I would bviously need the data in the format:

Is there any major mistake I might be doing? And is it possible to somehow calculate or find out the coordinates manually, if this cannot be resolved?

Edit:
I tried editing that section as you said, and I tried changing the datum or default coordinates system so much that I don't remember how many edits I did, but it still gives me the same values. At this point, I would like to ask if anyone knows how to find out what to add in the "origins" section in this convertor to get the values manually. I only have aroound 20 values, but I still have 100 problems as I don't have much knowledge about the program and its usage. s16.postimg.org/mhnskbqh1/image.jpg


texts: Alternatives to Zonal Statistics which include partial pixels (QGIS)

texts:
The task I want to complete is essentially exactly what the Zonal Statistics plugin for QGIS aims to achieve: gives statistics about the values of a raster layer in areas defined by polygons.

However, the way Zonal Statistics seems to work is that it treats a pixel as either 'in' or 'out' of the polygon ('in' if more than half the pixel is in?). Due to limitations of my data, my raster pixel size (30m) is close to the size of the polygons I am using (100m radius circles) so those edge effects become very important. I would therefore like an alternative method which calculates the same statistics, but based on the actual area of each pixel contained within the polygon.

One option I have thought of would be to crop the raster to match my polygons, polygonize the raster, export the values and areas of the generated polygons, and carry out the calculations separately, but that seems like a lot of effort compared to a tool like Zonal Statistics. This method may also be complicated by the fact that some of my polygons overlap.


texts:
I have a table of point, with a bunch of data attached. I need to replace them with polygons.

Drawing a polygon creates a new record. Deleting the point deletes the record.

How can I replace the point with a polygon without creating a new record and copy and pasting the data over?


texts: How to append row and column number bands to a geotiff file?

texts: I'm looking for a way to append to a geotiff file: (i) a band giving the row number for each pixel and (ii) a band giving the column number for each pixel. Preferably a command line tool that can be integrated into a linux bash script.


texts: Getting Error,while trying to access Web appbuilder Developer Edition

texts:
I have both arcgis online and arcgis portal organization accounts. I did all steps to create web appbuilder developer edition according to documents like this one : https://developers.arcgis.com/web-appbuilder/guide/getstarted.htm

I enter correctly both my Arcgis Online Url and App id, that i created in same arcgis online acount - contents. But i still get this error:

Error

Invalid redirect_uri

Error: 400

There is also another problem. When I type my portal Url, System doesnt accept it. I can only use my arcgis online account.(This problem is resolved. When I go to website with mozilla it doesn't accept my portal url, but with chrome it works. )

I tried different methods. But i always get this error. I also removed signinginfo.json file in /server everytime I fail entering website.


texts:
I wish to control the displaying of tms overlays with just a slider. Until now, I was adding all of my layers in the map like this
            var googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}',{maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3']});

            var layer1 = L.tileLayer('./layer1/{z}/{x}/{y}.png', {tms: true, attribution: "", opacity:0, minZoom: 9, maxZoom: 20});
            var layer2 = L.tileLayer('./layer2/{z}/{x}/{y}.png', {tms: true, attribution: "", opacity:0, minZoom: 9, maxZoom: 20});
            var layer3 = L.tileLayer('./layer3/{z}/{x}/{y}.png', {tms: true, attribution: "", opacity:0, minZoom: 9, maxZoom: 20});

            var map = L.map('map', {
            center: [48.8382880969, 2.33243516638],
            zoom: 18,
            minZoom: 0,
            maxZoom: 20,
            layers: [googleHybrid, layer1, layer2, layer3]
        });

And I was constolling them like this
<input class="slider" type="range" min="0" max="1" step="0.01" value="0" oninput="slider1.setOpacity(this.value)" name="slider1" id="slider1">
<input class="slider" type="range" min="0" max="1" step="0.01" value="0" oninput="slider2.setOpacity(this.value)" name="slider2" id="slider2">
<input class="slider" type="range" min="0" max="1" step="0.01" value="0" oninput="slider3.setOpacity(this.value)" name="slider3" id="slider3">

It's very simple and worked until now. But because of the increasing number of layers always loaded in the map, my site is slowing down.
So I would like to know if any of you know a simple way to add a layer when the range value of a slider is different from 0 and remove it when it reach the 0 again. I'm sorry if it's something considered as easy, I never learned JavaScript.
I already tried to set a value to each slider corresponding at each layer in the input and get the range value associated but it didn't work.


texts: Convert PNG to GeoTIFF: Invalid pixelsize in geotransform array in FME

texts:
I'm converting PNG file to GeoTIFF. Here's the setup that I use in FME:

PNGRaster ->
    RasterExtractor ->
        CoordinateSystemSetter ->
            RasterGeoReferencer ->
                writer

The settings of RasterGeoReferencer:

But when I try to upload the map to mapbox I get an error: Invalid pixelsize in geotransform array. What is wrong?


texts: Steps for installing new GDAL version for Python in Ubuntu 18.04

texts: If I'm installing the GDAL stock version from Ubuntu 18.04 then the installed version is 2.2 and I need at least 3.0.4 to better handle Sentinel 2 data. Is there  a way to update GDAL to version 3.1.0?


texts: How to load geojson vector tiles from mapbox id?

texts:
I have some data hosted on mapbox and I'm trying to load it as tiled geojson into Leaflet from its mapbox id (I just want to get plain geojson, I'm not trying to render it). How can I achieved that?

I tried this snippet:

L.mapbox.accessToken = 'myAccessToken';

var featureLayer = L.mapbox.featureLayer('myDataId');

but it doesn't work, I get the following error:

" could not load features at http://a.tiles.mapbox.com/v4/"myDataId"/features.json?access_token="myAccessToken" "


texts: How to automate conversion of raster NoData values?

texts:
I am doing the work of change all null pixels to a value of -1 in the raster file X with raster calculator by using following syntax:

Con(IsNull("X"),-1,"X")

However, I need to do the same work on >200 raster files. Is there any other method so that I can do these works simply?


texts: Why does "calculate" button remain gray in Group Stats Plugin?

texts:
I'm trying to use the Group Stats Plugin.

Unfortunately I can not use the plugin: after I enter all the required values, press "calculate" is not active and is always gray.

My problem is that I have a shape of point that are points for animal sightings.  This shape is formed by a text field containing the types of areas (beech, poplar, etc.) and another containing the areas value.
I need to calculate the number of records that contains a precise type of vegetation and the sum of the relative areas.

Is this possible with Group Stats Plugin?


texts: How to extract specific information from GRIB files?

texts:
How to extract fetched GRIB data with Python and gribapi package (link goes to official ECMWF Wiki)? I tried to follow few examples from their "documentation" and do it myself, but I just cannot figure out how to retrieve only specific parameter (e.g. surface temperature or wind) for given latitude and longitude. I don't need to plot the data or visualizations, I just need to pass few parameters when reading the file and get numbers back.

So far, I tried to download original GRIB2 file from www.ftp.ncep.noaa.gov and run few Python API example scripts from mentioned ECMWF Wiki page. Since Python API documentation doesn't exist, I have some hard time to understand which methods should I use in order to:

read the file,
select only specific "message" (e.g. surface temperature only) if there's more "messages" in a file,
print out the value for a specific location (using grib_find_nearest method).

Example code which I have so far, mostly copied from ECMWF examples and this answer from Getting time dimension from GRIB file?:

import traceback
import sys

# hopefully the only external package I need
from gribapi import *

# file with all possible 'messages'
INPUT = '2015121406_gfs.t06z.pgrb2.0p25.f000'
VERBOSE=1 # verbose error reporting

def example():
    f = open(INPUT)

    # location we are interested in
    lat, lon = 64.1353, -21.8952

    while 1:
        # STEP 1:
        # open downloaded GRIB2 file
        gid = grib_new_from_file(f)
        if gid is None: break

        # define the iterator (which is throughout the program the same?)
        iterid = grib_iterator_new(gid,0)

        # get the result for the nearest location
        nearest = grib_find_nearest(gid, lat, lon)[0]

        while 1:
            # STEP 2:
            # ???
            #
            # the loop goes through the whole file
            # instead just selecting messages we need beforehand...
            # fictional function which selects
            # 'TMP' (temperature) on 'surface' messages only
            # without need to iterate all of them:
            #
            # result = grib_select_specific_message(gid, 'TMP', 'surface')

            result = grib_iterator_next(iterid)
            if not result: break

        # STEP 3:
        # profit!
        # result variable returns numbers which I process in any way I need, yay!

        # more undocumented stuff,
        # put here just because examples do it the same way
        grib_iterator_delete(iterid)
        grib_release(gid)

    f.close()

# main program function
def main():
    try:
        example()
    except GribInternalError,err:
        if VERBOSE:
            traceback.print_exc(file=sys.stderr)
        else:
            print >>sys.stderr,err.msg

        return 1

# run the program
if __name__ == "__main__":
    sys.exit(main())

The problem with this code is that it iterates trough the whole file, all the messages and all possible coordinates (whole planet, 0.25 degrees precision). If file is 300+ MB it takes a while to read it. I feel like using "iterator" here (whatever that is) is a bit wrong since I need to "cherry-pick" only specific information (few weather parameters for a particular location only) and grib_find_nearest() function doesn't need an iterator at all to select only part of the data.
This could be half-solved with filtering the data I need before downloading the file (results in much smaller file) but I'm still not sure how to do it (part of Downloading GRIB GFS files with specific filters?), but still I'd like to figure this out since it might happen that I will occasionally have to download "full" files.


texts: ArcMap continuous scrolling when Shift key pressed?

texts:
I am using ArcGIS Desktop 10.4.1.

I need to use the shift key to select multiple segments to merge them together, this has been working fine until today when I press the shift key and the map immediately starts scrolling. The only way I have managed to get it to stop it by pressing it multiple times.

However, when I go to use it again to select multiple features it starts scrolling again.

Can anyone help?

I'm fairly new to the program.


texts: ogr2ogr with GDAL 2.4 not reprojecting correctly

texts:
I have downloaded the latest OSGeo4w (GDAL 2.4) and GDAL 2.4 (from GIS Internals site) but I cant get the below command to correctly reproject the shapes in either application.

I used the command below

ogr2ogr.exe  -f MSSQLSpatial "MSSQL:server=blah;database=blah;trusted_connection=yes;" "MSSQL:server=blah;database=blah;trusted_connection=yes;" -overwrite -sql "select databaseName,objectid,shape from gm.dbo.stg_polygon" -s_srs "EPSG:26910" -t_srs "EPSG:102008" -lco "UPLOAD_GEOM_FORMAT=wkt" -lco "GEOM_TYPE=geometry" -lco "GEOMETRY_NAME=shape" -nlt POLYGON  -nln "stg_ztest"

It always returns a spatial SRID = 32768.  We are loading into SQL Server 2017.This works correctly using OSGeo4W shell (from QGIS 2.18) in GDAL 2.2.1


texts: Why do we use PolylineClass() instead of Polyline()?

texts: I was wondering why we instantiate a class with a class word instead of just the name of the class?


texts: Calculating value sum of cells inside drawn polygon using ArcMap?

texts:
How to calculate the value sum of cells inside a drawn polygon?

I need to measure the caloric output of countries and caloric output of Oil Fields polygons separately. My setup: SHP file World Borders, SHP file OilFields and TIF file Post1500OptCalories, I’m working in geographic projection WGS 84. I’m using the zonal statistics as table tool, and interested in the statistics type “SUM”.   There are no problems calculating caloric output for countries, but calculating caloric output for Oil Fields polygons brings very suspicious results.

On the Picture 1 you can see that values in the column “SUM” are less than values in columns “MAX” and “MEAN”. Somewhere column “MAX” have zeros while corresponding values in the “MIN” column are strictly higher than zeros. When I try to calculate different statistics separately, e.g. “SUM” or “MEAN”, I get the same values for these statistics as in the “MIN” column when I’m calculating all statistics simultaneously (unfortunately, I'm not allowed to add more pictures). Conclusion: computed caloric output of OilFields polygons is incorrect.

I’m sorry for my English and poor knowledge of ArcGIS software.

Does anyone know what can be the problem?


texts: gdalwarp opens cmd during batch process in python

texts:
I am trying to process several MODIS images. I selected a sub dataset and saved them as geotiff files. In the next step I want to extract a regional subset and also change the projection from MODIS sinusoidal to WGS 84. However, after each processed file a cmd window pops up with the error code (usually 0) when I use QGIS to run the script and after a while my entire computer freezes.

Originally I used the os.system() command, which forced me to close the cmd window in order to process the next file from QGIS, in the OSGeo Shell it just stopped the script.

What can I do?

This is my code. Input/Output directories and extensions (both .tif) are defined at the beginning. The .prj file contains details about the source spatial reference set. Entire code + input and some output files here:
https://www.dropbox.com/sh/xj2raarioz27z2q/AAAOveRhl_cprQ44GxR3NQaIa?dl=0

#coordinates spatial subset
xmin = 50.0
ymin = 8.6
xmax = 51.0
ymax = 9.6

#Loop for all HDF Files in directory

filelist = os.listdir(inputdirectory)
for files in filelist:
    if files.endswith(inputwildcard):
        print 'processing ', files

# Create spatial subset
#proj = '+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs'
    inputname = inputdirectory + files
    subsetfile = outputdirectory + files[:-4] + regionextension + outputextension
    subset = 'gdalwarp -to SRC_METHOD=NO_GEOTRANSFORM -overwrite -of GTiff -s_srs D:\\MODIS\\6842.prj -t_srs EPSG:4326 -te ' + str(xmin) + ' ' + str(ymin) + ' ' + str(xmax) + ' ' + str(ymax) + ' ' + inputname + ' ' + subsetfile
  #  print subset
  #  sys.exit(0)
try:
 subprocess.Popen(subset, shell=False)
except:
 print 'Some error'
sys.exit(0)


texts: How to convert a huge database of ED50 coordinates into WGS84?

texts:
As the title says I have a huge database containing (among other data) a pair of coordinates using ED50 standard for each record.

I'm tasked to update the whole thing and convert all the ED50 entries to WGS84.
The whole database is used in FileMaker, I can export it in csv,xls,tab and some other formats.

Is there a "function" that I can apply to all these fields and change them all at once?

I searched on the internet but have found nothing useful.


texts:
In the following code (line 3), I dont understand why split('.')[-1] is used and what it does.

arcpy.env.workspace = sde_gdb

for table in arcpy.ListTables():

    t_name = table.split('.')[-1]
    arcpy.TableToGeodatabase_conversion(table, gdb)


texts: how to calculate the mean value of pixels of a raster in Grass plugin in qgis?

texts: I am using grass plugin in qgis 2.12. I have to estimate the average value of all the pixels but don't know how to do it.


texts: Two Different Areas for the same Image in Google Earth Engine

texts:
IMPORTS:

var polygon = /* color: #d63000 */ee.Geometry.Polygon(
        [[[-119.33364769821117, 46.05123532178373],
          [-119.3233620672313, 45.869732769408905],
          [-119.04111088542663, 45.873079023065166],
          [-119.0396574679861, 46.045448840018565]]]),
    landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA_FMASK");

FIRST CODE:
In the First Code, Collection is Filtered and Mosaic is applied even though it is only one image.

var PIXEL_SCALE = 30; // Meters. Resolution of most Landsat 8 bands
var PIXEL_AREA = PIXEL_SCALE * PIXEL_SCALE; // Square meters.

// Fmask classification values
var FMASK_CLEAR_GROUND = 0;
var FMASK_WATER = 1;
var FMASK_CLOUD_SHADOW = 2;
var FMASK_SNOW = 3;
var FMASK_CLOUD = 4;

var mosaic = landsat8
  .filterBounds(polygon)
  .filterDate('2016-08-01', '2016-08-30')
  .mosaic();

// Update the mask on our mosaic to mask cloud and cloud shadow pixels
var fmask = mosaic.select('fmask');
var cloudMask = fmask.neq(FMASK_CLOUD).and(fmask.neq(FMASK_CLOUD_SHADOW));
var maskedMosaic = mosaic.updateMask(cloudMask);

Map.addLayer(fmask, {min:0, max:4, palette:'green, blue, black, cyan,
white'}, 'Fmask');
Map.addLayer(maskedMosaic.select('B4'), {min:0, max:0.5, palette:'yellow,
green'}, 'Masked NIR');
Map.setCenter(-119.34, 45.97, 8);

// Calculate the number of pixels of each classification in our polygon
var regionCoverHistogram = mosaic.select('fmask')
 .reduceRegion(ee.Reducer.frequencyHistogram(), polygon, PIXEL_SCALE);
print('Fmask class pixel count within region', regionCoverHistogram);

var waterPixelCount = ee.Dictionary(regionCoverHistogram.get('fmask'))
  .get(FMASK_WATER.toString());

var waterArea = ee.Number(waterPixelCount).multiply(PIXEL_AREA);
print('Water Area (sq meters) in region', waterArea);

SECOND CODE:

Whereas in the Second Code, I am directly taking the Image ID of the same image and running the same algorithm.

var PIXEL_SCALE = 30; // Meters. Resolution of most Landsat 8 bands
var PIXEL_AREA = PIXEL_SCALE * PIXEL_SCALE; // Square meters.

// Fmask classification values
var FMASK_CLEAR_GROUND = 0;
var FMASK_WATER = 1;
var FMASK_CLOUD_SHADOW = 2;
var FMASK_SNOW = 3;
var FMASK_CLOUD = 4;

var mosaic  = ee.Image('LANDSAT/LC8_L1T_TOA_FMASK/LC80440282016227LGN00');

// Update the mask on our mosaic to mask cloud and cloud shadow pixels
var fmask = mosaic.select('fmask');
var cloudMask = fmask.neq(FMASK_CLOUD).and(fmask.neq(FMASK_CLOUD_SHADOW));
var maskedMosaic = mosaic.updateMask(cloudMask);

Map.addLayer(fmask, {min:0, max:4, palette:'green, blue, black, cyan,
white'}, 'Fmask');
Map.addLayer(maskedMosaic.select('B4'), {min:0, max:0.5, palette:'yellow,
green'}, 'Masked NIR');
Map.setCenter(-119.34, 45.97, 8);

//
// Calculating Region Cover Statistics
//

// Calculate the number of pixels of each classification in our polygon
var regionCoverHistogram = mosaic.select('fmask')
 .reduceRegion(ee.Reducer.frequencyHistogram(), polygon, PIXEL_SCALE);
print('Fmask class pixel count within region', regionCoverHistogram);

var waterPixelCount = ee.Dictionary(regionCoverHistogram.get('fmask'))
.get(FMASK_WATER.toString());

var waterArea = ee.Number(waterPixelCount).multiply(PIXEL_AREA);
print('Water Area (sq meters) in region', waterArea);

I am getting two Different Water Areas for the same image. Why?