texts: Setting up foundational OSGeo enterprise GIS?

texts:
First let me describe the task:

My lab has approached me about setting up a simple GIS for a colleagues 'non-spatial' lab. There are a couple of key characteristics to the intended setup:

Fully open source. The workstation will be running OSGeo-Live.
Single workstation. They only want one new computer in there, and they have no network set up as of yet, so it'll be stand-alone.
It has to play double duty: it will both as the server of a spatial database that holds all the data collected for the lab (so an Admin account needs to have full access to this database), but also act as a workstation for students who can come in, view the data, run analysis, but CANNOT edit the data.
System needs to be low on maintenance, so sysAdmin jobs kept to a minimum.

I'll quickly explain my background: I have training mainly as a GIS analyst, working almost exclusively so far as a Desktop GIS user. I have recently started looking into GIS sysadmin stuff and webserving. I have SQL experience, Geodatabase design training, and data management experience on a single user network database. Unfortunately, this is a situation where money is tight, and I was the only person in the lab who knows even a small amount of IT. The answer to my question might be: hire someone who does this for  a living. That, however, is not an option.

Now I've chosen the OSGeo-Live distro for obvious reasons, and the fact that it comes pre-packaged with more abilities than will be asked of it by this user group. This is important, however, because with time this lab wants to:

build a central server that will include spatial info, and
start serving maps over the internet. This, however, is not my task right now. It would be good, however, if I made the system as extendable as possible so when these upgrades become a priority they don't have to do a complete system overhaul.

Now that's my situation, here are my specific questions:

Database: What's the best way to setup a multi-user spatial database on a single computer that also acts as a workstation?

Partitioning with admin account write access?

Backup: Since there is no network infrastructure now in place, what would be a good local system for backing up the spatial database?

Separate internal hard drive with a simple cron bash script?

Resources: Could someone please point me in the direction of some intro sysAdmin resources for small scale (single lab) network and database sysAdmin, design, implementation?

Also, I've read a bit on choices of database. I'm inclined to go with PostGIS because it might make it easier to migrate to a larger network later on. But Spatialite is intriguing because it is simpler and would require less maintenance and a less restrictive setup.

Is it true that going for Spatialite now would make migration to a larger enterprise setup harder in the future?


texts: Editing between ArcGIS Desktop and older ArcSDE geodatabase

texts:
We are unable to edit feature classes in an ArcSDE 9.3.1 Versioned GDB using an ArcGIS 10.1 .mxd map. The feature classes are part of a geometric network. Previously we were able to edit feature classes in an ArcSDE 9.3.1 Versioned GDB using an ArcGIS 10.0 .mxd map. It seems that ArcGIS Advanced (ArcInfo level) for 10.1 is incompatible with our 9.3.1 SDE.

Has anyone else experienced this?

We are unable to update the 9.3.1 GDB because 1 editor, who is deaf, utilizes special customized tools for performing her work tasks. We are getting a contractor to update these tools to work in 10.1. Then we will convert the GDB to 10.1 and this problem should dissappear.

Yes, we did grant privileges to all editors. The editing problem only occurs if the feature class is part of a geometric network. Otherwise, if the feature class is in a dataset that does not have a geometric network, then editing can be performed. It appears then that ESRI's claim that 10.1 is backwards compatible is invalid for 9.3.1 with geometric networks. We will thus use only ArcGIS 9.3.1 and 10.0 until this specialized conversion is complete.


texts: How to use Dealul Piscului 1970/Stereo 70 (EPSG:31700) with Google Mercator?

texts:
To open Google layer I use OpenLayers 0.93 plugin, the base layer has CRS "Dealul Piscului 1970/Stereo 70 (EPSG:31700)", the Google layer is set to "Google Mercator (EPSG:900913)".

The same base layer + google maps layer is aligned in QGis 1.8 on Fedora and on Windows (using the same plugin version). The same problem exist in earlier versions of Ubuntu and QGis (I have tested QGis 1.7 on Ubuntu 10.04 and Ubuntu 11.10).

I tried to manualy change the EPSG:31700 parameters (in srs.db) to match those in the Fedora version of srs.db to:

+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +towgs84=28,-121,-77,0,0,0,0 +units=m +no_defs

original was:

+proj=sterea +lat_0=46 +lon_0=25 +k=0.99975 +x_0=500000 +y_0=500000 +ellps=krass +units=m +no_defs

I have installed "libgeotiff-epsg" but still no lock.

I have replaced all the *.db from /use/share/qgis/resources/*.db with ones taken from QGis 1.8 installed on Fedora, but still no lock, the layer is misaligned.

"enable on the fly reprojection" is checked.

If you need more details or have some solutions to test, please be a little more explicit because I am a beginner in GIS related things.

Thank you

Edit
I attachet PrintScreen with the offset (I updated towgs84 as @mkennedy recomanded, but still no lock, only on Ubuntu):


texts: Obtaining selected value from QGIS using python algorithm?

texts:
I'm writing an algorithm in python for QGIS and i have a function which uses a value from a selection.
The problem is that when i select a value the script give me the error that the local variable 'subsetOut' referenced before assignment.

This is my code

##Raster=group
##imagePath=raster
##gap=number 100
##window=number 31
##distance=number 5
##angle=selection 0;45;90;315

.....

def imageSubset(angle,window, distance, i, j):
    if angle ==0:
        subsetOut=InRaster[i-((window-1)/2):i+(window-((window-1)/2)),j-((window-1)/2):j+(window-((window-1)/2))+distance]
    elif angle ==45 or angle==np.pi/4:
        subsetOut=InRaster[i-((window-1)/2):i+(window-((window-1)/2))+distance,j-((window-1)/2):j+(window-((window-1)/2))+distance]
    elif angle== 90 or angle==np.pi/2:
        subsetOut=InRaster[i-((window-1)/2):i+(window-((window-1)/2))+distance,j-((window-1)/2):j+(window-((window-1)/2))]
    elif angle==315 or angle == -(7*np.pi/4):
        subsetOut=InRaster[i-((window-1)/2)-distance:i+(window-((window-1)/2)),j-((window-1)/2)-distance:j+(window-((window-1)/2))]
    return(subsetOut)

for i in range((window+1)/2, rowOut*gap+(window+1)/2, gap):
    sys.stdout.write('\r'+"Computing : "  + str(int(float(i)*100/(rowOut*gap))) + '%')
    sys.stdout.flush()
    for j in range((window+1)/2, colOut*gap+(window+1)/2, gap):
        sub=imageSubset(angle,window, distance,i-1, j-1)


texts:
Is there any way to disable, mute, or otherwise change the incessant message 'beep' in QGIS? I need volume on the PC for other unrelated notiifications yet am tired of apologising for the echoing cacophony to workmates whenever I'm using QGIS.

Thanks


texts:
I am having an issue with creating a TIN model.

My task is to create a map of Plymouth Sound for my UNI work. I have a .txt file with eastings, northings and elevation (Ill attach it). Due to covid ive had to move to QGIS from arc as running it on a Mac.

My issue is that when I import the data as a delimited text file which works I then want to create a polygon. My lecturer in arc just hits Create TIN and its done. Ive tried all sorts from the Delaunay Triangulation feature but this just gets stuck at 99%, to attempting to change the .txt file in QGIS.

It also doesn't need to be 3D so I believe I don't need to use GRASS.

Second image is the txt file imported with the track lines from our survey. This is as far as I could follow from ArcGIS lecture.

The txt file


texts: Importing UTM coords into QGIS: Handle UTM Zone

texts:
I have a csv list of points with their reference in UTM (X,Y) format:
33411590,4225441;5657743,8981463;

As you can see, the first two digits of the X column are the zone number. When importing these data into QGIS (Import Text file as Layer), QGIS asks for a CRS (EPSG:32633 would be the choice) and takes the content of the X column as the X value, including the first two digits. Thereby, it places my point 33.000km too far east.

Is there any solution to change this behavior (ignoring the digits or even extracting their real information)? Or do I need to "cut" between Zone number and X value by myself, before feeding the dataset to QGIS?


texts: How to use custom tile sources (Bing, Google) in geoviews / holoviews?

texts:
Geoviews offers a number of predefined tile sources, such as EsriImagery. These tile sources can be used as background imagery in interactive maps, e.g.:
import geoviews as gv
import holoviews as hv
from cartopy import crs as ccrs
from pyproj import Transformer

crs_proj = "epsg:4326"
crs_wgs = "epsg:3857"

# custom map bounds
lim_lng_max = 8.728187
lim_lng_min = 8.707770
lim_lat_max = 49.413423
lim_lat_min = 49.406589

# define reverse projection
proj_transformer_back = Transformer.from_crs(
    crs_proj, crs_wgs, always_xy=True)

gg_bottomleft = proj_transformer_back.transform(
    lim_lng_min, lim_lat_min)
gg_topright = proj_transformer_back.transform(
    lim_lng_max, lim_lat_max)

def set_active_tool(plot, element):
    # enable wheel_zoom by default
    plot.state.toolbar.active_scroll = plot.state.tools[0]

gv_layers = (
        gv.tile_sources.EsriImagery.opts(alpha=1.0) * \
        gv.Points(
            (xy_list[1][0], xy_list[1][1]),
            label='Points Layer',
            crs=ccrs.UTM(zone='32N')).opts(
                size=5, color='white', alpha=0.25)
    ).opts(
        responsive=True,
        title=f"Heidelberg Map with EsriImagery background",
        hooks=[set_active_tool],
        data_aspect=1,
        xlim=(gg_bottomleft[0],gg_topright[0]),
        ylim=(gg_bottomleft[1],gg_topright[1])
    )
# save to HTML
hv.save(gv_layers, f'heidelberg_map.html', backend='bokeh')

How can existing tile sources be extended, e.g. by Google Maps or Bing Maps Imagery?


texts: Is the QGIS connection with ArcGIS "mapserver" still working?

texts:
I would like to add the Ocean Basemap to QGIS. I also found the other posts and I followed this procedure:

http://hub.qgis.org/wiki/quantum-gis/Arcgis_rest

Hovewer when I put in the Python console the following code, an error message appears.

qgis.utils.iface.addRasterLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer","raster")

I tried this link also

qgis.utils.iface.addRasterLayer("http://services.arcgisonline.com/arcgis/rest/services/Ocean_Basemap/MapServer?f=jsapi","raster")

I also tried using the gdal function:

gdal_translate "http://services.arcgisonline.com/arcgis/rest/services/Ocean_Basemap/MapServer?f=jsapi" s.xml -of WMS

So, I wonder, Is this method still operational? Or did I made a mistake somewhere?


texts:
I have an sdo_geometry table that I created using ArcGIS Desktop (by converting an esri.st_geometry table to sdo_geometry). I'm using Oracle Spatial's sdo_geometry datatype because it has linear referencing functions (unlike esri.st_geometry).

I'm able to create a simple view on the table, and use it in ArcMap:

--Query #1
SELECT
    OBJECTID
    ,SHAPE
FROM
    USER1.SDO_ROAD

However, when I create a view that constructs new geometry, I'm unable to use it in ArcMap:

--Query #2
SELECT
    OBJECTID
     --simplified for Stack Exchange:
    ,SDO_LRS.CLIP_GEOM_SEGMENT(SHAPE, 0, 10) AS SHAPE_FIRST_10_METRES
FROM
    USER1.SDO_ROAD

I get this error when I open the attribute table:

Error reading OID from table. Reading rows has been stopped. Check that the datasource is valid.
Underlying DBMS error[ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 1278]
THE operation is not supported by this implementation.

I'm guessing that the main problem is: interface not supported without a spatial index.

To be clear, I am able to create the view successfully, and even add it to ArcMap. But the lines do not draw, and I get the above error when I open the attribute table.

Why does ArcMap and/or Oracle know how to handle Query #1, but not Query #2?

Why can't Query #2 use the spatial index from the underlying table, just like Query #1 does?


texts: Issue with the name of a PostgreSQL table in QGIS

texts:
The table in question is called "referentiel.adr_cad_numvoie_ponctuel" in the PostgreSQL database. But in QGIS, and this is the first time I've seen something like that, in the Browser panel, the table is displayed under the name "referentiel.adr_cad_numvoie_ponctuel.geometrie", I don't understand why there is this "geometrie" (which is the name of the geometry column). I don't understand what it is doing there. It is the only one of the many tables in the database, which is written this way in QGIS.
In PostgreSQL

In QGIS


texts: Changing default style on point GeoJSON Layer in Leaflet?

texts:
I need to change style on a point GeoJSON layer in a Leaflet map.

I'm using the following code:

function onEachFeature(feature, layer) {
                      if (feature.properties && feature.properties.popupContent) {
                         layer.bindPopup(feature.properties.popupContent);
                      }
                     }

var myStyle = {
 "color": "#ff7800",
 "weight": 5,
 "opacity": 0.65
};

myGeoJSONLayer = L.geoJson(myGeoJSON, {
                      style: myStyle,
                      onEachFeature: onEachFeature,
             });

myGeoJSONLayer.addTo(map);

All is working but there is always the standard default blue marker on my map.


texts: How to rename shapefiles that contain illegal characters?

texts:
I need to import multiple ShapeFiles in ArcMap whith the MakeFeatureLayer tool. To do so, I need to rename several layers which contain non-ascii characters ("à","é","è", ...), space (" ") or point (".") in their names.

To be more precise, the issue appears when there is a point in the Shapefile name! The special characters appear to be accepted.

I already saw these posts:

How can I rename multiple feature classes (each different name) using Python?
Multiple rename shapefiles and feature classes in python

MY "RAW" FILES

But, when I'm running my code, I got these errors in my IDE...

CODE

import os
import arcpy
from arcpy import env

folder = r'\TESTRENAME'
arcpy.env.workspace = folder

lfc = arcpy.ListFeatureClasses()

for f in os.listdir(folder):
    for fc in lfc:
        file_name, file_ext = os.path.splitext(fc)
        in_data = fc
        out_data = file_name.replace(".","_")+file_ext
        data_type = "ShapeFile"
        if in_data != out_data:
            arcpy.Rename_management(in_data, out_data)
        print out_data

ERRORS (IDE)

Traceback (most recent call last):
  File "<module1>", line 19, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 4507, in Rename
   raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Data Element: Dataset shp_19.2_160m.shp does not exist or is not supported
ERROR 000725: Output Data Element: Dataset C:\TESTRENAME\shp_19_2_160m.shp already exists.
Failed to execute (Rename).

ERROR (ArcMap)

As you can see, only the file with the extension ".shp" is renamed and not its related files which are added in ArcCatalog (and should not).

The result is then logically:


texts:
I have a series of QGIS map documents that have all branched out from a common ancestor that are, as of QGIS 2.6 causing quite a few crashes and issues while using print composers or while doing a document save in general. These crashes are now causing corrupted map documents after the crashes. While these documents are recoverable due to QGIS's backups and my own, I'd like to go searching for the problem so I can stop backtracking so frequently.

Is there any sort of document inspector for QGIS that can check for valid document structure, keeping the valid parts and notifying me about the bad parts and throwing them out? I'm thinking of something akin to ArcGIS's MXD Doctor, in purpose, if not in actual function. I suspect I could just recreate my document with the layers I want and probably remove whatever issue I've baked in, but I'd love to keep the document set up as it currently is.


texts: QGIS: Dissolving Polygons with Self-Intersection

texts:
I have created multiple polygons with some subset of track-lines, with the order of time those points were recorded. Therefore some of the polygons have self-intersection within the polygon.

Is there any way to solve this self-intersection problem for dissolving polygons?

I used "Buffer" in "GeoProcessing Tools" with 0 distance and "Dissolve
result". However, some of the polygons didn't merge into the same polygon (green in this picture). The bottom layer with brown polygons were my line-to-polygons constructed polygons.


texts: Switching career from GIS Technician/Analyst to GIS Web Map Developer/Programmer?

texts:
I am a GIS Analyst at work that dabbles in python scripting in ArcGIS and the Google Maps JavaScript API V3.

My professional goal is to either be in web mapping development or desktop/server GIS application development.

I have seem to hit a plateau and I am not sure how to progress with my learnings or professionally to reach my goal.

I ask those of you out there that made the jump from technician/analyst how did you do it?

How can I land a job in web mapping/application development with little to no experience.


texts: dijkstra_sp_directed not returning any result

texts:
I am trying to create a routing application with OSM data. What I am working with is an almost square area of about 30x30 kilometers, so nothing too big.
But when I do something like

SELECT the_geom FROM dijkstra_sp_directed('roads_clip','6','2','true','true');

It does not select anything. Both the table and the source and target vertices exist, as well as a possible path between them. This code is a part of a larger block that is about to insert the selected path into a new table, here's what it looks like:

BEGIN TRANSACTION;
DROP TABLE IF EXISTS shortest_path_table;
CREATE TABLE shortest_path_table(gid int4) with oids;
SELECT AddGeometryColumn( 'shortest_path_table', 'the_geom', -1, 'MULTILINESTRING', 2 );
INSERT INTO shortest_path_table(the_geom) SELECT the_geom FROM dijkstra_sp_directed('roads_clip','6','2','true','true');
END TRANSACTION;

All I get after running this is an empty shortest_path_table.

I have already used this code before and every time (until now) it worked like a swiss watch, so this time the problem seems to be in the data. When I run

SELECT assign_vertex_id('roads_clip', 0.00001, 'the_geom', 'gid');

I get a nice and useable network of vertices, but dijkstra_sp_directed does not return any result. When I modify the tolerance to 0,001 it can find a way. The problem is, that the vertex network is a mess (I need a lot more vertices) and the route pgRouting returns is an even bigger mess (see picture: http://imageshack.us/photo/my-images/89/pgrouting.png/ )

As you can see, not only the returned route (in purple) is a complete nonsense, but also many streets have no vertices assigned, and that is not very useful.

I also tried this: http://www.pgrouting.org/docs/howto/validation.html and the result, (if I set the tolerance in assign_vertex_id to 0,00001) is pretty much the same as the image displayed at the bottom of the page.

So I know something is wrong with the data, the question is: What it is? And how can I fix it?

Thanks for your help


texts: Binding Objects to List for ArcGIS Python Script Tool Parameter?

texts:
I am working on a python based script/tool.  I would like to make use of drop down lists for several of the parameters.  This is very easy to do if the lists are just plain old strings.

Does anyone know if it is possible to bind objects to this list and display a certain property?  Objects will be very simple; just key-value pairs.

So, I would like to display the key and be able to access the value somewhere in the ToolValidator, or better yet access the ToolValidator class from the tool script itself?


texts: How to convert multiple csv files to shp using Java

texts: I have some 100 CSV files. I want to convert them in shp format using Java. The csv file contains lat long information in WGS84. I can understand it is a batch processing and it is difficult to do in ArcGIS. is there any spatial plugin for eclipse that will do the task? I had a look at Geotools but found it bit complicated. Anything straight forward?


texts: What is the difference between Polygon To Line and Feature To Line in ArcGIS? Is feature to line a more abstract way such that it takes in not only polygon but like dots and other feature classes also?


texts:
I'm trying to export my map. But ArcGIS generates PDF (or other) maps that is not the same as in the layout view. I have polygons that is filled with a pattern, and this pattern is drawn over the entire page (outside of the polygon).

Have anyone experienced this problem before? And is there a way I can fix it?


texts: InvalidStateError in IE for esri-leaflet

texts:
I have a map that works perfectly in Chrome and Firefox, but gets stuck on the httpRequest in IE 11.

I get InvalidStateError in here on httpRequest.timeout = context.options.timeout.

I am a bit lost, not familiar with Request.js and haven't had much luck find any issues like this.

function xmlHttpPost (url, params, callback, context) {
  var httpRequest = createRequest(callback, context);

  if (typeof context !== 'undefined' && context !== null) {
    if (typeof context.options !== 'undefined') {
      httpRequest.timeout = context.options.timeout;
    }
  }

The Global code from the Call stack in the IE debugger shows my query statement as well.

          // style each zone and add to layer group
      query.run(function (error, response) {
          L.geoJson(response, {
              style: function (feature) {
                  switch (feature.properties.ZONING_) {
                      case 'CN': return { fillColor: '#FF7800', stroke: false, fillOpacity: 0.35 };
                      case 'CG': return { fillColor: '#DF73FF', stroke: false, fillOpacity: 0.35 };
                      case 'S-T4': return { fillColor: '#FFFF73', stroke: false, fillOpacity: 0.35 };
                      case 'S-T5': return { fillColor: '#FFFF73', stroke: false, fillOpacity: 0.35 };
                      case 'S-T5-2': return { fillColor: '#FFFF73', stroke: false, fillOpacity: 0.35 };
                      case 'S-T5-1': return { fillColor: '#FFFF73', stroke: false, fillOpacity: 0.35 };
                  }
              }
          }).addTo(zoningLayerGroup);
      });


texts: Create geometry column of type 'PointZM' in PostGIS

texts:
I want to add a geometry column with geometry like "PointZM", "PolygonZM". I have written something like this:

SELECT AddGeometryColumn ('data_rivne','geo_point','geom2',0,'POINTZM',0);

But it doesn't work. It says:

  Invalid type name "POINTZM(0)"

Can I create a column with such geometry, and what dimensions must I use?


texts: Automatically numbering points East-West & North-south on QGIS?

texts:
I have a dataset over with points every 100m over several km.

I want to number points so that they follow an 's' shaped path.

For example:

1   2  3  4  5

10  9  8  7  6

11 12 13 14 15

20 19 18 17 16

I can easily sort by X ascending using the sort & number plugin, but I haven't figured out how to alternate between ascending and descending on alternate rows.


texts: Rotating polygons by value from attribute table using ArcPy?

texts:
I have 60 polygons saved in one shp file.

Is there a way to rotate them by the angle value stored in the attribute table?

I know how to do it manually; I am looking for more automated way (Every polygon has different angle)

I tried to run this script but I got an error

  Runtime error  Traceback (most recent call last):   File "",
  line 55, in    File "", line 24, in main   File
  "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py",
  line 6520, in MakeFeatureLayer     raise e ExecuteError: Failed to
  execute. Parameters are not valid. ERROR 000732: Input Features:
  Dataset P:\3_Workspaces\DDP_REF.gdb\Original does not exist or is not
  supported Failed to execute (MakeFeatureLayer).

# -*- coding: utf-8 -*-
import math
import arcpy
import numpy

def Transform_coords(x, y, angle, polygon_centroid):
    radians =  math.radians(angle)
    (X,Y) = polygon_centroid

    x_trans = x - X
    y_trans = y - Y

    x_transprime = math.cos(radians) * x_trans - math.sin(radians) * y_trans
    y_transprime = math.sin(radians) * x_trans + math.cos(radians) * y_trans

    x_prime = x_transprime + X
    y_prime = y_transprime + Y

    return x_prime, y_prime

def main(shp_file, new_shp_file):
    arcpy.env.overwriteOutput = True

    arcpy.MakeFeatureLayer_management (shp_file, "polygon")
    sr = arcpy.Describe("polygon").spatialReference
    features = []

    with arcpy.da.SearchCursor("polygon", ["SHAPE@", "SHAPE@XY"]) as cursor:
        for row in cursor:

            array = numpy.random.uniform(0, 360, size = 1)
            angle = array.tolist()[0]

            for feature_parts in row[0]:
                feature = []

                polygon_centroid = row[1]

                for coord in feature_parts:
                    x = coord.X
                    y = coord.Y

                    new_x, new_y = Transform_coords(x, y, angle, polygon_centroid)
                    feature.append([new_x, new_y])

            points = arcpy.Array([arcpy.Point(*coords) for coords in feature])
            polygon_feature = arcpy.Polygon(points,sr)
            features.append(polygon_feature)

    arcpy.CopyFeatures_management(features, new_shp_file)

if __name__ == "__main__":
    main(
        shp_file = r"P:\3_Workspaces\DDP_REF.gdb\Original",
        new_shp_file = r"P:\3_Workspaces\DDP_REF.gdb\Rotated"
        )


texts: How to copy attachment feature class from personal GDB to File GDB?

texts: I have some feature classes with attachments in personal geodatabase  . I want to copy these  from personal to file geodatabase automatically using arcpy. I used the code suggested by @Aaron to copy all feautre classes and datasets to file geodatabase.It was great But i couldn't copy attachments using the code.How can i copy the attachments to file gdb using arcpy?


texts: Change output file type in QGIS georeferencer?

texts:
I have successfully georeferenced a raster file via the Georeferencer plugin (Georeferencer GDAL Version 3.1.9) in QGIS 1.7.0.

However, I noticed that the output georeferenced raster file is in TIFF format. Is there a way for me to change it to something like JPEG (or others) to save disk space and memory usage? Thanks.

BTW, I am running this in Mac OS X 10.6.7.


texts: Is there a way to evaluate how realistic an r.drain-generated ideal walking path is in the real world?

texts:
I generated an idealized walking path between two points using terrain data and r.drain.

I'm attempting to visualize the pathway that may have connected two sites occupied in antiquity.
However, humans are of course not machines, and I could be missing a completely different path around a mountainous terrain because its "cost" is slightly higher than the ideal path, however, a human pathfinder may be completely oblivious to the more efficient path because the time savings is relatively meaningless.

Is there a way to iterate paths?  To generate, for example, all the paths that fall within +/-10% of the travel time of the ideal path?


texts: nngeo- nearest neighbor with distance dataframe

texts:
I'm working with some spatial data and I want to turn the output of the st_nn command (outputs a list) into a data frame that I can join. For example

library(nngeo)
library(tidyverse)

cities <- cities
towns <- towns

nearest <- st_nn(towns, cities, returnDist = TRUE, k = 2)

The output of the list give me the unique ID of the two nearest cities and also the distances for those cities. I would like this as a tibble with the following columns: 1) nearest_id, (2) nearest_distance, (3)second_nearest_id, (4) second_nearest_distance.

Here is what I tired

tibble(col1 = unlist(nearest[[1]]), col2 = unlist(nearest[[2]])) %>%
  rowid_to_column(., "row_id") # for joining later on

I need to find a way to keep the id/distances for the two nearest neighbors separate and give the id/distances each its own column. I tried a st_join with st_nn but that doesn't return distance.


texts: How to define filter in WFS layer in order I can show new filter result layer for new filter condition (i.e.redraw the layer according to filter)

texts:
I am using OpenLayers 2.12 for this WFS filter purpose. I wanted to redraw filter layer as conditions in filter changes dynamic.

Following is my code in for WFS:

 var ty=OpenLayers.Filter.Comparison.EQUAL_TO;
   var propertyOP="name";
    var valOP="buil2";
    build1 = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        filter: new OpenLayers.Filter.Comparison({
            type: ty,
            property: propertyOP,
                value: ValOP
        }),
        protocol: new OpenLayers.Protocol.WFS({
            srsName:"EPSG:4326",
            version: "1.1.0",
            url:  "http://localhost:8080/geoserver/sol/wfs",
            featureType: "ch",
            featurePrefix:"sol",
                featureNS: "http://localhost:81/sol"/*,
            geometryName:"geom"*/
        }),
        projection: geographic,
        styleMap: styleMap
        });
    map.addLayer(build1);

Now I wanted to make this filter to update and show new filter layer result. In my current code previous filter result remain but show result on previous result. My Filter type,property and value get changed.


texts: pgr_dijkstra select shortest path for pairs

texts:
I have a a set of start and end nodes in a table
best_routes

start_vid | end_vid
-------------------
1        |   7
2         |   8
3         |   9

I want to use pgr_dijkstra to create shortest paths for the group of pairs of source and targets, many-to-many creates too much redundant data so essentially I want one-one-one paths for the whole set of pairs
e.g.
SELECT * FROM pgr_dijkstra(
    'SELECT id, start_vid as source, end_vid as target, mincost, reverse_cost FROM edge_table',
    best_routes.start_vid, best_routes.end_vid

been stuck for hours please help,


texts:
How can we match the Landsat 1 MSS and Landsat TM, ETM + and OLI bands?

I have a scene of 1973, but on this one, there are only the bands 4, 5, 6, 7 and the bands T2_BQA and T2_VER, unlike the other sensors where one has the bands B1, 2, 3, 4, 5, 6, 7, etc.
it is to say to make the composition colored in natural color or false color of L1 MSS


texts:
I use arcpy to load all layers in the current map document, and I need all layers but not the last one (this is my layer for the symbology template).

How can I access the length or count of the layer list or another way to exclude the last layer?

I already tried to use length and count, but it did not work.

My code so far:

arcpy.env.overwriteOutput = 1
mxd = arcpy.mapping.MapDocument("CURRENT")
lyrList = arcpy.mapping.ListLayers(mxd)
for lyr in lyrList:
    #for each layer, but not the last one
    #do something


texts:
Is there a better way to do this?

I'm trying to create a script that will change classifications of a raster to:

0 for:  0,7-9,15-20,40,62-63,73,78-87,89-130,132-151,153-175,177-203,215,228,251-253

1 for:  all others

#RECLASSIFY LANDCOVER
#Considers 0 for:  63,81-83,87,111-112,121-124,141-143,190,195,
#Considers 1 for:  All others.
#Considers "NODATA" for:  background, blank
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = r'C:\Erosion\LandCover'
outReclass1 = Reclassify("CDL_2014.tif", "Value",
                         RemapRange([[0,0,"NODATA"],[7,9,"NODATA"],[15,20,"NODATA"],[40,40,"NODATA"],
                                     [62,62,"NODATA"],[63,63,0],[73,73,"NODATA"],[78,80,"NODATA"],[81,83,0],
                                     [84,86,"NODATA"],[87,87,0],[89,91,"NODATA"],[93,110,"NODATA"],[111,112,0],
                                     [113,120,"NODATA"],[121,124,0],[125,130,"NODATA"],[132,140,"NODATA"],
                                     [141,143,0],[144,151,"NODATA"],[153,175,"NODATA"],[177,189,"NODATA"],
                                     [190,190,0],[191,194,"NODATA"],[195,195,0],[196,203,"NODATA"],
                                     [215,215,"NODATA"],[228,228,"NODATA"],[251,253,"NODATA"]]), 1)
outReclass1.save(r'C:\Erosion\Output\CDL_reclass.tif')

I was attempting to modify the script from the ArcGIS Resource Center Desktop Help.


texts: Creating label formatted like " 1,000' " from numeric field?

texts:
This question builds on a previous question I came across at gis.stackexchange:
How to easily edit attribute data using Regular Expressions?

Perhaps someone can point me in the right direction?

I have a vector shapefile of contour lines. In the attribute table I have already converted a field called FEET consisting of integer data containing elevation values to a string field called Label. Additionally I successfully appended a ' to the end of the string so that when the data is labeled it will be read as feet.

The next thing I am attempting to do is to insert a comma between the first two values of the string only if the string length is greater than 4, or so that a comma will only appear between the thousands and hundreds digits in the Label field. The length has to be greater than 4 because I'm also counting the '

My code so far is:

case when  length( "Label") >4  then regexp_replace( "Label", '^([0-9])+([0-9]{3}\')$','$1 , $2') else "Label" end

however the regexp_replace function doesn't seem to accept the group variables $1 $2 in the 3rd parameter of the function.

I've looked at http://docs.python.org/2/library/re.html as the field-calculator regex is from what I understand based on python's use of regex but haven't been able to figure this out. Maybe what I'm attempting to do isn't possible yet with this function in field calculator in QGIS 1.8 on mac OSX. Or more likely my syntax is wrong as I'm a novice programmer and somewhat new to regular expressions.


texts: Origin server not finding current representation for target resource when using GeoServer?

texts:
I installed Java 8, Tomcat 8.5.12 and GeoServer 2.11.2. When I navigate to localhost:8080/geoserver it is giving me this weird 404 error:

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

The Tomcat logs show:
SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.startInternal Context [/geoserver] startup failed due to previous errors

Why is the GeoServer (/geoserver) servlet failing to start or where else I can look to determine why?


texts: Convert x,y,z origin of SRS to longitude and latitude and place on map

texts:
I have a file with this metadata -
<ModelMetadata version="1">
<!--Spatial Reference System-->
<SRS>EPSG:32636+5773</SRS>
<!--Origin in Spatial Reference System-->
<SRSOrigin>700137,3489675,0</SRSOrigin>
<Texture>
    <ColorSource>Visible</ColorSource>
</Texture>

I try to place the point of the SRS on map.
During the search of how to do this I encounter several question :

I notice The EPSG combined from two number- 32636+5773 i don't understand what represent the summation of them.
I figure out that one represent horizontal system coordinate (32636) and one represent vertical (5773)
but I don't understand the meaning of the summation and most important how I relate it when I  configure the system coordinate I work with on the map.

The SRS origin is in format of x,y,z vector. How can I transform it to longitude and latitude format in order to find this location in map like Google maps?


texts: Change marker size in plot with GeoPandas

texts:
I have a geodataframe with points and some associated data. I want to plot it on a map using geopandas and have the size of the points correspond to one of the columns in the geodataframe.

So far I have the following code:

base = world.plot(color='white', figsize=(20,10))
geo_df.plot(ax=base, marker='.', color='red', markersize =
geo_df['Pop_2005'])
plt.xlim([-85, -60])
plt.ylim([-5, 12.5]);

But I'm getting the following error: TypeError: cannot convert the series to <class 'float'>

Any ideas?


texts: "Error" on Advanced Digitizing Window in QGIS

texts: I have the word "Error" that has appeared on my Advanced Digitizing Panel since upgrading to QGIS 2.12.0 Lyon. It doesn't appear to actually affect anything negatively... has anyone else seen this or know what might be causing it?


texts: Why do odyssey.js info bubbles recentre the map?

texts:
I'm using Odyssey.js (scroll) and have created a map with info bubbles when the user clicks on features. On the initial load everything works fine. However, scrolling to the first header means that when I click on a feature the map recentres on somewhere in the Antarctic before showing the info bubble. Has anyone else experienced this problem and is it a known bug within Odyssey?

Here's the map so you can try it for yourself:

http://www.burdgis.com/blog/map/global-palm-oil-production/


texts: Could not access file "$libdir/postgis-2.4": No such file or directory

texts:
When trying to make the postgis_tiger_geocoder extension and running 'make installcheck' I get the following error:

could not access file "$libdir/postgis-2.4": No such file or directory

Searching for 'postgis-2.4' proves that it does not exist.

I get the same error if I try to install the extensions into a database through the psql interface.

I have seen one ticket with the same problem on this site and the answer was to re-install the software with a different version, but I was hoping there was a more targeted solution. There seem to be so many incompatibilities to overcome that re-installing the software seems likely to solve one problem but then present me with a whole list of other problems.

I have installed postgreSQL 9.6.9 and postGIS 2.4.5.


texts: How to fix the placement of an SVG marker in QGIS?

texts:
Currently, I'm trying to apply the things I've learned from this GIS.SE question to include an SVG marker of a looped arrow in my map. Here is the code for the SVG file in question:
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27.9mm" height="27.9mm" version="1.1" viewBox="0 0 27.9 27.9" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="#d40000" stroke-width="2.23">
<path d="m26.8 13.9a12.8 12.8 0 01-10.6 12.6 12.8 12.8 0 01-14.3-8.22 12.8 12.8 0 015.6-15.5 12.8 12.8 0 0116.2 2.81" stop-color="#000000"/>
<path d="m24.7.472-.434 5.65-5.58-.401" stop-color="#000000" style="font-variation-settings:normal"/>
</g>
</svg>

which has been kindly provided to me by Billy Kerr. This is what it normally looks like (in a slightly different color scheme) :

Although I'm content with how the SVG looks, I'm having trouble getting the placement right in QGIS. When I load it as a marker, this is what I see:

As one can see in the top left corner of the image, only a part of the SVG file can be discerned properly. It seems to show the beginning and the end of the loop.
I've tried correcting the placement of the SVG by adjusting the rotation and offset parameters, but that does not help much. I always get to see only a part of the looped arrow.
Question: How can I improve the placement of the SVG of the looped arrow, so as to make it visible as a whole?


texts: Is there a plugin or another way to quicky edit the attribute features in QGIS?

texts:
I want to edit the field "name" of several roads in QGIS 2.14.

How to do it very quickly?

Currently I select with "Identity feature" tool that open Form Feature Attribute, then with the mouse I must search the "name" field, type new name and hit enter, but the form stay open in the background.

There's a way when I select the feature jump right to the "name" field, start typing right away and close the form?


texts: Calculating proportional area of polygon covered by circle

texts:
I have two layers here (ignore the green layer), blue polygons and black circles. I want to calculate for each circle, what percent of the each of the blue polygons does it cover. For example, the circle closest to the top right of the image covers 100% of that small dark square polygon, and about 1% of the huge lighter blue polygon on top. Each circle would need potentially multiple attributes since each circle can cover multiple polygons.
The end goal is to estimate (assuming uniformity) how many locations fall into each circle. If a polygon contains 100 locations and is equally covered by two circles, each circle would then have an estimated 50 locations each


texts: Alerts in Earth Engine app not appearing when embedded in a Google Sites website

texts:
I have published a script in the Earth Engine javascript editor as a GEE app. Included in the code are several alerts to guide users as they interact with the app. The way the app is designed, a user selects a year from a dropdown menu, then can click the map to get data at that point from the selected year. If the map is clicked with no year selected, a message pops up. Here is a (non-runnable) snippet:
map.onClick(function(coordinates) {
  if (waterYearDropdown.getValue() < 10) {
    alert('Please select a water year to display SCF and SDD data at your selected point.');
  }
  else {
    // other stuff
  }
});

All the alerts work as expected with I visit the app at the users.earthengine.app page. Here is the popup from the previous example:

My issue is that the alerts do not appear when I interact with the app embedded in a Google Sites website. I followed the instructions in this article to build the website. The app was successfully embedded in that I can interact with the dropdown menus and other widgets, but the alerts no longer appear when they should. I'm not sure how to diagnose this issue as this is my first time using Google Sites.


texts: Using Quality Control process for MODIS Leaf Area Index?

texts: Anyone can help in explaining how I can apply Quality Control (QC) for MODIS Leaf Area Index (LAI) to extract the valid pixels of LAI using ArcMap?


texts: Why is part of the MODIS (MOD09) Swath missing?

texts:
I have been using the WorldView web application to identify clear sky days to download MODIS images. However there are some instances where I see a clear day image, then download the MOD09 product and there is a stripe of no data across my area of interest.

I understand that areas can be missed due to the orbit the satellite is on, but why am I seeing a clear image on the WorldView but not in the MOD09 product for the same day? Not the same image??

Take for example the 22nd June 2015 shown on worldview here. A bit of cloud around but I can see the snow pack on the NSW snowy mountains. Then when I download the MOD09 product from here (I need to merge two tiles H29 V12 and H30 V12 for my area) I get a big stripe of no data through my area of interest shown in the image below.

How do they come up with an image in worldview? It doesn't appear to be the Aqua image (as far as I can tell anyway), is there another tool which would be better for previewing an area before downloading the MOD09 product?

Since using the new preview method I mention in the comments below I still see issues like this here (South Eastern Australia is missing coverage), and it happens periodically some day fine and others not but always that section.

What's causing this?

Is there another resource I could use to get the MOD09 product for this area?


texts: Work flow for georeferencing imagery using open source tools?

texts: Does anyone have a recommendation for a work flow for georeferencing high resolution aerial photography using open source tools?  Comparison of user friendliness and robustness between Quantum GIS versus GDAL?


texts: Saving project from QGIS to CD so it can be used on other computers?

texts:
For purpose of a project, I created a project in QGIS - aerophoto base and 3 layers. It works perfect on my computer, but if I save it on CD, the project doesent work on any other computer... I saved all data for layers & project works from CD, but only on computer, where it was created.

How can I save it, so it will be working on other comps, since I have to distribute this project to other partners?

I am using windows and QGIS 1.8.0. Lisboa

EDIT & MORE INFO:
my project is aerophoto based with one raster and 2 vector layers.
It works on my comp (where QGIS 1.8.0 Lisboa is installed).

Now I need to put it on USB (and few on CD), so I can take to my menthor and cooperants to see it...
I copied all data (those are in same folder), I downloaded the QGIS Lisboa (.exe file) so everyone can install it. Now all is on usb.
It works on my computer, where this was created.
But when I try to see it on laptop (after installing QGIS), it serves me with error (runtime error) - same on my friend computer.

Proposal to make a USB option of qgis is nice, I am in a process of trying, but i suspect there is something else, because error is reported.

if possible, step by step solution, because I am comp analphabet actually :(


texts:
I'm having a hard time to get my vector features showing as i would like to.
I have a geojson file with polygon which overlaps. They are generated with OpenTripPlanner and the features are isochrones.

I have made a small test like this which looks as it should but is not transparent:

If I set opacity to 0.4 i get this:

Is there a way? - I would like to just request the polygons from the opentripplanner api.

EDIT:

Here is some of the styling I'm doing:

var red = [255, 0, 0, 1]
var green = [0, 255, 0, 1]
var blue = [0, 0, 255, 1]

var interval_Isochrone = {
    300: red,
    600: green,
    900: blue
}

var defaultStyle = new ol.style.Style({
    fill: new ol.style.Fill({
    color: [255, 0, 0, 1]
    }),
    stroke: new ol.style.Stroke({
    color: [255, 255, 255],
    width: 1
    })
});

var styleCache_Isochrone = {}

function styleIsochrone(feature, resolution){
    var tid = feature.get('time');

    if (!tid || !interval_Isochrone[tid]){
    return [defaultStyle];
    }

    if (!styleCache_Isochrone[tid]){
    styleCache_Isochrone[tid] = new ol.style.Style({
        fill: new ol.style.Fill({
        color: interval_Isochrone[tid]
        }),
        stroke: new ol.style.Stroke({
        color: [0, 0, 0],
        width: 1
        })
    });
    }

    return [styleCache_Isochrone[tid]];
}

geojson = new ol.layer.Vector({
      source: new ol.source.Vector({
        url: 'isochrone.json',
        format: new ol.format.GeoJSON()
      }),
      style: styleIsochrone
    });


texts: Unable to use bold font in QGIS print composer

texts:
I want the title of a legend in the print composer to be in bold font. If I change the font to be italic in the item properties font dialog the output becomes italic but if I change it to bold it does not change. I have tried numerous font types.

I am using QGIS 2.18 on macOS High Sierra 10.13.6. I have enabled bold layer names in the print composer settings.

What can be the problem?


texts: How can the scale be projected correctly in Quantum GIS when it is imported from google earth (KML) files?

texts: While importing KML files from google Earth to Quantum GIS, the scale is not being projected properly and the area of a particular selected feature is not being calculated in the attribute table by the field calculator. How can the area of a selected feature be calculated by the field calculator, as right now it is showing up zero as the value?


texts: Unable to deploy add-in updates (ArcGIS Explorer build 2500)

texts:
I'm having trouble deploying updates for an add-in developed for AGX Desktop (build 2500).

The initial deployment is fine.  If I copy my addin.eaz file to the ‘C:\Users[user]\AppData\Roaming\esri\arcgis explorer\Addins' folder, then start AGX, it works as expected.

Replacing the original add-in with an updated version doesn't seem to work as the described in the documentation:

  When a new add-in file is found in this location by ArcGIS Explorer,
  it will unpack the contents of the file into a cache. ArcGIS Explorer
  will check if any add-ins have been updated in this location on
  startup, and if necessary unpack the updated files so that the latest
  version is used.

If I just overwrite the original .eaz file with an updated version, then start AGX, the new version is ignored.

Confusingly, if I rebuild the project in Visual Studio then start AGX, it works fine.  The build information in Visual Studio shows that the new .eaz file was copied to the AddIns folder mentioned above.  Why this works after a build and not when I manually copy the .eaz file is a mystery (on a different machine).

The only way I can get this to work is to manually remove the add-in within AGX, then start and stop AGX, then copy the updated .eaz into the AddIns folder, then start AGX again.

Does anyone know of any restrictions when deploying updates, or have I missed something?

Thanks,
Glenn


texts: Converting *.lyr file to shapefile or raster using ArcPy?

texts:
I am using ArcGIS Desktop 10 and Python 2.6.5.

i have created a "test.lyr" file, now i want to convert it either to shape file or raster file. i have created the "test.lyr" from "test0.tif" and added symbology from "test0.lyr" files as follows.

 arcpy.MakeRasterLayer_management(tifFile,tmpFile,"#","","#")
 arcpy.SaveToLayerFile_management(tmpFile,curFile)
 arcpy.ApplySymbologyFromLayer_management(curFile,symbologyLayer)

the curFile in the above code is the test.lyr file obtained.

Can anyone show how to convert it to "test1.shp" or "test1.tif" file using arcpy?


texts:
I'm trying to display SRTM15PLUS netcdf grid (topo15.grd) with different software (QGIS, ArcGIS, IDV) but I always get the same messed up result.
Any suggestions?
SRTM15PLUS grid is available here: ftp://topex.ucsd.edu/pub/srtm15_plus/


texts: How to join nodes when editing a boundary?

texts:
Using QGIS 2.8.2, I have the following layer:

I'd like to remove the white strip and have each end closed off. Looking more closely, I need to join the nodes at each end as shown in red pen, such that the white area is now shaded yellow like the rest:

I am at a total loss on this one. I've tried the various geometry tools, but nothing seems to work. I think this should be easily done?


texts: exporting metadata from gps camera to spreadsheet

texts:
I have a question involving exporting metadata from a GPS camera to an application such as a spreadsheet.

In essence, I'm working with a significant number of images taken with a GPS digital camera. The GPS coordinates are embedded in the metadata that is accessed when you open the “properties” tab on the jpg file.

Is there a computer program or tool available that can extract that metadata automatically and put it into a file that can be manipulated (e.g., put the GPS coordinates in a spreadsheet)?


texts: How to set center of map in ArcGIS API for JavaScript using Lat Long?

texts:
I am using Arcgis javascript API for my map where map is coming from arcgis online using map by ID.
    Now I want to set map center using Lat long,For this I am using this method to set map center

   map.centerAt(42.58,78.25);

But this method is not working for me.
Does anybody know how to set map center using Lat Long In Arcgis javascript API.


texts: minimum number of pixel points for regression on atmospherically corrected satellite images

texts: I am performing atmospheric correction on a Landsat 8 image using different methods to check which one works best (in order to proceed with further/subsequent analysis). Wondering if it's okay to use as low as 5 observations (pixel points) for regression analysis (to check for agreement between Landsat, dependent variable and MODIS Surface Reflectance, independent variable).


texts: Distributing object distance using ArcGIS Pro?

texts:
Is there any tool in ArcGIS Pro, which could help me arrange objects to my  desired distance?

As an example, to see you what I am trying to achieve. ( in example objects are in chaotic distances)


texts: How can I check the intersection from a line layer?

texts:
I have a line layer which represent streets and I would like to know where a line is not connected to other in their nodes.

I would like to find where the lines are like the two first images automatically, I need all the lines connected, if there's a plugin that do this or other tools.


texts: Download Sentinel-2 WMS layer using GDAL?

texts:
I want to download Sentinel-2 WMS layer from https://s2maps.eu/ using gdal_translate option. I have an XML file to fetch the image. But I am not getting a proper output. I believe it is due to the XML file which I am not an expert to fine tune properly. I can't find out where I went wrong.
<GDAL_WMS>
  <Service name="WMS">
    <Version>1.1.1</Version>
    <ServerUrl>https://tiles.maps.eox.at/?SERVICE=WMS</ServerUrl>
    <Layers>s2cloudless-2019</Layers>
    <SRS>EPSG:4326</SRS>
    <ImageFormat>image/jpeg</ImageFormat>
    <Transparent>FALSE</Transparent>
    <BBoxOrder>xyXY</BBoxOrder>
  </Service>
  <DataWindow>
    <UpperLeftX>94.9998611110000013</UpperLeftX>
    <UpperLeftY>26.9998611110000013</UpperLeftY>
    <LowerRightX>97.0001388889999987</LowerRightX>
    <LowerRightY>29.0001388889999987</LowerRightY>
    <SizeX>7201</SizeX>
    <SizeY>7201</SizeY>
  </DataWindow>
  <BandsCount>3</BandsCount>
  <UnsafeSSL>true</UnsafeSSL>
  <ZeroBlockHttpCodes>204,403,404,500,502,503,504</ZeroBlockHttpCodes>
</GDAL_WMS>

The output of gdal_translate -of GTiff wms.xml sent12.tif is like:

If I check the pixel size it is not 10m and is nearly around 28m. So how do I get the imagery with 10m resolution?


texts: Converting GPS from Google Earth to Google Maps?

texts:
So, I tried to take coordinated directly from google Earth kml output and use them in Google Maps, but the coordinates are different.

Google Earth output:

  <LatLonBox>
    <north>35.2414546011443</north>
    <south>34.54929167433407</south>
    <east>-81.5465662119679</east>
    <west>-82.32383816010319</west>
    <rotation>-1.452325961664849</rotation>
  </LatLonBox>

It is fairly close but not ideal. Is there spherical trignometry or something I could use?


texts:
Im trying to export a table from MSSQL to geopackage using ogr2ogr:

This is the exact command I try in windows terminal (but with real serv,db,user,pass ofc):

C:\OSGeo4W64\bin\ogr2ogr.exe -f "GPKG" C:/GIS/data/testdata/test123.gpkg MSSQL:database=somedbname;server=somesrv123;uid=userid;pwd=password;tables=sometable

I get errors:

  ERROR 1: Error initializing the metadata tables :
  [37000][Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE
  TABLE permission denied in database 'somedbname'.(262)

and

  ERROR 1: No column definitions found for table 'sometable', layer not usable.

What am I doing wrong? I can connect to the db in QGIS and ArcMap and add table to the map.

ogrinfo MSSQL:database=somedb;server=somesrv;uid=user;pwd=password;tables=sometable

  ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL
  Server Driver][SQL Server]CREATE TABLE permission denied in database
  'somedb'.
  and
  ERROR 1: No column definitions found for table 'sometable', layer not
  usable. INFO: Open of
  MSSQL:database=somedb;server=somesrv;uid=user;pwd=password;tables=sometable'
        using driverMSSQLSpatial' successful. 1: sometable

Adding the layer to QGIS and using OGR2OGR from QGIS generate errors:

  CMD.EXE was started with the above path as the current directory.

  UNC paths are not supported. Defaulting to Windows directory.

  ERROR 1: Error initializing the metadata tables :
  [37000][Microsoft][SQL Server Native Client 11.0][SQL Server]CREATE
  TABLE permission denied in database 'somedb'.(262)

  ERROR 1: No column definitions found for table 'sometable', layer not
  usable.

  ERROR 1: Couldn't fetch requested layer 'someschema.sometable'!


texts: Methods for converting a regular polygon grid to a numpy array

texts:
I have a regularly spaced model grid, 5000 by 5000 feet (517,300 cells), which I need to convert to a numpy array. I am investigation a couple of different methods, using arcpy, by which I can convert the grid to a numpy array using the values in a particular field. They are as follows:

Polygon to raster conversion followed by a raster to numpy array conversion, and
Iteration over the rows of the grid, pulling row/col indices from each row and assigning values to an empty array.

Neither of these methods seems to be particularly fast - is there a more direct way to use the regular geometry of my features to apply the values to an array more efficiently? I will need to run this process on multiple versions of my model to populate parameter arrays for each of the 9 layers with multiple parameters per layer. Any processing time I can gain will be helpful.

import os
import arcpy
import datetime
import numpy as np

arcpy.CheckOutExtension("Spatial")
arcpy.env.workspace = r'..\gis\geom.gdb'
arcpy.env.overwriteOutput = True

grid = r'..\gis\grid_5000ft_01.gdb\grid'

out_table = r'in_memory\{}'.format('TOP_sas')
arcpy.sa.ZonalStatisticsAsTable(grid, 'OID', 'geodas_fasft', out_table, 'DATA', 'ALL')

grid_lyr = r'in_memory\grid_lyr'
table_vwe = r'in_memory\table_vwe'
arcpy.MakeFeatureLayer_management(grid, grid_lyr)
arcpy.MakeTableView_management(out_table, table_vwe)
arcpy.AddJoin_management(grid_lyr, 'OID', table_vwe, 'OID_', 'KEEP_ALL')

print [field.name for field in arcpy.ListFields(grid_lyr)]

start = datetime.datetime.now()
arcpy.PolygonToRaster_conversion(grid_lyr, '{}.MEAN'.format('TOP_sas'), r'in_memory\ras', '#', '#', 5000.)
a = arcpy.RasterToNumPyArray(r'in_memory\ras')
print (datetime.datetime.now() - start) / 60.

b = np.zeros((739, 700), dtype=np.float)
start = datetime.datetime.now()
with arcpy.da.SearchCursor(grid_lyr, ['grid.row', 'grid.col', '{}.MEAN'.format('TOP_sas')]) as cur:
    for row in cur:
        (r, c, val) = row
        a[r-1, c-1] = val
print (datetime.datetime.now() - start) / 60.

a.savetxt('{}.ref'.format('TOP_sas_a'))
b.savetxt('{}.ref'.format('TOP_sas_b'))


texts:
If I copy my plugin locally to QGIS I have to tick a box in repository to see/load it.

Is there any way to make this "checking" automatically, such that when I start QGIS it will be already loaded?


texts: Extracting band names of RasterLayer in R

texts:
I have a RasterLayer with 500 bands in R (I exported the raster as a single image in Google Earth Engine, which was originally an ImageCollection).  I know you can extract the band you want to use by number:

raster("raster.tif", band = 1)
raster("raster.tif", band = 2)
# etc.

But I was wondering if there was a way to call the band by its name instead in R.


texts: Showing an Error in the code(d.fc is not a function)


texts:
This is a follow-up question to a previous post.  For some reason the following script in Arcpy does not want execute the command. Please see fields and script below. (All credit to Aaron for the script)

import arcpy, os

fc = 'Segments'

with arcpy.da.UpdateCursor(fc, ["Name", "Name_From", "Name_To", "OID@"]) as cursor:
    for row in cursor:
        if row[0] != None:  # Make sure there are no None type data

            # 1) Split strings by "&" and 2) remove leading/tailing white space
            cleaned = [x.strip() for x in row[1].split("&")] # "Name_From" field
            cleaned2 = [x.strip() for x in row[2].split("&")] # "Name_To" field

            # Tackling the "Name_From" field
            if row[0] in cleaned: # Make sure "Name" is in "Name_From" field
                cleaned.remove(row[0]) # Remove "Name" from field
                if len(cleaned) > 1:
                    new = ' & '.join(cleaned)
                    row[1] = new
                elif len(cleaned) == 1:
                    row[1] = cleaned[0]
                else:
                    print "There was a problem with OID %s" % row[3]

            # Tackling the "Name_To" field
            if row[0] in cleaned2: # Make sure "Name" is in "Name_To" field
                cleaned2.remove(row[0]) # Remove "Name" from field
                if len(cleaned2) > 1:
                    new2 = ' & '.join(cleaned2)
                    row[2] = new2
                elif len(cleaned2) == 1:
                    row[2] = cleaned2[0]
                else:
                    print "There was a problem with OID %s" % row[3]
        cursor.updateRow(row)


texts: ArcGIS Server 10.5 service conflicts with Remote Desktop login into Windows Server 2012 R2 machine

texts:
We are in the process of migrating to ArcGIS Server 10.5 and stuck with a strange issue:

ArcGIS Server 10.5 is installed in Windows Server 2012 R2 (virtual machine). Whenever I try to remote login to that machine using Remote Desktop it takes at least 20 minutes to login. But if I remotely stop the ArcGIS Server Service or change the Log on as a different user/refresh the service it logs in to Remote Desktop right away.

Have anybody seen this behavior?

I am also facing supplementary problems which I don't want to list as this is the critical one to be solved first.
Also, here is a list of things which I tried and failed:
1. Log On as ArcGIS Server service using a domain account (which works fine in our ArcGIS Server 10.3 production environment) has slow login to Remote Server (using Remote Desktop). When remotely changed the Log on as ArcGIS Server service to local account(and refreshed), Remote Desktop immediately logs in to the Remote Server. So, I though it has something to do with domain account.
2. Log On as ArcGIS Server service using a previous Local account again has slow login to Remote Server (using Remote Desktop). When remotely changed the Log on as ArcGIS Server service to local system account or domain account(and refreshed), Remote Desktop immediately logs in to the Remote Server. Now, it's clear that it has nothing to do with domain account or local account or local system account - but with ArcGIS Server 10.5.
Any thoughts?


texts: How to retrieve tiles from mbtiles in GeoServer?

texts:
I have installed the "GWC SQLite Plugin" and read the doc at http://docs.geoserver.org/latest/en/user/community/gwc-sqlite/index.html,
but not quite sure on how to set it.  In the doc, the ext is *.sqlite, but my mbtiles ext is *.mbtiles.

Is there anybody who have successfully done it?

I want to  publish the mbtiles as WMTS service and call it.


texts: Alternative to self.Destroy() for wxPython in Arcmap?

texts:
I have created a Python Add-in for ArcMap 10.4 that involves a wxPython UI to display upon a click on a map. The UI is populated with default values as well as a combobox displaying the layers on the map. It works perfectly the first time it is run, but the second time, it does not update to show the current layers and displays the last values entered rather than the default values I have specified.

I believe this to be because self.Destroy does not work with wxPython in ArcMap. I had previously worked around this by using self.Show(False), like an example I found here. However, I believe that when being run more than once, the script is only changing the visibility of the UI back to 'True' and not actually opening a new UI.

So, is there any alternative to using self.Destroy() to get rid of my UI?

Here is an example of my script:

import arcpy
import pythonaddins
import wx

class ToolClass2(object):
"""Implementation for DesignTool.tool (Tool)"""
    dlg= None
    def __init__(self):
        self.enabled = True
        self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.
        self.cursor=3 #set cursor to crosshair
    def onMouseDownMap(self, x, y, button, shift):
        global laylist
        laylist=[]
        mxd=arcpy.mapping.MapDocument("CURRENT")
        for lyr in arcpy.mapping.ListLayers(mxd):
           laylist.append(lyr.name)
        del mxd
        if self.dlg is None:
            self.dlg = TestDialog()
        else:
            self.dlg.Show(True)
        return

class TestDialog(wx.Frame):
    def __init__(self):
        wxStyle = wx.CAPTION | wx.RESIZE_BORDER | wx.MINIMIZE_BOX |wx.CLOSE_BOX | wx.SYSTEM_MENU | wx.CB_DROPDOWN
        wx.Frame.__init__(self, None, -1, "Design Form", style=wxStyle, size=(330, 370))
        self.SetMaxSize((330, 370))
        self.SetMinSize((330, 370))
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        panel = wx.Panel(self, -1)
        wx.StaticText(panel, -1, "Choose Layer:", pos=(8,64))
        self.LayerCombo = wx.ComboBox(panel, -1, value=laylist[1], pos=(180, 64), size=(120,21), choices=laylist)
        self.Bind(wx.EVT_BUTTON, self.OnSet, id=self.btnSet.GetId())
        self.Show(True)

    def OnClose(self, event):
        self.Show(False) # self.Destroy() doesn't work

    def OnSet(self, event):
        Layerpath= str(self.LayerCombo.GetValue())
        self.Show(False)

app = wx.PySimpleApp()
app.MainLoop()


texts: Geojson taking long time to load in google map from database

texts:
I am trying to load a GeoJSON file from a MySQL database but it is taking about 6-10 seconds to load the data into the map. This is what I have done so far.

I generate a GeoJSON file after doing a process which contains LineString geometries. The size of these files are about 4 to 5 MB. Then I store this data in a MySQL database. When I load the map I initiate the request of data from the MySQL database so that the data is in the client. I am currently using a button to load the GeoJSON into the map but it is taking long time (6 to 10 seconds).

I have seen some other posts similar to my issue which have suggested simplifying the geometry. But this is not an option for me right now.

Is there any other method to show this GeoJSON data faster?

I am showing data like this

var geojsondata = JSON.parse('data from mysql database already in the client side');
map.data.addGeoJson(geojsondata);


texts: How to read .asc format DEMs that have headers with #comments

texts:
I have around twenty 2 GB DEMs (xyz) in .asc format.

The header has 13 lines of metadata, and then the basic data in three columns

#
# The DTM grid had lower left (southwest) corner coords:
#     X or easting  = xxxxxxx.xx meters
#     Y or northing = xxxxxxxx.xx meters
# and grid intervals:
#     X (east)  grid interval = 2.0000  meters
#     Y (north) grid interval = 2.0000  meters
# For a total of 10001 x 2506 = 25062506 points.
#
# CE/LE = -9999.0000 /-9999.0000
# There may be less points in this file because those
# grid points that were outside of the polygon that
# defined the DTM boundary are not included in this file.
#

100000.0000 1000000.0000 500.0000
100002.0000 1000000.0000 500.0000
100004.0000 1000000.0000 500.0000
100006.0000 1000000.0000 500.0000
100008.0000 1000000.0000 500.0000
...and so on

I tried to open this file as grid in SAGA GIS and in ArcGIS, but with little success. Eventually I circled around this by converting the files to .txt then with lasTools to .las and furthermore to .tif, when I'm finally able to view the DEM. However, this seems a little bit too complicated. Are there any fast workarounds for correctly reading the file in to SAGA or ArcMap OR is there a fast way to manually edit the headers, e.g. to the format ESRI requires? My file size prevents me from editing them manually in notepad/wordpad or in other basic programs.


texts: Specifying precision and scale of new field using ArcPy?

texts:
I'm wanting to create a field with a maximum of 1 decimal place and then calculate a value into it: (I know that all my values are < 10)

arcpy.AddField_management('C:/shapefile.shp', 'myField', "FLOAT", 2, 1, "", "", "", "NON_REQUIRED", "")
arcpy.CalculateField_management('C:/shapefile.shp', 'myField', "[MEAN]", "VB", "")

It seems that no matter what I try I can't get the number of decimal places I want - I get the full value from the field I'm calculating from : [0.888889] and when I view the field properties I just see 0 for precision and 0 for scale.  The data context is ESRI shapefile.  And altering the numeric settings in the field properties is not an option.

Anyone have any ideas?


texts: How to select all dangling polyline features with Arcview license?

texts:
I have a city roads shp file and would like to identify (select) all the locations where a roads ends (in other words dangles). I am working in ArcView 10.

I do not want to use a topological tool such as ETgeowizards because it can detect and dangles but fixes them automatically with no further options to identify exeptions or even visualize where fixes occured (in my case I will have many exeptions). ArcEditor provides a good interactive environment for identifying which errors are expections - but I am trying to see if I can do this with just ArcView.

The approach I have been experimenting with is to try  to identify/select segments in the network that only touch one other segment. I thought the dissolve tool might be an option, but it doesnt look like it has the settings I want in the "unsplit lines" option...


texts: PostGIS ST_Intersects result is ignored by where condition

texts:
I have a simple query filtering by st_intersects function finding all lines intersecting with a polygon.

select *, st_intersect(graph_line, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')
from graph_schema.graph_line
where graph_id=<ID> and st_intersect(graph_line, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')

The problem is that for some data where a line is just a point the st_intersects returns false even though it intersects. Furthermore even when the result is false it is returned in the result.

Examples:

select st_intersects(st_geomfromtext('LINESTRING(480 270,480 270)')::geometry, st_geomfromtext('POLYGON((261 156,148 452,333 507,566 199,261 156))')::geometry);

returns false, but where condition does not filter it when the first parameter is taken from the table - and even when the object should spatialy intersect.

Is this because of the LINESTRING being just a point? Or what can be the problem?


texts:
How can one set google earth engine dictionary value to null?
The code ee.Dictionary.set('var', null) results in the error  Dictionary.set: Parameter 'value' is required.
I am mapping through an image collection and in some images the property I am setting is null, but i still need them, so I don't want to filter metadata.


texts: Fast intersection of a list of polygons with a bounding polygon using Shapely

texts:
I have a list of Shapely polygons which I need to find the intersection of each with a bounding Shapely polygon.

Not all the polygons in the list cross the boundary of the bounding polygon so I only need to calculate the intersection for those that do but my method is rather slow as I'm currently iterating over each polygon in the list.

My current code is below:

def intersect_polygons(poly, boundary):
    if poly.overlaps(boundary):
        poly = poly.intersection(boundary)
    return poly

# polygons is a list of shapely Polygon objects
# boundary is a shapely Polygon object
new_polygons = [intersect_polygons(p, boundary) for p in polygons]

The limiting step is checking to see if the polygons overlap as the intersection only happens for a small percentage of the polygons. Is there anyway to do this step without checking every polygon to speed this up? I've seen an rtree suggested as a solution for similar problems but I'm not sure whether one could be used here.

Here is what my input looks like before with the shaded hexagon as the bounding polygon I want to intersect all overlapping polygons with:

And here is what I want the output to look like, once the overlapping polygons have been swapped for their intersections with the boundary.


texts: Is there a tool to bulk convert loc files to gpx

texts:
Currently I am using GPSBabel to convert geocaching.com loc files to gpx files, since my navigation device does not support loc.

I have a lot of loc files to convert and I would like to know how I can convert all loc files in 1 folder with a few clicks, since doing it one by one costs a lot of time.

Shortly, I want a bulk loc to gpx converter

Moreover, it would be extra nice if their would be a way to let the filename match the name tag in the loc/gpx file?

If you need extra information to answer my question, please ask


texts: How get layerID or Layer name from marker

texts:
I can get marker but I want to get the layer ID or name from markers so as to filter markers.

var overLayers = [
{
    name: "Bar",
    icon: iconByName('bar'),
    layer: L.geoJson(Bar,{onEachFeature: onEachFeature}),
    group: "Bar",
    markerType:"accordion",
    active:true
}];

Get markers function

function getAllMarkers() {

 var allMarkersObjArray = []; // for marker objects
 var allMarkersGeoJsonArray = []; // for readable geoJson markers

 $.each(map._layers, function (ml) {

     if (map._layers[ml].feature) {

         allMarkersObjArray.push(this)
         allMarkersGeoJsonArray.push(JSON.stringify(this.toGeoJSON()))
     }
 })

 console.log(allMarkersObjArray);
}

Does anyone have a suggestion.


texts: What do the acronyms OBT and OCIP mean on a survey plan?

texts:
When looking at survey plans for British Columbia, Canada, there are various acronyms used to describe survey markers. Ones that I do know include:

BT - bearing tree
CIP - capped iron post
PP - "old-style" pipe post
OIP - original iron post

I am, however, unsure of the acronyms OBT and OCIP. Could they mean "original bearing tree" and "original capped iron post"? If so, what would the qualifier "original" refer to? A previous/different survey plan?
I cannot seem to find answers elsewhere on the 'net.

Per request in a comment, I added an image of the OCIP marking


texts: Centroid of multiple polygons based on value in attribute table

texts:
I have a (polygon) shapefile with multiple zones. Now, I would like to calculate the centroid of groups of these zones. The zones have to be grouped based on a value in the attribute table:

AreaNr  AreaName AreaChar
   1      Amst       a
   2      Delf       a
   3      Zeis       b
   4      Apel       c
   5      Deve       c

Now, I would like to group them by their string value in 'AreaChar' and then calculate their centroid. What I would like to end up with is thus the 'AreaChar' value and an X and Y value for its centroid.

I usually use QGIS, but I am open to using other software if necessary.


texts: Connection between output variable and calculate field

texts:
I want to use the calculate field function, to calculate which input comes an expression that should be connected with an output variable.

But I can't figure out how to do so.  And if it is possible to do so.

My model looks like this:

I use the get field value, to select a field from "soil_type", where I will get one value, that I will put in the calculate field function, so the field in the BS_SJ_Points will have the same value. I have already created a new field in BS_SJ_Points. All fields data_types is double.

%%% UPDATE %%%

So I have changed the model, and now it looks likes this:

And it almost works.
When I run the model through the edit mode, the model works and I add a new field to my shapefile with the wanted information.

As you can see, I have set up parameters, so the end user shouldn't go to the editor to make the model work but can just double tap the model and set the necessary parameters. When I try to run the model that way it is the wrong output I get. Either it is 1 or it is the value from when I run it in editor mode.

I assume there is something wrong with my field parameter or the information in the get field value function.
So what can I do to fix it, so you can run the model without entering editor mode?


texts: Programmatically change the template of the layout

texts:
Is there a way to change the layout with arcpy?

Here are images of the steps I want to do programmatically.

The file I want to choose already exists and I want to hardcode its path in the script.
I run ArcGIS 10.2


texts:
About to head out for a round of golf and wondered if there are any golf apps that use OSM as a background?

I live in a fairly remote, rural area, and I'm not sure how well the courses round here will be mapped. With OSM, of course, any problems I can fix myself.

So, anyone know? I'm using iOS for preference.


texts: How to open/display and extract NetCDF files info?

texts:
I am working with NetCDF files using R & Matlab and I would like to know if the GIS community is using them. I know that ArcGIS can open & display, however most of the times the results are not good, since the structure of the netcdf files is always different.

I would like to know what kind of software/add-ons are you using to open & display netcdf files? do you extract any geographic+time series info?


texts: Can’t import any python modules in Jupyter notebook with newly created environment, ImportError: DLL load failed: specified module could not be found

texts:
(base) C:\WINDOWS\system32>conda activate agrodss
(agrodss) C:\WINDOWS\system32>python
Python 3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

from geocube.api.core import make_geocube
import geopandas
import gdal
exit()

(agrodss) C:\WINDOWS\system32>python
Python 3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

from geocube.api.core import make_geocube
import geopandas

i can import the modules using anaconda prompt
but i am unable to import the same modules in the jupyter notebook
although i have added the ipykernel to newly created environment

import geopandas
import pandas

ImportError                               Traceback (most recent call last)
 in
----> 1 import geopandas
2 import pandas
~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_init_.py in
----> 1 from geopandas._config import options  # noqa
2
3 from geopandas.geoseries import GeoSeries  # noqa
4 from geopandas.geodataframe import GeoDataFrame  # noqa
5 from geopandas.array import points_from_xy  # noqa
~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_config.py in
124 use_pygeos = Option(
125     key="use_pygeos",
--> 126     default_value=_default_use_pygeos(),
127     doc=(
128         "Whether to use PyGEOS to speed up spatial operations. The default is True "
~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_config.py in _default_use_pygeos()
110
111 def _default_use_pygeos():
--> 112     import geopandas._compat as compat
113
114     return compat.USE_PYGEOS
~\Anaconda3\envs\agrodss\lib\site-packages\geopandas_compat.py in
4 import warnings
5
----> 6 import pandas as pd
7 import shapely
8
~\Anaconda3\envs\agrodss\lib\site-packages\pandas_init_.py in
15 if missing_dependencies:
16     raise ImportError(
---> 17         "Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
18     )
19 del hard_dependencies, dependency, missing_dependencies
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

The Python version is: Python3.7 from "C:\Users\hp\Anaconda3\envs\agrodss\python.exe"
The NumPy version is: "1.19.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: The specified module could not be found.


texts:
I'm looking for suggestions of interactive exports from GIS software. The need for this research is that many of our customers either do not have access to GIS or the knowledge to use it.

One method I have explored is the use of Interactive PDFs. But the set up of these is particularly difficult as the outputs contain a huge number of layers!

Do you know of any other exports which for example have points linked to table of data when clicked on?


texts: Adding layer as input with code of OpenLayers / GeoExt using GeoServer?

texts:
I try to develop a GIS app with raster data.
I have integrated the code of the following openlayers example in
my app.

http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/wps.html

I have built my app's interface, using the code from the following GeoExt's example:
http://api.geoext.org/1.1/examples/wms-tree.html

I have uploaded my raster data on GeoServer.
The piece of code from the openlayers' example that add the raster image in the input form is the following:

function addRasterInput(input) {
    var name = input.identifier;
    var field = document.createElement("input");
    field.title = input["abstract"];
    var url = window.location.href.split("?")[0];
    field.value = url.substr(0, url.lastIndexOf("/")+1) + "data/tazdem.tiff";
    document.getElementById("input").appendChild(field);
    (field.onblur = function() {
        input.reference = {
            mimeType: "image/tiff",
            href: field.value,
            method: "GET"
        };
    })();
}

I'm trying to modify the above code so that, when the user check a raster image from the GeoServer Demo WMS, (the folder that retrieve data from an xml GetCapabilities
file and it is displayed to the left side of the screen) to be added to the input form.

How can I do this ?


texts: why are my buffers not lining up with their original points despite setting the layer crs as all the same crs when I reopen my project

texts:
I am having my entire project in pseduo mercator (google earth raster image) and when I create buffers for points and then open back up my project all the buffers are offset from their points.

Update: pseudo-mercator-error

So my buffers I got to line up with their original centers, but other points that I meant to place within proximity were offset. I think it has something to do with meters and relative buffer distance being the reason why the buffers were fixed, but not some of the points.


texts: Copy/convert selection into filter/query builder of QGIS?

texts:
Can anyone tell me if it is possible (and how) to convert or copy a selection on a layer (that has not been created through "select by expression", but instead by irregular selections from a canvas, or a combination of methods) in to the filter/query builder.

OR: If i have made a selection of features not based on a "selection query" or "select by expression" process, but simply by selecting them from the canvas in an irregular fashion ... I want to know if i can take that irregular selection and turn it into a "filter"? (I know i can "save as" a new layer - but I am trying to avoid having to do that) by simply clicking a button/command or something similar and "pasting" it in the query builder to create a filter?

The benefit of this feature would make progressive/iterative selections of selections quicker and without having to "save as" lots of new files ... or potentially lose them if they are just memory layers.

... beyond progressive/iterative, the important thing is to be able to attempt various selections on an initial selection before been satisfied and moving to the next stage.


texts:
I opted to use gp.GetCount in my script. This raises an exception, though the process completes "successfully" while returning zero features (which is untrue). I'm wondering how this could be. Using ArcGIS 9.1 and Python 2.1.

file = open(txt).read().splitlines()
for line in file:
    query = "[FIELD] = \"%s\"" % line
    if line[:].isdigit():
        gp.SelectLayerByAttribute("lyr1", "ADD_TO_SELECTION", query)
result = int(gp.getCount("lyr1").getOutput(0))

gp.Append("lyr1", "featureclass", "NO_TEST")
gp.DeleteFeatures("lyr1")
gp.SelectLayerByAttribute("lyr1", "CLEAR_SELECTION")

Output looks like..

Execution GetCount lyr1 0
Row Count = 0
Executed Successfully

Frankly I just want to check if my feature layer (created with makefeaturelayer) is null.


texts: DLL Load Failed: The specified module could not be found -Anaconda 3 on win10

texts:
I know that this question has been asked a lot (e.g., here, here, here, and here), but none of the solutions worked for me.

I downloaded the latest Anaconda version (file name - Anaconda3-2018.12-Windows-x86_64.exe). I've installed it on Windows 10. I've create virtual environment with python version 3.7 and installed gdal and rasterio via conda forge and conda rasterio.
I've also installed jupyter notebook in that virtual environment with:

pip install ipykernel
python -m ipykernel install --user --name=myenv

Now, when I open jupyter notebook I can see this environment in the kernel, but when I try to import gdal or rasterio I get:

I've tried to add Anaconda paths to system path (as suggested in other questions), I've uninstall, reinstalled (with and without the add to system path check box) and reboot several times.

I really don't know what is the problem now. Should I use other versions of Conda? if so, which one?


texts: Hide layers by default on CartoDB visualization

texts:
I'm loading a CartoDB visualization and I want all layers to be switched off as the default setting, so users have to switch them on using the layer selector loaded with the visualization.

I'm reallly new on leaflet and cartodbjs so not sure where to begin to dive in the code. I think is related with this question but it doesn't have any answer.

I have a sample code on gist (demo).


texts: Points symmetric location (informational question)

texts:
I am working with a huge data set and having plotted/imported them through the QGIS I see the following:

As one can notice, points are almost perfectly distributed which is not real, because points are representing car/people location.

I have doubts that QGIS doing that in order to show all points without overlapping.

Is it possible to see a reallocation while zooming on the map? (when I am zooming out the map, points are distributed in a real way)


texts: Zoom to a specific location in ArcMap Viewer window using ArcObjects

texts:
I'm trying to find out how to open Viewer window (menu Windows->Viewer in ArcMap) programmatically and zoom it to a specific location. This is how I can open it:

IDataWindowFactory dwf = new MapViewerWindowFactoryClass();
IDataWindow dw = dwf.Create(mArcMap);   // typeof mArcMap is IApplication

and to show it:

dw.Show(true);

but I can't find a way to set the initial extent when opening the viewer window or at least how to change it after it is loaded.

Problem solved by using IMapInsetWindow interface.

IDataWindow2 dw = this.createDataWindow(new MapViewerWindowFactoryClass());
IMapInsetWindow mapInset = dw as IMapInsetWindow;
mapInset.MapInset.VisibleBounds = extent;

dw.Show(true);


texts: OpenLayers: line elevation profile with slider

texts:
I have an OpenLayers client displaying tracks from a vector source. I would like to display an elevation profile of the track. When hovering mouse on a point on the elevation profile, a marker should appear on the corresponding map point. Are there any online resources on building this?

Tutorial for a similar control in Google Maps API

Example of page using the control


texts:
I know how to move a point feature to a new location based on an updated XY coordinate. For example, joining an Excel or dbf table with the new XY cords to the production feature class attribute table based on a common unique identifier. When I export the combined tables (now 1 feature class) I use the following Python code.

def XYsetVALUE( shape, X_value, Y_value):
     point = shape.getPart(0)
     point.X = X_value
     point.Y = Y_value
     return point

XYsetVALUE ( !Shape! , !POINT_X! , !POINT_Y! )

However, if I try to use this code before exporting the joined tables it does not allow me to move coords. I keep getting an error message. I do need to move features and NOT export the tables together, I need to update the XY coords and move the point features only when the tables are joined.


texts: How can I use Leaflet with esri-leaflet and ArcGIS Online services

texts:
I've used public ArcGIS Online services plenty of times in ESRI JS web apps and I imagine that using them as layers in Leaflet is pretty much the same. The one problem I can see is how would one access a private service? In the ESRI JS api provides an Identity Manager to facilitate OAuth and cookie handling. Leaflet provides no such facilities.

Has anyone done this?


texts: How to deal with data-defined SVG paths in a project used on Windows and Linux?

texts:
I have a project QGIS used in both Linux and Windows, synchronizing the working directory with dropbox. The project uses relative paths, so that the directory structure is observed only from the parent folder of the project.

Everything works fine except when I try to use a style with a "marker SVG" where I use to define "myFile.svg" that represent "defined by data properties".

The problem is that if I write the path of file in Windows format (path with backslashes), Linux (path with common bar) does not work and vice versa.

Is there any function to translate paths depending on the operating system used for?  Or is there any way of knowing, in the expression editor which OS I'm using? I solve the latter case using a "case" and setting the appropriate path in each case.


texts: Calculating mean recapture distance between points

texts:
I have a series of coordinates associated with ID and date (these points represent individual recaptures of individuals at different locations). I want to joins lines between the sequential recaptures of these individuals to 1) visualise their movement, and 2) calculate metrics such as mean distance moved by each individual.

Points2One seems like the best was to do it but is not available on QGIS3. I tried the function points to path, but this did not connect the points in the correct order, and additionally turns everything into one line which is not what I want.

e.g.


texts: Populating attribute field with Python function using PyQGIS

texts:
I'm working with PyQgis in version 2.18 and have a number of coordinates in WGS84 (decimal degrees) that I would like to convert to degrees, minutes, seconds (DMS) programmatically. I began by writing a Python function as follows:

from qgis.utils import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
import math

layer = iface.activeLayer()

#creating my new dms fields called 'LONGITUDE' and 'LATITUDE'
myField_1 = QgsField( 'LONGITUDE', QVariant.String)

layer.dataProvider().addAttributes([myField_1])
layer.updateFields()

fed = layer.fieldNameIndex('LONGITUDE')

myField_2 = QgsField( 'LATITUDE', QVariant.String)

layer.dataProvider().addAttributes([myField_2])
layer.updateFields()

det = layer.fieldNameIndex('LATITUDE')

#creating the function
def dd2dms(longitude, latitude):
    layer.commitChanges()
    split_degx = math.modf(longitude)
    degrees_x = int(split_degx[1])
    minutes_x = abs(int(math.modf(split_degx[0] * 60)[1]))
    seconds_x = abs(round(math.modf(split_degx[0] * 60)[0] * 60,2))

    # repeat for latitude
    split_degy = math.modf(latitude)
    degrees_y = int(split_degy[1])
    minutes_y = abs(int(math.modf(split_degy[0] * 60)[1]))
    seconds_y = abs(round(math.modf(split_degy[0] * 60)[0] * 60,2))

    # account for E/W & N/S
    if degrees_x <= 0:
        EorW = "W"
    else:
        EorW = "E"

    if degrees_y <= 0:
        NorS = "S"
    else:
        NorS = "N"

    # abs() remove negative from degrees, was only needed for if-else above
    print "\t" + str(abs(degrees_x)) + u"\u00b0 " + str(minutes_x) + "' " + str(seconds_x) + "\" " + EorW
    print "\t" + str(abs(degrees_y)) + u"\u00b0 " + str(minutes_y) + "' " + str(seconds_y) + "\" " + NorS

features = layer.getFeatures()

layer.startEditing()

#
for feat in features:
    name_1 = feat['LAT']
    name_2 = feat['LONG']
    feat[fed] = dd2dms(name_2, 0)
    feat[det] = dd2dms(0, name_1)
    layer.updateFeature(feat)

layer.commitChanges()
iface.vectorLayerTools().stopEditing(layer)

LAT and LONG are the names of the fields which I'd like to convert to DMS. The problem I'm facing now is that, when I run the script, the changes occur only on the Python console, but not in the attribute table.

I would like to know why my attribute table is not getting populated when I run the script.


texts: Overlap between Google Earth and Topographic OSM

texts:
First, I have Google Earth and Garmin BaseCamp with OSM maps. I would be satisfied if the solution is only available on one of these software. A third software that combine both view can be interesting if I can export to one of these.

Today I can draw a route on pedestrian road by using the routing of BaseCamp and I can as well export it to Google earth. But I did not find any option to merge both views.

Is it possible to have all pedestrian road with satellite view on any of these software and how?


texts: Performing regression analysis between two variables using ArcGIS Desktop?

texts:
I have a temperature image (interpolated from climatic point data) and NDVI data at the monthly interval.

I need to do correlation analysis between temp and NDVI.

Is it impossible to do this using ArcGIS Desktop, and if so, can you tell me how to do it?


texts: Does ArcGIS Desktop have conditional function useable in field calculations?

texts: Does ArcGIS / ArcView 10 have a conditional function, e.g. ifx(test,if_T,if_F), that could be in-lined in field calculations?


texts: How do I count occurrences of unique field values?

texts:
I have a feature class with a field which contains values 1, 2 and 3. I need to write code that reports the total count for each value:

1: 29 features
2: 52 features
3: 57 features

This is my code so far:
print "start"
import arcpy
arcpy.env.overwriteOutput = 1

fc = r"D:\AVI_DAVID\zevel\zevel.gdb\Export_Output_miv_cur"
lst_field = arcpy.ListFields(fc,"USAGE") #usage is the field
for f in lst_field:
    print f.name

Do I need a SearchCursor? Or an UpdateCursor?


texts: Creating buffers with values, and finding areas with high value overlap of these buffers

texts:
I'm working on a project where, essentially, I'm measuring threat levels based on geospatial patterns. I have different groups with higher or lower threat levels based on the distance from their location. These distances are fixed between different groups, all are roughly 0-30 miles, 31-90 miles, 91-270 miles, etc.

I have a data set that lists these groups and the threat levels based on those distances. It basically looks like:

There will be multiple examples of each group, and I know how to create the points and buffers off the points, but this is where my current skill set fails me and I need help.

I need to assign values to each groups buffer area.
I need to identify areas where the buffers overlap, and create a high threat level.

Ideally, the outcome would look something like this, where the points are a various groups locations, the buffer circles are the distances, and the black numbers are the values assigned to each buffer:

The orange numbers show the value of the overlapping buffers, and something like the red area is where two groups threat levels overlap to create the highest overall threat.


texts:
The geopackage open format offered by OGC for vector data (like that of shapefiles) supports map tiles (raster tiles) as well. The functionality is similar to mbtile format founded by mapbox. Is there a tool or a python library to convert between the two formats (mbtiles and geopackage)?

In essence, both formats are Sqlite databases. So, I suppose a conversion tool only has to change the schema of tables.


texts:
How can I convert from ITM ref (Israel new map) to GPS ref and from GPS ref to ITM ref?

I need any C# sample code or formula for this.

For example: 32.086156,34.769239 = 178364,665948
Or : 29.548783,34.952316 = 194997,384546


texts:
I am trying to overwrite the styling of the leaflet tooltips on a map but it does not seem to use my CSS style. I am using angular and electron but as far as I know neither should cause any changes to leaflet. (leaflet is installed as a dependency)

My marker adding function looks like this at the moment:

data.flights.map(function(plane){
  const positionVariable = {
    lat: parseFloat(plane.position.latitude),
    lng: parseFloat(plane.position.longitude)
  }
  if(westBound <= positionVariable.lng && eastBound >= positionVariable.lng && northBound >= positionVariable.lat && southBound <= positionVariable.lat){
    var tooltipOptions = {
      classname: 'labelstyle',
      permanent: true,
      direction: 'right',
      opacity: 1.0
    }

    var tooltipContent = plane.callsign

    return L.marker(positionVariable, {icon: greensquare}).addTo(markers).bindTooltip(tooltipContent, tooltipOptions);
  } else {
    return;
  }
})

The markers and the tool tips are applied correctly however they are missing the custom style found in the scss file for the component in which the map is displayed:

.labelstyle{
  color: green;
  font-size:14px;
  font-weight: 700;
  background-color: none;
  border-color: none;
  background: none;
  border: none;
}


texts: Can QGIS 3.0 identify tool give labels as well as band values for selected raster pixels

texts:
I'm using QGIS 3.0 for comparison of several landcover grids. These have a set style with 72 categories of landuse. The Style menu allows you to give a text label for each value within a band. The Identify tool gives the band and value for a particular pixel but does not give the label - which forces you to remember or look-up value labels.

Is there some setting to show the associated labels with the Identify results?