texts: Converting Multipart annotation to Singlepart causes stale record

texts:
When converting a feature-linked multipart annotation to a singlepart in either the context menu within ArcMap, or with the ArcObjects  interface I am left with an annotation that becomes stale.

The only way I can fix this is by moving the annotation a little bit, in this case its in follow feature mode.  This also generally makes the rotation handles in the corners appear.  It also populates the angle field in the annotation featureclass.

Converting to a singlepart annotation does work without error.  The problem manifests when you try to edit a field such as "Angle" in the annotation featureclass.  It always gives me the error "Invalid Angle".  By default, upon conversion, the angle field will still say 0.

Is there some method within ArcObjects that will perform the same sort of action that moving an annotation does to "refresh" itself when converted to a singlepart?

Relevant Code snippet:

var annoFeature = feature as IAnnotationFeature2;
var element = annoFeature.Annotation;
((IMultiPartTextElement)element).ConvertToSinglePart();
feature.Store()


texts: Summary table with a field that shows components of each summarized record

texts:
I have a table with 2 fields the first is for community and the second for the main community that it belongs to, as in the image

I want to summarize the second field (Belongs_to) but with an extra field (multiple value field) that shows components of each main community, as in the image

Could anyone help me please?


texts: Comma separated field in a PostgreSQL (PostGIS) SELECT query?

texts:
I've polygons and points in a PostGIS database. Let's say there are red, blue, green and yellow points. This information is saved in a field named 'color'. What I want to do is to select all polygons without red points:

CREATE VIEW polygons_without_red_points AS
SELECT
DISTINCT ON (gid)
polygons.*
FROM
polygons LEFT JOIN points
ON ST_Contains(polygons.geom, points.geom)
WHERE points.geom IS NULL OR points.color != red;

Duplicate geometries should be removed from the result set! Unfortunately, I do not know how to save the color information in the polygons. Is there a way to create a comma separated field?


texts: What causes an Autofield to turn off in QGIS?

texts:
Sometimes when I reopen a project, the autofields that I have set up previously are turned off. Other times they remain.

This is the Autofields Plugin. I have autofields for lengths and coordinates of some of my layers that update whenever I save that layer. By "turned off" I mean that they no longer automatically update these fields. The fields are still there, they just do not automatically update and they retain the value they last had.

What would cause autofields to toggle off? We have multiple people potentially working on a project at different times. Could that cause them to toggle off?


texts: MapServer Mapfile: Scalebar not displaying correct distances?

texts:
Scalebar:

SCALEBAR
  LABEL
    COLOR 0 0 0
    SIZE SMALL
  END
  STYLE 0
  SIZE 180 8
  POSITION lc
  COLOR 0 0 0
  UNITS MILES
  INTERVALS 2
  TRANSPARENT TRUE
  STATUS EMBED
END

I didn't even have a projection prior to adding the scalebar, I would just use the same projection per layer. So, I added that same projection outside the layers:

PROJECTION
  "proj=latlong"
  "ellps=WGS84"
  "datum=WGS84"
END

Currently the scale bar comes up correct in size and intervals (2). The distance is 40 miles, which is definitely incorrect.

Any ideas on how to fix this?


texts: How can I scale a feature referring to the area?

texts: I'd like to scale features with a scale factor. With the scale tool of the editor toolbar it is possible to define a factor but then every single line of the feature is scaled by this factor. However, I'd like to scale the feature referring to the area and not referring to every line (for example 1.5 times the size it was before). Moreover, I'd like to automise the whole process. Does this only work with a python script?


texts: ECD file not produced from the "Train Random Trees Classifier" tool

texts:
I am using ArcMap 10.4.1 and i am trying to use the Train Random Trees Classifier tool to create an .ecd file, before finally using the Classify Raster tool to extract certain areas in the raster.
I am using 8 bit unsigned SideScanSonar images that have been smoothed and edge enhanced with laplacian 5x5.

In the geoprocessing window i get the message that the tool has been run successfully, and it states the lcation of the new file it allegedly created. However, i can not find the .ecd file neither in that specific folder or in any folder on my computer.

Why is it nowhere to be found?

I have tried several training features, of different extent and sized. cant get it to work.

An .ecd file IS created when using the ISO cluster Classifier tool.


texts: Exporting multiple dataframes as images using ArcPy?

texts:
I use this code to export a dataframe to png, and it works.

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
ar = df.extent.height / df.extent.width
arcpy.mapping.ExportToPNG(mxd,r"C:\Users\Kakemphaton\Desktop\out.png",df,1024,1024*ar,96,True)

Code from: Writing world file when exporting TIFF using ArcPy Mapping?

This code exports only the first dataframe and always the first. I can't export others and I have multiple dataframes in my mxd (example_1, example_2, example_3). How could I export example_2 and example_3? I tried to activate it for example_2, but it always exports example_1.


texts: Performing a raster calculation on three different soil texture layers originating from a WMS service in ArcGIS Pro

texts:
The goal of the project is to make a suitability map of the soil textures in Europe. I already use the LUCAS topsoil data, but it came to my attention that many points in this data set don't have soil texture data. So, I went to look for something better, which originates from WMS services. However, after some searching on the internet I couldn't find how to perform query commands on these layers. (see picture for an example of the map)
So, if anyone knows how to perform similar calculations to the raster calculator in ArcGIS Pro with the WMS services layers, it would be really helpful.
Otherwise, I'm forced to use the LUCAS topsoil data and just use the raster calculator tool.
Below you can find the source of the data, for extra clarification:


texts:
I'm trying to create a memory layer with gdal/ogr python that contains a Binary Field.
But I didn't succeed, where am I wrong?
from osgeo import ogr

# create layer
driver = ogr.GetDriverByName('Memory')
data_source = driver.CreateDataSource('foo')
layer = data_source.CreateLayer('bar')

# create binary field
field_name = 'bin_field'
binary_field = ogr.FieldDefn(field_name, ogr.OFTBinary)
layer.CreateField(binary_field)

# add feature that contains binary value
bytes_value = bytes(b'hello world')
feature = ogr.Feature(layer.GetLayerDefn())
feature.SetField(field_name, bytes_value)
layer.CreateFeature(feature)

Error message :
    feature.SetField(field_name, bytes_value)
  File "/usr/lib/python3/dist-packages/osgeo/ogr.py", line 4321, in SetField
    return _ogr.Feature_SetField(self, *args)
TypeError: Wrong number or type of arguments for overloaded function 'Feature_SetField'.
  Possible C/C++ prototypes are:
    OGRFeatureShadow::SetField(int,char const *)
    OGRFeatureShadow::SetField(char const *,char const *)
    OGRFeatureShadow::SetField(int,double)
    OGRFeatureShadow::SetField(char const *,double)
    OGRFeatureShadow::SetField(int,int,int,int,int,int,float,int)
    OGRFeatureShadow::SetField(char const *,int,int,int,int,int,float,int)


texts:
Consider this example,

https://geoext.github.io/geoext2/examples/grid/feature-grid.html

It uses

protocol: new OpenLayers.Protocol.HTTP({
                url: "../data/summits.json",
                format: new OpenLayers.Format.GeoJSON()
            })

for the locations and elevations of some mountains. There are three properties: name (string), height (long), and geometry (point).

What I want to do is put the json file onto GeoServer and call it that way. I imported the file into GeoServer, and I know it works because I can see it with a WFS url. But I'm trying to load it with the code

var vecLayer = new OpenLayers.Layer.Vector("vector", {
    styleMap: new OpenLayers.StyleMap({
        'default': style
    }),
    strategies: [new OpenLayers.Strategy.Fixed() ],
    protocol: new OpenLayers.Protocol.WFS({
        readFormat: new OpenLayers.Format.GeoJSON(),
        url: "http://fakeurl.com/geoserver/wfs",
        srsName: "EPSG:4326",
        featureNS: "http://fakeurl.com/geoext/geonodeuri",
        featureType: "summits",
        outputFormat: "json",
        version: "1.1.0"
   })
});

I know that url, featureNS, and featureType are all correct because I can successfully add other shapefile vectors in the same workspace with them. I'm quite stumped as far as getting the WFS protocol to work, however. Do I need to set geometryName or something? GeoServer lists three properties, and I need all three of them. Ideally I would get the exact same result as the simple OpenLayers.Protocol.HTTP protocol.

If I put the JSON file in a web directory and do an HTTP protocol to it, it works. Which is to say,

protocol: new OpenLayers.Protocol.HTTP({
                url: "http://fakeurl/data/summits.json",
                format: new OpenLayers.Format.GeoJSON()
            })

displays just fine. However, when I link to a WFS Getfeature request, like

protocol: new OpenLayers.Protocol.HTTP({
                url: "http://fakeurl/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=geonode:summits&maxFeatures=50",
                format: new OpenLayers.Format.GeoJSON()
            })

I get no result. But the url provided displays the JSON file in a browser. I don't understand. I just want some way of getting those contents via GeoServer, but it continues to elude me.

turns out there's something wrong with the layer itself. I can view the JSON data through a link but only if I'm logged into Geoserver. If I'm not logged in, then I get a "Could not find layer" message. So I guess that's my issue: why data imported in GeoServer it not made public (my JSON), but a layer through Geonode is.


texts: How to extract values from raster at points with many different rasters and points

texts:
I have a folder containing 100 DEM rasters.  I have a point file containing thousands of points.  I need to collect raster values at all of these points.

Only some of the rasters intersect with the points, so I need to somehow pull out rasters that intersect with points and then extract values to the points that intersect with the raster.


texts: Connecting to several WFS using python/OWSLIB/OGR2OGR

texts:
I'm trying to download a lot of datasets from different WFS URLs using ogr2ogr (and to an extent, owslib) in Python. My problem arises when I try to connect to a second WFS.

In my test code, I have first tried connecting to one WFS, then downloading the layer. This went fine. Afterwards, I replaced the URL with a second WFS URL. this time I got the error:

ConnectionError: ('Connection aborted.', ConnectionResetError(10054 An existing connection was forcibly closed by the remote host)).

In the first part of the code I try to extract the version number from the WFS:

import subprocess
from owslib.wfs import WebFeatureService as wfsmod

#connecting to second WFS using owslib
url = 'http://wfs2-miljoegis.mim.dk/raastofpaahavet/ows?
version=1.1.0&OUTPUTFORMAT=GML2'
wfs = wfsmod(url)
version =  (wfs.identification.version)
typenam ="rashavtilladelser20auktion"

The connection error happens at line "wfs = wfsmod(url)".

I also try to download a specific layer from this url using ogr2ogr/subprocesses:

if str(version) == "2.0.0":
    #layername is the specific title of the layer on the WFS server.
    layername = "&TYPENAMES="+layername
else:
    layername = "&TYPENAME="+layername

cmd =  [r"C:\OSGeo4W\bin\ogr2ogr.exe",
    "-f",
    "ESRI Shapefile",
    r"C:\havplan\havplan_data\wfs_downloads\havbrugszoner.shp",
     "WFS:"+url+"version="+str(version)
     +"&request=GetFeature"+layername]
subprocess.check_call(cmd)

as far as I understand, the error happens because I can only connect to one WFS at a time in Python. Is there some way to close the connection to a WFS in owslib and ogr2ogr using a command?


texts: Range search: Identify points in intersecting circles

texts:
I am trying to identify points in two intersecting circles. The points are only in the first circle $O_1$. In many cases, the node density in the circle is not uniformly distributed. The radial node density grows exponentially with the distance from the origin $O_1$. Checking which points lie in the intersecting area one by one takes linear time. It takes a lot of time when the number of points is huge. Is there any kind of geometric data structure or method that I can use to improve this?
(The coordinates of points and $O_1, O_2, R_1, R_2$ are given.)


texts: How to speed up PostGIS intersects query?

texts:
I have a table which contains 5,00,000 records. I want to fetch all the rows which intersects with the given bounding box.
My query is:

select * from data_master b
         where b.geom && 'BOX(-74.5312518129245 40.4469465897231,-73.8281269653149 40.9798974884433)'::box2d
        and b.class in (1,2,3,4,5)
        and b.statecode in ('LA');

I have build index on geom, class and statecode columns. Still this query is taking around 7 min and return around 24000 rows.
My data_master table contains data of 5 states. I have also tried to break this table into individual state table. Where each state contains around 90000-120000 rows. Still there is no improvement in the query execution time.

I am using PostGIS 2.5.1 and PostgresSQL 11.1

My query execution plan is:

 ->Bitmap Heap Scan on data_master b  (cost=5456.55..47805.76 rows=20906 width=843) (actual time=65.239..106.499 rows=45388 loops=1)
 ->Recheck Cond: (((statecode)::text = 'LA'::text) AND (geom && '01030000000100000005000000E49C9A0700A252C0B0F5BC8B35394440E49C9A0700A252C0F425E9476D7D4440A53D3E08007552C0F425E9476D7D4440A53D3E08007552C0B0F5BC8B35394440E49C9A0700A252C0B0F5BC8B35394440'::geometry))
 ->Filter: (class = ANY ('{1,2,3,4,5}'::integer[]))
 ->Heap Blocks: exact=19233
 ->  BitmapAnd  (cost=5456.55..5456.55 rows=20906 width=0) (actual time=59.390..59.390 rows=0 loops=1)
 ->  Bitmap Index Scan on idx_data_master_statecode  (cost=0.00..2320.56 rows=125351 width=0) (actual time=24.091..24.091 rows=123409 loops=1)
 ->Index Cond: ((statecode)::text = 'LA'::text)
 ->  Bitmap Index Scan on data_master_geom_gidx  (cost=0.00..3125.29 rows=89201 width=0) (actual time=31.081..31.081 rows=86010 loops=1)
 ->Index Cond: (geom && '01030000000100000005000000E49C9A0700A252C0B0F5BC8B35394440E49C9A0700A252C0F425E9476D7D4440A53D3E08007552C0F425E9476D7D4440A53D3E08007552C0B0F5BC8B35394440E49C9A0700A252C0B0F5BC8B35394440'::geometry)
 ->Planning Time: 0.476 ms
 ->Execution Time: 108.643 ms.


texts: I am in deadly need of geoserver rest php scripts for creating workspace, store, publishing layer etc. I have done a lot of googleing but couldn't find any. In geoserver site only examples using cURL are given. Can anybody provide me PHP scripts


texts: Stats for forest cover change over 10 years in R

texts:
I am rather new to GIS and I don't know how to perform the following operation: [ R programming language]
I am developing a project evaluating forest cover change over 10 years (2010-2020) for a specific area in the state of São Paulo/ Brazil. I have this area as a shapefile, and I have managed to clip this area from the raster of forest cover change in a single year (I can sure do it for the other years). I then proceeded to extract the value of the resulting raster to inspect the output. However, I don't know where to go from there to compile the forest cover change data over the years and compute statistics. The output from the extraction is a list I cannot interpret. Does anyone know how to do this? So far, I have used the sf, sp and raster packages.


texts: Join attributes by location summary: names instead of count

texts:
I have two layers: a 30m x 30m grid and a layer of polygons indicating landuse.
I already know how many landuse polygons are in each cell. For example cell 105 has 4 different classes of landuse. However, I also want to know which landuse classes are in this cell.
Is there are way to use "Join attributes by location (summary)" or another function to get a summary of the landuse classes for each cell? For example: cell 105 contains residential, industrial, allotment and park.


texts: Configuring lidR catalog to overwrite raster output (with different extension)?

texts:
I have a small issue with configuring the lidR package for parametrizing the extracted raster files with grid_metrics() function.

My question is how to set in the catalog options that:

be able to overwrite the results with a second run if I want to run
my script several times and I do not want to name each output
differently.
instead of .tif I would like to get .grd files as output.

My current code (which is working) is the following:

normalizedctg = catalog(workingdirectory)
opt_output_files(normalizedctg) <- paste(workingdirectory,"/clipped/normalized/{XLEFT}_{YBOTTOM}_height",sep="")
height = grid_metrics(normalizedctg, max(Z),res = resolution)

But with a second run on the same code I get the following error:

Error in .getGDALtransient(x, filename = filename, options = options,  :
  filename exists; use overwrite=TRUE


texts:
I have a binary image with pixel resolution in units of degrees (EPSG:4326):

In this case, all the light-blue pixels are water (value = 1) and purple pixels are not water (value = 0). I would like to compute a distance transform of this image, where the result is each pixel's distance away from the nearest "on" (water) pixel. This is doable with scipy:

However, the returned distances are Euclidean with respect to the row, column coordinates of each pixel. Does anyone know of a package or function that will compute a distance transform using the Haversine formula on the lon, lat coordinates rather than the row, col coordinates?
[I know I can reproject to a length-preserving CRS and multiply by the resolution.]


texts: Write M value into shapefile with geotools

texts:
I'm using the Java 1.8 library geotools (version "23-SNAPSHOT") to generate a shapefile.

Opening the resulting .shp file with QGIS was successfull and I noticed that the gemeotry was apparently automatically set to "PointZM", which is exactly what I want. Every point surprisingly also lists an "M" value (but they're all 0).

How do I set the M value (additional to x, y and z!) using the library? Does the library now automatically default to using "PointZM" (it didn't with an older version)?

The code I more or less copied from here:

final SimpleFeatureType TYPE = DataUtilities.createType("Location","the_geom:Point:srid=4326,name:String,number:Integer");
List<SimpleFeature> features = new ArrayList<SimpleFeature>();
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);

//Create features/points
for(int i=0; i<maxpoints; i++) {
    Point p = geometryFactory.createPoint(new Coordinate(i*10,i*5,i));
    featureBuilder.add(p);
    featureBuilder.add("P"+i);
    featureBuilder.add(i);
    SimpleFeature feature = featureBuilder.buildFeature(null);
    features.add(feature);
}

//Generate shapefile
ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
Map<String, Serializable> params = new HashMap<String,Serializable>();
params.put("url", fileout.toURI().toURL());
params.put("create spatial index", Boolean.TRUE);
ShapefileDataStore newDataStore = (ShapefileDataStore) dataStoreFactory.createNewDataStore(params);
newDataStore.createSchema(TYPE);

//Write file
Transaction transaction = new DefaultTransaction("create");
String typeName = newDataStore.getTypeNames()[0];
SimpleFeatureSource featureSource = newDataStore.getFeatureSource(typeName);
SimpleFeatureType SHAPE_TYPE = featureSource.getSchema();

if (featureSource instanceof SimpleFeatureStore) {
    SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
    SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, features);
    featureStore.setTransaction(transaction);

    try {
        featureStore.addFeatures(collection);
        transaction.commit();
    } catch (Exception e) {
        e.printStackTrace();
        transaction.rollback();
    } finally {
        transaction.close();
    }
} else {
    System.out.println(typeName + " does not support read/write access");
    System.exit(1);
}

There's a setM function for Coordinate, so I tried this:

Coordinate c = new Coordinate(i*10,i*5,i);
c.setM(i*20);
Point p = geometryFactory.createPoint(c);

But this only throws an exception:

  Exception in thread "main" java.lang.IllegalArgumentException: Invalid
  ordinate index: 3


texts: Open QGIS project from PostgreSQL DB while clicking on the QGIS desktop ICON using PyQGIS and Plugin

texts:
I am writing a PyQGIS code to directly open QGIS (loaded with QGIS Project file obtained from PostgreSQL database). Here's the code I have written in my Plugin-open_project.py file
QgsProject.instance().read(uri)
Here URI describes the PostgreSQL user credentials and DB name , port etc.
When I click on the QGIS desktop icon, it asks for username and password for the QGIS project saved in DB but does not load the project on the MapCanvas /layer panel. How can I open the Project using Plugin and PyQGIS?


texts: Seeking pre-compiled QGIS to run from USB stick?

texts:
Is there a place I can find pre-compiled QGIS?

I want to run it from my USB stick, without installation.


texts: Plotting points along line with specified distances from start using QGIS?

texts:
I have a table with distances in a line in meters.

Distance
---------
3110
3120
3145
...

I need to create points along this line in the distance from the start, as specified, using QGIS.

My doubt is similar to this Plot points along a line at specific distance value?, but the PyQGIS code didn't work.


texts: Polygons not properly exported in Adobe Illustrator (.ai) file format by ArcGIS Desktop?

texts:
I exported a map from ArcGIS 10.5 as an Adobe Illustrator (AI) file (.ai). When I open the .ai file (I'm using AI CC 2019 23.0.1 on a separate Mac), my ArcGIS polygons (Fig. 1) are 'messed-up'. Specifically, polygons that originally contained cut-outs (i.e. 'holes') are now 'filled' (Fig. 2). Moreover, AI has created unneeded polygons for the cut-outs (Fig. 3), but these don't necessarily match the original cut-outs - sometimes one original cut-out is filled by a mosaic of AI polygons.

How can I export the map/polygons correctly (I DO NOT want to post-process the polygons in AI)!?

Fig. 1. Example of a polygon layer in ArcGIS 10.5.

Fig. 2. Polygon layer from Fig. 1 in AI. Almost all cut-outs have been filled and AI has created one big polygon.

Fig. 3. AI has created additional, but unneeded, polygons for the cut-outs.


texts: Removing "duplicate feature" button from QGIS attribute table

texts:
when I enable action buttons on particular layer I always get two additional buttons in edit mode: duplicate feature and duplicate feature and digitize.
Is there any way to remove them, because they aren't very helpful at our current project (and they can be easily missclick)? I couldn't find any related option in layer properties so maybe there's an option to remove them in qgis options somewhere?

And by the way: after some edits on layer I usually get a duplicate of my buttons in first column (like on the screenshot below). Is it bug or a feature? And how to get rid of them also?

QGIS 3.4.x


texts:
I have a set of transportation analysis zones, and a set of shorted path polyline features connecting the centroids of each zone.  There are two line features between each zone, one for each direction.  Each line feature has an attribute, the travel demand between the origin and destination zone. The demand is not necessarily symmetrical.

I am trying to capture the total demand along "corridors".  Each corridor is a buffered zone around the line feature connecting two zones.  The buffer is used to select by location all other line features (connecting zones) that fall within the buffer.

I am now trying to sort out the demand by direction. I would like to select all line features whose destination zone is closer than its source zone to the corridor destination.

I am using Model Builder in ArcMap 10.2.2.  I can successfully select all line features within the buffered corridor and dissolve the demand, however, I am having difficulty sorting by direction.  I have tried several ideas, but have not found a working solution.  Does anybody have advice for how to approach the problem?

--
Edit:
I am currently using mock data, but I have 5 "census tracts", with an 11 digit GEOID ending with 1-5.  Each path has a start and end zone, with a separate line feature representing the path in each direction.  "Est" is the demand from origin to destination (circa 2010 CCTP commuter flows).


texts: Is it possible to inject a value into an algorithm text setting in QGIS Processing Model?

texts:
I have a SAGA Raster Calculator algorithm inside a model that I'm building.

For the formula, I'm using the function (g1>20)*1 to give me a binary raster output. This categorises pixels to buildings (1) or ground (0) depending on whether the altitude is 20m or more. This works as expected!

I can link this string expression into a string parameter in my model, and use this when I run my model.

For ease-of-use, I'd rather provide the threshold value of 20 as a numerical input value. So rather than

a string parameter "Minimum Height Expression" of "(g1>20)*1"

It would be something like

a number parameter "Minimum Height" of 20

And the expression inside the algorithm would be something like

(g1>[Minimum Height])*1

Is token subsititution like this possible with Processing? Or is there another way to get around this?


texts: Accessing raw data from LAZ file in Python with Open Source software?

texts:
Is there anyway to access raw "LAZ" (not LAS) datasets in Python? I was trying to with ArcPy (I'd prefer not too), but it doesn't seem able to access LAZ. I'd prefer to work with the raw LAZ file and develop something to give access to other users.

My goal here is to do some filtering of the data to produce different features in  a shapefile format. To do that I need to access the raw points XYZ, classification, and other fields. I've done this before, but never with a LAZ, only LAS.

I am looking for an Open Source, free solution, I know ESRI has some tools, but I am hoping to run this tool without any licensing needed.

This is related to What LiDAR processing tools are available in Python?, but specific to compressed LiDAR format (LAZ) and more about accessing the data than processing it.


texts:
I would like to use GIS data as input in a C++ program, to do some work around data before to pass them to the program core, then display some maps. I would like to do that with the QGIS C++ API. I'm working in Linux 14.04 LTS.

I'm trying to make this "hello world" example work:

//
// QGIS Includes
//
#include <qgsapplication.h>
#include <qgsproviderregistry.h>
#include <qgssinglesymbolrenderer.h>
#include <qgsmaplayerregistry.h>
#include <qgsvectorlayer.h>
#include <qgsmapcanvas.h>
//
// Qt Includes
//
#include <QString>
#include <QApplication>
#include <QWidget>

int main(int argc, char ** argv)
{
 // Some stuff
 return app.exec();
}

I get an error :

error: qgsapplication.h: No such file or directory

How do I precise to Qt to find the files ? Do I need to download QGIS sources before ?


texts: Coordinate conversion (EPSG:3857 to EPSG:4326) using OpenGIS/JTS too slow

texts:
I am using the Java based libraries of OpenGIS and JTS to convert coordinates from EPSG:3857 to EPSG:4326 to proceed to compute the distance using the Haversine formula. The distance features in a constraint on whether to zoom in further on a map or not.

We are using a tangible user interface and depend on the reactivity of the system. Unfortunately, the conversion is quite slow which induces even more delay than loading the map from a server. Would there be a less costly way to proceed with the conversion using local resources?

        CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");
        CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:3857");
        MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false);
        GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 3857);
        Point minPoint = geometryFactory.createPoint(new Coordinate(xMin, yMin));
        Point minTargetPoint = (Point) JTS.transform(minPoint, transform);
        Point maxPoint = geometryFactory.createPoint(new Coordinate(xMax, yMax));
        PointmaxTargetPoint = (Point) JTS.transform(maxPoint, transform);


texts: Does QGIS 2.14 handle WMS redirect properly?

texts:
I'm using QGIS 2.14 on Windows 7/8. I try to access a WMS version 1.3.0 set up in a DMZ and only accessible through a server running "F5 Networks" Application Delivery Control and Load Balancing software.

The first request, for the capabilities, always returns a HTTP redirect (code 302). Internet Explorer, other browsers and other GIS such as ArcGIS handle this 302 correctly. Using QGIS, I get this strange error:

  WMS Provider: Failed to download capabilities: Download of capabilities failed: Protocol "" is unknown

I was wondering if this is a known issue with QGIS and WMS redirects? In case this is an issue, what may be the solution?

PS. FYI: while ArcGIS does handle the redirect just fine, other open source GIS such as OpenJUMP en gvSIG had issues accessing the capabilities as well.


texts: Exporting from QGIS to ACAD DXF as Linework

texts:
I am attempting to export some QGIS (2.14.1) layers into AutoCAD (vanilla 2014) .dxf.  While I can do this by using the "Save As" feature, the problem I have is the elements export as solid hatch - no borders or line work that I can snap to in ACAD. It's as if QGIS is exporting the filled area and not the boundaries of the shapes as lines / polylines. I tried turning fill to 'transparent' under Layer Properties > Style, but that didn't help.

Any ideas? As AutoCAD users will know, hatches without borders drawn is essentially useless to work with or manipulate.


texts: ArcObjects Error HRESULT E_FAIL has been returned from a call to a COM component

texts:
When you run a Python script from ArcObject .net, an error occurs, all parameters are correct. ArcMap 10.6

import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True

env.workspace = arcpy.GetParameterAsText(0)
#"D:\GISLAB3\Post.mdb"

#Result = arcpy.GetParameterAsText(1)
Result = arcpy.GetParameterAsText(1)
#"D:\GISLAB3"
Hous = arcpy.GetParameterAsText(2)
#"Postt"

arcpy.FeatureClassToShapefile_conversion(Hous, Result)

c#
    private void button1_Click(object sender, EventArgs e)
        {
            IGeoProcessor2 gp = new GeoProcessorClass();

            gp.AddToolbox("D:/GISLAB3/Scripts.tbx");

            IVariantArray parameters = new VarArrayClass();
            parameters.Add("D:/GISLAB3/Post.mdb");
            parameters.Add("D:/GISLAB3");
            parameters.Add("New");

            gp.Execute("lol", parameters, null);
        }


texts: Running ILWIS commands from DOS (cmd) prompt?

texts:
ILWIS commands from DOS (cmd) prompt

I am able to run MapDrainageNetworkExtraction from ILWIS's command prompt interface.

However, I now want to run it from a DOS (cmd) prompt like this:

C:\Program Files (x86)\ILWIS 3.3 Academic>outmap=MapDrainageNetworkExtraction(flowaccilwis.mpr, 60);

Is it possible?


texts:
I am trying to find the shapefiles for postcode sector and districts in the UK. Specifically inside London. I know I can go and pay for these but I only really need to use them once. I want to generate my own mapping tiles with the shapes on one version of the tiles. Allowing me to show all the postcode boundaries without overloading the JavaScript on the client side.

I could "redraw" some of shapes myself (tracing from others) but would be great if there were some shapefiles already out there.

Can anyone help?


texts:
In QGIS 2.18 I draw polygons on a certain grassland-type on aereal imagery. Sometimes, there are other landcover-types within the patches of interest, so I'd like to draw polygons with holes.

In the example, I want to exclude the small forest-patches within the grassland. Is there any procedure other than creating a new layer for everything I want to exclude and then clip my grassland-layer?


texts: How to perform a calculation using attributes of groups of features in ArcGIS?

texts:
I have a table with information about 2000 aquifers (thickness, area, depth, volume etc.; there are 20 fields approximately). One of these fields is an internal code, i.e. DK_12_456_XXX; the last 3 digits of the code tell us to which groundwater body the aquifer belongs to. For each groundwater body there is more than one aquifer, and there are approximately 400 groundwater bodies.

I need to calculate the weighted thickness for each groundwater body using the formula:

Area Aquifer and Thickness Aquifer are fields in the table. Notice that the formula only refers to the acquifers belonging to that groundwater body.

I have thought about doing it using "Select by Attribute" and entering an expression that selects from the "internal code" field using only the 3 last digits. That would give me all the aquifers for the groundwater body that I define, and from there I could calculate the groundwater weighted thickness. However that would force me to do it manually and, as I mentioned, there are about 400.

How can I calculate this all at once?


texts:
I tried to add several layer files to MXD file. when i run this code no error rise- but only one layer file added to the MXD and all the other 34 layer files in the workspace aren't added to the map. This is the table of content after runnig the code:

import arcpy,os
workspace = r"G:\desktop\Project\lyr\taba\7650"
mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
walk = arcpy.da.Walk(workspace, datatype="FeatureClass")
for dirpath, dirnames, filenames in walk:
   for filename in filenames:
       arcpy.mapping.AddLayer(df, arcpy.mapping.Layer(os.path.join(dirpath, filename)))
mxd.save()

How can i add the layers to the Mxd?

i red

Add multiple Layer files in subdirectories to mxd using python
Finding layer file used to add layers to MXD in ArcPy?


texts: Self rendered tiles don't look the same as on the OSM website

texts:
I have generated my own tiles for part of the Great Britain using the osm.pbf file from here [1] and the style sheets from here [2].

I'm using Mapnik version 3.0.9 and generating the tiles using the polytiles.py script from [3]

As I understand it the OSM website uses the same style sheets but my tiles don't look the same as the OSM ones. For example, the road colors are different and some road labels don't line up between tiles.

OSM Screen Shot

My Tiles Screen Shot

[1] http://download.geofabrik.de/europe/great-britain.html
[2] https://github.com/gravitystorm/openstreetmap-carto.git
[3] http://svn.openstreetmap.org/applications/rendering/mapnik


texts: How to make 'gdalUtils' package in R to use GDAL installed in OSGeo's directory instead of QGIS's directory

texts:
I have GDAL installed through QGIS and OSGeo in the directories:

C:\Program Files\QGIS 3.6\bin\gdalinfo.exe
C:\OSGeo4W64\bin\gdalinfo.exe

My gdalUtils package uses GDAL installed in QGIS and I want it to use GDAL in OSGeo because I have some troubles with QGIS's GDAL.

I set the GDAL path to OSGeo's GDAL using following code:

library(gdalUtils)
# following command forces 'gdalUtils' to use GDAL installed in OSGeo
gdal_setInstallation("C:\\OSGeo4W64\\bin", rescan = TRUE)

All troubles were gone but it was temporary. After quitting R session, when I restarted R, the same thing was all over again. How can I make gdalUtils package in R to permanently use GDAL installed in OSGeo?


texts:
I'm trying to do a print export using arcgis 10.1 and latest esri jsapi.

Is there any out of the box way that I can extract out Web_Map_as_JSON from a given webmap?

esri.tasks.PrintTask generates a Web_Map_as_JSON object on its execute method.

I can capture the request parameter while posting but I need much cleaner approach. I have to post this to another application which works as a proxy between my client and server.

Please help!


texts: Distance Between Two Points vs Length of Linestring

texts:
So I have two points that I want to calculate the distance between. If I use:

SELECT
  ST_Distance_Spheroid(point_a, point_b, 'SPHEROID["GRS 1980",6378137,298.257222101]') / 1000
FROM (
       VALUES (
         ST_GeomFromText('POINT(116.330533333333 39.976266666667)'),
         ST_GeomFromText('POINT(116.34415 39.97875)')
       )
     ) AS query (point_a, point_b);

I get the value 1.1953967900687876km. I think this is the correct value since when I use any online distance calculator I get this result; however, if I put the two points into a LINESTRING and then compute the length I get a different number:

SELECT
  ST_Length2D_Spheroid(trajectory, 'SPHEROID["GRS 1980",6378137,298.257222101]') / 1000
FROM (
       VALUES (
         ST_GeomFromEWKT('SRID=4326;LINESTRING(39.976266666667 116.330533333333, 39.97875 116.34415)')
       )) AS query(trajectory);

I get the value 1.5228519672706637km. I don't understand why this is happening. In the case of just two points shouldn't these distance bet the same?

Thanks in advance.


texts: Clipping a catalog with lasclipCircle returns "no point found within region of interest"

texts:
I'm trying to clip a catalog using lidR (v2.0.1) package. I've tried with lasclipCircle and lasclip. It gives me the error: no point in ROI, but when I'm viewing the shapefile using mapview (I've exported the X and Y coordinates from this shapefile) and the catalog, they are at the same place.

Here's my code.

page1 <- catalog("O:/LiDAR/NB_LiDAR_16/page1")
Buffer_16 <- readOGR(dsn = "O:/2018_Regen/Derived GIS", layer = "Buffer_16")
X_16 <- Buffer_16@data[["DDLONG"]]
Y_16 <- Buffer_16@data[["DDLAT"]]
page1_points <- lasclipCircle(page1, xcenter = X_16,ycenter = Y_16, radius = 10)

or

page1_points <- lasclip(page1, Buffer_16)

I get the following error:

  Error : No point found for within region of interest 2.

I got the same message for ROI 1 and all the other ROI as well.

Summary of Buffer_16

Object of class SpatialPolygonsDataFrame
Coordinates:
      min     max
x 2457220 2613228
y 7490508 7662516
Is projected: TRUE
proj4string :
[+init=epsg:2953 +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs]
Data attributes:
    OBJECTID         MAPNO         PLOTID          X             Y           DDLAT           DDLONG       SCHEDULE
 Min.   : 62.0   4721   : 11   23239  :  1   2541224: 11   7600512:  9   Min.   :46.41   Min.   :-67.07   1:179
 1st Qu.:257.5   4921   : 11   26157  :  1   2539224: 10   7554512:  8   1st Qu.:47.09   1st Qu.:-66.46
 Median :454.0   5230   : 10   26159  :  1   2543224:  9   7604512:  8   Median :47.35   Median :-66.14
 Mean   :415.1   4425   :  9   26160  :  1   2505224:  8   7646512:  8   Mean   :47.34   Mean   :-66.12
 3rd Qu.:578.5   4714   :  9   26369  :  1   2501224:  7   7602512:  7   3rd Qu.:47.61   3rd Qu.:-65.88
 Max.   :790.0   5523   :  9   26370  :  1   2507224:  7   7648512:  7   Max.   :47.96   Max.   :-65.00
                 (Other):120   (Other):173   (Other):127   (Other):132
 ISPSP     OBJECTID_1   objectid_2 PHOTO_YEAR  LABEL     NUMBERING   Shape_Leng       Shape_Area
 0:131   Min.   :5    Min.   :2    2016:179   2016:179   0:179     Min.   :749732   Min.   :1.876e+10
 1: 48   1st Qu.:5    1st Qu.:2                                    1st Qu.:749732   1st Qu.:1.876e+10
         Median :5    Median :2                                    Median :749732   Median :1.876e+10
         Mean   :5    Mean   :2                                    Mean   :749732   Mean   :1.876e+10
         3rd Qu.:5    3rd Qu.:2                                    3rd Qu.:749732   3rd Qu.:1.876e+10
         Max.   :5    Max.   :2                                    Max.   :749732   Max.   :1.876e+10`

Summary of page1:

class       : LAScatalog
extent      : 2457000 , 2590000 , 7542000 , 7647000 (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:2953 +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=2500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
area        : 43 km²
points      : 844.56 million points
density     : 19.6 points/m²
num. files  : 43
Summary of the processing options:
  - Catalog will be processed by file respecting the original tiling pattern
  - Catalog will be processed using 1 core(s).
Summary of the output options:
  - Outputs will be returned in R objects.
Summary of the input options:
  - readLAS will be called with the following select option: *
  - readLAS will be called with the following filter option:    `


texts:
I have a table (Feature class in FGDB) with 2 columns, one is the "name" and the other is a list of year values as text "Value1".

How do I obtain the lowest 5 values for EACH name?

I am trying to do this with arcpy or even select by attributes however I am lacking SQL skills to make this happen as expected.I tried this with arcpy however it comes down to SQL for this statement. I tried MIN(date) and that is only for one value.

arcpy.SelectbyAttribute_management(r"<my path>"), "New_Selection", ' [Field1] = 'lowest5' AND GROUPBY [NAME]


texts: Urban positional accuracy of Google Streetview

texts: How does Google Streetview have accurate locations in urban environments, such as in tunnels, below buildings and next to buildings?


texts: Extract values from raster based on weighted average area using polygon grid

texts:
EDIT: I am using Armap 10 sp 5
I have found similar questions but they were either unanswered or somewhat different to what I am asking.

I have a raster with cell values 1-5 and a polygon shape file with regular grid of squares the same size.

All I need as output is a table with the polygon ID and the raster value. I tried to use the zonal tool but in the option it does not have a weighted average based on the area that each raster cell occupies in the polygon grid cell. For example in a grid cell I might have two raster cells, one of value 2 that occupies 30% of the area and one value 5 that occupies 70%. My result would be 2*.3+5*.7=4.1 instead of 3.5 that I get with zonal tools.


texts: What are my options for geocoding a large dataset for free?

texts:
I'm a software engineer new to GIS and mapping systems. Recently I have been playing with ideas for applications built from the Center for Medicare/Medicaid Services 2012 cost dataset. It consists of about ~1.5 million records of American physicians, and their Medicare billing information.

Each physician has an address and I think there are interesting things to be done with mapping this data. However mapping APIs / libraries universally require latitude / longitude values, and I only have street addresses. I've done a fair amount of investigating how to go about bulk geocoding data. Google and Bing maps APIs both are volume limited (even with a business license) to a restrictive level. SmartyStreets seems to do the job, but to get the volume that I require to geocode ~1.5m addresses would cost ~$1000 dollars per month. AddressDoctor looks both complicated and prohibitively expensive.

Are there ways I can do this for free? I'm very unfamiliar with GIS but I understand that at least for the U.S., a lot of the source data comes from the federal government and (I would think) would be free. However bulk processing APIs seem prohibitively expensive for the scale on which I am trying to work.


texts: Finding all street names or addresses within polygon?

texts:
I have a geojson list of lat/long coordinates that make up a custom polygon of a section of my county. Ideally I would like to be able to find all the addresses that are within the polygon boundaries.

My county GIS department provides for free a geojson list of all the polygon coordinates that make up every single building in the county.

Is there a way I can use these two files together to determine all the addresses inside the custom polygon?

If this is not really possible, another possibility is to list all the street names within the polygon.

The ultimate goal is to provide a list of all the names, phone numbers & addresses in the polygon, all done programmatically.


texts: MMQGIS returns city locations instead of addresses

texts:
I've been trying to geocode addresses using MMQGIS. In each case, the .shp file has a point over where the name of the city is located on the Google Maps OpenLayers map, instead of at the location of the address.

I fed the program a csv file with the following addresses:

Address City    State

6 Dorset Ct East Brunswick  NJ
702 Washington Dr   Ramsey  NJ
293 Washington Ave  Brooklyn    NY
1400 Laurel Ave Minneapolis MN

Here is the MMQGIS window:


texts:
I have a point layer postgis with some fields that georeference the point (comune, provincia, river etc.)
I need to set these fields with a default value that appears in qgis form when I insert a point, possibly I can change them.

So I solved it introducing sone default function using refFunctions v1.0 plugin.
I have used 5 functions like this.
It works fine  but after inserting the point I must wait 10 second to open the form.
So I have the fields already filled but it's all slower.
Using postgis trigger or autofield plugin I can't see the default values in form and this doesn't help me to correct inaccuracies.

Some ideas to speed things up?

UPDATE

I'm triyng to develop a solution using QGIS field calculator in python?
Every suggestion is welcome


texts: Colour-based shapefile generation from image

texts:
Suppose I want to extract the road network of Zambia, and I retrieved the following image:

The conventional strategy would be to georeference it (e.g. using GDAL/QGIS) and then manually draw a line shapefile over the green lines on the map.

But would it be possible to automate the process based on colour (i.e. tell the software to draw lines wherever a certain RGB colour is found)?


texts: How to deal with extreme values messing up Graduated colours? (ArcMap)

texts:
Is there an easy way to deal with extreme values messing up the Graduated colours of a map and skew the intervals in such a way that the colour ramp still makes visible sense?
I have a map displaying changes between two sets of numbers - I have chosen a colour ramp that goes from blue to red, each fading to yellow in the middle and want the decreases to be displayed in blue while the increases to be displayed in red, with little to no change being displayed as yellow. Ideally using 7-10 colour bands to display varying magnitudes of increase/decrease.
However, because I am mapping the percentage change, the decreases are capped at -100%, whereas some of the increases are in the many thousands of percent. This leads to an overall skew whereby all decreases and even smaller increases fall into the darkest blue colour section of the colour ramp, and all but the most extreme increases are also displayed as (slightly lighter) blues, thus making it look at a glance like the numbers are almost exclusively decreasing, which is not the case.
When I try to classify the break values manually, the axes of the chart where you can drag the break values are also skewed by the extreme large values which make it difficult to see/change the lower breaks - and using the percentage function on the right, is similarly difficult due to the fact that even tiny percentages give a break value above 0.
Is there a certain classification that is designed for data distributed in such a way? Or something I can do to the results that will make the classification/visualisation easier?


texts: PostGIS ST_ConvexHull for cube corners not as expected

texts:
I'm new to PostGIS and am wondering whether ST_ConvexHull will be of use in a particular work problem. Trying out some simple cases to make sure I understand what it's doing, I didn't expect this:

=> select st_astext(st_convexhull(st_geomfromtext('MULTIPOINT(0 0 0, 1 0 0, 0 1 0, 1 1 0, 0 0 1, 1 0 1, 0 1 1, 1 1 1)')));
st_astext
---------------------------------------------
 POLYGON Z ((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))
(1 row)

I think I'm asking for the convex hull of the vertices of the unit cube, which should also be the unit cube.  Have I messed up the query, or my interpretation of the result, or my understanding of convex hulls, or something in my PostGIS setup?

PostGIS 2.1.1, PostgreSQL 9.3.4.


texts: Why is there no Map.SnapToLevels property in the ESRI JS API?

texts:
The ESRI Silverlight and WPF API's both have a Map.SnapToLevels property that can be set on or off. It "gets or sets whether zooming will snap to scale levels if the map contains cached layers". But with the JS API, you always snap to levels and there appears to be no way to turn that behavior off. Is there a way to disable the snap to levels behavior in the JS API?

Or can someone provide the rationale behind ESRI's decision to not include that property in the JS API? (I'd like to be able to explain why I cannot provide the same type of zooming in JS API as with WPF API.)


texts:
I have an excel file with missing values encoded as blanks and I want this excel file to be converted into DBF but with the conversion process, the blanks (missing values) become 0.

The reason I am doing this is because I want to perform interpolation but because of the missing values becoming 0 the interpolation becomes wrong.

My question is how to treat missing values as  without deleting the point shapefile and still proceed with interpolation.


texts: Caching Bings Maps Aerial Locally to make it draw faster in ArcMap?

texts:
When you add Bing Maps Aerial to your MXD, can you cache the basemap locally to make it draw faster?

If not, what other workaround can you do to make Bing Aerial draw faster?

I'm using ArcGIS 10.2.2 for Desktop.


texts: Interpreting Global Moran's I and should I krig?

texts:
I am trying to weigh up if kriging (or cokriging) the residual error from my model is a valid approach.  My first step was to compute whether the error is spatially autocorrelated. I have done this using Moran's I statistic but I'm having trouble interpreting the results.  Below are 5 examples (my actual data is the ERROR example), the text is the output from the ape package in R.

I interpret that as the p-value of RANDOM is >0.05 then the data is not autocorrelated.  Reading the help file with ape it states that if the observed values are significantly greater than the expected value then your data is positively spatially autocorrelated (e.g. E vs W and X coord). I would have expected the observed value for CHESS to be negative.  How should I interpret the results from ERROR? The p-value is <0.05 so this would suggest some degree of spatial autocorrelation, but the difference between observed and expected values is relatively small compared to the other examples. Below is the (massive!) semivariogram for the ERROR example.

This again would suggest a degree of spatial autocorrelation.  My question would then be would kriging this error be an acceptable approach to reduce error in my final output?


texts: Cleaning up polygon generated from NDVI raster

texts:
So I have NDVI raster files for about 1000 acres of vineyards we manage. What I have done is created a model that takes the NDVi raster, reclassifies it to isolate out the areas of high vigor, then runs an Iso Unsupervised Classification, then generates a polygon (shown below). What I need to do is filter out the "noise" (aka the weeds and grass with very high NDVI values that my model couldn't filter out).

The 3 rows on the left are polygons showing our producing vines, gaps in between represent dead / missing bines. The issue is the giant green globs in-between each row; which is essentially tall, healthy grasses etc due to someone not mowing before the drone captured this imagery.

Other then manually going in and selecting the grass polygons in ArcMaps and deleting them, is there a tool I can use to automate this process? They unfortunately do not have a distinguishing attribute allowing me to select them.


texts: Run SelectLayerByAttribute for multiple where clauses

texts:
I have around 20 different where clauses that I will need to run it at different times when my dataset is updated. Is there a way to iterate through a list of where clauses and get the results, so I don't have to type each one out separately in the code?

This is what I have so far (just testing it by putting 3 of the where clauses in the list for now). The script at the moment is successfully calling the where1 clauses but I don't know how to get it to loop through the others. Assuming I need to use a for loop but not exactly sure how?

The print statement also gives me the entire SQL statement but I'm happy to figure that out later.

import arcpy

dataset = r"F:\DB_Intersect_200213"

where1 = "management_type IN ('1', '7') AND year IS NOT NULL AND habitat IS NOT NULL"
where2 = "management_type IN ('1', '7') AND year IS NULL AND habitat IS NOT NULL"
where3 = "management_type IN ('1', '7') AND year IS NOT NULL AND habitat IS NULL"

wherelist = [where1, where2, where3]

featurelayer = arcpy.MakeFeatureLayer_management(dataset, "data_fl")
selection = arcpy.SelectLayerByAttribute_management(featurelayer, "NEW_SELECTION", wherelist[0])
expressioncount = arcpy.GetCount_management(selection).getOutput(0)
print("There are {} results for " + wherelist[0]).format(expressioncount)


texts:
I'm trying to create a map where I have one wms layer and then a vector layer which is created from a kml file - held in the same directory as the web page.

I'm trying to implement the cluster strategy but to no avail. I think I might me going wrong even before the cluster strategy kick is in as I can't see the vector layer at all when I remove the wms layer?

This is the code for the vector layer:

var map;

function init() {
   map = new OpenLayers.Map('map_element', {});
   var wms = new OpenLayers.Layer.WMS(
    'WMS Layer Title',
    'http://vmap0.tiles.osgeo.org/wms/vmap0',
    {layers: 'basic'},
    {}
);

var masts = new OpenLayers.Layer.Vector("Masts", {
projection: displayProjection //EPSG:4326,
protocol: new OpenLayers.Protocol.HTTP({
url: "masts.kml",
format: new OpenLayers.Format.KML({
        extractStyles: true,
        extractAttributes: true
        })
}),
strategies: [
new OpenLayers.Strategy.BBOX(),
new OpenLayers.Strategy.Cluster()
],

styleMap: new OpenLayers.StyleMap({
"default": {
        fillColor: "#8aeeef",
        strokeColor: "#32a8a9"
        }
     })
});

var StaffTravel = new OpenLayers.Layer.Vector("StaffTravel", {
protocol: new OpenLayers.Protocol.HTTP({
    url: "staff.kml",
    format: new OpenLayers.Format.KML()
}),
strategies: [
    new OpenLayers.Strategy.Fixed(),
    new OpenLayers.Strategy.Cluster({distance: 15, threshold: 3})
]
});

map.addLayers([StaffTravel]);

Any ideas where I might be going wrong?


texts: How can I see the 'Custom Options' metadata following Save As in QGIS?

texts: In QGIS 2.10 Pisa, I've right-clicked a layer in the TOC and used Saved As ... to save a shapefile with a new name. During this process, I used the Custom Options (Data Source and Layer) to include some metadata. The new shapefile was created just fine as always. However, it seems this metadata can't be found with the new shapefile. How can I see this metadata?


texts: Online/cloud storage options for GIS file-based data

texts:
I am currently looking into online/cloud-based storage solutions in general and also for my GIS data which consists of shapefiles, rasters, file geodatabases, and the like (no relational databases). Here are my requirements:

Unlimited storage (need several hundred gigs to start with)
Either unlimited file size or can handle files many GBs in size
Just need it for one Windows 7 box right now, but Mac support needed as well
Less than $100/yr - most are around $60 looks like
An Android app would be nice, not to back up the phone, but to access my backed up files from the phone
Backs up external hard drives
Can seed the backup with a hard drive and then get the restore sent to me on a HDD as well

From what I have looked at so far, it looks like CrashPlan might be my best bet, except no mobile apps available. Mozy used to be unlimited, by apparently changed and now is not. Carbonite looks promising and has mobile apps, but doesn't backup removable hard drives and I can't find anything about if they let you seed your backup with a removable drive. Anyone currently using any of these services? Know of another service that might fit the bill?

One service/provider per answer please so they can be voted on properly. Thanks.


texts: Looking for example of a Random Forest tutorial to estimate spatial distribution

texts:
Could anyone point me to a Random Forest tutorial for predicting a spatial random variable? Or an easy dataset to try to work through.

For Decision Trees and Random Forests, I found some very good tutorials from Trevor Stephens, Kaggle, and Datacamp, here, here, and here. But I'd like to look at a spatial example - I've come across a lot of literature on this subject but nothing as clear cut as the above links. The closest thing perhaps would be Jeffrey Evan's code here, but it appears to be unfinished.


texts:
I've been trying to get some GeoJSON features into OpenLayers. 3.7 changed the geojson source format, and I've made the changes. But I don't know how to reproject in the new format from 4326 to 3857.

Here is the link to fiddle.net (https://jsfiddle.net/aborrell/h2yv6moy/) :

As it shows, the features are near 0,0, but actually they should be in Mexico.


texts:
I'm inserting Open Street Map data into a PostGIS database using the GeometryBuilder of osm4j. I then fetch the data and display it on a Leaflet map using ST_AsGeoJSON.
This usually works flawlessly, but every now and then PostGIS throws an exception at me. For example, OSM relation 13169 does not work:
select ST_GeometryType(geom) from featuretable where id=13169;
    st_geometrytype
-----------------------
 ST_GeometryCollection
(1 row)

select ST_AsGeoJSON(geom) from featuretable where id=13169;
ERROR:  GeoJson: geometry not supported.

Doing select ST_AsBinary(geom) from featuretable where id=13169; gives this output.
At first I thought that features of type ST_GeometryCollection could not be handled by ST_AsGeoJSON, but for instance OSM relation 3244259 works fine and is also a ST_GeometryCollection.
select ST_GeometryType(geom) from featuretable where id=3244259;
    st_geometrytype
-----------------------
 ST_GeometryCollection

What is it that makes ST_AsGeoJSON crash on certain features, and how can I prevent it? All I really want is a GeoJSON of the feature; perhaps it is possible to convert/transform the feature somehow to achieve this?


texts: OpenLayers 3 capturing various click events

texts:
I would like my KML layer in OpenLayers 3 (OL3) to respond to different types of click events.

I have a single click method working nicely. But how do I get it working for "shift-clicks" "double clicks" etc?

 map.on('singleclick', function(evt) {
   var feature = map.forEachFeatureAtPixel(evt.pixel,
     function(feature, layer) {
     // do stuff here with feature
     return [feature, layer];
   });
 });

This was a good start, but I can't quite put the OL3 API documentation together.


texts: Repairing ArcGIS license that became untrusted after Windows 10 install?

texts:
I've installed Windows 10 update. After that I get that message when I try to run ArcGis:

I have ArcGis 10.3 Education version.

Here screen from ArcGis Administrator:

Does anyone know how to solve my problem?


texts: Finding intersection density for weighted lines connecting points across the continental USA

texts:
I'm working on an one-time problem that I'm hoping to solve with a computer program using free GIS libraries (preferably for VB.Net, C#, or Python... Java or C/C++ could work too). Alternatively, I wouldn't mind using a tool like the free MapWindow GIS.

The problem:

Given knowledge about the ultimate origin/destination for passengers flying, draw lines weighted by passenger volume connecting origin and destination airports. (i.e. passengers flying from San Francisco to New York can travel via many routes, but we only care about the total volume of passengers flying between the two cities).
Find intersections for all the lines. Each intersection will have a 'weight' - the sum of the passenger volume on the two intersecting lines.
Given 3-digit ZIP codes, calculate a density for each ZIP code by summing the weights of each intersection within X miles of the centroid.

The idea here, being to find good natural locations for hub airport given current passenger volume.

Tools/Accuracy:

I found Shapely for Python that looks useful. It includes a lot of spatial analysis tools (like centroid, buffer, intersection, etc.) that would make solving this problem fairly easy. However, it works in the Cartesian coordinate system. It seems like that would be rather inaccurate on a continental scale. It seems like, from an accuracy standpoint, it would be best to do spatial analysis in the geographic coordinate system (lat/lon on a datum) itself rather than re-projecting the data.

So my questions:

Since we only want a general picture, is the Cartesian coordinate systems accurate enough?
Can I do spatial analysis directly in a geographic coordinate system/datum?
What tools exist that would allow me to convert the data (if necessary), and do the required spatial analysis on it (with minimal setup effort since this is an one-time thing).


texts: OSRM Error on startup - [warn] Process /usr/bin/osrm-routed could not be locked to RAM

texts:
When I try to launch Open Source Routing Machine I am now getting a warning and the service will not start.

[warn] Process /usr/bin/osrm-routed could not be locked to RAM

I have looked at the discussion at https://github.com/Project-OSRM/osrm-backend/issues/893 however this doesn't seem to offer any suggestions to resolve. I have plenty of RAM available on this server and have been able to start it previously. I have not made any changes to the server since I last started the service successfully only a few days ago.

[peterscott@route-optimiser ~]$ /usr/local/bin/osrm-routed --sharedmemory=no /opt/DATA/australia-latest.osrm
[warn] Process /usr/local/bin/osrm-routed could not be locked to RAM
[info] starting up engines, HEAD-HASH-NOTFOUND, compiled at Sep 28 2015, 20:04:28
[info] HSGR file:   "/opt/DATA/australia-latest.osrm.hsgr"
[fatal error] exception: Permission denied


texts: Selecting one of multiple overlapping features (in same feature class) based on attributes

texts:
I have a feature class containing thousands of overlapping buffer features representing service coverage. Each buffer has an attribute of service quality (numeric, high is good). I want to determine the lowest number of buffers needed to cover my extent, and currently there are a lot of overlapping buffers that can be reduced and still cover the same area (see picture). Is there a way to select from overlapping polygons in the same feature class based on which ones have a higher attribute value for the service field?

I am currently using ArcGIS Pro and am able to use python, QGIS, and Microsoft SQL Server.


texts: Get extent of GeoJSON layer using OpenLayers

texts:
I have implemented geojson-vt to load a big GeoJSON file but the problem  I am facing is I am not able to get the extent of the layer so that I can zoom in on the specific area in the map neither is it showing entering in the method tileloadstart, tileloadend and tileloaderror.
My code is:
fetch(url)
      .then(function (response) {
        return response.json();
      })
      .then(function (json) {

        var tileIndex = geojsonvt(json, {
          extent: 4096,
          debug: 1,
        });
        var format = new ol.format.GeoJSON({
          dataProjection: new ol.proj.Projection({
            code: 'TILE_PIXELS',
            units: 'tile-pixels',
            extent: [0, 0, 4096, 4096],
          }),
        });
        var vectorSource = new ol.source.VectorTile({
          tileUrlFunction: function (tileCoord) {
            return JSON.stringify(tileCoord);
          },
          tileLoadFunction: function (tile, url) {
            var tileCoord = JSON.parse(url);
            var data = tileIndex.getTile(
              tileCoord[0],
              tileCoord[1],
              tileCoord[2]
            );
            var geojson = JSON.stringify(
              {
                type: 'FeatureCollection',
                features: data ? data.features : [],
              },
              replacer
            );
            var features = format.readFeatures(geojson, {
              extent: vectorSource.getTileGrid().getTileCoordExtent(tileCoord),
              featureProjection: map.getView().getProjection(),
            });
            tile.setFeatures(features);
          },
        });
       #Not Working start--
        vectorSource.on("tileloadstart",  function () {
            $('.message').html("Drawing..");
        })
        vectorSource.on("tileloadend",  function () {
            $('.message').html("");
        })
        vectorSource.on("tileloaderror",  function () {
            $('.message').html("Error Please try again");
        })
        #Not Working end--
        vectorLayer = new ol.layer.VectorTile({
          source: vectorSource,
          style: function (feature, resolution) {
            return [new ol.style.Style({
                  stroke: new ol.style.Stroke({
                    width: 1,
                    color: "#808080"
                }),
                fill: new ol.style.Fill({
                    color: feature.get('fill'),
                })
            })];
          }
        });
        console.log("Data :" + vectorLayer.getExtent());  #getting undefined
        vectorLayer.getSource().once('tileloadend', function (evt) {
            if (vectorLayer.getSource().getState() === 'ready') {
                console.log(vectorLayer.getExtent());
                // map.getView().fit(vectorLayer.getExtent(), map.getSize());
                // console.info(map.getView().getCenter());
                // console.info(map.getView().getZoom());
            }
        })

        layersByName[layer_title] = vectorLayer;
        map.addLayer(vectorLayer);

Any suggestions will be of great help! Already wasted my 2 days to get the extent but nothing worked out/


texts: Custom ordering/z-index of icons in Leaflet layer

texts: I have a single layer (points) with a bunch of markers. Each point has an attribute that is regularly updated. I understand by Leaflet sorts the layers such that those lower in latitude are on top for aesthetic reasons, but I would like to reorder them such that in areas of clustering, those with higher values in the attribute are on top. Is there any way to do this without having to split up each marker/point into an individual layer and forcing draw order that way?


texts: My dataset lists state and county FIPS codes separately. How should I combine?

texts: I can't do a simple "concatenate" because the codes don't have leading zeroes. Are there any available APIs that I can use to geocode this data given the format? Or do I have to manipulate them so that they resemble a more typical GeoID.


texts: Copying polygon feature class with 405 features for each matching owner entity?

texts: I have 425 polygon features that I need to duplicate in relationship to 5907 owner entities that are contained inside an excel sheet I converted to a table. So each polygon represents a lease record and each lease record has different owner entities associated each lease file number. So for polygon lease file 03457 you have 7 different owner entities related to it. I need to make a copy of the one polygon feature 03457 6 more times to match the owner entities records and provide a polygon feature for each owner entity. The polygon feature and the table showing the owner entities both have lease numbers to associate both together. I tried a relater and it only related all the data for the first record of each lease file number. I feel like there is probably a way to take the polygon features and create copies for each matching lease file number representing the owning entity for each lease file.


texts:
Is there anyway to snap one set of vectors to its nearest neighbor vector in another feature class?

For example, I have a road feature class and a feature class of bridges and I want to snap the bridge FC to the Road FC.

I'm using ArcGIS 10.2.1.


texts: How to display legend in mapview when using cex argument

texts:
Giving the example:

library(sp)
library(mapview)

data(meuse)
coordinates(meuse) <- ~x+y
proj4string(meuse) <- CRS("+init=epsg:28992")
mapview(meuse, cex = "cadmium", legend = TRUE)

I was expecting that legend=TRUE will display a legend with graduated circles, something similar like in this link. Is there a way to achieve this in mapview?


texts: cut/fill calculation tool to investigate if there is enough material to achieve a 30 degree slope

texts:
This is a cut/fill problem.

We have pits that have been dug in the ground, usually rectangular. They have a bund wall around them. They are being rehabilitated by pushing the bund back into the pit. Usually the bund is not enough to refill the pit. We need to achieve a maximum 30 degree slope between the original land surface outside the feature and the backfilled material pushed in from the bund. We need to know if we have enough material in the bunds to achieve this angle of slope.

We know the bund volume from topographic survey (interpolated the original land surface under the bund from elevation points outside the feature in the topographic data). From this interpolated surface we know the location and height from which the 30 degree slope will start and go down into the pit. Is there a tool in any GIS or CAD program that will take this line (as a polyline or polygon for example), take the angle (in this case 30 degrees) and output a new line or polygon showing where the topographic surface will be intersected, right the way around the pit? With this new line, a TIN could be created of the elevations along it at the bottom of the proposed slope and the elevations of the intersection at the top of the slope between the original land surface and the topographic surface. The topographic surface could then be subtracted from this new TIN to get the volume and see whether it is the same or less than the volume in the bund.

If there is a tool to automate this, it would make life much easier. Otherwise we could calculate a few points around the pit manually for a coarser estimate.


texts:
I'm creating a application with Geoserver, OpenLayers and Postgis.
At some point, the user can select his own style for a layer.
I've succeded to make a php script to write to a file the SLD code. Dynamic style for each user based on Postgis attributes.
The problem is that when I select to add the style, nothing happens.
The SLD is working fine. I've tested it on Geoserver - view layers.
But in my application it doesn't do anything.
here is my code for mergeing the SLD external file:

  function layerselect(layer)
    {

        value_selected = document.getElementById("legend_option").value;

        if(value_selected=="Pret/mp")
            {
            spatii.mergeNewParams({SLD: "file:///C:/Program Files (x86)/EasyPHP-Webserver-14.1b2/www/data_dir/www/proprietati/tmpo/ro25858_spatii_pretmp.sld"});

            }
        if(value_selected=="2")
            {

            }

    }
}


texts: Managing Very Large Vector File Geodatabases

texts:
I am currently looking for ways to more effectively work with an extremely large 10,000,000 (+) vector features contained in a  file geodatabase.  Its just very cumbersome to work with in ArcGIS (v 10.2.2).

My current thought is to simply break the feature class in to 5 - 6 sub feature classes based upon OBJECT ID (e.g. 1 - 2,000,000; 2,000,001 - 4,000,000 and so on).  Since I don't want to break any features given it is topologically correct and clean. Then using model builder create a model to modify the attributes as necessary and simply rerun the model on each subsection and then append the sections back together, since I am not changing any of the geometries nor the attribute heading only the attribute records themselves.

Anyone have any other thoughts of how to deal with such large vector files?   Bottom line is I am having to reformat ~630,000,000 attributes - data restructuring, reformatting.  It currently can take up to 10 minutes just to reformat one attribute field.


texts: Splitting polygons into lines using QGIS?

texts:
I have one shapelne that composed from many polygons. I wwant to create lines insides the polygons according to a given distance,

for example,
this is the original plots-

and I want the lines to be like every 25 meters  -sorry I draw it but it suppose to be symetricly-

I tried to create grids but because of the different of the plots it never sits perfectly, so even if I clip it I cant use it -

I also tried it with points and I rotated them but again , it doesn't match all the plots.

I am looking for tool that can create grid only inside the polygons.

my end goal is to be able to use this grid in order to locate points that have no coordinates data, based on distances.


texts: Carto Builder Azure Marketplace - default Postgres configuration causing poor performance

texts:
We recently learned some valuable lessons which I wanted to share with the community.

We recently moved our map application from being hosted by CartoDB onto an Azure Marketplace Carto Builder VM.  There were several other changes we made to our application at the same time.

The application performance was much worse immediately after the move, especially under load, and in the browser's dev tools we saw lots of HTTP 500 responses.

As well as trying to fix this or that potential performance factor with our application, we eventually also wondered:

  was the VM's Postgres configuration causing poor performance?


texts: Something is wrong with my vector source format

texts:
I have been having a hard time with getting my WFS URL to go inside of OpenLayers. Here is the code I have. Am I missing anything? It looks correct to me. It must be something due to logic.
wfs_url = 'http://localhost:2222/geoserver/CAICWeb/wfs?service=WFS&' +
              'version=1.1.0' +
              '&request=GetFeature' +
              '&typename=CAICWeb:hospitals&' +
              '&CQL_FILTER=' + cqlfilter + '&' +
              'outputFormat=application/json&srsname=EPSG:2231&' +
              ',EPSG:2231';

var vectorSource = new ol.source.Vector({
        format: new ol.format.GeoJSON(),
        url: function(extent) {
          return 'http://localhost:2222/geoserver/CAICWeb/wfs?service=WFS&' +
              'version=1.1.0' +
              '&request=GetFeature' +
              '&typename=CAICWeb:hospitals&' +
              '&CQL_FILTER=' + cqlfilter + '&' +
              'outputFormat=application/json' +
              '&srsname=EPSG:2231&' + ',EPSG:2231';
        },
        strategy: ol.loadingstrategy.bbox
      });

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


texts: Postgis: aggregate function for intersection

texts:
I have a PostGIS Table with LINESTRINGS.

I look for a query that returns all Roads that are connected.
So I get a set of unconnected trees (in german 'Wald (Graphentheorie)')

pseudo code:

select array_to_string(array_agg(id),', ') from roads
  group by ST_Intersection;

e.g.:

in table:

 id |           way
----+-------------------------
  1 | LINESTRING(1 3,2 4)
  2 | LINESTRING(1 3,1 0)
  3 | LINESTRING(11 13,12 14)
  4 | LINESTRING(2 4,0 1)
  5 | LINESTRING(11 13,11 10)
  6 | LINESTRING(6 12,8 7)

result:

  id
-------
1, 2, 4
3, 5

For Testing in DB:

  SELECT DropGeometryTable ( 'roads' );
  CREATE TABLE roads (
    id integer
  );
  SELECT AddGeometryColumn('public','roads','way','900913','LINESTRING',2);
  INSERT INTO roads (id ,way) VALUES (1,GeometryFromText ( 'LINESTRING (1 3, 2 4)', 900913 ) );
  INSERT INTO roads (id ,way) VALUES (2,GeometryFromText ( 'LINESTRING (1 3,1 0)', 900913 ) );
  INSERT INTO roads (id ,way) VALUES (3,GeometryFromText ( 'LINESTRING (11 13,12 14)', 900913 ) );
  INSERT INTO roads (id ,way) VALUES (4,GeometryFromText ( 'LINESTRING (2 4,0 1)', 900913 ) );
  INSERT INTO roads (id ,way) VALUES (5,GeometryFromText ( 'LINESTRING (11 13,11 10)', 900913) );
  INSERT INTO roads (id ,way) VALUES (6,GeometryFromText ( 'LINESTRING (6 12,8 7)', 900913 ) );


texts: Layer time extent calculating problem while table joining with layer using ArcObjects C# .NET

texts:
I have added a layer in the ArcMap. I want to see the different values of the items of this layer using the "Time Slider". For this, I have prepared a table that contains a field named DateTime and its type is Date. After completing data preparation I have joined the table with the layer using ArcObjects C# .NET AddJoin tool. After this, when I calculate the layer time extent. It set start time and end time the same as the start time.

If I remove join from the layer or skip the join operation using ArcObjects and join the table with the layer manually in ArcMap then it works fine.

AddJoin Tool Code:
public AddJoin(string inputLayerName, string inputTableField, string tableToBeJoinedPath, string toBeJoinedField)
    {
        _inputLayerName = inputLayerName;
        _inputTableField = inputTableField;
        _tableToBeJoinedPath = tableToBeJoinedPath;
        _toBeJoinedField = toBeJoinedField;
    }

    public IGpResult Execute()
    {
        try
        {
            var addJoinTool = InitTool();
            var result = _gp.Execute(addJoinTool, null) as IGeoProcessorResult;
            return null;
        }
        catch (Exception exception)
        {
            return null;
        }
    }

    private ESRI.ArcGIS.DataManagementTools.AddJoin InitTool()
    {
        _gp = new Geoprocessor { OverwriteOutput = true, AddOutputsToMap = false };
        var addJoin = new ESRI.ArcGIS.DataManagementTools.AddJoin()
        {
            in_layer_or_view = _inputLayerName,
            in_field = _inputTableField,
            join_table = _tableToBeJoinedPath.Replace(@"\", @"\\"),
            join_field = _toBeJoinedField,
            join_type = "KEEP_ALL",
        };
        _gp.OverwriteOutput = true;
        return addJoin;
    }
}

How can I join it using ArcObjects and make it workable?


texts:
I´m using pgr_dijkstra one to one and it´s ok, but error occour when I try one to many or many to many. I´m typing:

SELECT * FROM pgr_dijkstra('select id, source ,target, cost from edge',
                           35681,
                           ARRAY[34450,34926],
                           FALSE);

The message is:

  SQL Error [42883]: ERROR: do not exist the funcion
  pgr_dijkstra(unknown, integer,integer[],boolean)

May tell me where is the error?


texts: How can I clean up this OpenLayers code by correctly doing a transform or projection, for an array of features?

texts:
I have some features I've created via some Kml data.

Now, to display these features on a Google Map, I need to project them from 'EPSG:4326' to 'EPSG:3857'. This works great.

Now, i need to convert this to WKT 4326. When I do that, i re-transform the features but the google map doesn't display them any more because the features are in the wrong projection.

Can anyone suggest a way to clean up my code so I can keep the features in 4326 format, but when I need to display these features on my Layer, it's smart enough to transform it into 3857.

Here's my full javascript code ... but here's the important bits in there...

// Converts some Kml string data into an array of Features.
function convertKmlToFeatures(kml) {
    var kmlFormat = new OpenLayers.Format.KML();
    var features = kmlFormat.read(kml);
    for (var i = 0, l = features.length; i < l; i++) {
        features[i].geometry.transform('EPSG:4326', 'EPSG:3857');
    }
    return features;
}

.....
// Display features.
// NOTE: (This will be as 3857 .. but i wish i can leave this as 4326 and
//        just transform on the fly, here).
map.layers[1].addFeatures(features);

.....
// Finally Output the features as WKT. This needs to be as 4326.
// Right now, it's still as 3857.
var wktFormat = new OpenLayers.Format.WKT();
return wktFormat.write(features);


texts:
I'm going through the QGIS Map Design book and have run up against a wall in adding cascading rules.  I'm working with QGIS LTR 2.14.  The authors recommend this version.

My vector data is in a SQLite db.  I used ogr2ogr to convert it from the planet .pbf file.

I've created an extended subcategory rule from "motorway" called "motorway bridge" and used the following SQL to do so:

"other_tags" LIKE '%"bridge"=>"yes"%' OR "other_tags" LIKE '%"bridge"=>"viaduct"%'

This SQL yields a total of 6273 results.  So far so good!

Now, I go ahead and right-click on that rule and select "Refine current rule" --> "Add categories to rule."

To create my level 1 bridge style, I use the following SQL, which should only run on the results in the parent filter; namely, only bridges.

"other_tags" NOT LIKE '%"layer"=>"2"%'

However, when I test this, it yields 118145 features, which means that it's  clearly ignoring the parent query.

This may be a bug in 2.14; I'm inclined to say it is, otherwise, what is the point of using the "Refine current rule" function?  Has anyone else run into this?  I can write a whole bunch of explicit SQL to get around it, but wanted to make sure I'm not doing this wrong.


texts:
I am curious about the algorithm of Flow Direction in ArcGIS. Recently I am studying about Hidrology, and I have some questions regard to Flow Direction in GIS.

The size of this cell is 100m x 100m, with the radius of 10km for the raster data model. I have used the Flow Direction. The result showed that the value of one circle is 1. I am curious about this result.

Since the value of the circle is same, how the Flow Direction result could came out like that?
what kind of logarithm is that? I have tried to find the answer in here: (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000052000000.htm). But I still cannot understand. Would you explain it to me?
Using DEM, finally i got this value. But my question is : what kind of Flow Direction is this? ([16]West? or [4]South)

Beside of the raster data model, I have also made he square and hexagonal Flow Direction model as you can see below.

I hope you can help me to figure out my question.


texts: QGIS lines multipart to singlepart without splitting at self-intersection

texts:
I have a line layer and a vector grid. Now I want to count the lines in each raster. First I split the lines by intersecting the line layer with the vector grid.

Second, I need to do a multipart to singlepart for the lines because I want to count each line individually.

Now here is the problem: The lines are intersecting itself and at every intersection, the multipart-to-singlepart tool makes new parts of the lines.

How can I avoid this, are there other workarounds?


texts: Model Builder iteration process problem: could not create the output tables invalid extension

texts:
I encountered problems with my Model Builder in Arcmap 10.4:

I want to perform some statistics on my rasters using the same polygon (buffer). I use the Raster Iteretor and I did check if the extent of my input were the same. Actually it worked when using "zonal Statistics", but I needed to collect the values in a table (using "zonal statistics as table"). When I used zonal Statistics as table, the model doesn't work because of the tif extension present in the name of my raster inputs. How can I deal with that problem? . Any suggestion ?


texts: Georeferencing bands at first then calculating NDWI, or, calculating NDWI at first and then georeferencing it

texts:
I want to get NDWI from MODIS mod021km as GeoTIFF files. As far as you know, MODIS images are not georeferenced and the point is georeferencing these imagages is a little bit inaccurate (because of resampling ...). So I don't know that I should georeference bands at first and then calculate the NDWI, or I should calculate ndwi at first and then georeference it and save it as a GeoTIFF file?
Which one is better and more accurate?


texts: What is causing these strange results in the Layer Symbology?

texts:
I am using Arc 10.3.1 and I have a feature class with various INT fields that hold values for number of defect type found in this polygon.  Here is an example of my table:

Now when I go to the symbology options in my properties and I choose Unique Values, and hit add all values,  it adds the values for the proper field in the first section, but the second and third parts I don't know where this data is coming from.   IE in the map below the first blue symbol should just be 0 , and not 0,0,0  the third symbol should be green and be 1 , not 1, 3636, 3636.

Why am I seeing the broken window, none, none, when I am choosing unique values, so I should only being seeing the value from the field I want.  What could be causing this and is there a solution?


texts: Copying feature service to local geodatabase using ArcPy and ArcGIS API for Python?

texts:
I am trying to export/copy a feature service to a local geodatabase where I can work on it locally.

I have provided the code below. I keep getting an "Object: Error in executing tool" for the last line where I am trying to copy the feature.

from arcgis.gis import GIS
from arcgis.features.use_proximity import create_buffers

import arcpy

#########################################################################################

GDB_Name = input("Name Geodatabase")

Folder_Input = input("Provide Folder Path of Project")

Item_ID = input("Provide item ID")

#########################################################################################

gis = GIS("http://arcgis.com", "XXXXXXXX", "XXXXXXXXXXX")

search_results = gis.content.search('{}'.format(Item_ID))

Trail_Data = search_results[0]

WorkspaceGDB = arcpy.CreateFileGDB_management(Folder_Input, '{}.gdb'.format(GDB_Name))
print("GDB created")

arcpy.env.workspace = r'{}'.format(WorkspaceGDB)

arcpy.CopyFeatures(Trail_Data, "Area_Trail_Data")


texts: "Data source not valid" problems with QGIS processing

texts:
I'm having a lot of problems with QGIS processor. Most of the algorithms show me this QGIS log error:

  La fuente de datos no es válida. (Data source not valid)

This happens with SAGA and GRASS algorithms mostly. This is pretty annoying because I can't work properly.

The log processor only tells me this:

  processing.runalg("grass:v.overlay","/home/luismi/Documentos/Cartografia/arqueologia/Mapa_IMperio_Romano/vectoriales/2/roman_empire_ad_200_provinces.shp",1,"/home/luismi/Documentos/Cartografia/arqueologia/Mapa_IMperio_Romano/pruebas/vectoriales_prov/Imperio_Extension.shp",1,False,"-9.48732,43.12373,22.74626,55.10117",-1,0.0001,0,None)**

What should I do? Where I should look?

I'm using QGIS 2.4 on Lubuntu 12.04,  processor plugin 2.2.0-2. Ask for more info if it's needed.

EDIT:

I've installed OSGEO Live-7.0, it happens the same thing.

When I run "Spatial point Pattern analysis" this is what I get:

Algorithm Spatial point pattern analysis starting...
geostatistics_points "Spatial Point Pattern Analysis" -POINTS "/tmp/processing/ed1a459a603a4f20927861d30a5c06b2/ne10mpopulatedplacessimple.shp" -STEP 5 -CENTRE "/tmp/processing/7c03f63d9e4a48418f4cb1dbadb2afac/CENTRE.shp" -STDDIST "/tmp/processing/f1ee992e4f0040449e2523621fb31c13/STDDIST.shp" -BBOX "/tmp/processing/8e4efd5dd12546a98417de775a2d4b56/BBOX.shp"
Error: library
_____________________________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
_____________________________________________

68 loaded tool libraries (678 tools):
- garden_fractals
- pj_proj4
- ta_slope_stability
- tin_viewer
- garden_games
- io_table
- io_gps
- grid_calculus
- sim_erosion
- db_odbc
- garden_webservices
- grid_spline
- shapes_tools
- table_tools
- grid_gridding
- shapes_polygons
- imagery_photogrammetry
- ta_profiles
- io_esri_e00
- ta_preprocessor
- io_grid_grib2
- sim_ecosystems_hugget
- sim_hydrology
- docs_pdf
- ta_morphometry
- imagery_classification
- db_pgsql
- statistics_kriging
- io_virtual
- pointcloud_tools
- statistics_points
- sim_cellular_automata
- contrib_perego
- imagery_svm
- io_shapes_las
- grid_tools
- io_grid
- shapes_lines
- imagery_rga
- sim_fire_spreading
- statistics_regression
- docs_html
- grid_calculus_bsl
- shapes_points
- table_calculus
- io_grid_image
- io_shapes_dxf
- shapes_grid
- ta_compound
- io_gdal
- grid_visualisation
- ta_lighting
- imagery_segmentation
- tin_tools
- ta_channels
- sim_ihacres
- grid_filter
- garden_learn_to_program
- garden_3d_viewer
- ta_hydrology
- statistics_grid
- io_shapes
- shapes_transect
- grid_analysis
- climate_tools
- pj_georeference
- pointcloud_viewer
- imagery_tools

type -h or --help for further information

Converting outputs
Loading resulting layers
Algorithm Spatial point pattern analysis finished

processing.runalg("saga:polygoncentroids","/usr/share/qgis/python/plugins/processing/tests/data/polygons.shp",False,None)

And QGIS log says this again:

La fuente de datos no es válida ()

    Error 4 de OGR [3]: Unable to open /usr/share/qgis/python/plugins/processing/tests/data/polygons.shp or /usr/share/qgis/python/plugins/processing/tests/data/polygons.SHP.

Second EDIT:

I have installed a new Xubuntu 14.04 in another partition in my PC, I've installed SAGA, GRASS and QGIS again since ubuntugis repositories, this problem persist!!! Anyone has any idea why is happening this? Some algorithms are working fine other don't!!

Third Update:

File of random points created with QGIS algorithm.


texts: ArcGIS Online won't connect from ArcMap or Catalog

texts:
I've had 10.3 installed now for about a month.  At the beginning everything seemed to work fine but somewhere along the way my connection to ArcGIS Online went away and hasn't been back.  The options to "Sign In", "Add Basemap", and "Add Data from ArcGIS Online" are all grayed out.  There are several threads addressing these issues with answers that do not seem to be working for me.

ArcGIS Online and Sign In options are greyed out in ArcMap 10.2.2

How does ArcMap decide ArcGIS Online and Basemaps are not reachable?

Both of these threads concern earlier versions than 10.3 but the approaches seem to be the same.  I have tried all of the recommended procedures to fix this and have been on the phone several times with tech support at Esri.

Here are some of the things we have already tried.

I've ran the "test connection" and "run connection test" dialogues and have set the properties for the system tray icon to all 3 settings.
Deleted the HKEY_CURRENT_USER\Software\ESRI\ArcGIS Online registry key and the HKEY_CURRENT_USER\Software\ESRI\ArcGIS Connection registry key.
I set all the variations of the proxy settings and auto detect settings in IE, made it my default browser and upgraded to IE 11.
I uninstalled and re installed ArcGIS.
I have signed in and out of ArcGIS Online via web browser several times with both Chrome and IE.
My IT department white-listed a list of URLs sent by Esri support in order to eliminate any firewall type issues.
My IT dept. has also monitored outgoing requests across our network to watch for traffic from ArcGIS.com.  They see the connection tests but nothing when I load ArcMap or ArcCat.


texts: What packages are needed on CentOS to compile MapServer from source

texts:
I'm trying to configure MapServer 6.2.0 for compilation on CentOS 6.3, but always run into the same problem, no matter what configure options I supply (also the same with no options at all, just plain configure).

It has something to do with g++ (although I do not really understand why it tries to use it).

Here is the output:

http://pastebin.com/8H5vmrPi

What is wrong?

EDIT: This problem was solved with yum install gcc-c++, as suggested by @steko. Now, I have another error, which is weird in my opinion:

configure: checking whether we should include PROJ.4 support...
configure: error: "Could not find proj_api.h or libproj.a/libproj.so in /usr/lib64."

Although locate proj_api.h gives /usr/include/proj_api.h (I also set --with-proj=/usr/include for configure, not as in the paste bin).


texts: Retrieving feature outside of ArcSDE into IFeature in ArcObjects?

texts:
I would like to be able to use Entity Framework with a repository pattern for non-spatial querying of my SDE Sql Server database.  I was hoping to reverse code-first engineer the database with the Entity Framework Power Tools to accomplish this.

Has anyone tried this before or something similar?  Is it feasible?

A couple issues I've come up with:

The reverse engineering tool doesn't know what to do with the geometry data type in the database, so it skips those columns when generating the POCOs.  I'm hoping to get around this by referencing Microsoft.SqlServer.Types.dll (or whatever assembly) and adding a geometry property to my POCOs.
Converting my POCO into an IFeature if I want to do some spatial stuff with it.  I'm not sure how I'd set the feature's geometry.
How to handle adding and updating in my EF context.  I'd probably make it "read only" so that clients can retrieve data but not commit to it.  I have no idea how to handle the versioning, even if it were possible to commit a feature back to the database purely with EF.


texts:
I'm coding an algorithm which uses as an input a map from QGIS. The software has been implemented in C++ and my idea is to convert, automatically, a shapefile into a raster one.

Is there any function in C++, from the QGIS api, to perform this task automatically? Besides: is there any data structure in the QGIS framework to handle matrices which comes from raster files?


texts: I´m having some trouble manipulating an osm-file I downloaded from geofabrik.de. For each street in the lines-layer I need to fill the missing "name" tags with the "ref" attribute listed under "other tags". Is there a way to fulfill this task in QGIS? If so can someone help me out with an explanation as I´m completely stuck. I tried to solve it with Python but handling osm files with python can be quite a task too. I provided you an image showing what I like to achieve.


texts: Decimals Appearing after ArcGIS Pro field calculation?

texts:
I'm working on an application that would reference phone numbers in an online application that would allow our call center to automatically call the number depending on the jurisdiction. When I take the field that has the phone number in it write out the code for it to be reference in HTML a decimal is added.

"!number!"

I have gone into the number column and turned off decimal, but get the same results.

Has anyone else had this problem with ArcGIS Pro 2.2.1?


texts:
Given two polygons (point, line, or up to 8 vertices) I need to be able to calculate the shortest distance between them via code I write or a call to an API (I haven't been able to find one that does exactly this).  Calculating distance between points is easy, polygons to polygons is much more complex.

Here is what I have come up with so far:

First create a function that calculates distance between a point and a line:

Calculating the distance between a point and a virtual line of two lat/lngs

Next, given shapes A and B, find out if the shapes intersect using a ray casting algorithm.  If so then return 0 for distance.  If they do not intersect, for every vertex in A, find the distance to every edge in B using the above point-line-distance function.  Then repeat process but reversed (Every vertex in B to every edge in A).  Then take the shortest of these distances.  This seems very expensive though especially if finding distances between large numbers of polygons.  I'm wondering if there is a better approach.


texts: Where can I find map data for Northern Territory State, Australia?

texts:
Could you please say where I can find the layers for Australia?

I need just Northern Territory State

I need basic layers like buildings, roads and others in shape format apart from the cloudmade.


texts: Regarding property setMinScale(scale) and setMaxScale(scale) in ArcGIS API for JavaScript?

texts:
I am new to programming in JSAPI.

I have two dynamic layers and I want to set the property setMinScale(scale) and setMaxScale(scale) to layers so how do I Set ?

ex. I tried using layer.setMinScale(0) but it is not working


texts: Ggplot2 map with colored background and coord_map()

texts:
I'm trying to plot some cities stored in my rda file naobrazokSR.rda on a map from GADM while having a background of the map in color #2C3E4F. Without using the coord_map() this works as intended but looks deformed. After using the coord_map() white bars appear on top and bottom. I'm trying to use the plot inside shiny application and I believe this can be solved by fixing the aspect ratio somehow, but I'm not sure how. Is there a way to change the whitebars to my color without adjusting the aspect ratio?

library(ggmap)
library(ggplot2)
SVK <- readRDS("D:\\Downloads\\SVK_adm1.rds")
alfa = 0.5
load("D:\\Downloads\\naobrazokSR.rda")
p <- ggplot() + geom_polygon(data=SVK, aes(long,lat,group=group))
p <- p + geom_path(data=SVK, aes(long,lat, group=group), color="white",size=0.1)
p <- p + geom_point(aes(x=pomoc$X1, y=pomoc$X2) , size=2,col = "red", alpha=alfa)
p <- p + theme(axis.line=element_blank(),axis.text.x=element_blank(),
           axis.text.y=element_blank(),axis.ticks=element_blank(),
           axis.title.x=element_blank(),
           axis.title.y=element_blank(),legend.position="none",
           panel.background=element_rect(fill = "#2C3E4F", colour = "#2C3E4F"),
           panel.border=element_blank(),panel.grid.major=element_blank(),
           panel.grid.minor=element_blank(),
           plot.background= element_rect(fill = "#2C3E4F", colour = "#2C3E4F"))
p <- p + coord_map()
p