texts: Correct way to stop Leaflet Map propagation

texts:
What is the correct use of the Leaflet stopPropagation?
I have a canvas map drawn with some custom png markers. That works great, but when they are clicked, both the marker and map click events are fired. I just want the marker click event to fire.
https://francoisromain.github.io/leaflet-markers-canvas/dist/leaflet-markers-canvas.js to do the custom canvas png markers.
     var marker = L.marker([entry.Lat, entry.Lon], {icon: icon, UniqueId: entry.UniqueId}).on('click', onClick).bindTooltip(entry.Callsign);
 aircraftmarkers.addMarker(marker);

The below function is when a marker is clicked.
function onClick(e) { /*show the div*/ }

And this is the function for when the map (not marker) is clicked.
map.on('click', function(e) { /*hide the div*/}

So as you can tell when I click the marker, it would show and hide the div at the same time.
I have tried putting in
L.DomEvent.stopPropagation(e).

to either and both of the functions but this does not seem to make any difference whatsoever.
From the console I can tell that the marker event is fired, then the map event, presumably due to the order of layers.
What is the correct use of the stopPropagation()? Am I missing something? On Leaflet 1.7.1
Here is the full onClick(e)
 function onClick(e) {
 L.DomEvent.stopPropagation(e);

    //////////////////set the currentselectedmarker variable.
    currentselectedmarker = this.options.UniqueId;

    //////////////////set marker id in url
    window.history.replaceState('', this.options.Callsign+' - Live Map', '?id='+currentselectedmarker);
    ///////////////ensure only 1 request can happen per second
    if (((Date.now() / 1000) - lastwindowupdate) > 1) {
    lastwindowupdate = Date.now() / 1000;
    map.panTo(this.getLatLng());
    document.getElementById("searchresults").innerHTML = '';

    if (screen.width > 600) {
    /////////////screen width is large enough for normal window, show it
    document.getElementById("window").style.width = "335px";
    document.getElementById("window").innerHTML = '

<img height="250px" width="300px" src="<?php echo site_url(); ?>/leaflet/loading.gif">';
    $('#window').load('<?php echo site_url(); ?>/leaflet/livemapaircraft.php?id='+this.options.UniqueId, function() {
    });
    }
    else {
    /////////////screen width is too small, show the mobile window instead
    document.getElementById("window-mobile").style.height = "170px";
    document.getElementById("window-mobile").innerHTML = '<img height="150px" width="200px" src="<?php echo site_url(); ?>/leaflet/loading.gif">';
    $('#window-mobile').load('<?php echo site_url(); ?>/leaflet/livemapaircraft-mobile.php?id='+this.options.UniqueId, function() {
    });

    }

    }

    ////////reqeust too early
    }


texts: how can I speed up openlayers plugin for Google images in QGIS?

texts:
I use Google aerial photos when using QGIS (2.10.1) using the openlayers plugin.

I find that it is very slow, and often hangs when I refresh or move around the map.

Is there a way of improving its performance - I am certain it is not my internet connection, which is fibre optic.


texts: Setting default browser for QGIS actions

texts:
I am trying to open a pdf using QGIS action tool with Adobe Reader. Currently, the action defaults to Internet Explorer which doesn't succeed in opening my document. I'm currently able to open AutoCAD files and photos. Does anyone know how to set the default software used to by QGIS actions? I'm using QGIS version 2.0.

my pathname in the attribute field is:
explorer C:\Documents and Settings\user\Bureau\file.pdf

Action Type: Windows. Name: Open file. Action: [%"pathname"%]. I didn't click the Capture checkbox.

Thanks in advance!


texts:
I am using 3D map view in QGIS 3.4 and I have point data. On layer properties I have enabled 3D Renderer but the billboard rendering to point option does not seem to be there.

Does anyone know where I can find this?


texts: How to create a new point file containing selected points?

texts:
Using QGIS 2.16.3, I have uploaded a point dataset. Using the attribute table, I have made a selection of several points, and would like to create a new point layer containing only the selected points. I have consulted:
  How to create a new layer from a selection in QGIS?
Problematically, my menu selection is somewhat different form the one here, and I can not choose 'Save selection as'. Is there any other way to choose the selection?


texts: Using expressions to relate column to layer style in QGIS?

texts:
I have a QGIS project with N layers, each pointing to the same CSV file with columns "1_1, 2_1, ..., N_1".

I would like each layer to refer to its respective column (Layer 1 -> column 1_1, and so on) and display points based on the Graduated style I have set. I am able to get the result I am looking for by manually selecting the Column in each Layer Style for every layer like so:

However, this is very time consuming so I am trying to figure out a way to use Expressions to relate the layer name to the respective column name. I have tried the following expressions with no success:

@layer_name+'_1' (Valid expression but every point has the same value and style)
"@layer_name+'_1'" (Valid expression but null output)
"concat(@layer_name,'_1')" (Valid expression but null output)
column "@layer_name+'_1'" (Invalid expression)
column name "@layer_name+'_1'" (Invalid expression)

I am using this as reference: https://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/expression.html

Is there something I am misunderstanding about expressions in QGIS?

This is my desired result: (One layer visible)

This is the closest I was able to get using the first expression:


texts:
Is there a way, within QGIS 2.*, to stop the interface from trying to snap in floating toolbars (as attached pic)?

I want to maximise canvas space, but the interface keeps on wanting to grab my toolbars.


texts: I have a problem with go to X, Y tool in arcgis 10. When I want to use this tool the program crashes. Is there any service pack or something to repair that problem?


texts: Creating multivariate choropleth map with diverging color scheme(s)?

texts:
We recently had primary elections in the community I serve. With the results having been released, there have been some requests for precinct level maps. Many of these primary elections featured more than 2 candidates. Rather than assign a color to each candidate and color precincts strictly by who won, I would like to make some choropleth maps that visualize the balance (or imbalance) in those primary races where there were 3 candidates. For example, if in Precinct 1 Candidate A received 45% of the vote, B 35%, and  C 20%, I would like for the symbol to show up as a composite of the three candidates' vote percentage relative to the whole. Essentially I want to make the map below for the three candidates who participated in the primary.

The data I have - % total votes per candidate per precinct - seem similar to what is being used in the map above. Unfortunately, this map is relatively old and the actual nuts and bolts about how it was produced seem to have been left undocumented.

Now, I think it is rather simple to create a diverging color scheme between percentages comparing two variables, but I'm having trouble wrapping my head around how one might use something like ArcGIS Desktop to crunch the numbers to do the same with three variables. It just doesn't seem equipped to natively create a multi-variate, diverging color scheme.

It's also quite possible that I'm using the incorrect terminology describe what I want I'm trying to create.

How can I process my data to be able to make a map like the one above?

I know there are other ways of visualizing this type of data, but I am particularly interested in making the type of map I've described above.


texts: Clipping vector layers in specific study area in QGIS?

texts:
I've asked the same question before (sorry for this) but I still couldn't solve the problem.

I wanted to cut all my vector layers into specific studying area (which in screenshot blue and purple), I've digitilized polygon within this area and used clipper tool. But it cannot cut it or cut out of the area. I've also tried to save (save as) my vector layers in user-defined coordinate, still doesn't work. I'm a newbie, could someone please explain this problem to me?

All my vector layers are in WGS 84, but project coordinates (right corner below) is user-defined: 100 000 (north Asia + Europa), I want my datasets to look normal (Lambert/curve), not flat. clipper: input layer and clip layer are: WGS84.

While creating the polygon in my study area, do I have to make sure that my project coordinates (in the right below corner) are in WGS84 (4326)?

In the screenshot, you can see the polygon, that I've created, which is my study area, I have to cut them (vector layers) because now I am working with world data which is quite big to deal with.

As you can see, I have 2 polygons, I can't merge them otherwise the area I don't want will be also included.

It will be much easier if I cut them like this and keep it this way.


texts: Assigning feature symbology by categories with related table in ArcGIS Online?

texts:
I am making maps for Collector app with features and related tables.

Is there a simple way to assign different symbol to features based on whether it has related records or not?


texts:
I recently installed the 3.2.2 version of QGIS but the interface seems to be weird

How can  make the map canevas occupy the rest of the window?


texts: BuildCircleMbr with 1km of accuracy - spatialite

texts:
I want to create a Circle MBR in spatialite of 1km for example from lat/lon in WGS84

I use BuildCircleMBR but i am not able to generate this well.

My query
SELECT BuildCircleMbr(40.0,-4.0,1, 1000)

I have read the third argument (1000) should be in degrees and not in meters but i don't know how to do this.

Any idea?

Thanks


texts: Extracting from two rasters in ArcGIS for Desktop?

texts:
I have raster A with 11 classes and raster B with 11 classes. I tried the con= tool but didn't work. I'd like to extract a new layer from something like:

  extract where raster A class >=1 and <=4 and where raster B class = 9

Any ideas?


texts: Row_number with create virtual field in QGIS

texts: How can using  @row_number option or similar together the command "Create virtual field". It works very well with "Create new field", but doens't work with "Create virtual field".


texts: Calculate the travel time from locations to the closest N points

texts:
I  want to calculate the travel time (based on walking time) from locations to the closest N points of another dataset. Then I want to create a hull around those N closest points per location

Is this possible? How can this be done?

The software does not really matter; I have access to QGIS, FME, ArcGIS, R, python; any other software is fine with me. However, I do not know where to start.


texts: Connecting to a spatialite DB, querying, writing the queried result to a spatialite table using PyQGIS

texts:
I am developing a plugin that connects to a spatialite DB , do some queries and outputs the results to a spatialite table. I had tried with the below code to connect to the DB and print the queried result to the console as first step.

from pyspatialite import dbapi2 as db
conn = db.connect('/home/farook/DB/cities.sqlite')
cur = conn.cursor()
sql = 'select * from test_pt'
rs = cur.execute(sql)
print(rs)

I could not see anything printed for the given query. Please tell me where i am wrong.


texts: Custom Python Toolbox not importing when module in other folder?

texts:
I'm following this guide
http://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/extending-geoprocessing-through-python-modules.htm

I got it to work on arcmap 10.6 (desktop) when the toolbox is in the same folder as the module (src/foo/foo.py). But when I move the toolbox into src/foo/esri/toolboxes, the toolbox has a red x on it in arccatalog.

Inside the toolbox I've tried:

import foo.foo
import foo
import foo from foo

When i right click on toolbox and "check syntax" I keep getting the error
"ImportError: No module named foo"

Reading up on google it sounds like i may need to do something with sys.path.append... but I've tried tons of copied and pasted solutions to no avail.

Other people have said I have to type in the path manually, but that's a problem since i'm hoping to share this to others.

I tried building it, and installing it, and it doesn't show up in arctoolbox. When I have the toolbox in the foo folder, it does show up in arctoolbox after install.

I'm out of things to try and looking for help!

I am creating the project in PyDev Eclipse, and there are no syntax errors or problems with imports.


texts: Adding value of overlapping point features?

texts:
I have several different point feature classes (shape files) spread on a grid, each point (located at grid centers) has a attribute named value. For example, assume we have a 3x3 grid, which has nine point features at the grid centers. The first point feature class is the four lower left ones with value = 1, and the second point feature class is the four upper right ones with value = 2. Now I want to merge these two feature classes, and get a new feature class with seven (not eight) points and with value being sum of the first and second one, as indicated in below picture.

How can I do it in ArcGIS?

I tried Merge or append tools in ArcGIS but it will not add values the way I want.


texts: Unique Layouts within Data Driven Pages (ArcGIS 10.2)

texts:
I am fairly new to working with data driven pages and have run into a problem that I can't solve on my own. I have a set of maps organized with data driven pages from a grid shapefile that I generated through the "grid index features" tool. Everything is set up perfectly to be finished with the project... except that I noticed my legend covers up a bit of my project area on a few of the maps. So my problem is that no matter where I move the legend, it covers up some portion of my project area on one or more of my maps.

Is there some way to have the legend placement be unique on individual pages within the data driven pages file? I feel like there is a button to click somewhere I just can't seem to find it.


texts:
SOLVED: f_table_name was not working as no spatialindex was created/defined using just the tutorial for VirtualKNN - Solution: Run the query
SELECT CREATESPATIALINDEX('tablename','geom_col')

Original Problem
First time using spatialite - followed a tutorial to set-up my database and ran a basic distance function to get the nearest objectid - works great but I have A LOT of points so I decided to use the virtualKNN - ran it on the same point to test but KNN returns nothing - tried without the PointFromText as well but it doesn't seem to work.
What am I doing wrong?

My end goal is to run a KNN from another bunch of points from another table but this is throwing up a blank table as well.

Looks like something wrong with the way i am calling f_table_name?
I have a table called LION but i guess it is not able to see that?
I get a blank result when i call anything in the between the '' that doesn't exist so f_table_name is having trouble reading my table?

Edit - Added code
This is the distance function that works
query='''
Select OBJECTID, Distance(PointFromText('POINT(-73.9215944000000036 40.8278258999999935)'),wkb_geometry) as distance
,wkb_geometry
FROM LION
Order by distance
'''

test=pd.read_sql_query(query,db)
test[~test['distance'].isnull()]

This is the knn query that returns a null table because it can't read f_table_name
query='''
Select * FROM knn
WHERE f_table_name = 'LION'
AND ref_geometry = MakePoint(-73.9215944000000036, 40.8278258999999935);
'''

test=pd.read_sql_query(query,db)
test.head(100)


texts: QGIS:what does it do "snap gcp coordinates to background layers" in the Georeferencer plugin?

texts: Maybe is too obvious, but I don't find any precise documentation about this checkbox in the georeferencer plugin.


texts: How to redistribute values of a raster according to a gaussian distribution

texts:
I have a matrix of dimension 10 x 10, with each cell value equal to 100.

100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100

And I would like to create a new matrix in which these values are distributed according to a gaussian distribution with values higher than 100 in the middle of the matrix and values lower than 100 going towards the borders of the matrix.

However, I want the total sum of values to be the same in the two matrices (therefore 10.000).

Do you have any suggestion on how I could do it in R?


texts: Unable to render pbf tiles extracted from osm2vectortiles

texts: I have downloaded an mbtile file from osm2vectortiles (http://osm2vectortiles.org/downloads/) project. After that I have extracted pbf tiles using mbutil and tiles were successfully written to the disk. I have configured nginx to serve the static tiles with appropriate header information but my client (tangram https://mapzen.com/products/tangram/) is not able to render these tiles. It is neither throwing any errors nor debug information.


texts:
I have a QGIS project running on QField that allows the user to draw points/lines and assign attributes to them. Every point/line gets an unique ID that get created through an UUID-Generator in QGIS.

When I open the project on QField, no ID is created and the ID is blank. How can I achieve an unique ID when I create objects using QField?


texts: how to find 20 closest points efficiently

texts:
Say I want to find 20 closest business near me.

My table structure is like this:

    BusinessID  varchar(250)    utf8_unicode_ci         No  None        Browse distinct values  Change  Drop    Primary     Unique  Index   Fulltext
    Prominent   double          No  None        Browse distinct values  Change  Drop    Primary     Unique  Index   Fulltext
    LatLong     point           No  None        Browse distinct values  Change  Drop    Primary     Unique  Index   Fulltext
    FullTextSearch  varchar(600)    utf8_bin        No  None        Browse distinct values  Change  Drop    Primary     Unique  Index   Fulltext
With selected: Check All / Uncheck All With selected:
Print viewPrint view Propose table structurePropose table structureDocumentation
Add new fieldAdd field(s) At End of Table At Beginning of Table After
Indexes: Documentation
Action  Keyname Type    Unique  Packed  Field   Cardinality Collation   Null    Comment
Edit    Drop    PRIMARY BTREE   Yes No  BusinessID  1611454 A
Edit    Drop    Prominent   BTREE   No  No  Prominent   0   A
Edit    Drop    LatLong BTREE   No  No  LatLong (25)    0   A
Edit    Drop    sx_mytable_coords   SPATIAL No  No  LatLong (32)    0   A
Edit    Drop    FullTextSearch  FULLTEXT    No  No  FullTextSearch  0

There are 1.6 million bizs. Of course it's stupid to compute distance for all of them and then sort it.

That's where geo spatial index kicks in right?

So what SQL comman I need to cast?

Note:

I am using mysql myisam spatial index. However I did not specify this before. So I will accept those who answer it to show my appreciation and ask another question.
I do not want to compute
    distance for the whole table
I do not want to compute distance for
        any region which are still inefficient
I do want to compute distance
            for reasonable number of points because I want to sort the points by
            distance and be able to display point 1-20, 21-40, 41-60, etc.


texts: I have map points for schools in a district. I want to label the map ID and the name of the school on the map. I have the map ID labeled within the point symbol but I want the school name outside of that. Is this possible without manually putting in a text box for the school name? Using ArcMap 10


texts: WPS "distance" function with geographic coordinates

texts:
I need to use WPS to calculate distance between two geometries, the geometries are represented in EPSG:4326.

The geo:distance function of WPS tells:
"Returns the minimum distance between two geometries. Measurement is given in the input units, so geographic coordinates are not recommended."

So, how can I do that? Must I convert the coordinates to UTM? if yes, how?

My environment is: PostGIS, Geoserver, and OpenLayers


texts:
Has anyone noticed that sometimes when uploading to Carto via the app (my tests are just from CSV) the column order is different from source, and sometimes it isn't??

I have not noticed the same problem uploading directly via the SQL API, but have not tested extensively.

Question: is there any way I control whether column order is kept intact when uploading?

Context: I'd like to standardise an update process where a new table is uploaded then the existing table is truncated and values populated from the newly uploaded table. A la:

TRUNCATE table;
INSERT INTO table
SELECT * FROM newtable;

This does not work if the columns are in a different order - I get a type error because the index is pointing to the wrong column!


texts:
I have this questions, how to Import by GDAL_TRANSLATE IMAGE GOES-13?
Whats is possible projection?

Files: 1501201445G13I01.TIF
Size is 14400, 12001
Coordinate System is `'
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=
GOES 13 Imager frame  78 at UTC 14:45:22.252 day 020 of 2015
Vis pixels :   4009, 24840    lines :   2621, 13440
Vis Lon    : 999999,999999 Lat   : 999999,999999
Imager ch1:count(0,1023) => [(albdo-0)/0.4]^1 =Uchar> (0,255)
(xscale,yscale) => (0.571429,1)
Vis pixels:  3650,  28850 lines:  2250,  14250
(xstride,ystride) => (1.75,1)
IMC status:      1
nadir pixel,line:  15352,  8050
Ref lon,d,lat,yaw:  -74.99990305,   42164.17478,         0,         0
Attitude roll,pitch,yaw:          0,         0,         0
  TIFFTAG_MAXSAMPLEVALUE=255
  TIFFTAG_MINSAMPLEVALUE=0
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,12001.0)
Upper Right (14400.0,    0.0)
Lower Right (14400.0,12001.0)
Center      ( 7200.0, 6000.5)
Band 1 Block=14400x1 Type=Byte, ColorInterp=Gray


texts: How to convert multiple shapefiles of different geometries into a georeferenced raster

texts:
I have multiple shapefiles extracted from OSM vector data,  as shown in the image bellow:

How can I render this into a raster of a specified resolution? Is there a way to do that using QGIS or Python?


texts: Fixing ModelBuilder error? Error 010045: COSTPATH: The number of FROM cells is 0

texts:
I'm a beginner to ModelBuilder and I keep getting the error shown below.

I keep getting the same error even when I convert point to raster:

  Error 010045: COSTPATH: The number of FROM cells is 0


texts: How to make a contour map from a list of points and values?

texts:
I need to create a nice map with contours that represent various thematic data on a scale of a country, for instance, average temperatures in Germany.

I have a list of coordinates with the values, and that's it. I am a bit lost here what's the best approach. The output should be a PDF or raster map (I am not interested in a web service). The base map can be very basic with just country borders and optionally major cities.

My idea was to use matplotlib and somehow overlay the contours over a map, but I don't think that it'd look professionally made and appealing.

What are your recommendations? Can QGIS do the complete job?


texts: Geoserver gwc rest api - how can I edit config

texts: Is there a way to change geoserver gwc-gs.xml through a rest interface? I want to be able to set cacheLayersByDefault to false.


texts: Unable to intersect with search cursor on ArcPy?

texts:
I would like to loop through the shapes in the attribute table and create a new intersection point feature class for each row in the table. But every time I do this, I keep on getting the same error.

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\analysis.py", line 289, in Intersect
raise e
ValueError: DescribeGeometry: Unexpected error

This is the portion of the code I am working on, where tribufline and water_feature are line feature class. I t would be really helpful is someone is able to point me in the right direction because I have no idea what is causing this error

for row in arcpy.da.SearchCursor(tribufline, ["SHAPE@", "OID@"]):
   line = row[0]
   culint = "triculint{0}".format(row[1])
   arcpy.Intersect_analysis([line, water_feature], culint, "ALL", "","POINT")


texts: Comparing Slope among various DEM resolutions?

texts:
I'm comparing the slope products derived from DEMs of various spatial resolutions (1m, 10m, 30m) for a set area.

The trend I find is that as the resolution improves, the areal extent of various extreme slope breaks (>45%, >50%, >70%) all increase.  The areas increase by so much in fact, that it makes me question the reliability of anything I would produce from the 30m DEM - beyond using as just a general reference or guide.  I'm inclined to believe that better resolution equates to a better answer, but know that isn't always the case.

Is there a simple enough explanation for this pattern I see?

Or perhaps 1m is overkill for this?  Could noise be a big factor?


texts: DB Manager in QGIS 3.8 Zanzibar unable to load from PostGIS

texts:
I am no longer able to load tables from PostGIS (PostgreSQL 9.6) since the last update of QGIS. On polygon tables, the DB manager now shows a ? icon, point icon, line icon and polygon icon for each table whether they have those geoms or not. Worse, when attempting to laod it each ask for the CRS yet still none will load into QGIS, even when they contain those geoms.
See image attached. Is anyone else experiencing these issues and is there a solution to this problem?


texts: How do I combine GeoTIFF files covering the same area but storing different data into a single file?

texts:
I have shapefile cutouts (same shapefile across all images) of different GeoTIFF rasters (with different metadata and sometimes resolutions). How do I merge them into a single GeoTIFF file?

I'm well versed in Python but completely new to GIS, GDAL, and QGIS. Command line, code, and GUI based solutions are all fine.


texts: ST_Collect while computing average values

texts:
In a PostGRES/PostGIS database, I have a table "myTable" containing very large numbers of polygons (the geometry is under the column "Polygon"). Each polygon has a numerical value under the "Var1" column. They also each fall under an area stored as a string in the "Region" column.

Since these polygons are too numerous, I'd like to aggregate them according to the region they belong to.

This is what I'm doing:

SELECT ST_Collect(Polygon) as geom FROM myTable GROUP BY Region;

Although, by doing that, I lose the very important values under Var1.

How can I compute the means of the values of Var1 for each polygons under the same Region, and output it in my query?


texts: Raster calculator ArcGIS, high precision floating point operation

texts:
I need to preform a transformation on a DTM, in order to use it as a variable in a multiple regression equation (the variables, including elevation data have been box-cox transformed).

A part of the transformation looks like this:

("dtm"**3.813499755859380) - 1

The first part, the power (**, or ^) transformation results in a raster image with values I expect to see, min and max values of this raster are: 1.596767423145407e-013 and 2.391312495242381e-011.

However, when I want to subtract 1, ArcGis rounds all my values to -1.

How can I suppress this rounding? In Matlab, this would result in something close to -0.9999999......98000 for example, but it doesn't round it to -1. I need this information to continue my tranformation of the DTM.

Pixel type and depth for this raster are: floating point and 32 Bit.


texts: geopandas: clip() not working as expected

texts:
I have two dataframes--one with a polygon (POLYGON Z in region column), and one with one linestring (LINESTRING Z in path column) per row.  I was expecting that the following code calling .clip() would apply the polygon mask to each linestring (what I'm trying to accomplish) per the docs, but that does not appear to be happening.
linestrings_cropped = gp.clip(linestrings, polygon.region)

Including a screenshot of the cells from my notebook which demonstrates that the mask is not being applied to each row (the red in the example is outside of the blue polygon).


texts: Module output not added to display when using ModelBuilder in ArcGIS Pro

texts:
I have a model that runs fine in ArcMAP and adds the data to display if run in edit mode. I have now "converted" the module to ArcGIS Pro and it runs as it should. The only issue is that for some reason it does not add the data to display regardless if the model is run through dialogue box or edit mode.
Please advice.


texts: Saving a Child Object as a Feature Class/Layer

texts:
I'm very new to arcpy, my terminology might not be the most precise/accurate.

I'm having trouble saving a sublayer (named "LALines") from a Location Allocation Solve Result as a feature class. As I understand it, these sublayers are children objects of the LocationAllocation layer that results from the Solve function.

My code looks like this:

    desc = arcpy.Describe(LocationAllocation_Output)
    for child in desc.children:
        if child.name == 'LALines':
            arcpy.FeatureClassToFeatureClass_conversion(child, "\\\\DC1\\ExampleLocation", "ChildLines")`

and I receive this error every time:

RuntimeError: Object: Error in executing tool

I've done some pretty thorough searching/googling but can't seem to find an exact answer. Anyone have any ideas?


texts: How to perform raster Overlay Analysis using QGIS?

texts:
I tried to do a raster Weighted Overlay Suitability Analysis to find the best location for home lands using QGIS. Used layers are:

School location (point)
Crime locations (point)
Road (line)
Water lines (line)
Towns (point)

My procedure is to first convert to distance each layer and apply the Weighted Sum Overlay method. I used Raster > Rasterize to convert but the result was a black square and it can't apply styles. If anybody knows the correct steps, please help me. Next if it is ok, what is the tool for weighted sum in ArcGIS?


texts: How to calculate total number of data cells in raster?

texts:
I am using ArcGIS 9.3 and python 2.5. My code is shown at the bottom of this post.

I have a raster containing fire intensity information at 200m cell resolution.
I run the script and the first count cell part returns the size of the fire. This works fine.

I then clip the raster using a polygon representing a forested catchment. The new raster represents the area of the catchment that is burnt.
When I try to use the same code to count the number of cells of the new raster, it always gives me an answer of zero, even if there is definitely a raster created by the clip tool.

I have tried every combination of every tool I can think of.

my code...

    fire = str(ignitionID) + "_" + str(weatherID) + "_Intensity.asc"
    print "fire: " + fire

    # ---------------------------------------------------------------------------
    # this section calculates the size of the fire for model calibration purposes
    # ---------------------------------------------------------------------------

    # Process: Build Raster Attribute Table...
    the_fire = input_fires + fire
    shutil.copy(the_fire, "C:\\FIRESTORM\\Workspace") # copy the fire to workspace
    the_fire = "C:\\FIRESTORM\\Workspace\\" + fire

    try:
      gp.BuildRasterAttributeTable_management(the_fire, "NONE")
      resultf = gp.GetCount_management(the_fire)  # count num of rows in raster
      countf = int(resultf.GetOutput(0))
      fire_area = countf * 4  # each cell has an area of 4 ha
      print "the fire area = " + str(fire_area) + " ha"

    except:  # the attribute table cannot be created coz the fire is too large

      fire_area = 300000 # default value for large fires 300000 ha
      print "the fire area EXCEEDS 262,140 ha"

    # -----------------------------------------------------------------------------
    # this section calculates the area of the catchments that are burnt by the fire
    # -----------------------------------------------------------------------------

    # Local variables...
    catch_extent = input_catch + "WS_Catchment_region.shp"  # catchment boundary
    fire_raster = "C:\\FIRESTORM\\Workspace\\fire_raster"
    fire_ascii = the_fire
    Output_raster = "C:\\FIRESTORM\\Workspace\\Extract_ASCI1"
    Output_ASCII = "C:\\FIRESTORM\\Workspace\\rastert_extract1.asc"
    catch_burn_area = 0  # reset catchment burn area

    # Process: ASCII to Raster...
    gp.ASCIIToRaster_conversion(fire_ascii, fire_raster, "INTEGER")

    # Process: Define Projection... based on projection of catch_extent
    desc = gp.Describe(catch_extent)
    spatialRef = desc.SpatialReference
    gp.DefineProjection_management(fire_raster, spatialRef)

    # Process: Extract by Mask...
    gp.ExtractByMask_sa(fire_raster, catch_extent, Output_raster)

    # Convert raster to ascii
    gp.RasterToASCII_conversion(Output_raster, Output_ASCII)

    # Process: Build Raster Attribute Table...
    gp.BuildRasterAttributeTable_management(Output_ASCII, "OVERWRITE")

    # count number of rows in raster
    resulti = gp.GetCount_management(Output_ASCII)
    counti = int(resulti.GetOutput(0))
    catch_burn_area = counti * 4  # each cell has an area of 4 ha

    print "catchment area burnt = " + str(catch_burn_area) + " ha"


texts: Geoserver WMS defaults to Mollweide projection in QGIS

texts:
We have a WMS on Geoserver (version 2.6.1) which we are using to view in QGIS. For some reason when importing to QGIS it defaults to World Mollweide (EPSG:54009). The process is as follows:

Add connection:

With the path http://www.ga.gov.au/geophysics-rockpropertypub-gws/ga_rock_properties_wms/ows

This gives us all our WMS Layers:

And if we add a couple:

We get a strange projection for the project:

If we look at the properties of the gamma short spaced density layer

It too has defaulted to World Mollweide. The layer source string is as follows:

crs=EPSG:54009&dpiMode=7&format=image/png&layers=gamma_short_spaced_density&styles=&url=http://www.ga.gov.au/geophysics-rockpropertypub-gws/ga_rock_properties_wms/ows

So what is the reason for this? We want the default to be EPSG:4326 at the minimum, although we would prefer EPSG:4283. How can we fix this? Is it a problem with QGIS or the  WMS?


texts:
I understand that this question has been asked before in one form or another, but unfortunately those answers haven't been able to solve my issue.

I've imported a .csv file into QGIS and all the data is visible on the attribute table - however only 3 out of the 13 points are shown on the map. I've selected those three on the table for the image and can't work out why the other points aren't shown.

The points on the map are in the correct place so I don't think it's an issue with the projection.

I've also tried copying the data into a google spreadsheet then re-downloading it as a .csv (as one previous question/answer had suggested) but had no luck.

Any suggestions are welcomed!


texts:
I have written code the produces a mean threshold value for the amount of satellite imagery needed in a single year to produce the 95th percentile of NDVI. I assume that this threshold of satellite imagery differs from biome to biome, so I am testing what that threshold is for various biomes in the world.
I have 30 csv files that I want to produce this threshold value for. Here is the code I wrote for producing this for one CSV file:

temp <- read.csv("tropical_grassland_N_Am_point_summary_table_gdrive.csv")
temp <- temp[which(temp$nd > 0.1),]

index <- substr(temp[,5],30,(nchar(as.character(temp[,5]))-2))
unique_index <- unique(index)
unique_index <- sample(unique_index, 20, replace=F)

thresh <- 0.95

for (i in 1:length(unique_index)){
  temp2 <- temp[which(index==unique_index[i]),]
  theDates = strptime(temp2[,2], format="%Y-%m-%d")

  for (year in sort(unique(theDates$year))){
    theFirstYear <- min(unique(theDates$year))
    NDVI <- temp2$nd[which(theDates$year==year)]
    results <- matrix(NA, nrow=length(NDVI), ncol=250)

    for (j in 1:dim(results)[1]){

      for (k in 1:dim(results)[2]){
        results[j,k] <- quantile(sample(NDVI, j, replace=F), c(thresh))
      }
    }
    if (year==theFirstYear){
      results2 <- list(apply(results,1,mean))
    }
    if (year > theFirstYear){
      results2[[length(results2)+1]] <- apply(results,1,mean)
    }
  }
}

differences <- unlist(lapply(results2, function(x) min(which(diff(x)<.01))))
sample_thresh <- mean(differences)
sample_thresh

I very simply want to loop this code over all of my 30 files to produce a unique threshold value for each one. They all have _point_summary_table_gdrive.csv in common after the description of the continent and biome.


texts: Saving a shapefile to an output file path in my function(which the user will provide)?

texts:
I have a function which takes the coordinate argument from the user and converts it to a shapefile, and finally saves that shapefile to the filepath that the user gives. This is the code...

epsg_code = int(input('Enter epsg code: '))
outfilepath = input('Enter filepath for where the shapefile should be stored(r"\\...\\..\\"): ')

def geodf(coords):
    from shapely.geometry import Polygon
    import geopandas as gpd
    from fiona.crs import from_epsg
    import os

    coords_gdf = gpd.GeoDataFrame()
    coords_poly = Polygon(coords)
    coords_poly

    coords_gdf.loc[0, 'geometry'] = coords_poly
    coords_gdf.crs = from_epsg(epsg_code)
    coords_gdf.crs
    return coords_gdf.plot(color = 'brown')

    #coords_gdf.to_file(os.path.join(outfilepath))#, *coords_gdf.shp ))
    coords_gdf.to_file(outfilepath + coords.shp)
    #outfilepath + "\\coords_gdf.shp")

a_coords =  [(659337, 737770), (659335, 737703), (659329, 737702) ,(659328, 737700), (659282, 737700), (659268, 737749), (659296, 737767)]   #example

epsg_code = 32630

geodf(a_coords)

But the shapefile doesn't get saved to the filepath I put in.


texts: How to set QGIS 2.14 on OS X to use GRASS 7

texts:
My current QGIS installation (2.14) on OS X 10.11 is set up to work with GRASS 6.4.4.  I am guessing this is the default GRASS version that comes preinstalled with the QGIS package maintained by William Kyngesburye.

However, I have GRASS 7.0 installed on my system (from Michael Barton's packages), and would like to set my QGIS to work with GRASS 7.  In addition, I would like the GRASS plugin for QGIS to use GRASS 7.  As you can see in the attached screenshot, the GRASS version the plugin is using is 6.4.4 (2014).

I tried to set the "Custom" installation path to my GRASS 7 installation, but the plugin tells me that particular GRASS installation is not valid.

P.S.: GRASS 7 and QGIS are working fine on my OS X 10.11 installation, as I have disabled SIP.


texts:
I am trying to run the Fuzzy Membership on simultaneous rasters in ModelBuilder and I am running into the problem (or bug) where it allows me to change the "Membership Type" but ends up defaulting to "MSSmall" irrespective of whether I change it in the batch table.
To put this in perspective, the "Remap" tool can be used to batch reclassify rasters, but the Fuzzy Membership tool defaults back to MSSmall even though it deceptively shows it processing with the chosen membership type.

Attached are two pics showing the ModelBuilder diagram I built and the resulting interface whence double-clicked in ArcCatalog.


texts: Which edition of ArcGIS for Server and which capacity level?

texts:
I need to define the edition of ArcGIS for Server product to invest for a small scale oil & gas company.

What we need is to be able to:

Work on a geodatabase with 2-3 concurrent desktop users while a allowing access to a few more desktop users,
Serve maps from geodatabase (and satellite images and documents from the file server) to internal non-GIS users through web browsers and enabling specific tools like querying and basic geoprocessing on the client side.
Allow some users feed the geodatabase using their tablets or smartphones,

I read the ArcGIS for Server functionality matrix and got confused. The first part of the document tells me that I need ArcGIS for Server Enterprise Advanced (full product) but the case studies made me think that a workgroup-standard license seems to be enough.
Similarly I first got the impression that I need the Portal for ArcGIS product to serve any maps (do not want to use cloud) but then I thought ArcGIS for Server alone can be enough for services like WMS, WFS etc..

My company can invest on these products so I do not consider Open Source platforms but just want to make sure that we are not over investing.

Any advise on this?


texts: QGIS proximity raster with extent beyond original coverage?

texts:
I need a raster coverage of distances from points outside the geographic region of interest, and am having trouble doing this with QGIS.

Questions like this one (Calculating distance to points in QGIS) seem close to what I want, but I'm getting hung up on the first step.  The raster that I create with the QGIS "Rasterize" tool has an extent that does not overlap with the region of interest (because all of the points I want the distance from are outside of that region).  I don't see any option for changing the extent of the generated raster.

I am then unable to generate a Proximity raster with the extent I need.  How can I get the correct extent?

In addition, when I run "Proximity", I consistently get an error that my raster cells are not square and so distance calculations may not be accurate.  I don't know how to make square cells because the tool asks for how many cells I want in the x and y directions, not the x and y dimensions of each cell.  Is there a way of fixing this?

Ultimately, I'm a bit uncomfortable with the necessity of converting point data to raster in order to calculate proximity, and wonder whether there is an open source tool that can do what I want without the "Rasterize" step...


texts: Running ArcGIS Data Reviewer using ArcPy?

texts:
I want to run the ArcGIS Data reviewer in Python code, to check domains.

My scenario is check the attribute values if its meet the domain value.

Is it possible to run ArcGIS Data Reviewer in Python code ?


texts: Insert 1 row that has tens of thousands of geometry data on Oracle

texts:
I have a query to insert 6 geometry data like this

DECLARE v_geom sdo_geometry;
BEGIN
  v_geom := MDSYS.SDO_GEOMETRY(2003,4326,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(107.3151187889,-7.32918547322475,107.315103530116,-7.32918547322475,107.315092087376,-7.32918165900357));
  INSERT INTO TEMP_GEOM (ID, SHAPE_GEOMETRY) VALUES (164,v_geom);
END;

That query does not error when executed. but when I insert around 60.000 of geometry data, an error appears like 'Pl/SQL ignored ......'

So how can I insert 60.000 of geometry data to Oracle ?


texts: Given long, lat, x and y, how do I find the projection?

texts:
I am using an app called farsite that outputs shapefiles that show how forest fires will grow.  I am getting output in coordinates as X and Y values rather than (lon,lat) and am looking for a conversion routine to (lon, lat).  If I knew the name of the coordinate system it might help my search, but I do not even know that.  I have gone to google maps and have looked at the expected (lon, lat) so I have a rough translation equation, but I am sure that someone else has a better one (mine is linear with a scale and offset, which I fear is too simplistic)

Here is a sample point
(X, Y):     162206            386691
(Lon,Lat): -115.326662    47.582952

Can someone please steer me to a reference or conversion routine?

Thanks in Advance - Steve Tufty


texts: How to find intersection points between two circles?

texts:
We have two points (centers of two circles) and their radius in meters, those radius make the circle. We need to find intersection points. For example we have  lat1 = 55.685025, lng1 = 21.118995, r1 = 150 and lat2 = 55.682393, lng2 = 21.121387, r2 = 250. Below you can find our current formula:

// Find a and h.
$a = ($circle_1_r * $circle_1_r - $circle_2_r * $circle_2_r + $distance * $distance) / (2 * $distance);
$h = sqrt($circle_1_r * $circle_1_r - $a * $a);

// Find P2.
$circle_3_x = $circle_1_x + $a * ($circle_2_x - $circle_1_x) / $distance;
$circle_3_y = $circle_1_y + $a * ($circle_2_y - $circle_1_y) / $distance;

// Get the points P3.
$intersection_1 = $this->newLatLngPoint(
    ($circle_3_x + $h * ($circle_2_y - $circle_1_y) / $distance),
    ($circle_3_y - $h * ($circle_2_x - $circle_1_x) / $distance)
);

$intersection_2 = $this->newLatLngPoint(
    ($circle_3_x - $h * ($circle_2_y - $circle_1_y) / $distance),
    ($circle_3_y + $h * ($circle_2_x - $circle_1_x) / $distance)
);

We find such intersection points (yellow markers), however those locations doesn't match in real world.

Someone, can help to find where the problem is and how to sort it ?

P.S.
Does the altitude (Height above mean sea level) affect the final result? I don't use it but may be should?


texts: Listing Data sources using arcpy: ListLayers very slow

texts:
What I am trying to do is create a list of all the data sources in a directory filled with mxds.
So I have this code pasted below. For some reason when listing layers it can take up to 50 minutes even though the mxd only has around 10 or 15 layers. Is this a common occurrence with the listlayers method?

with open('data.csv', 'wb') as csvfile:
fieldnames = ['File_Path', 'File_Size(MB)', 'Last_Edit', 'MXD_Version', 'Author', 'PageSize', \
              'XMAX', 'XMIN', 'YMAX', 'YMIN', 'DATASOURCE'] #all the header fields
writer = csv.DictWriter(csvfile, fieldnames = fieldnames)
writer.writeheader()
for mapDocument in findFiles(r"W:/GIS (no purge)", '*.mxd'):
    print mapDocument
    st = os.stat(mapDocument)
    print "Using ArcPY Mods..."
    mxd = arcpy.mapping.MapDocument(mapDocument) #using arcpy to gather more information
    print "Reading Map Document..."
    writer.writerow({'File_Path' : str(mapDocument),\
                     'File_Size(MB)' : str(((st[ST_SIZE])/1024.0)/1024.0), \
                     'Last_Edit' : str(time.ctime(st[ST_MTIME])), \
                     'MXD_Version' : getMXDVersion(mapDocument)})

    print "Searching Layers and Writing..."
    for layer in arcpy.mapping.ListLayers(mxd):
        print "boop"
        if layer.supports("DATASOURCE"):
            writer.writerow({'DATASOURCE' : layer.dataSource})
        else:
            break
    del mxd

So my issue with the above code is when I am running it It will take forever to get to the 'print "boop"'but once it gets there it runs perfectly fine. It seems to get hung up at the arcpy.mapping.ListLayers(mxd) for a very long time.

Sometimes its great, only takes a few seconds, other times 8 minutes. That is manageable, but when I leave my code running all night and some of them take 50 minutes or it just crashes, that is the problem (it crashed due to a memory error). These mxds do not have that many layers in them either.

There is usually just one data frame that has at the most 20 layers in them. I can open these mxds myself and it only takes a few minutes at the most when i do.

From further testing it doesn't seem to be related to the amount of layers either. There were a few mxds that had around 30 layers that were completed in a few seconds and then another few that took 4 hours (it had 44 layers) and there are some that had 30 layers and took 50 minutes. If I could just pinpoint why it takes so long it would be great.


texts:
I am using following code to save a Goverage2D to JPG:

File tmpJpgFile = File.createTempFile("temp", ".jpg");
Iterator<ImageWriter> writers = ImageIO.getImageWritersBySuffix("jpg");
ImageWriter writer = null;
while(writers.hasNext()) {
   writer=writers.next();
   break;
}
if (writer!=null) {
   writer.setOutput(new ImageOutputStreamAdapter(new FileOutputStream(tmpJpgFile)));
   writer.write(croppedCoverage.getRenderedImage());
   FileRawData fileRawData = new FileRawData(tmpJpgFile, "jpg", outputMimeType);
   tmpJpgFile.deleteOnExit();
   return fileRawData;
} else {
   throw new WPSException("No JPG Writer available to generate image.");
}

I get the following error:

Process failed during execution javax.imageio.IIOException: Illegal band size: should be 0 < size <= 8

The same GridCoverage2D gets written in a GeoTiff flawlessly.

Has this omething to do with the fact the Coverage has just one band?

Here from gdalinfo of geotiff export:

Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  441180.000, 5013630.000) (  8d15' 0.43"E, 45d16'25.35"N)
..
Center      (  441295.000, 5013500.000) (  8d15' 5.76"E, 45d16'21.17"N)
Band 1 Block=16x32 Type=Float32, ColorInterp=Gray
  Min=-0.214 Max=0.195
  Minimum=-0.214, Maximum=0.195, Mean=0.043, StdDev=0.048
  Metadata:
    STATISTICS_MAXIMUM=0.19480518996716
    STATISTICS_MEAN=0.042965890258674
    STATISTICS_MINIMUM=-0.21431475877762
    STATISTICS_STDDEV=0.048457298863482


texts: ESRI Flex API - Modify Style of Draw Toolbar Tooltips

texts:
Can anyone tell me how I can change the styling of the Draw Toolbar's tooltips in the ESRI Flex API?

If I use apply the style shown below - ALL of the application's tooltips inherit this style.  I am trying to target only the Draw toolbar here.  I have also tried intercepting the TOOL_TIP_CREATE event of various components with no luck.  That event does not fire on the map, at least when Draw toolbar tips are shown.  I can't figure out how to register that listener on the toolbar itself.

map.addEventListener(ToolTipEvent.TOOL_TIP_CREATE,onToolTipCreated);

<fx:Style>
        @namespace mx "library://ns.adobe.com/flex/mx";
        mx|ToolTip
        {
            backgroundColor: black;
            backgroundAlpha: 1.0;
            cornerRadius: 0;
            color: white;
        }
    </fx:Style


texts: ArcGIS Surface Volume - multiple results in one table

texts:
I'm calculating volumes and surfaces using Surface Volume tool. According to the help page:

http://pro.arcgis.com/en/pro-app/tool-reference/3d-analyst/surface-volume.htm

it should be possible to obtain results from multiple runs in one .txt file (one calculation -> one row), by specifying the existing .txt as the output in following calculations. However it doesn't seem to work for me, since I get an "ERROR 000725 - output file already exists" (on the second operation). I need to do long series of calculations with varying heights, thus having the results in one table at once would be immensely helpful.

Maybe I'm missing something here, but it seems pretty straightforward to me. Or could the help page be wrong about this? I use ArcGIS 10.4.1 Advanced.


texts: Is it possible to get specific Asian population totals from the Census at the Block or Block Group level?

texts:
I know you can get it at the Tract level but I can't for the life of me find it at at a lower level. I can find totals for just "Asian" at these levels but I want it to be more specific than that (e.g. Chinese, Korean, Vietnamese, etc.) and specifically in California.

Is this type of information available at the block or block group level?


texts: Which Writer do I need for PDF Documents in FME 2014?

texts:
I have successfully used the ImageFetcher transformer to download many images from a URL by using a JPG writer. Now I want to do this with PDF Documents, but have the problem that the Adobe 3D PDF writer and Adobe Geospatial PDF don´t write the outputs to a file.
Here is the log.
How can I use the HTTPfetcher to download pdf documents?

    f_39(CreationFactory): Created 1 features
f_40(TeeFactory): Cloned 1 input feature(s) into 0 output feature(s)
MULTI_WRITER: multi_writer_id `1': Started outputting features
Trying to find a DYNAMIC plugin for writer named `PDF2D'
Loaded module 'PDF2D' from file 'C:\Program Files (x86)\FME\plugins/pdf/pdf.dll'
FME API version of module 'PDF2D' matches current internal version (3.7 20140327)
FME Configuration: No destination coordinate system set
FME API version of module 'PDF2D' matches current internal version (3.7 20140327)
Writer `PDF2D_1' of type `PDF2D' using group definition keyword `PDF2D_1_DEF'
FME API version of module 'PDF2D' matches current internal version (3.7 20140327)
Could not open output file for writing.  Please verify that the file is not open in other applications or that the file is not read-only
A fatal error has occurred. Check the logfile above for details
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Feature output statistics for `PDF2D' writer using keyword `PDF2D_1':
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
               Features Written
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
==============================================================================
Total Features Written                                                       0
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
FME Session Duration: 51.7 seconds. (CPU: 3.3s user, 0.3s system)
END - ProcessID: 8464, peak process memory usage: 103668 kB, current process memory usage: 103252 kB

A fatal error has occurred. Check the logfile above for details
Program Terminating

Translation FAILED.


texts: I have 150gb .tiff image of country(Belarus) surface. After adding image and creating pyramid layer in ArcGIS Pro the image covers only narrow line. It seems like only narow top part of the image is loaded to the Scene. The image should cover all Belarus territory. Can i fix it?


texts: FeatureCollection is not a valid type of discriminator Error

texts:
I'm trying to pull in Planet data to visualise satellite imagery using Jupyter. I'm new to Python and I get an error like this:

{
 "field": {
  "filter.config.0.config.type": [
   {
    "message": "FeatureCollection is not a valid type for discriminator"
   },
   {
    "message": "u'FeatureCollection' is not one of ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon']"
   }
  ]
 },
 "general": []
}

My code snippet for drawing my API key is this :

import os
import json
import requests
from requests.auth import HTTPBasicAuth

PLANET_API_KEY = os.environ.get("PL_API_KEY")

item_type = "PSScene4Band"

search_request = {
  "interval": "day",
  "item_types": [item_type],
  "filter": combined_filter
}

search_result = \
  requests.post(
    'https://api.planet.com/data/v1/stats',
    auth=HTTPBasicAuth(PLANET_API_KEY, ''),
    json=search_request)

print(json.dumps(search_result.json(), indent=1))


texts: custom Layer Switcher style in openlayers

texts:
I use this example to customized my layer switcher in openlayers.But I want to change the  position,width and height of layer switcher.I know it relates to CSS.I change some numbers to get some idea.But I can't figure out how to do it.
Pls give me some tips.Thanks


texts: Filtering clouds from average in Google Earth Engine

texts:
I am filtering a Sentinel-2 collection with the goal of producing an average over a period of three months. I have selected three images within the collection with which to do this. They all have some cloud cover but in different parts of the image. So far, I have defined a cloud mask and mapped this over the three images before averaging them, but this produces an average like in the attached image which has all the cloud from all three images masked out where there is a cloud in just one image. Eventually, I will be running vegetation indices on them and making different layers with other years, so I don't want large areas of the average masked out due to cloud cover. As it will impact these differences.

My question is this: How can I create an average of these three images whilst excluding cloudy patches from the resulting layer. I.e., if one patch of the cloud is present in one image, how can I exclude that so the average layer is just an average of the other two images where the cloud was not present?
Apologies if that sounds convoluted. I basically want to end up with a resulting layer which does not have any cloud masked out and instead takes the average from the two images which do not have a cloud in any particular area.
This is my code so far:
//define the cloud mask layer
function maskS2clouds(collection) {
  var qa = collection.select('QA60');
  var cloudBitMask = 1 <<10;
  var cirrusBitMask = 1 <<11;

//layer called mask = the cloudy bits
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
  .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

//'image' is a layer with the mask applied to it
  return collection.updateMask(mask).divide(10000);
}

//image collection is filtered
var dataset = ee.ImageCollection("COPERNICUS/S2")
  .filterBounds(geometry)
  .filterDate('2017-06-19', '2017-06-20')
  .map(maskS2clouds);

var dataset2 = ee.ImageCollection("COPERNICUS/S2")
  .filterBounds(geometry)
  .filterDate('2017-08-23', '2017-08-24')
  .map(maskS2clouds);

var dataset3 = ee.ImageCollection("COPERNICUS/S2")
  .filterBounds(geometry)
  .filterDate('2017-07-19', '2017-07-20')
  .map(maskS2clouds);

//image with mask applied
var image1 = dataset.map(function(image) { return image.clip(geometry); });
var image2 = dataset2.map(function(image) { return image.clip(geometry); });
var image3 = dataset3.map(function(image) { return image.clip(geometry); });

Map.addLayer(image1, RGB, "June");
Map.addLayer(image2, RGB, "August");
Map.addLayer(image3,RGB, "July");

var june = image1.mosaic();
var aug = image2.mosaic();
var july = image3.mosaic();
var junaug = june.add(aug);
var augjuly = junaug.add(july);
var avg = augjuly.divide(3);
Map.addLayer(avg);


texts: Populating linestring column based on other table values (OSM nodes/ways)

texts:
I'm trying to populate a linestring column using points from another table.
After reading a lot in this site and many experiments I'm still stuck.

This is the table which I want to fill the road column:

TABLE planet_osm_ways
(
    way_id bigint NOT NULL,
    road geometry(LineString,3857),
    CONSTRAINT planet_osm_ways_pkey PRIMARY KEY (way_id)
)

and this is the table I want to get the points from:

TABLE planet_osm_nodes_ways
(
    node_id bigint NOT NULL,
    way_id bigint NOT NULL,
    node_number integer,
    lat double precision,
    lon double precision
)

What should happen is that all points with a certain way id should create a linestring in the planet_osm_ways table.

I come up with this query:

WITH line_table AS ( SELECT way_id , ST_SetSRID ( st_makeline ( st_makepoint( lat, lon ) ), 3857 )
AS builtedline FROM planet_osm_nodes_ways
GROUP BY way_id , node_number ORDER BY node_number )
UPDATE planet_osm_ways SET road = builtedline
FROM line_table WHERE line_table.way_id = planet_osm_ways.way_id;

But what this query does is to populate each way row with a linestring made by just one point. How can I make a query that gets all points for each way?


texts: Leaflet WMS from geoserver is not working

texts:
I am using leaflet in order to create my project. The map I am using as tile layer is from openstreetmap. However, I want to add mapping from Geoserver. It is a shapefile that was added with the postgis CRS 4326. When open the browser does  not show anything.

var map = L.map('map', {
      crs: L.CRS.EPSG4326,

}).setView([31.9252738952637, -26.8797512054443], 9);

var mywms = L.tileLayer.wms("http://localhost:8080/geoserver/turismo/wms", {
    layers: 'turismo:bairros',
    format: 'image/png',
    transparent: true,
    version: '1.1.0',
    attribution: "myattribution"
});
mywms.addTo(map);


texts:
I'm getting an unsatisfied link error when running gdal.AllRegister() in my java application running on AWS Lambda.

java.lang.UnsatisfiedLinkError: /var/task/lib/libgdaljni.so: libgdal.so: cannot open shared object file: No such file or directory
java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.AllRegister()V

This indicates to me that the libgdaljni.so file was found, but depends on the libgdal.so file which was not found.

Both of these files exist in the /var/task/lib director which is in the LD_LIBRARY_PATH. Also note that libgdal.so is a symlink to libgdal.so.2 which is in turn a symlink to libgdal.so.2.2.2.

I also have a method that calls out to gdal without the swig bindings (almost like cgi) which succeeds. So I think all the necessary pieces are in place, but there's something missing in the link between libgdaljni.so and libgdal.so.

Does anyone have any experience with this who might be able to help?


texts: Retrieve subtypes from feature service using arcpy

texts:
Within a python toolbox, I'm trying to retrieve subtypes from a feature layer in ArcGIS Pro using arcpy.da.ListSubtypes(). The feature layer is a hosted feature service on ArcGIS Online. Rather then returning a dictionary populated with all subtypes, the code below returns a single entry in the subtypes dictionary that looks like default values for a feature class that does not have subtypes defined. In addition, the SubtypeField property is empty.

subtypes = arcpy.da.ListSubtypes(layerSelected)
for stcode, stdict in list(subtypes.items()):
    for stkey in list(stdict.keys()):
        if stkey == "SubtypeField":
            subtypeFieldName = stdict[stkey]

The single entry in the subtypes dictionary has a key = 0, and a value of:

        {'Default': True,
         'Name': 'L14Barriers',
         'FieldValues': {'OBJECTID': (None, None), 'GlobalID': (None, None),
                         'Subtype': (None, None), 'Site': (None, None),
                         'Comments': (None, None), 'Material': (None, None),
                         'Authorized': (None, None), 'InCompliance': (None, None),
                         'FeatureStatus': (None, None),
                         'AdjacentParcel': (None, None),
                         'OldPermitID': (None, None), 'EncroachmentStatus': (None, None),
                         'Shape__Length': (None, None), 'Shape': (None, None)},
         'SubtypeField': ''
         }

Notice that the SubtypeField property is an empty string. This works just fine if you run it against a layer that is sourced in a geodatabase. It returns the subtypes, fields, and references to domains for each subtype. However, against a feature service layer arcpy.da.ListSubtypes() does not recognize the subtypes. Is there another method for acquiring subtypes from a feature service?


texts: Iterating fields using ModelBuilder in ArcGIS Pro

texts:
I am trying to combine multiple fields using the iterate fields in ArcGIS Pro ModelBuilder. I can iterate through and get the combined values but it only gives me the combination of one row, therefore I have no way to calculate a new field with these fields merged together for all rows in the table. The main aim is to use wildcard for all columns starting with soil_type and concatenate into a new field but it always calculates the same values.
Can this be done or will it only work for updating features based on only these fields? Image shows what I want to achieve. I want to do do this once a week but the soil type fields are not consistent


texts: Google Maps API extract elevation value along route

texts:
I am using the Directions and Elevation Service of Google Maps, in order to extract the coordinates and the elevation along a route between a start and end point. I could set my directions service successfully, I could also extract the elevation values. Everything works fine at the first request, but if I send a second request I got the error message:

"InvalidValueError: in property path: fewer than 2 LatLngs".

I also noticed, that if I reload my page in Firefox, the error disappears. But if I don't reload my webpage, the error remains.

Below you can see my code:

$(window).on('load', function() {
 var directionsDisplay;
 directionsService = new google.maps.DirectionsService();
 var map;
});

$(window).on('load', function () {
 initMap();
});

 function initMap() {
  directionsDisplay = new google.maps.DirectionsRenderer();

  var mapOptions = {
    zoom: 7,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    center: new google.maps.LatLng(48.7758459, 9.1829321),
    mapTypeControl: false

}
map = new google.maps.Map(document.getElementById("map"), mapOptions);
directionsDisplay.setMap(map);

}

//take start and end from input field
function calcRoute() {

var start = document.getElementById("start").value;
var end =  document.getElementById("end").value;

//send request to server
var request = {
    origin: start,
    destination: end,
    travelMode: google.maps.TravelMode.DRIVING
};

path = [];

//get result from google maps server as response
directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
        directionsDisplay.setDirections(response);

        pointsArray = response.routes[0].overview_path;

        var i = 0;
        var j = 0;

        //get long lat of vertices along route
        for (j = 0; j < pointsArray.length; j++) {
            lat = pointsArray[j].lat();
            lng = pointsArray[j].lng();

            //save lat long in path array
            path.push(new google.maps.LatLng(lat, lng));

        //create marker
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(lat, lng),
            map: map
            });
        }

    }
});

//Create an ElevationService
var elevator = new google.maps.ElevationService;
displayPathElevation(path, elevator, map);

function displayPathElevation(path, elevator, map) {

new google.maps.Polyline({
    path: path,
    strokeColor: '#0000CC',
    strokeOpacity: 0.4,
    map: map
});

elevator.getElevationAlongPath({
    'path': path,
    'samples': 256
}, plotElevation);

}

function plotElevation(elevations, status) {
 if (status === 'OK') {
    for (var i=0; i < elevations.length; i++) {
        console.log(elevations[i].location.lat() );
        console.log(elevations[i].location.lng() );
        console.log(elevations[i].elevation);
     }
  }

};

Here are my libs and buttons:

    Start<input id="start" type="textbox"></input>

    End<input id="end" type="textbox"></input>

    <input id="submit" type="button" class="btn btn-dark" value="search" onclick="calcRoute();">


texts: Getting Symbology Colors from a Layer File with ArcPy

texts:
I would like to use ArcPy to extract the symbology colors used in a .lyr and export to a spreadsheet (like csv or dbf). Specifically, I want to be able to export RGB (and both CMYK and HSV) values.

This question was asked back in 2013: https://community.esri.com/thread/80770, but there was no solution at the time. Does anyone know of a method for this?


texts: Use of Hot Spot Analysis (Getis-Ord Gi*)

texts:
I'm working with a polylines shape. I'm searching for a tool that could help me to define neighbourhoods using the values of the polylines.

I have good results with Hot Spot Analysis (Getis-Ord Gi*), because it creates new values depending on the neighbourhood. The doubt is about the possible use of all the values. I don't need only the hot or cold spot polylines, I want to use all the network, included the ones classified with a P-value as a non significant level.
¿Is it correct or should I use other tool?


texts: Calculating Distance from Vector Point to Raster Points

texts:
I am using QGIS 2.18.2. I would like to calculate the Euclidean distance from the pixels in a raster to a single Shapefile GPS point. My raster is a Geotiff DEM with a pixel size of 3.856 meters by 3.856 meters. My Shapefile point contains just spatial coordinates and no other attribute information.
I am aware that this type of problem is not new. I've reviewed a number of posts on this topic, and one would think that this would be a no-brainer for me, but unfortunately, I'm still unable to work out the problem(s) in my workflow.
This post summarizes the workflow that I am attempting to do: Calculating distance to points in QGIS. My understanding is that I need to:

Add a new field to the attributes table of the Shapefile point (I call this new field "Value" and set it to 1), then go Raster-->Conversion-->Rasterize to convert the Shapefile point to a raster.
Using the result of step 1 as the input, go Raster-->Analysis-->Proximity to generate a raster of distances from the point.

I get stuck on step 1. I have tried a multitude of GDAL command sequences for Rasterize (with reference to http://www.gdal.org/gdal_rasterize.html), but output from this program either includes NAN or is not generated at all.
Here is my DEM and my GPS point at the start:

My (latest) GDAL command line code for Rasterize is as follows:
gdal_rasterize -burn 1 -tr 3.856 3.856 -te 317595 4903986 328357 4911219 -l point E:/point.shp E:/point.tif
After running this Rasterize command , which reportedly finishes without error, I end up with this:

The result is called RasterTx in the Layers Panel on the left. Note that the lower threshold is NaN (black) and the upper threshold is 0 (white). This result doesn't make sense to me, because I would expect to have NaN for all pixels in the square except for the one pixel in which I have my point, which should be assigned a value of 1, per the "burn" command I gave in the GDAL code above. Furthermore, when I proceed to step 2 and attempt to run the Proximity program, the result yields only NaN, so my suspicion is that I'm still missing something wit the Rasterize step.
Where might I be going astray?


texts: ArcGIS Server - Print Map Task result retrieving

texts:
I have an application where i'm printing a map on one page and would like to display the result in a PDF when the user goes to the summary page. The print task takes about 4-5 seconds to return the URL. I don't want my user to sit on the page to wait for the print task to finish instead of moving to another page.

Is there a way to retrieve the Print task URL at a later point based on some ID?

Update:
I changed by service to asynchronous and also set the async flag to 'true'.But when i run printtask.execute(printParameters) i'm not getting a jobID back. Here is the code snippet:

   var initPrintParameters = function () {

        var temp = new PrintTemplate();
        temp.exportOptions = {
            width: dpi * 10, //3000, //960, //840,
            height: (20 * dpi) / 3, //640, //560,
            dpi: dpi
        };

        temp.format = "PNG32";
        temp.layout = "MAP_ONLY";
        temp.preserveScale = true;
        temp.showAttribution = true;

        printParameters = new PrintParameters();
        printParameters.format = "png32";
        printParameters.template = temp;
        printParameters.map = map;
        printParameters.outSpatialReference = map.spatialReference;
        printParameters.async=true;

    };
  var exportMapAtCurrentExtent=function(){
       printTask=PrintTask(printTaskUrl);
       initPrintParameters();
       console.log(printTask.execute(printParameters));
  };

Not sure if there is anything else that i need to do. Couldn't find any reference on how to execute printTask asynchronously .


texts:
I work with several MXD files. In each map there a polygon layer with unique values:

I try to change in the table of contents the "a" into "land use" by using this code:

import arcpy,os,sys
from arcpy import env

env.workspace = r"G:\desktop\Project"
for mxdname in arcpy.ListFiles("*.mxd"):
    print mxdname
    mxd = arcpy.mapping.MapDocument(r"G:\desktop\Project\\" + mxdname)
    df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
    lyr = arcpy.mapping.ListLayers(mxd, "*")[0]
    if lyr.symbologyType == "UNIQUE_VALUES":
        vals = lyr.symbology.classLabels
        for v in vals:
            if v == "a":
                print lyr.name
                v = 'landUse'
                print v
    mxd.save()
del mxd

I just want to change the name in the table of content, and not change the attribute table value. When running this code i get this result and with no change in the maps:

>>>
project.mxd
polygon
landUse
>>>


texts: Is it possible to open ModelBuilder SCREEN from .NET base command class?

texts: I simply want to open the custom model's SCREEN (ModelBuilder) from .NET.


texts: Getting "value", "color", "label" from existing palette raster layer in PyQGIS?

texts:
renderer = activaterlayer.renderer()
    symboloyitems = renderer.legendSymbologyItems()
    label = symboloyitems[i][0]
    color = symboloyitems[i][1].getRgb()
    value = ?

How can I get the corresponding "value" attribution?

Using legendSymbologyItems I can not get the corresponding "value".  other function of "renderer"


texts: GeoServer multiple labeling with different color

texts:
I am pretty new to GeoServer. I am trying to make a style with dynamic labeling. Currently, I am using env to label multiple attributes, but I don't know how to change the color for each of the attributes that I made. Heres the SLD that I made.
Is there any way for me to have color red for attr0 and blue for attr1?

          <TextSymbolizer>
            <Geometry>
              <ogc:Function name="centroid">
                <ogc:PropertyName>the_geom</ogc:PropertyName>
              </ogc:Function>
            </Geometry>

            <Label>
              <ogc:Function name="property">
                <ogc:Function name="env">
                  <ogc:Literal>attr0</ogc:Literal>
                  <ogc:Literal>0</ogc:Literal>
                </ogc:Function>
              </ogc:Function><![CDATA[
]]>
              <ogc:Function name="property">
                <ogc:Function name="env">
                  <ogc:Literal>attr1</ogc:Literal>
                  <ogc:Literal>0</ogc:Literal>
                </ogc:Function>
              </ogc:Function><![CDATA[
]]>
            <Font>
              <CssParameter name="font-family">Arial</CssParameter>
              <CssParameter name="font-size">
                <ogc:Function name="Categorize">
                  <!-- Value to transform -->
                  <ogc:Function name="env">
                    <ogc:Literal>wms_scale_denominator</ogc:Literal>
                  </ogc:Function>
                  <ogc:Literal>10</ogc:Literal>
                  <ogc:Literal>3000</ogc:Literal>
                  <ogc:Literal>10</ogc:Literal>
                  <ogc:Literal>30000</ogc:Literal>
                  <ogc:Literal>5</ogc:Literal>
                </ogc:Function>
              </CssParameter>
              <CssParameter name="font-style">normal</CssParameter>
            </Font>
            <Fill>
              <CssParameter name="fill">#ff0000</CssParameter>
            </Fill>
          </TextSymbolizer>


texts:
This is what I want to do:

When loading the map, it will first grab the window coordinates of the current screen, and then load the data points of the current screen.
  The next screen is as described above, but the data of the previous screen will be cleared.

I think make the performance worse when loading too much data,so I want to do this problem.

To put it simply, it means that only the screen that moves to it appears, and the data of that screen appears.

This is my code:

Now,I don't know how can I catch window position,and combine the data I load.


texts: QGIS Wien 2.8.1 RuntimeError concerning the sip module on Win 7

texts:
I am running windows 7 64bit and python 2.7.9
I just installed QGIS Wien 2.8.1 and it crashes on start up with the following code:

Couldn't load PyQGIS.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in
  File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python\qgis\__init__.py", line 36, in
    from qgis.core import QgsFeature, QgsGeometry
  File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python\qgis\core\__init__.py", line 3, in
    from qgis._core import *
RuntimeError: the sip module implements API v11.0 to v11.1 but the qgis._core module requires API v10.0

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.8.1-Wien 'Wien', exported


texts: Enabling SEXTANTE toolbar in ArcGIS for Desktop?

texts:
I have just upgraded to ArcGIS 10.1 from version 10.0.  I am trying to add the SEXTANTE tools to ArcToolbox.  I have followed all the instructions from the SEXTANTE website. I have also tried the instructions here and here.

No matter what I do, I keep getting little red crosses when I try to run any of the tools in SEXTANTE.

Note, following the instructions in the above links worked for me in version 10.0 but I just can't seem to get it to work in 10.1.

Does anyone know what might be going on?  Are other people having this issue?


texts: What does a value = -1 mean for the GRASS v.to.db module?

texts:
I need to identify the adjacent polygones of each polygon of my shapefile. I've applied methodology described here and here.

as a result, the columns (left, right) have all a value of -1.

I find no information about the meaning of this value.


texts: How to extract breaklines from a given DEM?

texts:
Breaklines are very useful for describing a terrain - for example to build an exact TIN.

My question is, how to extract these breaklines from a given DEM?

I calculated the curvature (vertical) - raster (using arcgis 10), where you can see the breaklines (min/max-curvature), but I did not figure out how to extract them to get polylines in the end.

What is the workflow to get these breaklines from a DEM?

Does anyone have an idea of a workflow, or a "tool", or skript, which can help?

I think I am not the first/last man who wants to perform this task:)

...in the meanwhile i have found a paper on this topic that seems to be a good solution, but the big question remains: how to reduce that to practice?

Or has anyone a different (easier?) approach with some software?


texts: I installed QGIS long term release today first 64 bit and second 32 bit. My problem is that SQL Developer for Oracle a non QGIS product does connect to Oracle and when I use the same credentials in both the 64 bit then 32 both cannot connect to Oracle. I did visit this link at  http://trac.osgeo.org/osgeo4w/. which supposedly has a download with Oracle dependencies that QGIS needs. It was still installing but is the correct approach. What is the most likely reason QGIS is not connecting to the Oracle database that my SQL Developer for Oracle easily does on the same workstation?


texts: Spatial weight matrix QGIS - export to stata

texts:
I'm looking to estimate a spatial panel model in STATA, however, I'm running into difficulties creating a spatial weight matrix. For note my N=66 while my T=25.

I'm a novice when it comes to utilising spatial econometric methods. However, I wonder could I use QGIS to create a spatial weight matrix? I have longitude and latitude data which provides coordinates of countries. Is it possible to create a binary weight matrix to indicate if 1 if any region 1..66 shares a border and 0 if they do not? Obviously this will not change over time.

I would like to then export this matrix into a csv file and upload it to STATA. Sorry if any of my terminology is off as I'm a novice when it comes to these methods.

Any help is most welcome!


texts: Changing Legend Arrangement/Style in ArcGIS Pro?

texts:
In ArcMap 10.3 you were able to change the vertical/horizontal arrangement of patch, label, description in the legend via the Style button on the Legend Properties Items tab.  I cannot locate something similar in ArcGIS Pro.  It looks like you can change the order horizontally but I want to put the label above the patch.  I have messed around with the offets and can move the labels around a bit but cannot adjust the patch location.

Am I missing something obvious?


texts: GDAL doesn't create contours for the whole raster

texts:
The contour algorithm in QGIS doesn't create all of the contour lines. I've attached a screenshot of my raster layer below and the parameters I used. The raster ranges from 40-90 in value, spreading out from the center. So my expected output is a series of concentric circles.

Edit:
The lines in the image is the output when I run the process.

This is the updated link to the test file: test_LPr1.tif


texts: ArcMap: Raster layers, how to extract information

texts:
I have several raster layers which represent particular geological formations.

Each layer is a raster dataset in a grey scale. Each cell has a pixel value which is an elevation of the bottom of a particular geological formation. Each cell also has a stretched value which is a thickness of a particular geological formation.

For each location, I would like to have the type of geological formation at each depths. Let's say, at 1 m depth step.

How can this be done? Can I somehow extract the information about layers into a csv file? Or can some manipulations be done in ArcMap?


texts: Is it possible to indicate direction on a line in CartoDB?

texts: I am working on a project that involves mapping journeys, and I am wondering whether there is a way to indicate the direction of the journey on a line in CartoDB. For example, could the direction of the line be indicated with an arrow on the line, or with a color change along the line?


texts:
I am using ArcGIS software
I have a Feature Class layer that represent a Grid network, which consists of rectangles that covers all the areas.
I want to use it to generate another feature class layer with smaller grid, by dividing each rectangle into 4 quarters.
What is the best way to do it with ESRI software?
is  there a geoprocessing tool that can do that?


texts: Getting buffer wizard-like speed in Python (vs using MultipleRingBuffer_analysis)

texts:
I've got a script that takes a single input polygon feature, throws 10 buffers around it at tenths of a specified input distance, and then symbolises the output based on an existing layer file.  Pretty simple.

However, the arcpy.MultipleRingBuffer_analysis operation is amazingly slow.  It takes upwards of two minutes to generate the buffers, even for very basic polygon inputs - the same result can be had in about two seconds by using the buffer wizard tool.  Problem is, the buffer wizard can't be accessed through arcpy.

So obviously it's possible to quickly generate multiple ring buffers - does anyone have any insight as to how the buffer wizard tool is doing it, and how that might be replicated in Python?


texts: How to add ArcObjects SDK into Visual Studio Express 2013?

texts:
I have just installed the ESRI SDK from the 10.0 installation Disk and downloaded the Visual Studio Express 2013 and I'm trying to work through the ESRI Walkthrough named "Building custom UI elements using add-ins".   (  http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Walkthrough_Building_custom_UI_elements_using_add_ins/0001000001ms000000/ )

I am looking forward to using this new Add-in format of customization, but am struggling to overcome the transition from the easy to use VBA Editor to the visual studio IDE.

My hurdle right now is in the walkthough it shows templates in the 'new project' dialog for ArcGIS and various options for ArcMap Add-In and such.  In the Visual Studio Express  dialog these options aren't showing up.  I guess I was expecting that when the SDK was installed they would show up here.  Can anyone direct me on how to get those comparable templates to show up in Visual Studio Express 2103?

Here is a screenshot showing the differences ( red arrow of the ESRI templates, and blue circle of my current options through VSE2013)


texts: Is there an easy way (like unzip) to convert a KMZ-file to KML?


texts:
I am accessing data from a National Data Services secure server. Within the server, all my project data is in one folder, and applications like ArcMap are in a separate folder.
In ArcMap, "add data" will connect to the drive (M:), but the secure folder is not listed as being there.
I had a similar problem with accessing Stata commands, and that was solved by adding "adopath +" at the beginning of every do file, to specify the directory were the commands are listed.
I think I need to direct ArcMap to this secure folder, in a more technical way, than just using "add data", but I have no idea how, I can't find the answer online, and technical support at the data service has provided no assistance.
As it's a secure server, I cannot add snapshots of the problem here.


texts: Setting Up Python Script tool ESRI arcpy to download files from table

texts:
It's been years since working with ArcPy and I'm having trouble setting up the parameters in my script tool.

What I'm trying to do:

I have a layer file (.lyr) that is a state wide index grid of available elevation model tiles.  The layer's attribute table has a field "URL" that contains the download link.  In my map document, I want to be able to make a selection of records in the layer and download the elevation model image tiles in my selected project area.

Here's the layer file. And the data table at the bottom

What works:

I can run the script tool successfully but it's downloading all 15,000 files in the table not just my selected records.

this is the .py behind my script tool:

`

import urllib

import os

import arcpy

#where am I saving the download?
path = (str(arcpy.GetParameterAsText(1)))
os.chdir(path)

#path to my index layer...stil unsure how to get this as a dropdown menu item in my tool
fc= r"C:\Users\Z\Desktop\LiDAR_Index.lyr"
cursor = arcpy.SearchCursor(fc)

for row in cursor:
    field ="URL"
    link =(row.getValue(field))
    head, tail = os.path.split(str(link))
    print "Downloading: "+ tail
    download=urllib.urlretrieve((str(link)), tail)

`

I'm lost as to how to only make this act on the selected records and not the whole feature class or shapefile.

Current UI on left and tool properties on right


texts: Calculate turn required to follow a line of latitude

texts:
Lines of latitude are not geodesic except at the equator. So to follow perfect eastern course in the northern hemisphere in a vehicle a left turn is constantly required. We can express a turn as the radius of a circle that the turn would produce on the flat. So, at the pole the turning radius would be zero and at the equator the turning radius would be infinite. Near the pole the turning radius would be almost equal to the distance from the pole.

Does anyone know of an equation that would provide the turning radius at a given latitude required to follow that line of latitude?

I will try to clarify with some examples.

If I were to drive a car on an eastern course at a location of 100m south of the north pole, I could not drive in a straight line otherwise I would eventually be driving south. So, to maintain an eastern course,  I must turn the car and circle the pole with an approximate turning radius of 100m.

If I were 200m south of the north pole the turning radius would be approximately 200m. However, the further south I am from the north pole the less turn is required and the more it differs from my distance to the pole.

At the equator no turn is required because I will be travelling a geodesic, the turning radius at this point is infinite (meaning no turn).

Is there a mathematical function (f) that given a latitude provides the turning radius required to preserve that latitude and maintain an eastern course?

r = f(l)

where: l - latitude, r – turning radius

I have performed extensive searches and cannot find an answer.


texts:
I would like to merge a few rasters by using a custom method, and not the default one (reverse painting). For this purpose I am trying to figure out how to pass the custom callable.
For example, I would like to merge raster cells by using the cell with the maximum value. Therefore here is my callback function:
def custom_merge(old_data, new_data, old_nodata, new_nodata, index=None, roff=None, coff=None):
    new_data = np.maximum(old_data, new_data)

And here is how I am calling it:
mosaic, out_trans = merge(src_files_to_mosaic_opened, method=custom_merge)

I am not getting an error, however I am gettin a raster with all zeros.
It would be great to know how to make this working. Thanks in advance


texts: Make an HTTP POST request to a WFS service?

texts:
So I'm new to GIS and I'm missing some of the basic concepts in this field, what I need to do is to write a POST method to add or delete or update some map services I'm working on an ArcGIS server, I can modify the URL to use a GET method, put I have no idea how and where to write a POST method to modify the services.

The URL I keep on modifying is something like this:

https://someserver.domain.com/webserver/services/FAT_Testing/demokmz03/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&typeName=Buildings&BBOX=0,0,100,100&

This works just fine, I also learned all these things from this site:
https://enterprise.arcgis.com/en/server/latest/publish-services/linux/communicating-with-a-wfs-service-in-a-web-browser.htm


texts: Using the Rule-based style to calculate each grid cell from overlaps

texts:
I am using the Rule-based styling properties (QGIS 2.2) to determine the colour of grid cells for a merged shapefile. Each grid cell defined by its ID may be overlapped by several layers as defined by Layer and each Layer has its own Score (a single column).

Focusing on ("ID" = 80) as shown in the image, I want to create a case statement where this ID has an overall Score of 6 or above which will make that cell become red.

I have tried something similar to the following:

case when "LAYER" IN ( 'Site_11' , 'Site_12' , 'Site_18' )
then "SCORE" +"SCORE" + "SCORE" >=6
END

This is wrong but it's the kind of logic I'm following at the moment.

Any advice welcome!


texts:
I'm getting mixed messages about these projections.
For example -Is this projection below, NAD 83, 4326?

GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]]


texts: Need to edit info to new column for label and concatenate information which is alphanumeric

texts:
I need to end up with the following:
Jones, H.L.
A-345

The data is entered into Survey Name (as string).
Survey Abstract #is entered as "345"

I need to add "A-" to the number, and then concatenate with Survey Name.  Also want them to post centered and on top of one another for the label....

I'm using GIS for the first time....tried to look for help with this and couldn't find a post.


texts: Very large difference between exported .eps files

texts:
I am exporting .eps images from ArcMap using the "Export" tool.

By looking at the exported images properties, all exported with a 600 DPI, I see some of them have the size of some MB, while others some hundreds of MB. The images I am talking about have include large sets of GIS data.

Why does this happen and how can I prevent exporting excessively large images using export --> .eps this way?

My aim is to avoid loading times in the PDF paper I am inserting these images in (at the moment, some of the PDF pages including the images require approximately 1 to 3 seconds to load)


texts:
So I installed a QGIS plugin and want to look how this plugin works internally. I have installed it within QGIS using the 'manage and install plugins' functionality.

In the installation folder I looked for the code of the plugins. I found the QGIS 3.4\apps\qgis\python\plugins folder and found most of my other plugins there. But not the one that I am looking for.

Is there any other location to look?


texts:
Why isn't my heat layer valid and I don't get a .tif in this location (this location exists 100%)? Code below:

output = "D:/QGIS_Project_New/heat_map_last.tif"
heat = QgsRasterLayer(output, "Heatmap")
QgsMapLayerRegistry.instance().addMapLayers([heat])
if heat.isValid() is True:
print "Layer was loaded successfully!"
else:
print "Unable to read basename and file path - Your string is invalid"

I get the "Unable.." print, why is that?

EDIT:

So my code for loading layers is working:

highway_layer = QgsVectorLayer("D:/Tomas/QGIS_Project_New/points_highway.shp","Highway","ogr")

if highway_layer.isValid() is True:
    print " HIGHWAY Layer was loaded successfully!"
else:
    print " HIGHWAY Unable to read basename and file path - Your string is invalid"

But when I try to create and save a layer on this location it is not working. Also I'm using Python Console in QGIS.


texts: Processing historic aerial imagery mosaics

texts:
I'd like to process multiple sets of old (>1938) aerial imagery that are scanned, but whether merged nor georeferenced. While I had good results with QGIS to align single photos, using passpoints, this doesn't scale for all the tiles and lacks preprocessing steps:

remove film-frame
align all photos to each other
choose / combine overlapping areas
composite and color adjustments
georeference using passpoints + global coordinates

Is there any free / open source toolchain, that can deal with all that?

A user-interface as huginn would be brilliant, but CLI + tutorial could do the job.
My approach would be to use GIMP to create a single image (incl. preprocessing), align it using QGIS and create the final GeoTIFF.
While the results are only for visual compare and will be embedded within an WMS, I don't need the highest accuracy and would preffer an solution that I can use with my limited knowledge in raster processing. Rectifieng the result is not required.

Unfortunately I don't own the calibration-infos for the cameras, so tools as MicMac doesn't seem to work. The Orfeo toolbox seems to be focused on detecting passpoints and perform the feature analysis :-/


texts: Estimating a location at the minimum distance between a point and a polygon

texts:
I have two types of objects (i) polygons representing postcode areas, and (ii) points representing telephone exchanges.

I want to find the part of the polygon that is closest to the exchange and place a point there (see the red X in the image below). The green lines in the below image are fanning out from the exchange location.

So far I have followed this example and converted the polygons to lines, and then tried to join the attributes of the point and line layers by closest distance]3. However, using the MMQGIS Distance to Nearest Hub tool it calculated the distance to the polygon centroid.

And using NNJoin, it correctly calculated the distance between the red X and the exchange, but it did not insert a point in that location. Please see the below image for more context

How do I put a point or some kind of feature at the red X as an estimate of broadband cabinet location?


texts: How to convert a JPEG to GeoTiff using FME?

texts:
I want  to convert JPEG to Geotiff in FME.

I use the following workspace
JPEG reader -> RasterExtractor -> CoordinateSystemSetter -> RasterGeoreferencer (parameter : extents) -> Reprojector -> GEOTIFF writer.

The transformation fails at the RasterGeoreferencer with error

Invalid coordinates.  The four coordinates must form a rectangle, which can be rotated
RasterGeoreferencer: A fatal error has occurred. Check the logfile above for details

Any suggestions?


texts: How to run a Epanechnikov (parabolic) decay in QGIS 3.6 field calculator

texts:
Does anyone know how you would implement a Epanechnikov (parabolic) decay to a field in QGIS field calculator. I am trying to apply varying distance decay functions in order to assess the best suitability.

I have run a Gaussian decay using but I am struggling to find any sources on how you would apply a parabolic decay ("Distance" is the field I am running this on).

My Gaussian decay example

exp(-("Distance" * "Distance")/(2 * (10000 * 10000 )))


texts: Calculations of Thiessen Polygon Bifurcated Areas

texts:
I have got a SewerGEMS network of a Sewerage Scheme for a Town. The Town is divided into 17 Wards having different Population Densities in (Population/Hectare). There is a AutoCAD drawing showing the Ward Boundaries with the Number for each Ward. I also have a separate Excel Sheet having the 2 Columns specifying Ward Numbers and Population Density for each Ward (Population/Hectare). I have generated the Thiessen Polygons for the 1476 Manholes in the Network specifying a Buffering Percentage only (i.e. No Separate Ward Boundary Used) . Now the issue is that many manholes will have areas of influence in 2 or more Wards with different Population Densities and thereby different flows.

How do I calculate the corresponding areas served by each manhole in different Wards?

Once I get these Bifurcated Areas I can multiply it by the Corresponding Population Density for the Corresponding Ward / Wards (If the area of influence is in 2 or more Wards) to get the Population Count for each manhole. I want to know the detailed process for getting these Areas of Influence of each manhole in Separate Wards i.e. the Bifurcated Thiessen Polygon Areas for each Manhole having Areas of Influence in 1 or 2 or more Wards having Different Population Densities..


texts: QGIS r.walk.points Movement Directions raster exeeds input raster

texts:
I am very new to GIS, so excuse my potentially poor terminology. I am trying to create a cost surface in qgis. I have an raster with elevation data. Based on that I created a slope with the DEM Terrain models tool. Then I use the r.walk.points algorithm to calculate Movement Directions and Cumulative Costs. However, the resulting rasters are exceeding the input rasters (see screenshots). All rasters are using the same CSR. What other information could be helpful to find the mistake? What am I doing wrong?

Slope:

Exceeding Movement directions raster:

EDIT 1

This problem occurred in QGIS 2.18. on Ubuntu 16.04.
In QGIS 3.4.1 everything works as expected.
Below I also provide a workaround for 2.18. However, I'll leave the question open for the case someone finds a real answer.