texts:
I am trying to select an existing file in the panel in QGIS, however every time I put this code an error appears:

layers = self.iface.legendInterface().layers()
    layer_list = []
    for layer in layers:
        layer_list.append(layer.name())
    self.dlg.comboBox.addItems(layer_list)

Where the error is:

  "Unable to load output sadasda due to error calling classFactory ()
  method

  IndentationError: unexpected indent"

where apparently can't compile the code:

layers = self.iface.legendInterface().layers()


texts: PyQGIS getting dictionary for each feature of layer with their attribute values

texts:
I need to obtain, for each feature of a layer, a dictionary with the attribute names and their values using PyQGIS.
I can get all the attributes of the layer using
indiv = QgsProject.instance().mapLayersByName('Individuos')[0]

for feature in features:
    value = feature[field.name()]
    attrs = feature.attributes()
    print(attrs)

But what I need is to create a dictionary with field names as key and their value for each feature.


texts:
I have administrative boundary data in geojson/wkt format, which I retrieve from my REST service and display, using mapbox gl. This works well enough, but the data points are (depending on the country) extremely dense, resulting in several megabytes of data for each request, which is simply too much.

Mapbox does a great job at handling and rendering the data once received - the problem is the sheer amount of data transferred.
I am ok with reducing the data "fidelity" of my source data, but I would like to do it intelligently, if at all possible. The question is: what tool (preferably cost-free) should I use to reduce the data points ? This question deals with almost the same problem, but is "dropping every n-th data point" really the best/only answer to my problem ?
Skim-reading this blog post suggests that there might be more intelligent solutions. I have QGIS 3.0 installed - does it offer some functionality like this ? I also looked at GeoJSON-VT but am not sure if that is fit for the task, either.


texts: Programmatically setting a layer's bounding box in Geoserver

texts:
I have a system built on PostGIS/GeoServer/OpenLayers. Data (a ship's voyage track) is inserted into the database in real-time - a bunch of variables and point geometry type. This is served up via (primarily) WFS to OpenLayers.

I dynamically publish the layer for a new voyage using REST. When done this way, the bounding box (according to the config page) is set to 0,0,-1,-1 for both native and lat/long.

What I'd like to do is set this to a reasonable value programmatically - effectively automating going in and using the 'Compute from Data'/'Compute from Native Bounds' links on the layer config page.

My preference is to do this via a RESTful call, however this doesn't seem to be supported in the current version of the standard API. Any other alternative solutions are more than welcome.


texts: Labels location on print view way off IN QGIS

texts:
I'm having a weird issue with labels. I have two point layer files showing cities. They are both labelled using the same parameters (Around Point, 2mm from centre, etc.).

They both show up fine in the main working window (see screenshot).

However, once I get to print/page view, one of the layers places the labels really far away from their corresponding points. I can't figure out a reason why this would be the case. Any thoughts?


texts: Why is QGIS 2.14 automatically changing field type when saving layer?

texts:
I'm  creating shapefiles with specific field types (i.e. ID: integer, NAME: String, CODE: integer, etc.) using QGIS 2.14.0.

When I save the layer using "right-click" - "save as" and load the newly saved layer in QGIS, all field types are changed to "string". I don't change any default parameters in the "save as" window.

Is it a bug or a common issue someone has already encountered ?


texts: How to create raster map by day that observed maximum NDVI from multiple raster data in R?

texts:
I have 11 NDVI raster data, representing single summer. I want to create raster by day (Julian day or name of raster) that observed maximum value.

In other words, I want to know which day (which raster) has maximum value in each cells of NDVI data and I want to get the result by raster file.

Actually, the day of maximum NDVI value should be in each grid instead of maximum value.


texts:
Data used to create a network from has special considerations when cleaning, as minor spatial errors can lead to major bugs in connectivity.

What techniques could be considered best practice for cleaning spatial network data before building a network model?

To set the ball rolling, here's what I can think of

Make sure your GIS doesn't hide topology errors (as ArcMap can), or that if it does, the network build process is designed to account for this (as Arc Network Analyst does).  Understand how and why this happens.
Use the topology features of your GIS - e.g. Arc Topology, Autocad Drawing Cleanup.  Detect all polylines that come within a tolerance of one another, or touch or intersect, without being noded (i.e. that are not broken at the intersection point).  Overshoots and undershoots fall into this category.  Check them for errors (depending on your representation they may represent bridges/tunnels, or they may not).  Use automated repairs if they all look like errors and manual repair is infeasible.
Also check for link endpoints that fall within a certain tolerance without being coincident.  Use automated repairs if they all look like errors and manual repair is infeasible.
Gradually increase the tolerance in the above two steps until you are certain that all features thus detected are intentional.
Build the network, compute connectivity for each junction (the number of links that join it).  Check (ideally) all of them or (probably) a random sample to ensure they are what you expect.
Sort all the polylines in your model by length, and starting with the smallest length, check them manually (possibly with the aid of the computed connectivity data).  Very short network links are usually errors, and may be messing up turn angles etc.

Anything I've missed there?  Feel free to either describe or link to good offsite resources.


texts: Using arcpy.GetCount_management in a logic tree

texts:
I'm attempting to automate the process of clipping a larger feature layer into specific enumeration units. My code starts off with a fairly simple logical test to determine if new feature layer needs to be made for a particular county. If there are no features in a given county then the test is supposed to recognize this and move on to the next county. I've been using arcpy.SelectLayerByLocation_management() and arcpy.GetCount_management() in order to determine if there are in fact given features within a specific county. Both arcpy modules seem to be working, but when I use the value that GetCount_management spits out the logic doesn't. Here's my code...

    arcpy.SelectLayerByLocation_management(layer, "INTERSECT", County)
    count = arcpy.GetCount_management(layer)

    if count > 0:
        print "There are features in this county"
    else:
        print "There aren't features in this county"

Where I run into a problem is the logical test. For instance, the count will be zero but the logical test will print the if statement rather than the else statement. I've done something like this before and had similar issues but I don't know why, the test is fairly simple.


texts: Seeking PyQGIS equivalent to Geopandas or SQL?

texts:
Using sql

"DBpop2016" = maximum("DBpop2016" , group_by:= "DAUID")

OR geopandas

print (data.groupby('DAUID') ['DBUID','DBpop2016'].max())

I can select the single DB (of which there are several) with max.pop. within multiple DAs.

How can i do this in the Python console with (PyQGIS) with either QGIS3.8 or 3.4?


texts: Save map in raster format from QGIS using compression

texts:
Is there a method to save a map in raster format from QGIS using compression?

For exemple from "Export map" in ArcGIS there are many options to compress the images depending on the file type (tiff, jpg, etc.).

I need to export/save a raster from a vector data (shape), and specifically I need to export an atlas.


texts: Setting compression method when exporting composer from QGIS to PDF

texts:
I see that export of the composer to PDF in QGIS uses JPEG compression by deafult (my estimate maybe 75-80%, which is not good enough for my maps).
Where can I change this?
Can I set somewhere lossless compression/compaction (e.g. LZW)?


texts: Calculating Field based on name of shapefile

texts:
I have multiple shapefiles to which I have added a field called "gname1". For each shapefile, I want "gname1" to be set to the name of that particular shapefile, for every feature within the shapefile. I realize there are multiple ways to do this, but I want to know how to do this within the "Field Calculator" tool. So, in the "gname1=" box under Field Calculator, what is the expression I use to denote that I want the field to be set to the shapefile name?

I am very new to python, and not entirely familiar with the procedure for using python scripts to calculate fields through this tool in Arc10. I have seen other questions similar to this one, but I was confused on how to do this within the field calculator tool.


texts:
I'm working with Quantum GIS 2.4 and I would like to overlap a DTM (.asc) and a shapefile. The shapefile is a copy from the another, to make some trials, who had WGS84 as original CRS; I saved it by adopting EPSG:3857 as the default CRS. I would like to visualize everything in PseudoMercator: I create a new project, set the CRS as 3857, enable the 'on the fly' transformation but my shapefile is quite far from the DTM.

I think this could depend on the qpj file, who still has the WGS84 information: how can I solve this?


texts: Importing JPG into SWMM model asks for BPW world file

texts:
I need to import a jpg image of a map into EPA SWMM model but it asks for the world coordinates file (*.bpw) of this image. How can I get this file?

How can I open a georeferenced-JPG file in the EPA-SWMM as a backdrop image with its world coordinates file?


texts: How can I reorder the panel tabs in QGIS

texts:
I know I can rearrange the panel tabs by undocking a panel and on redocking it becomes the leftmost tab, but is there a more direct way to re-order the tabs?

QGIS 2.12 Lyon

Windows 7 64 bit


texts: How can I put the name of file in add field with python?

texts:
In my script, I have to create field in 15 layers. The name that I wold like to set in this new field is the same of the file's name. But all attempts that I did were worng.

My script:

proj=arcpy.mapping.MapDocument("C:\\analise_mestrado\\analise_215_070.mxd")
fclist= arcpy.mapping.ListLayers(proj)
[<map layer u'20060902_215_070'>, <map layer u'20080721_215_070'>, <map layer u'20090622_215_070'>, <map layer u'20100609_215_070'>, <map layer u'20110527_215_070'>, <map layer u'20010616_215_070'>, <map layer u'20000731_215_070'>, <map layer u'19860911_215_070'>, <map layer u'19870509_215_070'>, <map layer u'19870525_215_070'>, <map layer u'19880628_215_070'>, <map layer u'19930525_215_070'>, <map layer u'19940816_215_070'>, <map layer u'19941104_215_070'>, <map layer u'19850722_215_070'>, <map layer u'19970605_215_070'>, <map layer u'19730726_231_070'>, <map layer u'19960618_215_070'>, <map layer u'20110714_215_070'>]

Error for first attempt

for fc in fclist:
    arcpy.AddField_management(fc,fc,"DOUBLE",12,2)
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000840: The value is not a String.

Other error, for second attempt

for fc in fclist:
    arcpy.AddField_management(fc,str(fc),"DOUBLE",12,2)
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000313: The length of Field Name must not be larger than 10

Other error

for fc in fclist:
    arcpy.AddField_management(fc,str(fc[:6]),"DOUBLE",12,2)
Runtime error <type 'exceptions.TypeError'>: 'Layer' object is unsubscriptable

Is there anyone who can help me?


texts:
My QGIS Globe is not working: After starting it, that massage pops up in a endless loop:

  UnsupportedOperationException: GeometryGraph::add(Geometry &): unknown
  geometry type: N4geos4geom7PolygonE

Im using xubuntu 12.04, QGIS 1.8.0, ATI graphic card and AMD X2


texts: Is there a name for a coordinate system that measures angles with respect to the y-axis, angle increasing clockwise?

texts:
0 degrees correspond to Cartesian coordinate’s “y-axis” and all angles are measured with respect to this axis (clockwise increasing). Basis vectors are the “the vector pointing towards geographical north” and “the vector pointing towards geographical east”.

I’m writing some code documentation discussing vector averaging and converting between polar/Cartesian representation of a vector.


texts:
I have created a Geoprocessing service that is hosted on a server inside our firewall (ArcGIS Enterprise 10.6). The GP service adds messages via arcpy.AddMessage("msg").

Locally, I import the toolbox via arcpy.ImportToolbox("https://...") and execute the service. Everything runs to completion, but I would like to receive messages back from the service to my local python script.

Calling arcpy.GetMessages() from my local python script only returns local messages.

Is there anyway to get the messages from the server-side GP service?

Edit: when I run the GP service from ArcCatalog (as a tool) it returns all of the remote messages.


texts: Creating Unique IDs of points in order from west to east

texts:
I have a dataset with over 1000s points. I am wondering if I am able to give each point a unique ID starting from west to east.
I am using ArcMap 10.6. Is there a way to do this in ArcMap?


texts: Arcpy CopyFeatures creates empty shapefile

texts:
I'm running a script to create a buffer and find features from another shapefile that fall completely within that buffer. The script seems to work fine, it finds all the correct features (I checked using intersect in Desktop ArcMap) but then creates an empty shapefile. The resulting shapefile has the right schema from the input shapefile but no features.

EDIT: Strangely it seems to work fine if I do it to a GDB instead of a shapefile.

# this program buffers a file and finds what features are inside that buffer

# everything works except for writing to the new shapefile, and i can't figure out why

# import all the goodies
import ogr
import gdalconst
import sys
import os
import arcpy

# set the workspace for arcpy
arcpy.env.workspace = "c:/work/lab8"

# set folders and files
folder = 'C:\\work\\lab8\\'
myFile = 'Parcels.shp'
myFile2 = 'Powerline.shp'
filename = folder + myFile

# get all the attributes using describe and count the number of features
desc = arcpy.Describe(myFile)
cm = arcpy.GetCount_management(myFile)
nFeatures =int(cm[0])
print 'featureclass',myFile,'has',nFeatures,'features'
print 'running tool'

# make the new layers to select from
arcpy.MakeFeatureLayer_management(myFile, "parcels_lyr")
arcpy.MakeFeatureLayer_management(myFile2, "powerline_lyr")

# set the buffer destination
buffer_file = 'powerline_buffer.shp'
buffer_output = folder+buffer_file

# if the layer exists, delete it
if arcpy.Exists(buffer_output):
    arcpy.Delete_management(buffer_output)

#create the buffer
bufferDist = 250
sideType = "FULL"
endType = "ROUND"
arcpy.Buffer_analysis("powerline_lyr", buffer_output, bufferDist, sideType, endType)

# make the buffer result a layer
arcpy.MakeFeatureLayer_management(buffer_output, "buffer_lyr")

# run the intersect
arcpy.SelectLayerByLocation_management('parcels_lyr', 'COMPLETELY_WITHIN', 'buffer_lyr', "", "NEW_SELECTION")

# see how many features intersect. if 0, quit
matchcount = int(arcpy.GetCount_management('parcels_lyr')[0])
if matchcount == 0:
    print('no features intersect')
    sys.exit()
else:
    print matchcount, 'intersected'

# Set output file name
out_name = "parcels_within.shp"
out_location = folder+out_name
print out_location

# if the new featureclass exists, delete it
# i took this out in case it was causing problems, but it doesn't seem to be the cause
if arcpy.Exists(out_location):
    arcpy.Delete_management(out_location)
    print 'bye'

# showing all the features that interserct, to make sure it works
print '\nThese features of',myFile, 'intersect the buffer of',myFile2,': \n'
cursor = arcpy.SearchCursor('parcels_lyr')
for row in cursor:
    if row.getValue('SITUSADDR'):
        print row.getValue('SITUSADDR')

# Write the selected features to a new featureclass
# for some reason this creates an empty shapefile and I can't figure out why
arcpy.CopyFeatures_management('parcels_lyr',  out_location)


texts: Finding pixels in DEM with 5% slope or less?

texts:
I am trying to determine if a given property may be amenable for a ground based commercial solar project.

Among basic requirements there is flatness (5% slope or less), so I am trying to determine the slope suitability.

What is the best method to determine it?

If it helps I have a DEM LiDAR image of the area pulled in and have created 1' contours off of it already.


texts:
Just acquired free version of NEXTGIS and trying to install the plugin for QGIS. It tells me it was not designed for version 3 of QGIS.

How do I set up the QGIS-NEXTGIS interface then?


texts: Creating spatial view from materialized view?

texts:
I have a materialized view that runs nightly and performs an intersection of point locations and polygons. The materialized view works as designed and returns the desired results. It contains attributes from the point and polygon used in the intersect operation, including a unique objectid field and geometry field.

Now, I need to create a spatial view. First, can I create a spatial view that gets its data from a materialized view? If so, how?

I used the SDE command line to create a view and modified the query to include some additional fields. After my edits, the spatial view seems to work fine in TOAD. Performing a SELECT against the spatial view returns the data expected.

When I try to add the SV to ArcMap, I get the following message:

could not add the specified data object to the map.
Attribute column not found [schema.spatial_view][STATE_ID = 718731]
Attribute column not found [schema.spatial_view][STATE_ID = 718731]
Attribute column not found [schema.spatial_view][STATE_ID = 718731]

I tried dragging & dropping the spatial view from the Catalog onto the map surface as well as the Add Data button. Both produced the same message. This is causing me question my process and wondering if a) there's something on the backend that isn't wired up correctly or b) this is just not possible.

In ArcCatalog and the Catalog window in ArcMap, the icon adjacent to the spatial view is the icon used for data tables. It's not the point, line or polygon icons I see adjacent to the spatial views that work correctly. So arc thinks this spatial view is a data table and doesn't contain the polygon data it actually contains?


texts: How to skip 0 radius which create cords error

texts:
I am new in Python and I have to do program that make buffers around cities in shp file. My problem is how to skip 0 radius? It makes coords error. I think I should use a continue function but I don't have any idea where.

import fiona

from shapely.geometry import mapping, shape

with fiona.open('file.shp', 'r') as input:
    schema= { 'geometry': 'Polygon', 'properties': { 'name': 'str', 'population' : 'int' } }
    with fiona.open(
        'result.shp', "w", "ESRI Shapefile", schema, "epsg:4326" ) as output:
        for point in input:
            output.write({
                'properties': {
                    'name': point['properties']['NAME'], 'population': point ['properties']['POP_MAX']
                },
                'geometry': mapping(shape(point['geometry']).buffer(point['properties']['POP_MAX']/1000000))
            })


texts:
My knowledge in GIS and R is again tested when I want to map a small part of northern Greenland (called Washington Land) in R (and plot analysis data on top later).

I've managed to plot it with

library(maps)
library(mapdata)
library(rworldmap)
map("worldHires", "Greenland", xlim=c(-67,-63), ylim=c(78,82))
newmap <- getMap(resolution = "high")
plot(newmap, xlim=c(-67, -63), ylim=c(78,82), asp=1)

But resolution and projection is horrible for this area and my need.

I have a good map in MapInfo, but how should I output a map, so it can load in R and R can plot data accurately on top of it?


texts: Accessing each value from array and feed it to another function in PostGIS?

texts:
I have an edge_table containing start_id and start_geom column. I want to make one function which will take integer array as input (starts). In between the function, the array values will be checked with the start_ids of edge_table. If matches, then corresponding start_geom value will be send to st_makeline function. I have made following query but it is having syntax error near 'IN'.

CREATE OR REPLACE FUNCTION ids_to_linegeom (starts int[])
RETURNS geometry AS $BODY$
DECLARE
  i integer;
  res geometry;
BEGIN
 select st_makeline(geom) from (
    FOREACH i IN ARRAY $1
    LOOP
        SELECT start_geom AS geom
        FROM edge_table
        WHERE start_id = starts[i];
    END LOOP;
      )into res;
   RETURN res;
END;
$BODY$ LANGUAGE plpgsql;

Example of edge_table:

start_id   start_geom
81608    01010000007368912D8B622341E5D022EBEAF65A41
81557    010100000085EB51F89C0723418B6CE7DB9F8E5A41
189898   01010000006F1283C0A093214179E926F1A1005B41
80952    0101000000666666E67F832341F2D24DBA38B45A41

I have postgresql 9.6.


texts: Osm2pgsql crashed on import. Can I continue with what has been imported so far?

texts:
I recently imported the osm planet file using osm2pgsql. The process crashed (hung my whole box) when creating the geometry indices and other indices on the tables. Scouring through the source code, it looks fairly trivial to add the indices by hand, however I was wondering if anybody knew if the database is consistent at this point (ie, all row data comitted).

Don't want to have to start over with the whole import really.


texts: SAGA 2.3.1 makes QGIS 2.18 crash on Ubuntu 18.04

texts:
On Ubuntu 18.04, using packages provided by universe repos

QGIS 2.18.17+dfsg-1
SAGA 2.3.1+dfsg-3build7

When starting any SAGA algorithm, QGIS crashes with a "Segmentation fault" error message.

We also tried to install QGIS 3.4 from https://qgis.org/ubuntu-ltr with both SAGA 2.3.1 (same package as above) or SAGA 7.2.0 according to https://sourceforge.net/p/saga-gis/wiki/Compiling%20SAGA%20on%20Linux/ ...
In both cases, QGIS can't find SAGA.

We also tried to specify the path to SAGA lib by editing /etc/ld.so.conf.d/saga.conf

  /usr/local/lib/saga

It didn't help.

What is the setup to make QGIS work with SAGA on this OS ?


texts: Exporting elevations from AutoCAD in format that ArcMap can read

texts:
I have elevations in Autocad, I can shift between a triangles, contours etc if it makes any difference.

How can I export these into something I can use in ArcMap?

I have tried the Make shape function with both contours and triangles, which work fine. I can display the contours or polygons. The only hickup is that the Z values are not transferred with it.

I do not know any CAD myself, and those in my organization that do haven't got any clue about ArcGIS. So I'm kind of stuck between not knowing what I can get myself and the ones who do doesn't know what I need.

Google found me some supposed workflows that I fail to complete.

How do I export from AutoCAD (2010, 2011, 2013) or Civil3D to shape/TIN/ESRI Grid?


texts: How to obtain WGS84 or Projected Bounds for given EPSG in postgis?

texts:
On the http://spatialreference.org, for almost all SRS are definied WGS84 Bounds and Projected Bounds.

How to obtain this bounds from postgis? Spatial_ref_sys does not contains this information.


texts: Comb-like missing data in landsat data images

texts:
I am using Python osgeo/gdal library to access Landsat 7 data (from different bands) as a numpy array.  When looking at the data, I often see a very prominent comb-like banding effect.  The image below shows a example and a bit of zoomed in detail as displayed by matplotlib.  I see the same effect if I simply look at the image with an image viewer.

Is this normal, or am I reading the data wrong somehow?  And if it is an artifact of the data, is there a standard way of "fixing" it?


texts: Can PostGIS and QGIS provide dependable multi-user editing?

texts:
After considering a few options, I'm trying to give my 15-20 QGIS 2.2 users the ability to concurrently view/edit one or two basic point PostGIS layers, largest one has just 16,000 records. I've installed PostgreSQL 9.1 / PostGIS 2.0 and basic testing seems to work ok but haven't unleashed it to the masses yet.

We'll typically only have 2-3 editors at a time, but possibly 15 viewers. Edits will all be in QGIS, viewers will be QGIS and ArcGIS (but we don't have SDE).

As I said, these are just basic point files, and  edits will just be adding/deleting points and some table edits. I am not worried about editing the same features at the same time.

Can the combination provide dependable multi-user editing for two basic point files?


texts:
I have the following example:

I am able to obtain valid values from markers.getDataExtent(), however the map never get zoomed to the extend somehow. I did able to manually set a zoom level and zoom to one of the points, but that's not usable for my case. Any suggestion?


texts:
I am trying to combine three conditions into one con statement line:

ndvi_adjusted = Raster(ndvi_raw) * 0.004 - 0.08
con1 = Con(Raster(ndvi_adjusted) >= 0, ndvi_adjusted)
con2 = Con(IsNull(con1), 0, con1)

I am quite confused with the where clause input and map algebra expressions in Con. I tried some ways to aggregate the three lines into one but did not work out. How can Con statement be properly aggregated?


texts: Parsing for numeric and character wildcards in a QGIS query

texts:
In an attribute table with a land use shapefile in my QGIS project there are complex combinations of numeric and alphabetic character.  I wish to filter for a simple combination of numeric wildcards and particular character combinations

A(35FDP_25MTR_15PST_10SDNze_10ARR_05VAP)

I want to filter the first set of codes 35FDP starting with A( including ddFDP for instance.  I want to do the same for the second set of codes 15PST later.

My aim is to put the dd and FCP into two separate fields.

Any suggestions on how to use wildcards to parse these field number and text character combinations to set up new fields.  It may take a number of goes to fill the new fields with numbers or text using different combinations of query filters.


texts: Displaying arrows on pipes from upstream to downstream using QGIS?

texts:
I am trying to display arrows on pipes of a sewer network so their direction is from upstream to downstream edges of the pipes.

I have managed to display those arrows on a polyline layer (which is the pipes) from the properties menu, but their direction seems to always be from Northeast to Southwest, regardless of the upstream and downstream edges.

How do i connect the arrow direction to those edges?

For example in the picture, the pipe between Nodes D11122 and D115 should have the arrow directed the opposite way.

Each pipe has an upstream and a downstream edge. Each edge is connected with a node and their properties are shown in the attribute table.


texts: Negative coordinates for WGS84 system are invisible - ArcGIS 10.2

texts:
I have a csv file with point coordinates in GCS_WGS_1984 geographic system. I've imported it to ArcMap as a XY file however negative values for West hemisphere are not visible (but ALL records are in Table of Contents - even negative).

I've tried to save data in other formats, I've changed XY columns to Float type - nothing helps...

I want to generate a raster based on the coordinates - unfortunately, the raster doesn't cover area with negative coordinates...


texts: Google Earth: Shortest distance between point (Place) and nearest point on a polygon (Country)

texts: Using Google Earth, I am trying to find the simplest way to calculate the shortest distances of the geodesic lines between a specific set of points (lat/long locations) and the nearest points on a specific set of polygons (countries). I have tried to use measurement but the set of points is far too large to calculate the values for every point to every country in the world. Plus, it is very subjective. Is there an alternative?


texts: Adding attribute field value to a file naming loop function?

texts:
Recently I've ramped up my exposure to Python coding and I'm currently working on a workflow which utilizes a layer class to export images retrieved from extents derived from selected features. The workflow currently loops through each of the selected features within the layer class and then exports that view/extent as a .JPEG. This is all great! But I'm trying to configure a dynamic naming convention which will utilize the values within the attribute table to name files and having some trouble.

The simple naming convention for the "exportToJPEG" step currently just adds a value of x to the end of the file name prefix. Instead I would like this step to grab text values from a "Bounding_Area" column within the "Bounding Box" attribute table so that the file name convention looks something more like:

lyt.exportToJPEG(r"P:\testOutBound" + "_" + "Bounding_Area")

Instead of:

lyt.exportToJPEG(r"P:\testOutBound" + str(x))

My current code looks like this:

import arcpy
aprx = arcpy.mp.ArcGISProject(r"P:\test.aprx")

arcpy.env.workspace = "P:\testing.gdb"
arcpy.env.overwriteOutput = True

arcpy.MakeFeatureLayer_management("P:\TestShapes.shp","BoundingBoxes")

map = aprx.listMaps()[0]
layer = map.listLayers("BoundingBoxes")[0]

for x in range (1,20):
    obj = "ID=%s" % (x)
    arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", obj)

    lyt = aprx.listLayouts()[0]

    mf = lyt.listElements('MAPFRAME_ELEMENT','*')[0]
    mf.camera.setExtent(mf.getLayerExtent(layer,True,True))
    mf.zoomToAllLayers()

    arcpy.SelectLayerByAttribute_management(layer,"CLEAR_SELECTION")

    lyt.exportToJPEG(r"P:\testOutBound" + str(x))

For similar dynamic path naming/path referencing Python tasks on other (non-arcpy) projects I've used the glob module or data frame column references but I'm not quite sure if either of those courses take the right approach.


texts: GeoServer provide WMS without authentication

texts:
I'm trying to understand how can add a layer from my GeoServer without have to basic authenticate.

The problem is when in QGIS I try to add a WMS layer and I put as URL as http://localhost:8080/geoserver/my_ws/wms? If I do that it doesn't show anything. I've noticed that my workspace(my_ws) requires a basic authentication (username and password). If I preview any layer of my workspace it works fine, and I don't need any identification.

I'm using GeoNode and for that, GeoNode has a authprovider. My default is Basic authentication username/password.

How can I add a WMS layer to QGIS without authentication?


texts: Opening shapefile and Tiff layer Coordinates do not match up

texts:
I am new to using QGIS and am having a major problem. I have the UK Ordnance Survey (OS) 1:25000 raster layer in Tiff format open. When I open a shapefile or mapinfo vector layer on top of it the coordinates don't match up. The new layer opens way off from the raster image even though the CRS is the same. Can anyone help?

The tiff layer OS map has been stitched as it came in separate tiles from OS. Could the stitching be throwing out the coordinates?


texts: QGIS difference between Mac OSx and Windows

texts:
I try to import a KML-Placemark file with QGIS (--> Add Vectorlayer, UTF-8). When i import the File with my Mac (OS 10.6) i don´t have any problems viewing all the attributes stored in the KML-File (they are stored in the Tag "ExtendedData")

but when i import the same KML-File in the same QGis Version on a Windows 8 OS i only see the attributes "Name" and "Description" (The points are shown correctly)

this is referring to my question here:
KML in QGis with additional Data
i thought the problem is solved but it is only to 50 % :)

here is my updated kml-file:

<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark id="PM1">
<TimeStamp>
        <when>2007-01-14T21:05:02Z</when>
      </TimeStamp>
<name>Data1</name>
<description>AA</description>
<ExtendedData>
<Data name="Orientierung">
<displayName>Orientierung</displayName>
<value>1</value></Data>
<Data name="Brennweite">
<displayName>Brennweite</displayName>
<value>279/100</value>
</Data>
<Data name="Datum">
<displayName>Datum</displayName>
<value>2013:04:04 13:20:49</value>
</Data>
<Data name="Pfad">
<displayName>Pfad</displayName>
<value>file:///C:\Temp\20130404_132050.JPG</value>
</Data>
<Data name="Kamera">
<displayName>Kamera</displayName>
<value>GT-P3110</value></Data>
</ExtendedData>
<Point>
<coordinates>15.448561,47.11721,0</coordinates>
</Point>
</Placemark>

<Placemark id="PM2">
<TimeStamp>
        <when>2007-01-14T21:05:02Z</when>
      </TimeStamp>
<name>Data2</name>
<description>AA</description>
<ExtendedData>
<Data name="Orientierung">
<value>5</value></Data>
<Data name="Brennweite">
<value>400/400</value>
</Data>
<Data name="Datum">
<value>2013:04:04 13:20:50</value>
</Data>
<Data name="Pfad">
<value>file:///C:\Temp\HUGO.JPG</value>
</Data>
<Data name="Kamera">
<value>GT-P3110</value></Data>
</ExtendedData>
<Point>
<coordinates>16.458561,48.15721,0</coordinates>
</Point>
</Placemark>
</Document>

</kml>

does anyone know why this problem is appearing?? hope you can help me!thanks michik


texts: How do I compare two maps to determine which is better?

texts:
I'm trying to do an objective comparison of two different maps for the same region. At the moment, I'm struggling with defining criteria that will allow me to do a dispassionate evaluation.

Does anyone have any ideas on how to do this, or how I should approach the problem?

As you can see, neither map is superior, a few gaps on the blue set, a few on the red.


texts: Is there a way to build Service Definition files in Pro? I assume not since they have everything on lockdown to Portal. Thought I would ask here though.


texts: Seeking advice on generic open-source package roadmap?

texts:
I just wanted to ask for advice from the open source GIS gurus on a recommended stack to use for my envisioned project, as I do not fully understand the limits of the possible with most packages.  I know I can do what I want using ESRI's various packages, but I want cheaper and open for the world to see.  I am confident I can take on any challenge and learn pieces well enough to make a project happen, I just want to avoid going down the wrong path in the first place.

My site vision:  In terms of UI, a NON-GIS looking site!  Something more along the lines of whereis.com with everything (or almost everything) being done on boxes hovering above a base map.  The specifics are not important now, just emphasizing no GIS-layers with tick boxes in a separate pane, etc.  In terms of user interaction, registered users can create features (like drinking fountain locations, walking paths, etc) on top of the base map, and edit their own features.  If possible, edit ONLY their own features that they created.  A collaborative map, really.

I am still mostly in research mode, playing around with various packages but only for the sake of general familiarization and not real testing (which would require learning them in detail first!).  PostGIS definitely seems like the right way to go as the underlying DB(s), with Geoserver/Mapserver as most likely middleware.  Openlayers is almost definitely going to be the slippy map, as I am already comfortable with it and know its power.

So that brings me to two main issues requiring the bulk of advice:

1) What is the best top layer UI for a site like this?

Is it a customized instance of Django (or even Django-CMS), or simply a pieced together instance of GeoExt or other library (not sure if you can make a login/registration/full UI with it), a different CMS/framework (no, not drupal or anything that limiting!), or something totally different?

2) Is it even possible to have registered site users edit just their own features?

I want to avoid the mass “graffiti” places like OSM and other collaborative projects experience.  It seems from my reading and advice previously that Geoserver cannot have feature-level user authentication.

Can Mapserver?

I don't even know if a site's user population (from a CMS, or framework) can even directly link to geoserver/mapserver.

If such a concept is not possible with open source solutions, is there another way to achieve that goal?

Have authenticated users edit a non-published version of the main feature layer (so as not to mess up the original) and automatically merge it to the published version every 24 hours while maintaining a daily backup of the original?

Sort of lost on how to achieve this intent.

And yes, I've looked at GeoNode too, but I only want one overall map (keep it simple) and its UI is either not interactive enough (before going into GeoExplorer) or too GIS-like in GeoExplorer.  Seems like too canned a solution for this project.

Sorry to be so open ended here and vague, but I'm hoping to be able to start down a path in which the above is possible and not run into the wall several months from now, just to have to start all over again because path #1 never had that functionality from the start!

One of the best examples I can find is http://www.gpsies.com  I know this uses leaflet, but not sure the underlying framework and database.  Users can create/upload their own features, but not edit others'.


texts:
In my organisation we would like to have a set of organisation configured print templates. It would be convinient to stores these at some central location so we only have one copy of the templates.

We could ask our users to navigate to the central location and manually add each template.
We could also deploy the templates into the composer_templates folder, but this would mean a local copy for each user and this would make them more difficult to maintain.

Since we are using Windows based computers, I was wondering if it is possible to configure the QGIS Windows Registry settings to point to one or more folders and include all the found print templates in the list found in the composer manager?


texts: Problem with raster calculator gdal_calc.py

texts:
I have two rasters. One with the following values: 0,1,2,3,4,5,6,7,8,9,10
and the other one with continuous values ranging from 0 to 10000. I would like to create a raster where only values of the second raster will be kept when the first raster has values from 4 to 6. How could I do this using gdal_calc.py?
I tried:
gdal_calc.py -A first_raster.tif -B second_raster.tif --outfile=Result.tif --calc="B*(3<=A>=7)" --NoDataValue=0

But I get a Value Error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Is that the correct way to introduce this condition in to the raster calculator?
I thought that follows the same logic than the raster calculator used in QGIS, where the value in the ouput we want goes together with the * simbol and the condition goes in parenthesis.


texts: How to access feature layer properties in an array in arcgis javascript

texts:
I can't seem to access my feature layer properties in an array. I am adding my feature layers to an array as such:

dojo.forEach(globals.layers, function (addit, i) {
                globals.featureLayers[i] = new FeatureLayer(addit.url, {
                    mode: addit.mode,
                    id: addit.id,
                    outFields: addit.outFields,
                    infoTemplate: addit.infoTemplate
                });
                if (addit.type == "poly") {
                    globals.featureLayers[i].setRenderer(renderer)
                }
                map.addLayer(globals.featureLayers[i]);
            });

This adds the layer to the map and displays the layers in the browser fine.  However, when I try to access the graphics object in a feature layer it displays an empty array.

                var graphicstmp = globals.featureLayers[i].graphics;
                console.log("Features Layer Properties in base ", graphicstmp)
                console.log("Layer " + addit.name + " ", globals.featureLayers[i]);

When I use the dev tools to look at the globals.featureLayers[i] object I can see the feature and I can expand the graphics array in the feature layer and it is there.  However, my graphicstmp variable is an empty object in the dev tools.  It doesn't get the graphics.  How can I get the graphics array in a variable so I can modify certain properties as needed?


texts: I have an attribute that is calculated with the function "geomnearest('sampling', 'fid')" in a tree table. It is ok on QGIS on PC but don't work on QFIELD ?


texts: Is there a way to update the attribute table of a feature class with a query?

texts: I have a layer with multi-polygon feature classes for states and provinces. The shape area for some features classes is < 0 causing the label to be position in odd locations. It seems that the calculation is generally correct, and that if I could update all shape area in a single query I could fix this quickly. Currently I am querying to identify the negative area features classes, and editing a point, which resets the area and then it labels correctly. However it would be much quicker to be able to run a batch update on the value.


texts: Finding point with largest viewshed using QGIS?

texts:
I have a large number of points (2600) and I need to rank them by the size of their viewshed.

I have been using the Viewshed Analysis plugin in QGIS, but I can only select the option for a cumulative raster of all the viewsheds together. In the result raster, its not possible to determine the size of the viewedsheds for the individual points.


texts: Creating DEM raster from ASCII .xyzi LiDAR

texts:
I was passed along some LiDAR data that is in .xyzi ASCII format. I am having trouble figuring out a way to build a TIN or DEM from this data. I brought it in using "ASCII 3D to feature", and subsequently attempted to build a terrain dataset with the new feature. "Create Terrain" seems to work, but when I attempt to "Build Terrain", I am given an error that says "The terrain definition is incomplete or invalid".

I am not sure where I have gone wrong. Should the ASCII data be imported as point or multipoint data? Is there a better way of doing this?


texts: Clipping polygon layer into multiple polygons via model builder?

texts: I have a huge polygon layer created from a raster, and over that I have a watershed shapefile. I need to run a land-use regression process on each individual watershed so I'd like to clip and export each watershed's polygon layer to its own layer. Can this be done through the model builder so I don't have to sit around and reset the geoprocessor for every watershed? i am using ArcGIS 10.0.


texts: Maplex issues with "vbnewline" in ArcMap

texts:
I'm trying to stack labels using an expression I wrote using VBScript.

I can get them to stack using "vbnewline" but it is a no go when using Maplex's label stacking options.

Using ArcGIS for Desktop Standard 10.3.1. The layer in question is a shapefile and not a geodatabase feature class. The label being used is a banner to call out the feature. I tried to "force split" using spaces in the label expression.

Anybody else have this issue?


texts:
I have metadata in my .dat file that tells me that my cell size is 0.200 degrees longitude. I want to import this file into GIS and convert my points to raster.

My file is very simple: it has x, y coordinates and the variable. Its coordinate system is in NAD83.

I am wondering what value I  have to input for the cell size when I am using the point to raster toolset. I have two different files with two different resolutions (one is the 0.200 degress longitude and the other is 3km2); and so for cell size do I input 0.2 and 3 respectively.


texts: Can I change a bunch of address points to labeled points without having to do each one separately?

texts: I am trying to make a map with all of our customers in a certain area, I got the addresses on the map so now I have 300 dots. I was wondering if there is a way to make those labelled points without having to do all 300 separately? if so could someone please tell me. thanks


texts: ArcGIS corrupting MXD-files on certain users

texts:
In our organisation we have a number of ArcGIS users whose ArcGIS desktop installations cause MXD-files to go corrupt when they are saved.

All MXD files that are saved with ArcGIS Desktop by one of these windows users become corrupt and unreadable. It doesn't matter if it's a fresh empty map, or an older document containing data.

We have tried deleting the "Normal.mxt" template files in AppData to force a settings reset, but that has not helped.

The problem is bound to the windows login rather than the computer, and it concerns both fresh installs and older installs. The version is 10.3.1

My hypothesis is that ArcGIS corrupts even the supposedly fresh "Normal.mxt" template files when they are reset.

So, are there other places that ArcGIS stores settings information except for the "Normal.mxt" files in AppData?

If you have another experience or theory for the MXD-corruption, please share that as well.

(I read through Corrupt MXD Causes? which was closed, and I understand if this one is a bit too vague as well, although I've tried to narrow it down some.)


texts: where is the sequence in Oracle associated with the Objectid field in ArcGIS, and how to manage it?

texts:
I am working in ArcGIS 10.1 with tables from Oracle, now under control of SDE, after making use of the option: 'Register with Geodatabase'. All these tables have a column named 'Objectid' with an associated sequence controlled by SDE. However, my goal here is not just using ArcGIS exclusively but keeping the old functionality in Oracle, i.e. through SQL Developer, not via SDE. My biggest problem now is how I could handle the sequence associated with the 'Objectid' field.

So, where in the system is this sequence stored, I cannot see it in my Oracle schema's sequences.

In the end, how could I add records to the tables directly in Oracle without corrupting and/or badly affecting the SDE sequence?


texts:
I want to enable GeoJSON output format in MapServer to be used in an OpenLayers client.

I did create the WFS server and can make a GetFeature request as follows: http://localhost:8081/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2_wfs.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=hydro

What I get per future looks like:

<gml:innerBoundaryIs>
  <gml:LinearRing>
    <gml:coordinates>
      -94.979218,49.354610 -94.975800,49.356033 -94.976563,49.359272 -94.977921,49.358330 -94.980659,49.357376 -94.984085,49.356411 -94.987511,49.355450 -94.984711,49.353626 -94.979218,49.354610
    </gml:coordinates>
  </gml:LinearRing>
</gml:innerBoundaryIs>

Then I followed the instructions at http://mapserver.org/output/template_output.html to enable GeoJSON output. My template file looks like:

<!– MapServer Template –>
[resultset layer=hydro]
{
  "type": "FeatureCollection",
  "features": [
    [feature trimlast=","]
    {
      "type": "Feature",
      "id": "NAME",
      "geometry": {
        "type": "Polygon",
        "coordinates":[[shpxy precision="6" xh="[" yf="],"]]
      },
      "properties": {
        "name": [NAME],
        "area": [AREA],
        "perimeter": [PERIMETER],
        "hydrogm020": [HYDROGM020],
        "feature": [FEATURE],
        "state": [STATE],
        "state_fips": [STATE_FIPS]
      }
    },
    [/feature]
  ]
}
[/resultset]

The problem is when I request the GeoJSON (http://localhost:8081/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example2_wfs.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=hydro&MAXFEATURES=100&outputformat=geojson)

There is this extra comma at the end of the coordinates array, like this:

{ "type": "Feature", "id": "NAME", "geometry": { "type": "Polygon", "coordinates":[[-94.979218,49.354610], [-94.984711,49.353626], [-94.987511,49.355450], [-94.984085,49.356411], [-94.980659,49.357376], [-94.977921,49.358330], [-94.976563,49.359272], [-94.975800,49.356033], [-94.979218,49.354610],] }, "properties": { "name": , "area": 0.000, "perimeter": 0.028, "hydrogm020": 11427, "feature": Null, "state": , "state_fips": } }

for which reason I cannot add the GeoJSON layer in the client.

I checked all the formatting options of the [shpxy], available at http://www.mapserver.org/mapfile/template.html but none looks can solve this problem.


texts: ArcGIS JavaScript API not drawing points at proper distance?

texts:
I have an ArcGIS map created using the JavaScript API (version 3.23). I have coded it so I can add points by clicking on the map (I simply create a point object at the mapPoint of the mouse event on click). I can then get the distance between two points by using simple code like the following:

esri.geometry.getLength(p1, p2)

Which gives me a distance between the two points in map units. I can then use:

esri.geometry.getUnitValueForSR(monMap.map.spatialReference)

to determine how many meters are equivalent to 1 map unit, which in my case returns 1, indicating that 1 map unit is 1 meter, and therefore the result of getLength should be equivalent to meters.

Unfortunately, this does not appear to be the case. For example, if I place one point at the beginning of the on-screen scale, and a second point at the 2Km mark on the scale, I would expect getLength to return something around 2,000. However, in actuality it returns (in one test) 3,172. The results are similar if I use a feature of known size and place one point on either side of said feature - the distance calculated by getLength is significantly larger than the actual distance, by around 50%. This doesn't appear to be an issue with the getLength function either - looking at the x and y coordinates of the points indicates that the calculation is correct - in map units, the points are the distance apart indicated. Said distance simply doesn't appear to line up with the scale or features drawn on the map.

This appears to have something to do with being fairly far north (Alaska), as if I try the same test closer to the equator (Mexico), I get results much more in line with what appears on the map. So perhaps the features on the map, and the scale bar, are stretching as you go further north, but there is no indication of that in the mapUnits? If so, how can I determine this "stretch" factor?

What am I doing wrong, and how can I fix it?


texts: Is there a setSource parameter that I can use for a button/image click event in Leaflet?

texts:
Is there such a thing as setSource for a layer, as there is in OpenLayers 3, in Leaflet? Or something equivalent? I can't find it in the API documentation.

UPDATE WITH MORE INFORMATION

I am trying to add a click event for an image, so that when I click an external image it changes the source of the tile layer (L.tilelayer.deepzoom). It would be awesome if I could get it to change the layer source of 4 layers to different paths.

For Example:

L.tilelayer.deepzoom(path1)
L.tilelayer.deepzoom(path2)
L.tilelayer.deepzoom(path3)
L.tilelayer.deepzoom(path4)

[ Button Click Event ] on external image

L.tilelayer.deepzoom(path5)
L.tilelayer.deepzoom(path6)
L.tilelayer.deepzoom(path7)
L.tilelayer.deepzoom(path8)


texts: Georeferencing an aerial image based on satellite imagery

texts: As part of a bigger project I need to georeference an aerial image based on a landsat image downloaded form usgs. I use qgis. can I somehow place the layers on top of each other and mark certain points to apply the references of the downloaded image to the aerial photage?


texts: Setting layer visibilty in custom QGIS 3.x application (C++ versus Python)

texts:
In my QGIS application, I would like to be able to have a QDialog window pop upon clicking a toolbar icon which lists the layers set to the map canvas, and have QCheckBoxes that allow the user to show/hide layers if needed.  I am trying to do so in a C++ application.  I have a Python version which follows the answer given by Denis Rouzaud in the following example: Setting layer visibility in QGIS Python API?
Here is the custom slot I wrote which follows the API documentation:
void layerDisplay::setDisplay(QString &layerName, bool &isChecked)
{
    for ( QgsMapLayer *lay: qm0->layers() ) //qm0 is QgsMapCanvas
    {
        if ( layerName != lay->name() )
        {
            continue;
        } else
        {
            //pj0 is the QgsProject
            QgsLayerTreeNode *root = pj0->instance()->layerTreeRoot()->findLayer(lay->id());
            root->setItemVisibilityCheckedRecursive(isChecked);
            qm0->refresh();
            QList<QgsMapLayer* > lst = root->checkedLayers();

            if ( lst.isEmpty() )
            {
                cout << "Layer " << layerName.toStdString() << " is not checked" << endl;
            } else
            {
                for ( QgsMapLayer *lc: lst )
                {
                    cout << "Layer " << lc->name().toStdString() << " is checked" << endl;
                }
            }
        }
    }
}

and while the standard output tells me the layers have been checked or unchecked, the map canvas does not update; however the Python code works!  If you need to see more code (eg the widget's header and mainwindow slot) I can update this question.


texts: one row is discarded while importing shapefile into postgres

texts:
Please help me in following issue. I need to import a polyline shapefile into Postgres9.1 through shp2pgsql command.When i did like this, i got an error as

"NOTICE:  CREATE TABLE will create implicit sequence "new2_gid_seq" for serial column "new2.gid"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "new2_pkey" for table "new2"
Query result with 1 row discarded.
Query returned successfully with no result in 1063 ms.

because of this error, i couldn't able to do further processes.Please madam do needful thing![enter image description here][1]


texts: Creating single squared tile fishnet buffer based off shapefile in QGIS?

texts:
I'm interested in creating a fishnet buffer around a current grid I have. The fishnet buffer I'm interested in making needs to be exactly the same cell size and extend just one grid cell around the AOI.

How can I create such a result using QGIS?

The grids are square

I've provided an example of what I would like to the result to look like.


texts: Clip Aerial Image Pair by Overlapping Area?

texts:
I have a set of aerial images which I am trying to clip by their overlapping areas, for use in a more involved program I am writing in Python with Python Imaging Library (PIL).

Is there a  command line based tool out there with an easy method for extracting the overlapping areas from a pair of images?

I know this may be difficult since the images will have slight perspective differences, but I was hoping it would still be possible.

I was thinking a library such as GDAL may have this sort of capability but I am unfamiliar.


texts: Clipping vector data from raster data in ArcGIS Desktop?

texts:
I have two files:

National land cover data (raster)

HUC 8     (vector files of watersheds)

Both are national scale but the HUC 8 takes up a larger geographic region than the raster set so I want to cut the HUC 8 to match the smaller extent of the raster set.

How do I do this in ArcGIS Desktop 10.2.2?


texts:
I use UAS to survey vegetation at subcentimeter resolution for my research and have found that bidirectional reflectance (BR) is a huge issue that impacts the reliability of estimates across subsequent flights. (https://www.sciencedirect.com/science/article/abs/pii/S1161030115300733)

There are solutions for this in the world of remote sensing, specifically the bidirectional reflectance distribution function (BRDF). (https://www.mdpi.com/2072-4292/10/9/1348/pdf)

Is there any existing package that facilitates the use of BRDF on raster files in R?


texts: ArcGIS Snap raster option doesn't work with georeferenced images

texts:
Trying to snap cells of one Landsat image with another one (older ones are sometimes totally misplaced, so I had to georeference it first), I use ArcMap's Copy tool and snap raster environment setting. The output raster is however in exactly the same position as the input one, with no change. Any ideas of what I may be doing wrong?

Details:

Both files are *.TIF
I have background geoprocessing off as in this question
I have parallel processing left default as in my issue on Esri's Geonet
I tried saving both to custom location and to Default.gdb
My ArcGIS version is 10.5.0.6491
I tried to process in: ArcMap, ArcCatalog and through ArcPy script from Windows cmd
finally both have same cellzise (I used Resample tool to match it, since Environment setting in Raster Analysis didn't work. Before the georeferenced image had it 30,009244 while "correct" images have 30)

I have ~40 rasters to process, so I would like to avoid "raster projection with point reference" method, which is a totally manual one.


texts:
I would like to classify several values from a vector table with field calculator in 5 classes based on standard deviation. Example: value = 3.3, mean = 2.5, std deviation = 0.7 and class #5 is "mean+std dev and above", than his new value is 5 (new column)

It seems pretty easy to do with a CASE ELSE statement in QGIS, but I would like to write something that I can use for several SHPs with different means. I was looking for some help here to simplify the statement so it can be easily re-usable with a new and different shp.


texts: OSM XML: Should I generate contact:phone or phone?

texts:
I am generating OSM XML data for all POIs of Wikivoyage, the collaborative travel guide.

When I want to express a phone number, should I generate contact:phone or phone?

Both mean the same thing. According to a 2012 note on this page, the only difference is that contact:phone is newer but phone is more popular.

Which one should I use, that so my data is readable by most 2013 apps?


texts: Is there a way to add a "current user" label to the print composer?

texts:
Is there a way to add a current user label to the print composer in QGIS.

I thought there might be something similar to the $CURRENT_DATE format available.

This would be in a windows environment.


texts: Format GeoJSON use Join method before export in Earth Engine

texts:
After filter an LANDSAT-05 for an small area

  var Collection = function(pixel) {
  var colForPixel = ee.ImageCollection('LANDSAT/LM05/C01/T1')
  .filterBounds(pixel)
  .filterMetadata('CLOUD_COVER','less_than',4)
  .map(app);
  return colForPixel;
};

print(Collection)

Add NDVI and EVI2 to this collection filtered

var app = function (image) {
 //NDVI
  var ndvi = image.normalizedDifference(['B5', 'B4']);
  image=image.addBands (ndvi.rename('NDVI'));

  //EVI2
  var evi2 =  image.expression("2.5 * ((NIR - RED) / (NIR + (2.4 * RED) + 1))",{
    'RED':image.select('B4'),
    'NIR': image.select('B5')
  })

  image = image.addBands(evi2.rename('EVI2'));
  return image;
};

I ploted an chart, using a click point function

Map.onClick(function(lonlat){
  var pixel = ee.Geometry.Point([lonlat.lon, lonlat.lat]);
  var collection = Collection(pixel)
.select(["NDVI"], ["NDVI"])
.merge(Collection.select(["EVI2"], ["EVI2"])
)
  var options = {title : 'NDVI/ EVI2 CHART VALUES'};
   var graph = (
    ui.Chart.image.series(collection,pixel,ee.Reducer.mean(), 30
    ).setOptions(options)
  );
    print(graph)

Then, I create a function to reduce each feature

// make a feature collection (which you can export)
  var featureCollection = collection.map(function(image){
    return image.reduceRegions({collection: pixel, scale: 30, reducer: ee.Reducer.mean()}).map(function(feat){
      return feat.set('system:time_start', image.get('system:time_start'));
    });
  }).flatten();
  print(featureCollection)

Then, to could export as GeoJSON, I separated the featureCollection into two lists: one from  NDVI values, and another to EVI2 values

//Firts, transform the bigger FeatureCollection in to a lis and get the size
var featureCollectionList = featureCollection.toList(featureCollection.size())
print(featureCollectionList)

//filter NDVI values
var ndviFilter = featureCollectionList.slice(0,ee.Number(featureCollectionList.size()).divide(2))
ndviFilter = ee.FeatureCollection(ndviFilter)
print(ndviFilter)

//filter EVI2 values
var evi2Filter = featureCollectionList.slice(ee.Number(featureCollectionList.size()).divide(2),ee.Number(featureCollectionList.size()))
evi2Filter = ee.FeatureCollection(evi2Filter)
print(evi2Filter)

Applying an simple join method

// Use an equals filter to define how the collections match.
var filter = ee.Filter.equals({
  leftField: 'id',
  rightField: 'id'
});

// Create the join.
var simpleJoin = ee.Join.simple();

// Apply the join.
var simpleJoined = simpleJoin.apply(ndviFilter, evi2Filter, filter);

// Display the result.
print('Simple join: ', simpleJoined);

And, finally, export, but doesn't seems to work

Export.table.toDrive({
    collection: simpleJoined,
    description:  'exporting as GeoJSON, with two differents columns (one to EVI2 and, another, one to NDVI)',
    fileFormat: 'JSON'
  });

})

Here is the source code link


texts: Creating variable in ModelBuilder specifying range of possible values?

texts:
In the ModelBuilder (ArcGIS 10.3) I'm creating a tool where I want to let the user decide the Percentage_Of_Overlap, which is a field in my vector dataset.

For that, I want to create a variable where the user can insert a integer between 0 and 100.

I'm using the Selecting Tool, so it would be (in the Query Builder):

PercentageOfOverlap >= Value

Where the Value, will be the inserted value by the user.

How to do that with ModelBuilder?


texts: Using VB/Python script to populate field with maximum value among other fields

texts:
I am using ArcGIS 10. I have a little experience with python but i feel that python in ArcGIS is slightly different. VB will work fine as well.

Problem:

I have n different columns called 'percent_1', 'percent_2','percent_3' and 'percent_4'.... 'percent_n'. They contain percentages. I have a new field called 'Class_t'. I want to check which one among 'percent_1..n' is highest and then want to put 'x' in 'Class_t' field.


texts: Need sample 3D and multi-layer shapefiles

texts:
I've been given a task to write a GIS (Shapefile .shp) rendering application.

The document and shapefile technical specification states that 3D shapefiles exist. The document also mentions that a single shapefile can have multiple layers, although the technical specification does not describe this.

I was not given sample files for either of these cases so I can't do anything. I've been looking all over google, but I cannot find any sample 3D or multi-layered shapefiles. Does anyone have, or know where I can find such files?


texts: Upgrading from sde 9.2/oracle10g to sde 10.2/oracle11g

texts:
I have an old geodatabase created using Arcsde 9.2 on Oracle 10g.

Now, I'm trying to update it to new system using ArcSDE 10.2 on Oracle 11g r2.

Because SDE 9.2 schema and SDE 10.2 are not compatible with each other, I tried to setup a transition stage through ArcSDE 10.0.

ie: SDE 9.2/Ora 10g ---> SDE 10.0/Ora 10g ---> SDE 10.2/Ora 11g r2

What I did:

I made two vmware machines with win2003 installed on both, the first named dbserver and the second named sdeclient
On dbserver, I installed Oracle 10g.
On sdeclient, I installed Oracle client 10.2, ArcGIS Desktop 10, ArcSDE 10.
I creted new database named testdb On dbserver [while the original database name calgarydb].
I exported calgarydb from the real system and imported it to testdb.
I tested connection through oracle client on sdeclient to dbserver and it was succeeded.
From ArcCatalog 10.0 I tried to use direct connection to testdb on dbserver using the following parameters:

Server  : none
Service : sde:oracle10g:testdb
Database: none
Username: system
Password: pass
Connection details: sde.DEFAULT

but I received the following error:

Failed to connect to the specified server.
Operation Failed [Connection failed when attempting to connect using a 10.0 direct connect driver to 9.2 geodatabase. Missing suitable direct connection driver for this connection type. Please install the 9.2 direct connection driver. ArcSde Direct Connect driver release - 100001; ArcSde database instance release - 92011; ArcSde low release for instance - 92005]

Any idea please.


texts: Accessing PAT,NAT of coverages using arcobjects

texts: I want to access the polygon attribute table (PAT) and node attribute table (NAT) of an arcgis coverage using arcobjects VBA, is this possible?


texts: How can I view which markers are being clicked on by users in Leaflet?


texts: Getting complex CAD drawing to right location in QGIS?

texts:
I have a complex CAD drawing from a city with many layers..hatches, points, poliylines..and I need it to georeference because when I import the DWG file into QGIS it turns out to be at the wrong place.

I am new to GIS, so I seek ideas. I will attach imagery below.


texts: How can I optimize the processing time of the zonal_stats module using multiprocessing in Python?

texts:
I am carrying out a spectral feature extraction in Python 3 starting from an 8-band image and a shapefile (consisting of about a million polygons) superimposed on it. I calculate the mean and standard deviation of the pixels for each polygon and join them to the polygon as additional attributes. The most intuitive way was to use the zonal_stats module which automatically saves the result in geojason (maintaining geographic information). The rest of the code allows merging the individual geojasons into one. The process, in particular the calculation of the spectral features, takes 21 hours. Given that I am a beginner with Python and with the world of programming, how could I implement multiprocessing in order to reduce processing times?

P.S .: My goal is to have a shp or geojason file with the spectral features calculated for each polygon and to drastically reduce the processing time. I use a workstation in which an Intel Xeon processor with 12 physical cores and 24 virtual cores.

from rasterstats import zonal_stats

polig = '...\\poligons.shp'
img_Berg = '....\\8_band_image.tif'

col = ['mean', 'std']

#the most demanding part of code starts from here ....

def zstats(b):
    zs = zonal_stats(polig, img_Berg,  band=b, stats=['mean', 'std'], geojson_out=True)
    return zs

stats_blu = zstats(4)
stats_green = zstats(7)
stats_red = zstats(6)
stats_rededge = zstats(8)
stats_nir1 = zstats(5)
stats_nir2 = zstats(3)
stats_gndvi = zstats(1)
stats_dsm = zstats(2)

#.....to here

def change_name(d):
    for i in range(len(d)):
        a = d[i]['properties']
        if d == stats_blu:
            a['mean_blu'] = a.pop('mean')
            a[' std_blu'] = a.pop('std')
        elif d == stats_green:
            a['mean_green'] = a.pop('mean')
            a[' std_green'] = a.pop('std')
        elif d == stats_red:
            a['mean_red'] = a.pop('mean')
            a[' std_red'] = a.pop('std')
        elif d == stats_rededge:
            a['mean_rededg'] = a.pop('mean')
            a[' std_rededg'] = a.pop('std')
        elif d == stats_nir1:
            a['mean_nir1'] = a.pop('mean')
            a[' std_nir1'] = a.pop('std')
        elif d == stats_nir2:
            a['mean_nir2'] = a.pop('mean')
            a[' std_nir2'] = a.pop('std')
        elif d == stats_gndvi:
            a['mean_gndvi'] = a.pop('mean')
            a[' std_gndvi'] = a.pop('std')
        elif d == stats_dsm:
            a['mean_dsm'] = a.pop('mean')
            a[' std_dsm'] = a.pop('std')
    return(d)

a = change_name(stats_blu)
b = change_name(stats_green)
c = change_name(stats_red)
d = change_name(stats_rededge)
e = change_name(stats_nir1)
f = change_name(stats_nir2)
g = change_name(stats_gndvi)
h = change_name(stats_dsm)

def merge(a, b, c, d, e, f, g, h):
    l = [a, b, c, d, e, f, g]
    for i in range(len(a)):
        for j in l:
            z = j[i]['properties'].copy()
            h[i]['properties'].update(z)

merge(a, b, c, d, e, f, g, h)

Output_geoj = h.copy()


texts: merging TIGER Line shp files for better labeling in ArcGIS

texts:
When working with TIGER line shp data at county level scale the labeling of roads, rivers, railroads, etc. is cumbersome due to all of the tiny line segments. Merging the dozens of segments that comprise a particular road or river will result in much cleaner labeling. The only problem is the amount of tedious work this requires. Anyone know of a Python script that will automate this process? It needs to find all records with the same name and merge them into one record. I thought ET Geowizards had a tool for this but can't seem to locate it.

screen shot for better explanation


texts: Accessing band n of GeoTIFF using gdal_merge.py?

texts:
How does gdal_merge.py want input bands of a multiband tiff pathed via the --optfile option?

I am merging a large list of .tifs via a subprocess.call in python:

gdal_merge.py -o "target" --optfile "fileIn"

where "fileIn" is a list of input files. But playing around I can't seem to find how to reference example.tif Band_1, for example. So even more simply, how do you call a specific band of a multiband geotiff in gdal?


texts: Using Spatial Join for single point joins in ArcGIS Pro

texts:
I am trying to join population and job data to service area polygons I created, summing the population and job values to the service area polgyons. I had already previously joined the population and job data to census block polygons, and then used polygon to point to create points for the centroids of the census blocks with this information.
I then tried to do a spatial join for the census block points that intersect with the service area layer, but for whatever reason, only the value of only a single point is being carried over, instead of all the points.
I selected the single point that had its data joined with the service area polygon.
Does anyone have an idea what went wrong?


texts: Incorrect results while cropping with gdalwarp and cutlineSQL

texts:
Environment: Windows 10, Python 3.7, Numpy 1.18 and GDAL 3.0.2

Data required:

Single band raster
Polygons on same area with an attribute "name"

The code below works fine and cuts the data for all 3 polygons
ds = gdal.Warp('cut.tif', 'ndvi.tif', format = 'GTiff', cutlineDSName = 'parcel.shp')

if ds is None:
    print('Failed')
else:
    print('Success')
# prints Success

But this does not work
ds = gdal.Warp('first-wrong.tif', 'ndvi.tif', format = 'GTiff', \
               cutlineDSName = 'parcel.shp', \
               cutlineSQL = 'SELECT * FROM parcel', \
               cutlineWhere = 'name = "first"')

if ds is None:
    print('Failed')
else:
    print('Success')
# prints Success but gives same result as previous

Expected output:

Is this a bug or am I missing something?


texts: Can ArcGIS for Windows Mobile have legend for displayed layers?

texts:
Just finished building my first mobile map in ArcGIS mobile project center and opened it in ArcGIS for windows mobile but quickly realized there is no way to turn on a legend to show what the symbology represents?

Is there a way to display a legend?


texts: Buffering points bounded within polygons

texts:
I'm using arcGIS 10.1 on an i5 win7 machine with 16g RAM. Not a xeon but have never had big problems even with large datasets.

Here's what I'm doing: I have point data representing locations within specified political boundaries. They represent the centroids of districts contained within larger geographic units which are 1) not uniform in size or 2) shape.

My goal is to create a buffer around these points, but to do so such that the larger boundaries act as the minimum bounding geography. So the radius of the buffer would not exceed the closest point of the border of the larger geography. This would give me buffers which were totally contained in the larger geography and would vary with the size of the larger bounding geography. I've looked at min. bounding geography features, and this seems to do something different--i.e. it would create a larger buffer around the larger geography.

To answerers: The issue with this is that it will give me an irregular shape--what I'm really trying to get here is to preserve the circle shape, but to make sure that it doesn't exceed any point of the larger bounding geography. Clipping would give me 'pac man' kind of shapes that are not ideal. As to more than 1 step--Oh of course! I'd take a dozen steps if I can get to the solution. And welcome more cumbersome but technically simple approaches.


texts: Converting historic map data (raster) into polygon format?

texts:
How do I convert historical buildings from map data (raster) into a polygon format?

The historic maps that I am referencing are the Sanborn Fire Insurance Maps. Here is the link to an example in case the image doesn't load:
https://www.loc.gov/item/sanborn01615_001/

I want to preserve the outline of the buildings and turn those into polygons. Doing this manually is out of the question, as there are 300+ maps that need conversion. I have searched for many hours, but have not been able to find a good answer to this question.

I need to do this in ArcGIS Pro. I have tried to use the convert Raster to Polygon tool and then ran the Eliminate tool, hoping to combine sliver polygons into the actual features that I want.

How do I convert historical buildings from map data (raster) into a polygon format?


texts: How to open a GMLAS layer in Fiona or GeoPandas

texts:
I want to open a GMLAS layer.
When I open the file with:

ogrinfo -ro GMLAS:D:\path\to\file.gml

Output:

INFO: Open of 'GMLAS:D:\path\to\file.gml'
using driver 'GMLAS' successful.
...
15: roofsurface (Multi Surface)
...

I tried to open the layer "roofsurface" with Fiona with:
gpd.read_file(r'D:\path\to\file.gml', driver="GMLAS", layer=layer)

Error: DriverError: ... not recognized as a supported file format.

gpd.read_file(r'GMLAS:D:\path\to\file.gml', layer=layer)

Error: unsupported driver: 'GMLAS'

I get the same error in GeoPandas, which internally uses Fiona. Is there another/correct way to open this specific layer in Fiona?


texts: Importing arcpy on application launch to speed up subsequent arcpy methods

texts:
Is there a way of importing arcpy during the launch of my custom built application so that any usage of arcpy methods after the fact won't require the 3-4 seconds that it takes to import the arcpy module?

I am using wxPython for my GUI library if that helps. Preferably, the import would be done right after the MainLoop() launch of my GUI. This would lock up the GUI for a few seconds, but I can mitigate user experience issues with a busyinfo message or the like.


texts:
How to draw a line with pop-up in OpenLayers? For markers with pop-up i do so:

var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
            var markers = new OpenLayers.Layer.Markers( "Markers" );
    map.addLayer(markers);

    map.events.register("click", map , function(e){
   var opx = map.getLonLatFromPixel(e.xy) ;
   var marker = new OpenLayers.Marker(lonLat);
   markers.addMarker(marker);
   marker.events.register("click", marker, function(e){
   popup = new OpenLayers.Popup.FramedCloud("chicken",
                         marker.lonlat,
                         new OpenLayers.Size(200, 200),
                         "example popup",
                         null, true);

map.addPopup(popup);
    });
});


texts:
I am trying to obtain the spatial reference for lists of feature classes using the following code;

def spatialFileListing():
    for root, dirs, files in os.walk(inputLocation):
        for d in dirs:
            workspace = os.path.join(root, d)
            arcpy.env.workspace = workspace
            fcList = arcpy.ListFeatureClasses()
            for fc in fcList:
                fcPath = os.path.join(workspace, fc)
                desc = arcpy.Describe(fcPath)
                descSR = desc.SpatialReference.Name
                print(descSR)

The below error message is returned;

"AttributeError: DescribeData: Method SpatialReference does not exist".

However, when I substitute for a fixed path to a shapefile e.g.:

fcPath = r"C:\Fixed\Path\To\Shapefile\A_Shapefile.shp"

The spatial reference is returned. E.g.:

"ETRS_1989_UTM_Zone_31N"

I'm sure it is something to do with the name / structure of the feature class being returned within the for loop, but don't know how to resolve it.


texts: Different languages via command line paramaters

texts:
I'm looking for a way to start different qgis instances in different languages simultaneously without changing the settings in qgis.

Is it possible to define the language with a command line parameter or something like that?


texts: Getting polyline midpoint coordinates using ArcGIS REST API

texts:
I have an ArcGIS 10.7.1 feature service that integrates polyline GIS assets to a work order management system.

In the work order management system, I want to retrieve the midpoint coordinates of the currently selected polyline asset.

I think the best way to do this would be to request the midpoint coordinates of the specific polyline feature from the feature service/REST API.

Note: There are ways to do this with the REST API for the centroid/centerpoint of polygons. But they don't seem to apply to the midpoint of polylines.

  ArcGIS REST API - Query (Feature Service/Layer)

  returnCentroid (Optional)

  The returnCentroid parameter is currently only supported for polygon
  data.

Is it possible to get the coordinates of a polyline's midpoint using the REST API?


texts:
I have downloaded "xampp-windows-x64-7.3.6-3-VC15-installer.exe" and installed only Apache and PHP. My Apache server is running.

I have download "tileserver-php-master" and paste the folder in path of "C:\MyTileServer\htdocs" without any changes.

What will I do to open SAS Planet tiles in PHP? I want to open it in QGIS 3 in LAN network environment. Path for my SAS planet tiles is "D:\SAS.Planet\cache_gmt\vesat.....".  It is tree type folder.

How to proceed for next step.


texts: How often does GeoServer read its data Directory?

texts: Does GeoServer read its data folder only on startup or does it do so on every Get-request (for example when fetching data through WMS)? Is there some kind of a timer setting?


texts: Integrating geolocated Twitter posts in ArcGIS for Desktop?

texts:
Is it possible to integrate the lat/long data included with Twitter posts (those few that have it enabled of course) into an ArcGIS Desktop environment?

I've seen Twitter applications on ArcGIS Online that allow the position of Twitter posts on a base map.

I've also seen interesting mapart using Twitter geolocated twitter posts.  How is this done?

Keep in mind that we're looking to integrate these into a Desktop environment, not a Online environment.


texts: Combining intersecting polygons into one polygon using QGIS?

texts:
I'm working in QGIS and I am a little bit of a newbie.

I have created a buffer from a points shapefile. I would like to combine intersecting polygons into one polygon to create a kind of "cluster" polygon. I have highlighted below the polygons I would like merged into one.

I understand there is a manual way of merging selected polygons into one but I have a rather large file and this method is not ideal in terms of time (See second photo for what I am trying to achieve).

I am not concerned about preserving all attributes, I solely want to have my "clusters" as one polygon, that being said I cannot use the dissolve tool because this combines ALL my polygons into a single object.

My points and polygons are located in Canda, therefore I am working in Canada_Albers_Equal_Area_Conic to ensure polygon sizes are accurate.


texts: ERROR 000212: Cannot create XY event source Failed to execute (MakeXYEventLayer)?

texts:
I have a csv file that is 133mb in size and has over 1.3 million lines of data.  Each line of data has its own lat/long and I was wondering what would be the best way to display those points based off the lat/longs in ArcGIS Desktop 10 and ultimately turn it into a point shapefile?

So far I have tried the "Make XY Event Layer" tool but that keeps failing...

ERROR 000212: Cannot create XY event source
Failed to execute (MakeXYEventLayer).

The csv file is properly formatted and the lat/long fields are numeric so I have no idea why it keeps crashing.

Here is what the first 2 lines of my CSV look like, the first line is what should be the header:

"LAT","LONG","CUSTOMER_MASTER_ID","STORE_NBR","TRANSACTION_DT","SKU_DIVISION_ID","SKU_DEPARTMENT_ID","SKU_CLASS_ID","SKU_CATEGORY_ID","SKU_NBR","SALES_AMT"
"32.363544","-110.969778","2000000792627","2940","8/11/2010","2060","3920","5120","84021","5127866","13.99"

Any ideas?


texts: I have a SHP that includes the entire county and want to downsize it to a specific area...how??


texts: Problem with popup conclusion on pressing a marker

texts:
I have markers on pressing to which popup has to be brought. how to make it? (coordinates of markers undertake from a DB)

var map;
var markers;

function ejecutar() {
    init(3);
    //loadMarkers();
}
function init(b,kor_1,kor_2) {
    if (b == 3) {
        map = new OpenLayers.Map("basicMap", {
            controls: [
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.LayerSwitcher(),
                new OpenLayers.Control.Attribution()],
            maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
            maxResolution: 156543.0399,
            numZoomLevels: 2,
            units: 'm',
            projection: new OpenLayers.Projection("EPSG:900913"),
            displayProjection: new OpenLayers.Projection("EPSG:4326")
        });
    }

    layerMapnik = new OpenLayers.Layer.OSM.Mapnik("MapaCiudad");
    map.addLayer(layerMapnik);
    var lonLat = new OpenLayers.LonLat(50.5206298828125, 55.15881723298661).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
    //map.setCenter(new OpenLayers.LonLat(-3.862788677215576, 43.4669443349282) // Center of the map
    map.zoomTo(9);
    map.setCenter(lonLat, 19);

    //создаем дорогу

    var lineLayer = new OpenLayers.Layer.Vector("Линии");
    map.addLayer(lineLayer);
    map.addControl(new OpenLayers.Control.DrawFeature(lineLayer, OpenLayers.Handler.Path));

    var points = new Array(
       new OpenLayers.Geometry.Point(37.61556, 55.75222),
       new OpenLayers.Geometry.Point(45, 33),
       new OpenLayers.Geometry.Point(49, 35),
       new OpenLayers.Geometry.Point(45, 56),
       new OpenLayers.Geometry.Point(49, 87)
    );

    var line = new OpenLayers.Geometry.LineString(points);
    line.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));

    var style = {
        strokeColor: '#0000ff',
        strokeOpacity: 0.5,
        strokeWidth: 5
    };

    var lineFeature = new OpenLayers.Feature.Vector(line, null, style);
    lineLayer.addFeatures([lineFeature]);

    var popup = new OpenLayers.Popup.FramedCloud(
             "popup",
             OpenLayers.LonLat.fromString(feature.geometry.toShortString()),
             null,
             '
'+feature.data.Name + '
test.url' + '
',
             null,
             true
         );

    //добавление на карту
    map.addPopup(popup, true);

    //создаем маркер
    markers = new OpenLayers.Layer.Markers("Marcadores");
    map.addLayer(markers);

    if (b == 2)
    {

            //=================  =========стили для маркеров и тут хранятся координаты
            var size = new OpenLayers.Size(30, 30);
            var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);

            var location = new OpenLayers.LonLat(kor_1, kor_2).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
            var icon = new OpenLayers.Icon('http://icons.iconarchive.com/icons/icons-land/vista-map-markers/256/Map-Marker-Ball-Pink-icon.png', size, offset);
            markers.addMarker(new OpenLayers.Marker(location, icon.clone()));

    }

}

    function add_metka()
    {
        function dobavit(koor1, koor2)
        {

            init(2,koor1,koor2);
        }

    @foreach (Дорожное_строительство.Models.koordinats_piket picket  in ViewBag.Data)
    {
    <text>
        dobavit(@picket.Dolgota,@picket.Shirota);
    </text>
    }

    }

    setTimeout('add_metka()', 6000)
</script>


texts: Defining and including local tileLayer in Leaflet

texts:
I have a problem with including path of the local tileLayer (generated in OpenStreetMap) in Leaflet.

Here is the code in which I define path to the map.png

var map = L.map('map', {
    zoom: 8,
    layers: L.tileLayer('/tiles/{z}/{x}/{y}.png')
});

Errors in my console:

GET http://192.168.1.1:3000/tiles/8/139/92.png 404 (Not Found)   92.png:1
GET http://192.168.1.1:3000/tiles/8/139/93.png 404 (Not Found)   93.png:1
GET http://192.168.1.1:3000/tiles/8/140/92.png 404 (Not Found)   92.png:1
GET http://192.168.1.1:3000/tiles/8/139/91.png 404 (Not Found)   91.png:1
GET http://192.168.1.1:3000/tiles/8/138/92.png 404 (Not Found)   92.png:1
GET http://192.168.1.1:3000/tiles/8/138/91.png 404 (Not Found)   91.png:1
GET http://192.168.1.1:3000/tiles/8/138/93.png 404 (Not Found)   93.png:1
.......

Do I need to rename map.png file?


texts: ESRI Javascript APT FeatureSet input to custom Geoproecessing tool

texts:
I have an ESRI Javascript application that uses a geoprocessing service that uses a cutsom GP tool.
Since I have a set of values to be passed to the GP service I am planning to pass in it as a record set instead of string values. These are just attributes and no geometry associated with it. I think I can use FeatureSet in Javascript to pass GP input parameters.

Something like this. Let me know if this is the right way to pass record sets. I will have several records.

var attr = {"OBJETID:1", "Name":"Test", "Address:"Value2"};
var graphic = new esri.Graphic(null,null,attr,null);
var features= [];
features.push(graphic);
var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features;

Now inside the custom GP function tool how do I set the paramaters to read the input? Following is what I am trying to do. Is this the correct approach?

IGPParameterEdit gpParameterEdit = new GPParameterClass();
IGPDataType gpDataType = new GPRecordSetTypeClass();// GPStringTypeClass();
IGPValue gpValue = new GPRecordSetClass();// GPStringClass(); ;
gpParameterEdit.Name = "legal_desc";
gpParameterEdit.DisplayName = "Legal Description";
gpParameterEdit.DataType = gpDataType;
gpParameterEdit.Value = gpValue;
gpParameterEdit.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
gpParameterEdit.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;

Then while Casting the value, How do I cast and read the values from the input featureset? Following is what I am trying to do and it is returning null for gpRecordSet.

IGPValue gpValue = parameterValueArray.GetGPValue(_parameterIndex);
IGPRecordSet gpRecordSet = (IGPRecordSet)gpValue;

Basically I am trying to see how to pass in set of attributes from JavaScript and read it in custom GP Tool.

Now the return value I expect in the JavaScript application is a polygon graphic and no attributes. What is the best way to return the polygon? What I understand from my research is that I need to create in-memory featurecalss and return the polygon as feature. Is there a better way.

All help appreciated.


texts: How do you close the QGIS Commander in 2.18?

texts:
I have opened the Commander tool in Processing.  It is sitting over my map window.

How do I remove the Commander from the display?


texts: How can I load sqlite file into oracle 11g?

texts: I have SQLite file which I have taken it from Sptialite DB. I need to convert this file into SDO. Plz help me


texts: Dividing/tiling input features in FME, processing independently and fanning out the output by tile

texts:
I have two heavy-weight polygon feature classes that I want to union and then calculate some area-weighted average of one attribute for each aggregate (say parcel polygons, which is one of the inputs) by using FME (2018.1) on my Windows 7 machine. I developed a model with the sample data and it works fine (see below). However, when I use the official datasets, the workbench yields

  "Insufficient memory available -- error code was 2 - please read the
  FME Help section 'Adjusting Memory Resources' for workarounds."

error. As suggested I tried \3GB switch without any success (I have 32GB total RAM) and using 64bit FME is not an option at the moment.

If I was running the same process in ArcGIS, I would be able to divide my inputs into tiles and process them separately and then merge them to get my result feature class without any dramas. But in FME, I cannot do this since FME caches all inputs at once and pipe it to next process if it does not "hold" the overall model run.

I thought the looping as suggested elsewhere may help but still cannot fan-out the outputs from each loop. Any ideas?

UPDATE

The workbench works fine in 64-bit FME 2018.1.


texts: QGIS data is not showing up as options when I go to Graduated option on coloring

texts: I can’t seem to get a CSV file I added to show up as an option for column on a graduated map I added the CSV file to my shade file where do I go from here.


texts: Is the nearest neighbor in QGIS guaranteed to return the closest geometry?

texts:
I did assume that the answer was yes, but I have developed some doubts about that because I observe something which seems to contradict:

I have a netlayer containing road segments (LineStrings) with a corresponding spatial index netindex. Now I wish to find the closest segment to a given QgsPoint pt.

I use the netindex.nearestNeighbor(pt,n) to obtain the corresponding featureIds:

req = QgsFeatureRequest();
req.setFilterFids(netindex.nearestNeighbor(pt,n))
fs = [f for f in netlayer.getFeatures(req)]
closestEdgeGeoms = [f.geometry() for f in fs]
ptGeom = QgsGeometry.fromPoint(pt)
dists = [g.distance(ptGeom) for g in closestEdgeGeoms]

Now let's have a look what the dists are for increasing n:

n=1 # -> dists=[132.57922743885197]
n=2 # -> dists=[44.65094179417814, 132.57922743885197], ups!?
n=3 # -> dists=[232.91196346783073, 44.65094179417814, 132.57922743885197]
n=4 # -> dists=[186.9821211234746, 232.91196346783073, 44.65094179417814, 132.57922743885197], again found sth closer...
...

That's it. Does someone have an idea how large n should be to guarantee to catch the closest geometry? Or is this a bug?

Edit: As Steven pointed out this question is related. My question is actually answered by Håvard Tveite's answer.


texts: Area biased in 1x1 km2 vector grid in QGIS

texts:
I used

Vector -> Research tools -> Vector grid

with enabling

Output grid as polygons

to create a 1000 by 1000 m grid from a shapefile.
However, when I calculate the area of each grid cell via

attribute table -> field calculator -> Create a new field
Output field name: area
Output field type: Decimal number (real)
Output field width: 15; Precision: 5

For the Expression to calculate the area I use:

$area

When doing this, I get values which are bised by ca. 1% (too small):
eg a grid cell area of 0.991639 km2 instead of 1.0 km2.
The error seems to be bigger than just a rounding error and
this adds up to a wrong total area of the shapefile.


texts: Comparing floor and roof areas using QGIS?

texts:
I am trying to show the available roof area for installing photovoltaic moduls in comparison to the respective floor area in QGIS.
I have two vector layers so far. One contains the floor area of the houses, the second one the appropriate roof areas. All I want is the amount of roof area in percent (or at least in m²) of their respective floor area. Important is, that only the roof areas that sit in the floor areas shall be involved. As you can see in the picture below, some of the roof areas are bigger then the floor areas. I thought this problem would be very easy to solve, even for a newbie like me, but i could not handle this yet.

So you can better imagine the problem, a screenshot of how it looks like:


texts: How to style GeoJSON features with attributes from MySQL in Openlayers 3

texts: I got some GeoJSON-features from a file. The attributes of the features are stored in a database (MySQL), because I need them there for some interactions with users. On the other hand some of these attributes should be used to style the features in the map. So the generell problem is, that the browser (with the GeoJSON features from file) and the server (with the database) don't work synchron. This is no problem, when the features are styled after an user-event (a Click for eample). I use AJAX-technology and it works. But how can I manage this, when the map is presented the FIRST time, because at that time there is no user-event. I don't know, how to tell the browser "Please wait until the database ha s selected the data". I tried map.on('precompose', …) , but without success. Would be glad for some hints


texts: What's this 8 byte "padding" in the EGM2008 data?

texts:
I recently downloaded the 1' earth gravitational model 2008 Und_min1x1_egm2008_isw=82_WGS84_TideFree dataset from here. According to the readme, the file consists of 233,301,600 32-bit floating point values in big-endian format, conceptually organized into 21600 "columns" and 10801 "rows". I wrote a program (in Go, but that's irrelevant) to sample this dataset and produce a greyscale image.
While examining the data, I noticed that the first 4 and last 4 bytes (or first and last values) for each row is identical through the whole dataset... 1.21072e-40 or the actual bytes [0, 1, 81, 128] (decimal).
The readme doesn't mention anything about this, as indicated above. In fact, it specifically says the 0-degree East value for each latitudinal "record" is not repeated at the end (360E) of the record. (I noticed this was the case in the 1996 dataset.) It's especially odd that it's all exactly the same data without any variation by latitude.
A search on google for those particular values (in hex) turned up a reference to CRC-24, but that seems like a long-shot.
I can easily compensate for this in my program, but does anyone have any idea what this "padding" is?
Sample generated image for fun:


texts:
I need some clarification regarding MBTiles.

I am generating MBTiles in 2 different ways:

Using TileMill
Using Mapbox tm2 to MBTile using TileCloud

In TileMill, does the exported MBTile contain vector data or just raster images?

In TileCloud, I am generating MBTiles from a tm2 so I am assuming that the exported MBTiles from this process are vectors?

So I read somewhere that MBTiles can contain raster OR vectors.
Are vector MBTiles smaller in size and better than rastered ones?


texts: Converting WMS getmap request to Geotiff

texts:
I'm accessing a WMS server that doesn't provide geotiff as one of the format capabilities, but does provide PNG and KMZ.

http://tds.marine.rutgers.edu:8081/ncWMS/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0

I'm thinking that it should be possible to write a little shell script that would either:

Request KMZ and convert that to geotiff, using the implied SRS and
bounding box info
Request PNG and use the WMS query bounding box and SRS to create the
    geotiff, perhaps using gdal or similar

Has anyone done something like this, or is there a better way?

Thanks,
Rich


texts: Looking to combine temporal data from multiple shapefiles to produce a days per year file for each feature

texts:
I have many shapefiles in which there is a start date and an end-date per feature. I am hoping to produce a single shapefile that has each enclosed area with a "days per year" kind of calculation.

Trying to visualize this... if feature a is [ __ ] and feature b is ( __ ) and they overlap...

[ feature a 10/1/2011-10/3/2011  ( overlap ]  feature b 10/2/2011-10/8/2011 )

into

[ feature a = 3 days  ][ feature c= 8 days ][ feature b = 6 days ]

So, overlaps calculate properly and become their own feature.

Not sure if this is making sense?

Any help would be great! I've tried using unions, looked at rasters, checked out the toolboxes... Not sure what route to take.

My final map I'm hoping to produce should be a map that shows the duration differences.

Thanks!


texts:
I embedded ArcGIS Engine into a c#/wpf application and use it to display a map.
Now for print my client needs to display the scale of the map like it is used on street maps (the small bar which shows how long 500m are, and/or the scale information like 1:25000).

Prints are always on a set paper size like A4.

Is there a simple way to achieve this in an ArcGIS Engine application?