texts: ArcMap Dockable Search Window not launching

texts:
I'm running ArcGIS 10.5 on Windows 10, which I just updated from build 1511 to 1709. It has caused several problems; I don't know if this is related, but the timing seemed to coincide with my ArcGIS problem so I thought I'd include as much detail as possible.

The dockable Search window has disappeared from ArcMap. It still launches from ArcCatalog. I have followed the suggestions in:

ArcMap 10.5.1 search window not showing properly;
Search window not opening in ArcMap?; and
Result Window in ArcGIS 10.1 is not Opening

most of which recommend deleting the map templates like normal.mxt(which I've tried), or trying to find a hidden, off-screen pane.

I also found Moving an un-docked ArcToolbox from secondary screen to the main monitor which suggests editing the registry to reset entries for the pane states, but it only works if there is an entry at all for the window in question, which I don't have; it also means that it isn't just hiding off the edge of a display (usually in my experience, moving to-and-from dual displays will leave a small edge of the offending pane on the edge of the remaining screen, anyways).

I opened up the registry and built a little table of CLSIDs from ArcCatalog, since the Search window in it is working just fine. I used that (ProgID esriCatalogUI.SearchDockableWindow) to find the entry in the ArcObjects SDK ArcCatalog documentation, so that I could compare it with the ArcMap documentation, and hopefully locate the right entry and find a way to insert it into the existing registry keys.

But I'm a little hesitant to mess with registry keys at all, let alone trying to insert or alter an existing key. DockingPaneLayouts.panestate has several keys after the panes themselves: If only Pane-1 through Pane-3 are the only actual pane objects (Table of Contents, Toolbox, Identify, etc.), then how would I know what to edit in Pane-4 through Pane-12 and the Summary key?

Would it be worth it to download the ArcObjects SDK and try to instantiate a Search window from a script?

Or would it be safe to delete the entire DockingPaneWindows entry in hopes that ArcMap would generate new valid entries?

We have maintenance on our licenses, but I'd like to give GIS SE a shot before opening a ticket. I realize none of this is quicker or easier than reinstalling ArcGIS, but I'd rather find a real solution to the problem, hopefully one that can contribute to the knowledge base here.


texts: Attributes of polygons in a shapefile based on largest area intersection with polygons from a different shapefile

texts:
I have a shapefile of landcover.  It was developed from a raster dataset (the Crop Data Layer).

I also have a grid of 50x50m cells (polygons in a shapefile) I have overlain on the landcover shapefile.  It's only a subset of 1 county at this point, so it's not too terribly large.

I want to give an attribute to each cell that corresponds to the largest landcover category underneath.

I would prefer to do this with the shapefiles, as I made several modifications to the shapefile after converting it from the raster.  But if it can only be done with a raster, then I'll take that route.

I have tried spatial joins and the update overlay tool in vector data.  I have tried to take raster data, convert it to point data, then to raster, then back to polygon, but doing that you lose the habitat code for the data.


texts: Changing parallel line length to split polygon in QGIS?

texts:
I have a polygon which I want to split with a selected line with a parallel line.

I have made the parallel line but it's lenght is not enought to split the polygon.

It necessary to be parallel with the other line. Can I change the line lenght without I change the position of the line?

I use QGIS 18.2


texts: Connecting line with polygon edge using ArcGIS Topology?

texts:
I have to connect many of these points with the edges of polygons.

I am using Topology, but the "must not have Dangles" allow to connect two lines together, not a polygon edge and a line.

Can someone help me?


texts: Selecting features of vector layers based on another vector layer using QGIS?

texts: I am using QGIS 2.12.2. I am using three vector layers (point, polyline and polygon shapefiles) of the region of interest. Any advice in making the selections from one dataset based on the other dataset? What I am trying to do is to select the features of other two layers based on the one layer in QGIS.


texts:
I'm new (on Windows) and I'm trying to convert maps from PNG + PGW + PRJ format in a map format compatible with OrumMaps. I saw that GDAL can convert to MBTILES but I don't understand if it support PRJ file format.

How can I convert this format with GDAL?

The PRJ has format like this:

PROJCS["WGS_1984_UTM_Zone_32N",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_84",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",9.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

I have already installed OSGeo4W to get GDAL on Windows.


texts: Where is the 'on selected polygons only' setting in Processing tools?

texts:
Does anyone know where the geoprocess 'on selected polygons only' functionality has gone? I can't seem to find it (Vector>Geoprocessing Tools). As far as I can remember old fTools geoprocessing tools had this functionality - for some reason in the blanket replacement this has disappeared. Are there any workarounds? It's really frustrating to have so much useful functionality removed.

Edit: I'm using QGIS 2.16.0


texts: I am very new to GIS. I wanted to find out if it is possible to convert coordinates as specified in the table below to longitude and latitude c


texts: Incorrect results returning from st_distance_spheroid query

texts:
Given a routable network table constructed by completing the guide at http://anitagraser.com/2011/02/07/a-beginners-guide-to-pgrouting/, how can I get an accurate list of all roads that are within a ring between 5 and 10 miles of a randomly selected start point?

The contents of the routing network table were derived from a shapefile of all roads in the NG 911 system available for download at my state's GIS data repository

Using Python and raw SQL, I'm doing the following:

query_select_ring = """
    SELECT * FROM road_network
    WHERE st_distance_sphere(geom,st_pointfromtext('{0}', 4326)) < 10 * 1609.344
    AND st_distance_sphere(geom, st_pointfromtext('{0}', 4326)) >= 5 * 1609.344;"""

The value use for st_pointfromtext is the result of the query

SELECT st_astext(st_startpoint)FROM road_network WHERE gid = {0};

where gid is the ID of a randomly selected row.

My issue is that on every ocassion the ring query has run, the values returned appear to have no rhyme or reason for their inclusion in the result set, with some points being within 2 miles of the start and others being 50-80 miles.

How can I refine the query to return an accurate result set of all roads that are within 5 miles inclusive and 10 miles exclusive of a randomly selected start point?

For testing data, I've uploaded the files to my google drive

https://drive.google.com/file/d/0B86VfDOuBm2IcWgwRXhCTGlkVXM/view?usp=sharing
https://drive.google.com/file/d/0B86VfDOuBm2IZ29aRjFQS3RlZVE/view?usp=sharing

One is the dump file of 5000 rows (of approximately 140K) and the second is the schema ddl output resulting from

pg_dump --schema-only -t road_network geo > pgis_schema.ddl


texts: Compatibility with different versions of QGIS and Mac OS

texts: I use QGIS 2.1.0 and Mac OS 10.7.5. If I update to OS Yosemite or El Capitan when it's released this fall; do I risk compatibility problems with my version of QGIS? Or if I update to the newest version of QGIS; do I risk compatibility problems with my present projects?


texts:
I'm developing a WPF application. One of my requirements is to have polygon borders drawn with a dash-dot-dash style. Is there a way to accomplish that in the client side?

So far I've tried:

var graphic = new Graphic();
graphic.Symbol = new SimpleFillSymbol
{
    BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 255)),
    BorderThickness = 5
}


texts: Load many shapefiles into PostgreSQL with GeoKettle

texts:
I want to automate a process where a user can put a shapefile in a certain map. Kettle will put these files into a PostgreSQL table.

I want to make sure that this process can be done without knowing the name of the shapefile. I tried two different methods.

I dragged Shapefile File Input into the transformation and put the extension at *.shp. This didn't work.

I made a CSV file input with a CSV file with 1 column and the path plus the name of the shapefile. In the Shapefile File Input I insert that Filename as defined in a field from a previous step.

Although it looks like everything is read properly, I cannot furthermore do transformations like set SRS or put it in a PostgreSQL table, because it cannot receive any fields from previous steps.

Is there any way to fix this issue?


texts: Python Basemap: Michigan and Wisconsin coloring problem

texts:
I have a dataframe, State, containing state names and counts for each state. I am trying to create a map that colors the states based on the count by using the st99_d00 shapefiles. Here is my code:

import matplotlob.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
fig,MapAx = plt.subplots()
colorVotes = plt.get_cmap('coolwarm')
colors = []
patches = []
# create the map
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
    projection='lcc',lat_1=33,lat_2=45,lon_0=-95)

# load the shapefile, use the name 'states'
m.readshapefile('st99_d00', name='states', drawbounds=True)

# collect the state names from the shapefile attributes so we can
# look up the shape object for a state by it's name
state_names = []
for shape_dict in m.states_info:
    state_names.append(shape_dict['NAME'])

for state in State.StateNames:
    seg = m.states[state_names.index('{}'.format(state))]
    color = colorVotes(State['count'][State.StateNames ==
state]/float(max(State['count'])))[0]
    colors.append(color)
    poly= Polygon(seg, facecolor=color, edgecolor=color)
    patches.append(poly)
    MapAx.add_patch(poly)

p = PatchCollection(patches, cmap=colorVotes)
p.set_array(np.array(colors))
cb = fig.colorbar(p)
plt.show()

The above code returns the following map:

Notice both Michigan and Wisconsin are not colored, however both states exist and have values in my data set.


texts:
I'm digitising historic maps for an area about 2km square using QGIS 3.18 (the maps are from the David Rumsey maps collection, using WMTS).
Once I have the digitised maps (in polygons representing roads, field boundaries and buildings), I'd like to effectively do the same as I would with a raster map, and use georeferencer to rubberband the digitised map and align various features to produce maps that are overlaid on each other.
I'd have started by using georeferencer first if the maps were available in a format that would allow georeferencing - but I dont see how to convert WMTS output into a form suitable for this.
Has anyone any ideas if the equivalent of the georeferencer process could be done in any way with vector layers?


texts: QGIS: How to load feature (.qml) styles from python?

texts:
Possible Duplicate:
  How to style a layer from console?

I'm trying to set the styles for a vector layer by loading the .qml file in the python console. The qml-style file contains all categories and symbols needed, but I can not find the right function to load the qml file.
The QgsCategorizedSymbolRendererV2::create(domElement) seems to be not available in the python console (QGIS 1.8.0). Is myRenderer.load(doc.documentElement()) the right function to use?

Thank you!

Stefan

#load the xml
xmlfile = QtCore.QFile("qgis-layer-style.qml")
doc = QtXml.QDomDocument( "Categories" )
if xmlfile.open(QtCore.QIODevice.ReadWrite | QtCore.QIODevice.Text) == 0:
    print "cannot open file"
if doc.setContent( xmlfile ) == 0:
    print "no xml content"

# creating a new renderer
myRenderer = QgsCategorizedSymbolRendererV2('',[])
myRenderer.load(doc.documentElement())
# here myRenderer has still no categories!

# assign myRenderer to the active layer
layer = qgis.utils.iface.activeLayer()
layer.setRendererV2(myRenderer)


texts: Zooming in to magnify Inset Map in Layout of ArcMap?

texts:
this is the inset map I created in my layout view, notice how it is magnified to the full extent that I want to represent in my map

this is my map in its layout view with the inset map representation.

How can I zoom in on the inset map so it is magnified more just like in my data view?


texts: pgr_dijkstra invalid memory request size

texts:
I am trying to create a network of paths using pgr_dijkstra. I keep getting an invalid memory error:

ERROR:  invalid memory alloc request size 1080000000
CONTEXT:  SQL function "pgr_dijkstra" statement 1
SQL statement "SELECT *
FROM pgr_dijkstra('SELECT id, source, target, cost FROM p797.cost_lines', source_arr, target_arr, false)"
PL/pgSQL function inline_code_block line 10 at SQL statement
SQL state: XX000

I have adjusted work_mem up to 1.2GB in order to try and handle this query (I am sole user of the database). I thought that this would solve the memory error but it has not. Any ideas as to why I am still getting this error? The query works fine on small areas. The area I am trying to process now is very large.

DO
$$
DECLARE
source_arr text[];
target_arr text[];
BEGIN
SELECT array_agg(source) FROM source_locations INTO source_arr ;
SELECT array_agg(target) FROM target_locations INTO target_arr ;
DROP TABLE IF EXISTS dijkstra;
CREATE TABLE dijkstra AS
SELECT *
FROM pgr_dijkstra('SELECT id, source, target, cost FROM cost_lines', source_arr, target_arr, false);
END $$;

Version 2.6.2 of pgRouting


texts: How to move and open shapefiles with ogr2ogr?

texts:
I'm a total newb following along the d3 map tutorial.

at this line:

    ogr2ogr \
  -f GeoJSON \
  -where "adm0_a3 IN ('GBR', 'IRL')" \
  subunits.json \
  ne_10m_admin_0_map_subunits.shp

I get this output:

FAILURE:
Unable to open datasource 'ne_10m_admin_0_map_subunits.shp' with the following drivers.
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> SDTS
  -> TIGER
  -> S57
  -> DGN
  -> VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> GML
  -> GPX
  -> KML
  -> GeoJSON
  -> GMT
  -> PCIDSK
  -> XPlane
  -> AVCBin
  -> AVCE00
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDump
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> PDS
  -> HTF
  -> AeronavFAA
  -> EDIGEO
  -> SVG
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY

This has been asked before, but I have ogr2ogr installed correctly, and my question is much more basic.

I haven't moved any .shp, .shx, .dbf, and .prj files. I'm following the tutorial closely, and haven't created any type of project directory, so I am still working out of usr/bin/local. Do I need to move certain files to a new project folder? If so where can I find them?


texts:
The following leaflet codes draws a series of markers one by one. How to introduce variable time interval in "window.setInterval(function() {..." segment?. I want to display each marker for the time specified in "myInterval = geojson.coordinates[t][2]" milliseconds.

<!DOCTYPE html>

<title>Break Draw</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="leaflet.css" />

<link rel="stylesheet" href="Popcen.css" />

      <input type="button" id="btnSummary" value="Hit Sequence" onclick="myHit()"     class="btnStyle span2" />


texts: Publishing tile cache map service with full scale range without artificially over-sizing it on ArcGIS Online?

texts:
I'm working within the ArcGIS platform including the ArcGIS Online account. I've got some high detailed orthophoto that I'd like to tile cache and than publish as a map service to my AGOL account.
When producing and tile caching, I'd rather not to generate an artificially over-sized cache that exceeds the maximum cell\pixel size of my original orthophoto because of storage considerations (700 MB that grows into 1.7 GB). Hence my cache file is produced in a certain scale range that fits its origins maximum cell size. After the cache has been produced and published as a map service in AGOL, it's scale range visibility is being automatically constrained to fit the level of details that it have been produced at.

How can I make this map service to enable a larger scale range visibility that uses previous level of details?

Alternatively: How Can I produce and publish a map service that enables a larger scale range visibility and not artificially over-sizing my tiled cached orthophoto?

The reason I'm trying to do it is that, though there is no actual additive data (restricting cell size) by further scaling, is that it's much better in terms of user interface (seeing the orthophoto in larger scale).

I've tried using the REST API interface and change the max scale by 'edit'. It change the definition but didn't seem to work within a web map. I've also tried to 'Update' the levels of details available to exceed itself but I've got this error LOD not available for the level "8" Code: 500


texts: I have a PostGIS installation running on an old computer that I'd like to move.  I spent a bunch of time playing with pg_dump and pg_dumpall without success.  It seems the normal dump procedures don't work with PostGIS because file paths get hard coded in the output from pg_dump.  Any suggestions on how to move PostGIS installation to a new installation of PostgreSQL?


texts: Create multiple polygons from Excel file containing vertice coordinates in rows

texts:
I'm a beginner in GIS.
I am trying to map on ArcGIS Pro the individual areas used by ~400 fishing vessels. I have an Excel file with 1 row per vessel, and in the columns I have the coordinates of the NW, NE, SW and SE boundaries of its fishing area (The image is a simplified version of my data, I have many more columns with more information).
I know there are ways to use polygon vertices coordinates to create 1 polygon, but since I have so many individual fishing areas to define, I need a more efficient method. Is there a way to do this all at once?


texts: Why would Openlayers always render over other divs?

texts:
I'm having trouble getting an Openlayers div to allow other divs to appear above it.

Having tried the solution proposed here as well as the more classy-looking one here, I haven't had any luck yet. Openlayers always orders itself over other divs. I've also set the z-index for my other div (which I want on top) as high as it goes, still no effect.

Is there somewhere it could be getting overridden? Or some setting that needs an extra trick to get rid of?

I have asked this question on StackOverflow as well, where it's arguably more relevant. I'm only posting this here because someone here may have specific Openlayers experience on this matter.


texts:
My goal is to retrieve something like a multiband raster from geoserver where each band has data for a year. I have an image mosaic layer in geoserver where I can retrieve individual years using &SUBSET=time("2010-01-01T00:00:00.000Z") or &SUBSET=time("2011-01-01T00:00:00.000Z") to get years 2010 and 2011 respectively as explained in the accepted answer of this stack. I have over 100 years to retrieve and want to get them all in one request.

This site explains that you can request a range on the time dimension (specifically they do it for a netcdf:

  As explained in the NetCDF output Format for WCS 2.0.1 requests, a
  NetCDF output format has been developed to write down a NetCDF file
  with the proper contents coming from a multidimensional output
  request. Lets do a GetCoverage request involving trimming on these
  dimensions: latitude, longitude, elevation and time, by specifying
  these ranges of values:

http://localhost:8083/geoserver/wcs?request=GetCoverage&service=WCS&version=2.0.1&coverageId=geosolutions__time_domainsRanges&Format=application/x-netcdf&subset=http://www.opengis.net/def/axis/OGC/0/Long(5,20)&subset=http://www.opengis.net/def/axis/OGC/0/Lat(40,50)&subset=http://www.opengis.net/def/axis/OGC/0/elevation(20,150)&subset=http://www.opengis.net/def/axis/OGC/0/time("2008-11-01T00:00:00.000Z","2008-11-07T00:00:00.000Z")

In particular they use &subset=http://www.opengis.net/def/axis/OGC/0/time("2008-11-01T00:00:00.000Z","2008-11-07T00:00:00.000Z") to specify a time range

When I construct the following query to get years 2005-2010 it only returns one year's raster:

https://geoserver-dev.usanpn.org/geoserver/wcs?service=WCS&version=2.0.1&request=GetCoverage&coverageId=si-x:average_leaf_best&SUBSET=time("2005-01-01T00:00:00.000Z","2010-01-01T00:00:00.000Z")&format=geotiff

How do I write this request, or is it even supported for something like a geotiff?


texts: Adding attributes to each vertex of shapefile using shapely?

texts:
I have two polygons in Python:

poly1 = shapely.geometry.polygon.Polygon([(3,4), (2,4),(2,2),(3,2)])
poly2 = shapely.geometry.polygon.Polygon([(4,4), (3,4),(3,2),(4,2)])

that look like this:

Obviously the polygons touch in points (3,4) and (3,2).

How could I add this attribute (touches=True/False or 1/0) to each vertex of the Polygon?


texts: Google base layer opacity change in OpenLayers 2.13

texts:
I have recently swapped from using OpenLayers 2.12 to 2.13.1 as it fixes a bug. However in 2.12 I was using a base layer opacity of 0.7 to 'knock back' the map so that the vector layers stood out more, but this doesn't work in 2.13. In 2.13 OpenLayers the base layer opacity on a Google map is applied to all layers, so this trick doesn't work. I believe this is because 2.13 changes how Google base layers are handled (see release notes).

Anyone have a suggested work round that will work in OpenLayers 2.13.1? i.e. I want to make the map layer more transparent/less contrast while keeping the vector layers at full contrast so they stand out.

Also I am testing with Google but may go with a different map provider in the final application, due to licencing costs, so a generic answer for any base map type would be helpful.

Thanks in advance for your help.


texts: Calculate the difference of max image and min image in GEE

texts:
I am preparing parameters for the RF classification model. I calculated the NDVI,NDWI,EVI,NDBI from landsat8 time series. Then I calculated the minimum image colletcion (var min) and maximum image colletion (var max1) of the time series. Both of the two image collections include NDVI,NDWI,EVI,NDBI.
I define a function (DIFF) to further calculate the difference between the maximum and minimum image collection (including the difference between maximum value and minimum value of NDVI,NDWI,NDBI,EVI), but made mistakes in the codes (telling maxmin.map is not a function).
I think there should be easier way to calculate the difference, but I am still not practiced in GEE...
Link: https://code.earthengine.google.com/1fe1753f49d5ebbbb7aa4d86040e839c
var s2col = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filter(ee.Filter.calendarRange(2018, 2019, 'year'))
  .filter(ee.Filter.calendarRange(1, 3, 'month')).filterBounds(Linzhi);

//NDVI
function NDVI(image) {
  return image.addBands(image.normalizedDifference(["B5", "B4"]).rename("NDVI"));
}

//NDWI
function NDWI(image) {
  return image.addBands(
    image.normalizedDifference(["B3", "B5"])
         .rename("NDWI"));
}

//NDBI
function NDBI(image) {
  return image.addBands(
    image.normalizedDifference(["B6", "B5"])
         .rename("NDBI"));
}

//difference
function DIFF(image){
  return image.addBands(ee.Image.cat([image.select("NDVI_max").subtract(image.select("NDVI_min")).rename("NDVI_diff"),
        image.select("NDWI_max").subtract(image.select("NDWI_min")).rename("NDWI_diff"),
        image.select("NDBI_max").subtract(image.select("NDBI_min")).rename("NDBI_diff"),
        image.select("EVI_max").subtract(image.select("EVI_min")).rename("EVI_diff")]));
   }

//EVI
function EVI(image){
  return image.addBands(image.expression(
              '2.5*(NIR-RED)/(NIR+6*RED-7.5*BLUE+10000)',{
              NIR:image.select('B5'),
              RED:image.select('B4'),
              BLUE:image.select('B2'),
            }).float().rename('EVI'));
}

var l8Col = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR")
              .filterBounds(Linzhi)
              .filterDate("2018-1-1", "2020-10-13")
              .filter(ee.Filter.lte("CLOUD_COVER", 50))
              .map(NDVI)
              .map(NDWI)
              .map(NDBI)
              .map(EVI);

var min = l8Col.reduce(ee.Reducer.intervalMean(0,5)).select(["NDVI_mean","NDWI_mean","NDBI_mean","EVI_mean"],["NDVI_min","NDWI_min","NDBI_min","EVI_min"]);
print(min,"min");
var max1 = l8Col.reduce(ee.Reducer.intervalMean(95,100)).select(["NDVI_mean","NDWI_mean","NDBI_mean","EVI_mean"],["NDVI_max","NDWI_max","NDBI_max","EVI_max"]);
print(max1,"max");

var maxmin = min.addBands(max1);
var maxmin1 = maxmin.map(DIFF);
print(maxmin,"maxmin");


texts:
I am working with large tiled (no overlap) datasets of ortho imagery that has been mosaicked in ArcGIS and exported as a single, merged TIF for the entire AOI.
These images need to be compressed so that they can be easily distributed to the public, however when compressing to JPEG straight from ArcGIS, some pretty horrendous compression artifacts appear in the imagery along the edge of the nodata boundary.

I am trying to find a way to eliminate these artifacts, while still maintaining a decent compression.

I have tried using GDAL nearblack
followed by gdalwarp -srcnodata 0 -dstalpha input output
and finally followed by gdal_translate input output -b 1 -b 2 -b 3 -mask 4 COMPRESS=JPEG --config GDAL_TIFF_INTERNAL_MASK YES

This has created a significant reduction in the black pixelated artifacts around the edge of the imagery - however these artifacts still do exist until I zoom into a scale of 1:1500 and then they disappear.

Any ideas of how to (if possible) eliminate these artifacts altogether?


texts:
On trying to execute ogrinfo i got this error:

ogrinfo: symbol lookup error: /usr/lib/libgdal.so.20: undefined symbol: sqlite3_column_table_name

I got this on one of my PCs, though on the others it works well. Seems like i installed something which prevents gdal of working normaly. May be i removed something trying to get it work, or may be i installed a lot of useless packages, but it seems that i've tried everything. python gdal - libgdal.so.1: undefined symbol: sqlite3_column_table_name didn't help me as well as a lot of other solutions. I think the best option is to somehow remove all dependencies gdal made to make it work. If someone knows how to fix this or may be hint me about packages i should uninstall to install it in correct order.

spatialite-bin
libsqlite3-mod-spatialite
GEOS
PROJ.4

When i'm trying to start my django application which uses gdal and spatialite i got this error:

OSError: /usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined symbol: sqlite3_create_function_v2


texts: ESRI Silverlight API 3.1 query, edit, update issues in the code behind

texts:
Using ESRI Silverlight API 3.1, .NET Framework 4.0, ArcGIS Server 10.0

Is there a way to update an attribute in the code behind without looping through the featureLayer.Graphics? Or a way to call FeatureLayer.Update without losing the edits made?  We cannot hard code our layers into the xAML because we need them to be dynamic.

Ideally we would like to run something similar to a QueryTask, returning a set of features that we could update the attributes of.

To work around this we have attempted to use the FeatureLayer where and update functions.
For this test there is only a single FeatureLayer in my map.

The where and update successfully revises the layer to have a single entry -

FeatureLayer testLayer = (ESRI.ArcGIS.Client.FeatureLayer)featureLayer;
testLayer.UpdateCompleted += UpdateTask_ExecuteCompleted;
testLayer.Where = "TEST_ID=12345";
testLayer.Update();

// Update Event

private void UpdateTask_ExecuteCompleted(object sender, System.EventArgs args)
{
  foreach (GraphicsLayer graphicsLayer in testEditor.GraphicsLayers)
  {
    if (graphicsLayer is FeatureLayer)
    {
      FeatureLayer featureLayer = graphicsLayer as FeatureLayer;

      foreach (Graphic feature in featureLayer.Graphics)
      {
        if (Convert.ToInt32(feature.Attributes["TEST_ID"]) == 12345)
         {
           feature.Attributes["NAME"] = "Renamed";
         }
      }

   }
}

This event handler will loop through my feature layer – now queried to 1 record,  and update the name attribute.

The issue at this point is that on my display I now only have the single record showing.  If I reset the where clause to “1=1” and run an update I lose my edit.

I can SaveEdits before I reset the layer which will save my edit.  But I am hoping for a solution that will still allow the user to save all the edits at a single time when they are finished.   Is there a way to update and maintain my edit?

This all is a workaround due to not being able to query to get the feature to edit.  If there is a way of doing that without iterating through every Graphic that would be the ideal solution to this.  Are we missing the big picture here?


texts: Buffering a point/line/polygon by a mile in React, using Mapbox to display the result

texts:
Firstly, I'm using React and Mapbox to produce a view of a map and to store and buffer points, lines, and polygons.
I was wondering what way could I buffer said shapes by a mile or another metric unit. I've looked around and falling down a rabbit hole of options and it's all a bit confusing to me.
I have a 2d map projection, and have come across geodesic geometry, where drawing line accounts for the curvature of the earth. I was wondering if this would matter in regard to buffering a line by a mile as if this wasn't taken into account then surely this would be that the buffer was inaccurate.
Could anyone provide me with the math on how to calculate Euclidean buffers and geodesic ones or a library that is capable of doing so? I've used turf though noticed when drawing a geodesic line with mapbox-gl-draw-geodesic and then buffering using turf. It does not buffer the line properly and I am left with a straight buffer and a geodesic line.
Does having geodesic features matter if I want to buffer a shape with a metric of measurement or could this all be done in a Euclidean way that is accurate?


texts:
Can I create GeoJSON from DBF where X and Y coordinates are stored as normal attributes.

Is there something in ogr2ogr, which can create GeoJSON?

Example DBF file link:


texts: Selecting snapped vertices of different two features individually by QGIS 3.X vertex tool

texts:
In QGIS 2, I can use node tool,

click on feature 2
click on the vertex (of feature 2) to select it.
Delete it.

I QGIS 3, by using vertex tool, I can't select which feature I want to modify, it changes automatic by the mouse cursor.
I need to mouse over the part of feature 2 and move carefully to the vertex.
How can I chose which vertex I want to select by vertex tool if these vertices are all snap in same coordinate?


texts: Result of size() function could not be used in a for loop in Google Earth Engine

texts:
I get the number of images a ImageCollection using the size() function, but when I use that number in a for loop, it does not work.

See the last chunk of code in this script:

// study area
var roi = ee.FeatureCollection([
    ee.Feature(    // study area.
      ee.Geometry.Rectangle(20, -5, 75, 35), {label: 'study Area'})
  ]);

// images
var now = ee.Date(Date.now())
var NDVICollection=ee.ImageCollection('MODIS/006/MOD13Q1')
    .filterDate('2019-12-01',now)
    .select('NDVI');

// masker
var masker = function(image){
    var mask1 = image.select('NDVI').lte(10000);
    var mask2 = image.select('NDVI').gte(2000);
    return image.updateMask(mask1).updateMask(mask2);
    };

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

var ndvi = NDVICollection.map(clipper);

// PREPARE DATA FOR EXPORT
// Tyler Erickson provided the stacking function
// https://gis.stackexchange.com/a/254778/67264
var stackCollection = function(collection) {
    var first = ee.Image(collection.first()).select([]);
    // Write a function that appends a band to an image.
    var appendBands = function(image, previous) {
        var dateString = ee.Date(image.get('system:time_start')).format('yyyy-MM-dd');
        return ee.Image(previous).addBands(image.rename(dateString));
    };
    return ee.Image(collection.iterate(appendBands, first));
  };
var ndvi_img = stackCollection(ndvi);
print(ndvi_img);

var visParams = {
    min: 0.0,
    max: 9000.0,
    palette: [
      'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
      '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
      '012E01', '011D01', '011301'
    ],
  };

Map.centerObject(roi,2);

var size =NDVICollection.size() ;
print(size);//4
  Map.addLayer(roi,{},'Study Area');
// it does not work!!!!!!!!!!!!!!!!!!!!!!
  for(var i = 0;i<size;i++){
    Map.addLayer(ndvi_img.select(i),visParams,'img_'+i);
  }


texts:
I am trying to use the raster calculator in QGIS to combine a number of rasters. I want to calculate a mean, this is easy:

(raster_1@1 + raster_2@1 + raster_3@1) / 3

I then want to create a max. raster - i.e. for each pixel I want to compare raster_1, 2 & 3 and use whichever is the greatest of the three. According to the QGIS documentation I should be able to use the following code (modified from QGIS documentation example):

gt( raster_1@1, raster_2@1, raster_1@1 )

(All cells in raster_1 with value greater than (gt) the appropriate pixels in raster_2 will be replaced with the appropriate pixels from raster_1). I'd then have to repeat this for raster_3.

This doesn't work however as the raster calculator says the expression is invalid. What am I doing wrong? None of the examples of conditional statements provided in the QGIS documentation seem to work. I have tested this with .tif and .sgrd files and the same thing happens. I'm using QGIS 1.8 on a Linux machine. Thanks in advance.


texts:
Again a Grass 7 question. I have the output of a modelling run as matlab file, which I can export as tiff and load as geotiff. OK - now can I extract the data/convert this tiff into a raster proper?
I also have ArcGIS 9.3, should this be the better way (I think this would work with the raster calculator - In ArcGIS 9.3, how do I split a 3-band raster (.tiff) file and summarize the band values?, but I do not have ArcGIS at the moment to try this). Still curious if Grass 7 would be able to do this.

Additional info:
The data contain calculated wind speeds, but the display is as color band 0-255. So the question is how to retrieve the winds speeds? I can only see them in Matlab, but in order to correlate and spacially reference I have to export the result - as tiff...

Thanks in advance,
Peter


texts: Appropriate GeoJSON type for grouping many anonymous objects

texts:
I'm writing a converter that produces GeoJSON. My source data has multiple layers of discrete objects over a few square miles. For example:

Shuttle Stops: ~25 polygons
Shuttle Routes: ~10 line strings
Campus Buildings: ~20 polygons
Other Buildings: ~50 polygons
Sidewalks: ~200 polygons
Vegetation: ~400 polygons

I want to bring this data into Mapbox Studio as different layers, for different visual styling of each. Thus, I'm planning on creating one GeoJSON file per layer; one file for each type of object.

I originally thought I would use GeometryCollection.

{ "type"       : "GeometryCollection",
  "geometries" : [{ "type"        : "Polygon",
                    "coordinates" : [[[1,2],
                                      [3,4],
                                      [5,6],
                                      [1,2]]] },
                  { "type"        : "Polygon",
                    "coordinates" : [[[7,8],
                                      [9,10],
                                      [11,12],
                                      [7,8]]] },
                  { "type"        : "Polygon",
                    "coordinates" : [[[13,14],
                                      [15,16],
                                      [17,18],
                                      [13,14]]] }] }

According to RFC 7946:

  The word "Collection" in "FeatureCollection" and "GeometryCollection" does not have any significance for the semantics of array members.

However, I get the sense that a GeometryCollection is to be used for a group of related items, like a single logical building made of a few different Geometry primitives. My 200 sidewalk objects are not part of the same logical geometry.

So, I'm currently considering using a FeatureCollection. However, this requires a Feature wrapper for each Geometry, which I don't need. I have no metadata about most polygons or linestrings that would be useful.

{ "type"    : "FeatureCollection",
  "features": [{ "type"    : "Feature",
                 "geometry": { "type"       : "Polygon",
                               "coordinates": [[[1,2],
                                                [3,4],
                                                [5,6],
                                                [1,2]]] } },
               { "type"    : "Feature",
                 "geometry": { "type"       : "Polygon",
                               "coordinates": [[[7,8],
                                                [9,10],
                                                [11,12],
                                                [7,8]]] } },
               { "type"    : "Feature",
                 "geometry": { "type"       : "Polygon",
                               "coordinates": [[[13,14],
                                                [15,16],
                                                [17,18],
                                                [13,14]]] } }] }

What is the appropriate root collection for each file? Is FeatureCollection appropriate, and I should just live with the 'noise' of the Feature wrapper? Or is GeometryCollection appropriate? Or should I be making one file with a FeatureCollection, where each layer is a single Feature and all the objects for that layer are inside a single GeometryCollection?


texts: Contour command in Spatial Ecology's GME

texts:
Has anyone been successful using the contour command from GME (Geospatial Modelling Environment)? I'm trying to create contours out of a DEM. I know you can do it in ArcGIS with 3D or Spatial Analyst extension but I don't have them hence giving GME a try.

I've tried it and got the following errors:

  Error: The specified workspace does not exist. Cannot open raster dataset: C:\Users\as\Documents\Columbia Test.gdb!Columbia10M_Elevation

  Error: The command text could not be interpreted. Please check the syntax of the command.

  Error: An important error has occurred. Please include the information below if you submit a query about this error.
  The XY domain on the spatial reference is not set or invalid.

I read the help manual and it says that the algorithm hasn't been widely tested. So I'm thinking that it might not be the best tool for getting contours from DEMs.

Any suggestions on a fix or a different work around in lieu of Spatial Analyst?

Update 9/8/14:

GME's developer sent me the following:

  "Unfortunately GME is not designed to work with GDB-based rasters. You would have to export to one of the file-based formats (img, tif, or grid) if you want to use GME. I will have a look at adding that functionality into a future release."


texts:
I might be able to work this out myself but I am in a bit of a deadline rush and thought about posting this here with the chance that somebody has dealt with a similar issue before.

I am using ol.source.Cluster to create themed maps. I want to show an inset map with of the biggest cluster in detail.


texts: Merging featureclasses with the same name in multiple geodatabases using ArcPy

texts:
I tried merging all "Arc" feature class with same name nested in multiple geodatabases using ArcPy but didn't work
#importing module arcpy and os and glob
import arcpy, os, glob

#settin up an environment
#mainLoc = r'D:\NHP Project\2020_NHP work file\Toposheet\arcpy_practise\A02\HYDRO_LN'
#setting overwriteoutput as true
arcpy.env.overwriteOutput = True
#defining the output locaiton
output_folder = r'D:\NHP Project\2020_NHP work file\Toposheet\rough_latest_output'

Dict = {}

myList = glob.glob(r'D:\NHP Project\2020_NHP work file\Toposheet\arcpy_practise\*\HYDRO_AR')
print myList
for value in myList:
    arcpy.env.workspace = value
    print(value)
    for fc in arcpy.ListFeatureClasses("Arc"):
        if not fc in Dict:
            Dict[fc] = []
            #print(Dict[fc])
            Dict[fc].append(os.path.join(value, fc))
            #print(Dict[fc].append(os.path.join(value, fc)))
        else:
            Dict[fc].append(os.path.join(value, fc))

#loop through each key and merge them together
for key in Dict:
    output = os.path.join(output_folder, key[:-4]) + '_merge'
    arcpy.Merge_management(Dict[key], output)
    print output + " created"

As a result:
Traceback (most recent call last):
  File "D:/NHP Project/2020_NHP work file/Toposheet/project_clip/arcpy_merge_topo.py", line 38, in <module>
  arcpy.Merge_management(Dict[key], output)    File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\management.py", line 4124, in Merge
    raise e  arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
    ERROR 000732: Input Datasets: 'D:\NHP Project\2020_NHP work file\Toposheet\OneDrive-2020-12-15\2785\D13\TRANS_LN\Arc' does not exist or is not supported
Failed to execute (Merge).


texts:
I am working on a 13407 lines * 11050 columns raster file (SRTM DEM, 30m) with a script that calls a series of hydrological modules in GRASS 7.0. The system I am using is a Windows server 2012 R2, 64 bit Intel Xeon 2.5 GHz processor, 32GB of RAM.

The first module called in the script is r.watershed. When launched on that data set, it generates the following error : G_malloc: impossible to allocate 1185910608 bytes to raster/r.watershed/ram/init_vars.c:149

I managed to pass that first hurdle using the -m flag on r.watershed. The scripts now requires 7 GB of disk space, even if it's slow and I don't understand why it can't use the ram in the first place, r.watershed finishes correctly.

However, when the script gets to the next module, r.fill.dir, GRASS crashes at 'Reading input elevation raster map...' with the following message:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: r.fill.dir.EXE
  Application Version:  7.0.0.0
  Application Timestamp:    54e7aaf0
  Fault Module Name:    r.fill.dir.EXE
  Fault Module Version: 7.0.0.0
  Fault Module Timestamp:   54e7aaf0
  Exception Code:   c00000fd
  Exception Offset: 00001479
  OS Version:   6.3.9600.2.0.0.400.8
  Locale ID:    1036
  Additional Information 1: 3397
  Additional Information 2: 33978ebc9cf04f9490066e458551979d
  Additional Information 3: caf7
  Additional Information 4: caf72cf53bf264b7d49f3bd72b0afc04

The script runs fine on a smaller data set.

Any idea of how to solve the app crash?

Edit:
as requested, here is the result of g.region -p:

g.region -p                                                            projection: 1 (UTM)
zone:       22
datum:      wgs84
ellipsoid:  wgs84
north:      636094.00956457
south:      233878.203125
west:       98924.52245413
east:       430413.65625
nsres:      30.00043309
ewres:      29.99901663
rows:       13407
cols:       11050
cells:      148147350


texts: Clip shapefile and keep the outer part of it

texts:
I have to two polygon layers, the red layer is the the bottom layer.

The second layer covers most of the bottom layer

I would like to know if there is a tool that will create a polygon layer of just the red parts showing in the second photo.

The parts of image one that are visible in image two?


texts: Using ModelBuilder/ArcPy in ArcGIS Pro to Iterate Field Values of Multiple Feature Classes?

texts:
I am using ArcGIS Pro 2.01 for this task.

I have 114 shapefiles (each represents a session of the US Congress) which include every congressional district since 1790.  I have added a short integer field to each feature class called "Congress".  This field is intended to signify which session of Congress that feature was used for.  For example, all 435 features in the shapefile representing the 114th Congress should have a value of 114 for that field.

I am trying to automate the entire process using ModelBuilder.  I do understand that this could be done in Python but I would prefer to use the ModelBuilder so that I can teach my high school GIS class how to do this before showing them the code.

Each shapefile contains the Congressional session number at the end of the filename.

Should I try to use the For tool or should I use something like the Iterate Field Value tool?


texts: Downloading entire OSM world dataset and import into MS SQL

texts:
I am trying to download the entire dataset of OSM and placing into a MS SQL Database.

Does anyone have any ideas of how to go about that?


texts: I've downloaded the VA Geological Survey data set (http://mrdata.usgs.gov/geology/state/state.php?state=VA) that I have already on Google Earth as a kmz. The various formations are color coded. There's a style file (lith6_2.style) that QGIS doesn't seem to recognize, although ArcGIS has an instruction set to activate it (http://mrdata.usgs.gov/geology/state/style_help.html). Is there a way to do that in QGIS?


texts: How do I turn around the ticks on digitized faults?

texts: I have downloaded the USGS geology symbology and can assign a symbol, e.g. thrust fault, to a digitized line, but I have no control on the direction in which the ticks showing. How do I tell QGIS in which direction the fault dips? Do I have to think about this when I start digitizing, e.g. dip always to the east or do I have to add an extra field to the attribute table?


texts: Creating perpendicular lines along stream at points

texts:
Using ArcPy, I'm trying to figure out how to draw perpendicular lines along my Streams feature class. I have a set of points, that are snapped to my stream centerline.
I've seen the "Generate Transects Along Line" tool and I think that will get me close, but I'm not sure how to define that I want the lines are drawn at the point locations, rather than a set interval. Here is an example of what I'm trying to accomplish:


texts: Dealing with bridges and tunnels when modeling raster least cost paths?

texts:
I'm currently using ArcGIS 10 Spatial Analyst's Cost Path tool to model pedestrian routes. I have sidewalks, fences, buildings and a ton of pedestrian scale features, all combined into a cost surface in which sidewalks are low cost, parks are slightly higher, crosswalks are still higher, and buildings, fences, and the like are barriers. The model works great to define optimal routes, compare routes to each other, assess the walkability of areas, and build walkingsheds.

But I have one major problem: bridges and tunnels. Because the cost surface forces all the features into a single 2D plane, I'm unable to model a bridge with a sidewalk that crosses over a street with a sidewalk. I must choose which one should get cut off. An alternative is to find all the bridges and tunnels in the City and model all combinations of under/over, but the model takes forever to run as it is! Is there a third party tool that can perform in least cost path in 3D, or am I missing a workaround of some kind?


texts: How can I improve the performance and start-up time of arcgis 10.x?

texts:
ArcGIS 10.0 take about 3 minutes to start. ESRI recommends doing these steps (http://support.esri.com/cn/knowledgebase/techarticles/detail/31672) but does not explain the consequences or adverse side-affects with respect to other installed applications.

I have also heard from a recent ESRI Seminar that decreasing the number of installed printers on the System will also improve start-up performance.

Can anyone comment.

My system is Win7 64bit 4gb Ram. No Licence server.


texts: Total number of cells on each MGRS grid level

texts:
I'm trying to figure out how MGRS grid looks like in a whole. I've already read wiki page and some articles but still didn't find the answer to my question.

As I understand:

level (100 × 100 km cells) - 60 columns × 20 rows = 1,200 cells
level (10 × 10 km cells) - 10 columns × 10 rows = 100 cells (1200 * 100 = 120,000 total)
level (1 × 1 km cells) - 10 columns × 10 rows = 100 cells (1200 * 100 * 100 = 12,000,000 total)
level (100 × 100 m cells) - 10 columns × 10 rows = 100 cells (1200 * 100 * 100 * 100 = 1,200,000,000 total)
...

Is it right or did I misunderstood something?


texts: ST spatial queries to select multi-level location

texts:
I'm trying to write a query in SQL Server using 1 set of points and 2 sets of polygons. The polygons overlap, and I only want to select the points that fall inside of 1 polygon but not the other.

I want to duplicate this behavior in ArcGIS for Desktop.

In ArcGIS:

New Selection by Location Points that Intersect Polygon layer 1
Remove from the Current Selection by Location Points that Intersect Polygon layer 2

Attempt in SQL Server:

SELECT DISTINCT --MY FIELDS--

FROM

Points, Polygons1, Polygons2

WHERE

Polygons1.Shape.STIntersects(Points.Shape) = 1
AND Polygons2.Shape.STDisjoint(Points.Shape) = 1

Am I missing something? I think the logic is sound in the SQL query, but it's not working.


texts: DXF File with text labels not showing in QGIS

texts: I convert a CDR. file to SVG. using cloudconvert then i opened the SVG. file in Adobe Illustrator it was a vector map with text labels. I then export the file from Adobe Illustrator in DXF. format. I opened the DXF as vector layer in QGIS but the text labels are gone. What should i do?


texts: I uploaded the incorrect file. How do I delete this dataset from my map or account?


texts: ArcMap Graduated symbols: Color and size

texts:
Is there a way to get graduated symbols with two quantities being shown?
I am making a map with bus stops where I need to show two quantities both of which are continuous.
 - Symbol size: For population served
 - Symbol Color: For mean distance in the voronoi map


texts: How to use FeatureLayer's opacity settings?

texts:
I'm pretty new to GIS development and I'm trying to load a FeatureLayer that has opacity set (layer is outlined areas that are color-filled and translucent). However, when the layer is displayed in my app it seems as though it's using default 100% opacity. I can override it within the code and change the opacity myself, but that affects the outline borders and labels that are on the layer.

Looking at the drawing info for the layers on the mapserver, I see the borders have "Transparency: 0", and the areas have "Transparency: 50", which is what I expect.

Is there a specific setting when making the request to honor the opacity settings defined on the server?

ArcGIS JavaScript API v3.23

EDITED: Added the drawing info from the server.


texts: Insert Cursor Having an Issue With Reading the Syntax of a List

texts:
In my code below, how do I get the Desired Output?

# Get a list of all 'SITE_NFID' in the dashboard_site_summary table that don't have a match in the nfid_fqn_associations table
dashboard_site_summary_list = []
with arcpy.da.SearchCursor(dashboard_site_summary, ['SITE_NFID']) as cursor:
    for row in cursor:
        if row[0] not in nfa_dict:
            dashboard_site_summary_list.append(row[0]))

# Insert the NFID's into the SHP_Report that didn't have a NFA match to ensure ALL dashboard_site_summary NFID's are accounted
cursor = arcpy.da.InsertCursor(shp_report, ['SITE_NFID'])
for item in dashboard_site_summary_list:
    cursor.insertRow(item)

Current output in the "dashboard_site_summary_list":

Current Output = ['1903BRUF.65', '1903BRUF.65']<---Doesn't work
Desired Output = [(('1903BRUF.65'),),(('1903BRUF.65'),)] <----------Works

Article I found showing correct syntax: https://support.esri.com/en/technical-article/000011654

My best attempt to fix the output of the list:

# Get a list of all 'SITE_NFID' in the dashboard_site_summary table that don't have a match in the nfid_fqn_associations table
dashboard_site_summary_list = []
with arcpy.da.SearchCursor(dashboard_site_summary, ['SITE_NFID']) as cursor:
    for row in cursor:
        if row[0] not in nfa_dict:
            dashboard_site_summary_list.append('((' + str(row[0]) + ',),')


texts: How to get lattitude and longitude of selected pixels from a raster?

texts:
I have have a code which will select some pixels from a raster. Further I want to get Latitude and Longitude information of these pixels and save it in .csv format.

import gdal
import numpy as np
np.set_printoptions(threshold=np.inf)
path="/home/vigna/Downloads/Mod_LSTS/class.tif"
img=gdal.Open(path)
array=img.ReadAsArray()
for j in range(img.RasterXSize-1):
    for i in  range(img.RasterYSize-1):
        if array[i,j] == 4:


texts: OpenLayers Combines Rules and StyleMap/SelectFeature?

texts:
I'm using GeoServer, OpenLayers and WFS features. For one layer, I managed to set either rules to display according to a field or SelectFeature with a styleMap to highlight features when the mouse is over.

I would like to combine both, that's to say display features according to its rules but also being able to highlight features when the mouse is over.

Is that possible?


texts: Is there an Equivalent to the Near tool for Network Analyst?

texts:
I want to do a process where for each street segment, the network distance from the nearest point in a set of point features is calculated. The result is that when you click on a street segment using identify, one of the fields shows the network distance to the nearest point.

For euclidean straight line distance, this process is very simple using the Near(analysis) tool. I pretty much want to do the exact same thing except using network distance instead.

I have already created and built a network layer so no need for info on that.


texts: Creating text buffer in legend QGIS 2.18?

texts:
I work with this polygon layer and this is my map composer:

I used the labels with Text Buffer (yellow and red), and I try to find how I can make the same text buffer in the layer name in the legend.

I read Text color in the legend of the print composer and in it there a solution of creating a new text label. I don't want to do it in this way. I seeking a smart automatic way.


texts: Checking and enforcing downstream Z constraint for synthetic streams?

texts:
Assume I've delineated planar (X, Y) stream breaklines to use them for enforcement of bare ground DEM derivation from high density lidar data. The stream features are in a Z and M enabled polyline shapefile. To convert them into 3D breaklines I use a conflation process to populate the Z from an interpolation of nearby ground points in the same lidar. Before using them for hydro enforcement in DEM derivation, one needs to see that the vertex elevations decrease monotonically in the downstream direction -due to ground noise in the lidar this is not always the case. Does anybody know of a (python, standalone, QGIS or other OS) tool/code to:

Check for downstream elevation monotonic decrease? The tool would detect, maybe tag by ID/measure, polyline segments where the stream deviates from strict downstream gradient. An illustration:

Enforce the downstream Z monotonicity when errors are found. After enforcement the stream above would look like:"


texts: Python code that uses arcpy.describe skips if statement?

texts:
I have multiple shapefiles in a folder which I am trying to compare with same named features in geodatabase.

I want to first clip them within a polygon and then copy and overwrite the features in the geodatabase.

My script is currently skipping the if statement (no geoprocessing) and printing the else statement.

# Set workspace
arcpy.env.workspace = "C:\\Users\\mwisniewski\\My Documents\\DPIPWE"
arcpy.env.overwriteOutput = True
shpFile = arcpy.env.workspace
arcpy.AddMessage("\n")

# Location file geodatabase to update feature classes
geoPath = "U:\\NRM_Base_Data.gdb"

# Local variables
clipRegion = "U:\\Boundary\\NRM_Regions\\DPIPWE_NRMRegionBoundary_Tas_Unk.gdb\\Cradle_Coast_NRM_Region"
shpName = arcpy.Describe(shpFile).baseName
featureName = arcpy.Describe(geoPath).baseName
outFc = ""

shpName = arcpy.Describe(shpFile).baseName
featureName = arcpy.Describe(geoPath).baseName
outFc = ""

# Count the number of shapefiles clipped
count1 = 0
# Count the number of feature classes being copied
count2 = 0

try:
 # Loop through shapefiles and clip to NRM region
 for shp in shpFile:
     if shpName == featureName:
         arcpy.AddMessage(shpFile)
         arcpy.Clip_analysis (shpFile, clipRegion, outFc, "", "", "")
         count1 += 1
         # Copy clipped shapefile into file geodatabase
         arcpy.FeatureClassToFeatureClass_conversion(outFc, geoPath + "\\" + shpName)
         count1 += 1
     else:
         arcpy.AddMessage("Error: Shapefile/s not clipped and copied to file geodatabase ")


texts: I have a feature class containing linear features with from/to measure values applied. Is there a way I can map those measures into the attribute table in "Beginning" and "End" fields? Using arcmap 10.3.


texts: Creating animation with raster data in QGIS?

texts:
I have 4 raster images showing different conditions of air flow distribution at different times. I'd like to create an animation to show the change from image 1 to image 4. How can I do this? I tried Time Manager Plugin because I read it works also with raster but it didn't work. It says that I don't have a valid start time. That's true but because they are raster data I don't have something like a Time-Attribute...and I actually have to choose the attribute containing "time"-attribute in the Time Manager settings.

I'm working with QGIS v. 2.0.1.


texts: Raster created by python GDAL interpreted upside down

texts:
I am using CRS which has axis in left bottom corner. Code below produce Geotiff which is shown allright in QGIS but when I open it in other software it is upside down. Also gdal_calc takes it as upside down when calculating. Is there some easy way how to make sure this grid will be interpreted right as it is if I create it using gdal_translate from xyz?

geotransform=(min_x,min_cell_size,0,min_y,0,min_cell_size)
nrows,ncols = np.shape(zi)
output_raster = gdal.GetDriverByName('GTiff').Create(output_reaster,ncols, nrows, 1 ,gdal.GDT_Float32)
output_raster.SetGeoTransform(geotransform)
srs = osr.SpatialReference()
srs.ImportFromEPSG(28355)
output_raster.SetProjection(srs.ExportToWkt())
output_raster.GetRasterBand(1).WriteArray(zi)


texts: How do I safely open, work on, and close many shape files in pyQGIS?

texts:
I have a pyQGIS script that loops over many files (>1000). I had been getting a mix of OSError: [Errno 24] Too many open files and Creation of layer failed (OGR error: Failed to open Shape DBF file

I think I must not be closing out files correctly and leaving something orphaned behind so I wrote the following and consistently get the dbf file error after opening saving and closing a file about 122 times. I'm not sure if the dbf error relates to the Too many files open error but it would seem a likely starting point on the road to also solving that problem.

How can I safely: open, work on, save, close and repeat?

I can cut and paste the following code into the pyQGIS terminal to illustrate the problem, so you can too presumably

import tempfile
def delete_shape(shape_path):
    nosuff=os.path.splitext(shape_path)[0]
    suffix_list=['.shp','.shx','.dbf','.prj','.sbn','.sbx','.fbn','.fbx','.ain','.aih','.ixs','.mxs','.atx','.shp.xml','.cpg','.qix','.qpj']
    for suffix in suffix_list:
        try:
            os.remove(nosuff+suffix)
        except Exception as e:
            pass

def copyover(Afilename,Bfilename):
    delete_shape(Bfilename)
    Alayer = QgsVectorLayer(Afilename, "A file", "ogr")
    write_error, error_string = QgsVectorFileWriter.writeAsVectorFormat(Alayer, Bfilename, "system", QgsCoordinateReferenceSystem(epsg), "ESRI Shapefile")
    if write_error != QgsVectorFileWriter.NoError:
        print('WARNING write error no. '+str(write_error)+', was: {details}'.format(details=error_string))
    Alayer = None

###################################
## Create simple test shape file ##
###################################
low_lon=0; low_lat=0; high_lon=10; high_lat=10
epsg=4326
bboxlayer=QgsVectorLayer("Polygon?crs=epsg:"+str(epsg)+\
"&field=id:integer&field=name:string(20)&index=yes",\
"bbox_polygon","memory")
bbl_dp = bboxlayer.dataProvider()
bboxlayer.startEditing()
bbox_feature = QgsFeature()
bbox_feature.setGeometry(QgsGeometry.fromPolygonXY( [ [ \
QgsPointXY(low_lon,low_lat),QgsPointXY(low_lon,high_lat), \
QgsPointXY(high_lon,high_lat),QgsPointXY(high_lon,low_lat) ] ] ))
(res, outFeats) = bboxlayer.dataProvider().addFeatures([bbox_feature])
bboxlayer.commitChanges()
Afilename=os.path.join(tempfile.gettempdir(),"Afile.shp")
write_error, error_string = QgsVectorFileWriter.writeAsVectorFormat(bboxlayer,\
Afilename, "system", QgsCoordinateReferenceSystem(epsg), "ESRI Shapefile")
if write_error != QgsVectorFileWriter.NoError:
    print('WARNING write error was{details}'.format(details=error_string))

bboxlayer = None
Bfilename=os.path.join(tempfile.gettempdir(),"Bfile.shp")

##############################
## open save and close loop ##
##############################
for x in range(200):
    print(x)
    copyover(Afilename,Bfilename)
    copyover(Bfilename,Afilename)

It seems that pushing the work to a subprocess will solve it as per: force-garbage-collection-in-python-to-free-memory but this doesn't tell me why or how to solve it without using a subprocess which is much slower and may have caveats that cant be solved in my wider use case.


texts: Adobe Illustrator to Interactive Web Map. Need the basic requirements and steps

texts:
I have a set of city maps designed and customized in Adobe Illustrator with me. This is the first time I'm involving a GIS project. I need to develop an API & GIS supported interactive Web Map (Like Google Maps) with using that AI files. I don't know where to begin and what all are the requirements to start with.

EDIT: Hi Andrew Tice, I would like to use QGIS (Since it's a Open Source). If that's not effective with features, I Don't mind using commercial packages too.

NO, The maps i have are NOT from existing map, they're drawn in our own way with some extra elements (like cartoon/game maps). I would like to develop an interactive web map using them.


texts: Leaflet Sidebar - set content depending on clicked GeoJSON feature

texts:
My goal is to set the content of the sidebar depending on what GeoJSON feature was clicked on.

For example when clicked on polygon A the content of the sidebar is: "This is A" and when clicked on polygon B the content of the sidebar is: "This is B"

my approach to the problem (SOLVED):

function for click event to select GeoJSON feature:

    function onEachFeature(feature, layer) {
        layer.on({
            mouseover: highlightFeature,
            mouseout: resetHighlight,
            click: openSidebar
         });
     }

function to open sidebar:

    function openSidebar(e) {
        sidebar.toggle();
        if (e.target.feature.properties.name == "House 24") {
            sidebar.setContent('this is House 24');
        }
    }

loaded GeoJSON:

    var my_geojson = L.geoJson(my_geojson,{
        style: myStyle,
        onEachFeature: onEachFeature
    }).addTo(map);


texts:
I am using shapely to snap points to a line. This is the piece of code I use

import geopandas as gpd
gdf_segments = gpd.read_file("line.shp")
shply_line = gdf_segments.geometry.unary_union
point  = gpd.read_file('points.shp')
result = point.copy()
result['geometry'] = result.apply(lambda row: shply_line.interpolate(shply_line.project( row.geometry)), axis=1)

How do I get the RID and MEAS values? These values are obtained on running the Locate Features along route linear referencing tool in ArcGIS Desktop.

I would like to achieve the above without arcpy or ArcGIS or FME. I want to code it entirely with python using gdal/ogr/shapely/fiona anything.

Code above referenced from: Snap points shapefile to line shapefile using shapely


texts:
I want to have a localized (e.g. French) addin toolbar. What I have done so far:

Created the Config.fr-FR.xml file and put all the translations there
Changed my system "Region and Language" setting and set the format to French (France)
Installed the Addin

When I run Arcmap, I don't see the localization (I see the original english version)

Note: I have also read this page completely

Can anybody tell me where the problem is?


texts: My service area polygons are not right, look more like road buffers

texts: I have included a screenshot of my settings and what one of the polygons looks like. I have this set to approximately 10, 20, and 30 mile service areas and this entire segment is only about five miles long. It is not including all roadways available and it is not extending past the facility toward the east. I would also like to change this to drive times of 10, 20, and 30 minutes but don't know how to change the cutoffs to time.. Anyone know what's up with this?


texts: Add Join in ModelBuilder gives ERROR 999999

texts:
I'm trying to use Add Join in ModelBuilder but it keeps giving me an error message "generic error". Funny thing is, it works fine if I do one Join but I need to do several ones (about 200s or something and I want to do them at the same time of course).

I've tried Iterators and now succumbed to pasting the same simple formula in ModelBuilder several times but it still doesn't work. Of course I could do this manually but I would rather not having to do that.

I've also tried Join Field but that took 9 minutes for one of these records, it would take hours upon hours since I need to do this many times.

Is this a common problem?

This is an image of my model which outputs error message after one second or so. Some text is in Swedish "alla_lgh_sweref" are my point dataset and the polygon shapefiles are in buffer50 geodatabase.

  Error 999999: Error executing function.

So it's a generic error that doesn't say much. I just try to run the model with the Add Join tool. It works fine if I do it manually, but if I try to batch and/or model it doesn't work.


texts:
Where can the Road Graph plugin be found in QGIS 3.2.2?

It is not among the plugins.


texts: How to load vector layer slices in Leaflet by bounding boxes while caching locally?

texts:
Loading geojson via ajax in leaflet using bbox and How to add a bounding box filter to this leaflet WFS request? both answer how to request vector layer data within a leaflet map by the map's bounding box. However both answers discard the vector layer's data when refreshing, with no caching of the results. I foresee some kind of merging olddata and newdata arrays while removing duplicates and then redrawing the layer.

I found the leaflet-tilelayer-geojson plugin which creates a leaflet geojson layer from tiles of json, served from a request of URL http://{s}.somedomain.com/blabla/{z}/{x}/{y}.json, but the plugin has not been updated for leaflet 1.0

Is there a commonly accepted method/plugin for caching this data?


texts: I processed a tiff DEM (I call it A) in MATLAB and the result (I call it B) loses its georeferencing information. Now I imported B in the ArcMap again and need to overlay it on A (georeferenced) in ArcMap. So they both have the same number of rows and columns. I just want to georeference B exactly the same as A. It should be something quite easy forward like just copying the georeferencing information of A to B (two rasters with the exact same size). But I couldn't find any help through this.


texts: Styling/Selecting based on a hstore column in TileMill?

texts:
I have added an OpenStreetMap dump file to PostGIS using osm2pgsql --hstore (and the default osm2pgsql style file). I have added and opened up this to TileMill.

Is there anyway to style the map based on the values in the hstore column (tags) in TileMill using only CartoCSS? Or do I have to change the subquery on the layer to 'extract' the hstore column to make it look like a real column?

e.g. pretend I want style based on the OSM wifi tag, which is a key in the hstore tags column. In SQL I could select it with: select * from planet_osm_point where tags->'wifi' = 'yes';. If wifi was a real column, then I could style it in CartoCSS with:

#mylayerid[wifi='yes'] { … }

What would I put in to select based on the tags column?

#mylayerid[?????] { … }

I would like to use TileMill as a server to demo using OSM, and allow people to style based on esoteric/edge cases. These are not very technical people, so I'd like to have it as easy as possible.


texts: Force Atlas to print only pages with selected features in map

texts:
I have a layer with around 3000 points. I created a special print composer and I would like an Atlas that will print only pages with the selected features in the map.

Is there a way to force the Atlas to select only these pages?


texts: What elevation are each of my slopes at?

texts:
I am working on a DEM in a sand dune ecosystem, I also have a raster of slope data ranging from 0 to around 20 degree slopes which has been reclassified to 6 categories (1-6) and polygons of the slope categories created in order to find out how much vegetation is present at each slope angle polygon.

However I have decided to separate the slopes that occur at low elevations and those that occur at high elevations so as to distinguish whether there are slopes with a small angle at the top of dunes that may have a different environment for vegetation.

I have detrended my DEM so that it is easier to tell what is sand dune and what is interdune areas and to account for the natural slope of the land but I dont know how to find out which slopes are at higher/lower areas of the DEM, does anyone know how I might do this?


texts: Why does get_datasets not return all the datasets in the database?

texts:
I have code that gets all the Feature Datasets in a database in order to loop through them and find the one I want. This code returns 2 datasets of 24 in an SDE 9.2 database, but 3 datasets of 24 in a version 10 SP 2 database. The user has at least select permissions on all 24 of them, but the code only returns certain ones (and different ones). The code is very simple, shown below. What the heck is going on?

        ESRI.ArcGIS.Geodatabase.IWorkspace _ws = (ESRI.ArcGIS.Geodatabase.IWorkspace)aWorkspaceEdit;
        ESRI.ArcGIS.Geodatabase.IEnumDataset _ed = _ws.get_Datasets(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureDataset);
        ESRI.ArcGIS.Geodatabase.IDataset _ds = null;
        while ((_ds = _ed.Next()) != null) {
            if (_ds.BrowseName == _datasetName) {
                ESRI.ArcGIS.Geodatabase.IEnumDataset _dsed = _ds.Subsets;
                ESRI.ArcGIS.Geodatabase.IDataset _dsfc = null;
                while ((_dsfc = _dsed.Next()) != null) {
                    if (_dsfc.BrowseName == aFeatureClassName) {
                        _fc = (ESRI.ArcGIS.Geodatabase.IFeatureClass)_dsfc;
                        break;
                    }
                }
            }
            if (_fc == null) {
                _ds = _ed.Next();
            } else {
                break;
            }
        }
        _ed.Reset();


texts: Small discrepancy in scale reported by OpenLayers and GeoServer (after DPI fix)

texts:
I'm implementing some scale-dependent functionality in an application that uses OpenLayers 2.12 on the client and GeoServer 2.6.1 on the server.

The legend is created in JavaScript and when a scale-dependent rule in the SLD is disabled by its MaxScaleDenominator element I want to show this in the legend by changing CSS attributes.

The client responds to 'zoomend' events by querying the current scale, looking for any legend items whose rendering rules will be disabled at this scale, and visually identifying those as disabled (e.g. grey text, disabled checkbox).

At first I was seeing significant discrepancies between OpenLayers and GeoServer about what the scale was, but this was resolved by setting the OpenLayers.DOTS_PER_INCH property to 90.71428571428571.

This change addressed the bulk of the issue but I still see a small discrepancy that seems proportional to the scale, e.g.

OpenLayers: 68571.4656
GeoServer: 68609.7366320815

OpenLayers: 1097143.4496
GeoServer: 1097755.7861133264

Now for the important part (I think)... The client displays data in what OpenLayers calls EPSG:900913 (3857) but it is stored in the database in 4326. I'm currently working on the assumption that the discrepancy in reported scale is due to this difference.

Is it reasonable to assume that the discrepancy is due to the projection being performed by GeoServer?
Should I expect this discrepancy to be more pronounced towards the poles?


texts: Openlayers v4.0.1 support Google Maps Javascript API?

texts: I want to know if the latest version of Openlayers (v4.0.1) supports Google Maps as a Tile Layer. I can't find any document ion about this. If Openlayers doesn't support Google Maps, could someone  tell me if there is any way to do this?


texts: R{raster} getValues(): error accessing values of large raster?

texts:
I am getting the following, while extracting all values with:

  rs<-getValues(rster)

Error in getRasterData(con, offset = offs, region.dim = reg, band = object at data@band): long vectors not supported yet: memory.c:3308

rster
class       : RasterLayer
dimensions  : 76740, 80200, 6154548000  (nrow, ncol, ncell)
resolution  : 50, 50  (x, y)
extent      : -1888000, 2122000, -4847000, -1010000  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : /data/her134/BA/GDA94albers/clum50m0314
names       : clum50m0314
values      : 100, 663  (min, max)
attributes  :
    ID  COUNT LU_CODEV7 LU_CODEV7N TERTIARY_V7
from: 100 540931     1.0.0        100  1.0.0 Conservation and natural environments
to  : 663   1755     6.6.3        663 6.6.3 Estuary/coastal waters - intensive use
                          SECONDARY_V7 PRIMARY_V7 CLASSES_18
1.0 Conservation and natural environments 1 Conservation and natural environments          1
            6.6 Estuary/coastal waters                                 6 Water         17
       C18_DESCRIPTION
Nature conservation (1.1)
           Water (6.0)

Using:
platform       x86_64-unknown-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          3
minor          1.0
year           2014
month          04
day            10
svn rev        65387
language       R
version.string R version 3.1.0 (2014-04-10)
nickname       Spring Dance

raster version 2.2.31

Linux:
LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description:    SUSE Linux Enterprise Server 11 (x86_64)
Release:    11
Codename:   n/a

I used to be able to handle this sized raster in earlier versions.

Any ideas of a workaround?


texts: When to use DBMS instead of System Files for Spatial Data Storage?

texts:
I'm having trouble deciding when it is best to use a DBMS instead of System Files for storage of Spatial Data.  Are there any specific guidelines and reasons for when one method is preferred over the other?

For example, does it depend on the number of users working with the data (single-user vs multi-user)? Or what is being done in a project (data storage/visualization vs processing analyses)?  Or is it personal preference in some respects?


texts: GPS glitch causes 200 m circles around stationary position- Has anyone seen this before?

texts:
I am working with GPS data from public transport buses in a city in the UK. The data have very characteristic circles of approx. 200 m diameter at bus stops. I suspect that these are caused by an estimated position but I do not know enough about the GPS technology to explain these patterns. Have you seen these patterns before?
The image shows GPS positions for several months. The white circle is the outbound bus stop and all points in yellow are outbound vehicles and inbound vehicles are shown in blue.

If the vehicle lost signal and estimated its position ahead I would expect a ring only in the direction of travel but I am getting one in both directions. These rings are always oriented in the direction of the route.
They also do not occur at traffic lights and pedestrian crossings, which would be explained by the fact the vehicle does not always stop in the same place as is the case at bus stops.
Just looking at the outbound direction the data looks like this, where the arrow shows the direction of travel.

For a randomly picked example the percentages of the data points in the circle are:

~52% in the centre
~32% behind the bus
~15% in front of the bus

Even though this example is from a city, we are talking about houses on either side of mostly 2-3 storeys. So no skyscraper-canyons that could seriously impact the signal. Unfortunately, I do not know the exact GPS unit used or even where it is placed on the vehicle. For all I know, it might be installed under the driver's seat...
Below you can see an overview. with the stops highlighted in red and it the coordinates in white. These circles appear practically all along the journey at most of the 42 bus stops.

Any help explaining these circles would be amazing!
EDIT:
As suggested by jgm_GIS I have colour coded the points based on
(distance from prior point) / (Time elapsed).
The results are not that clear (I guess they never are...) but it appears that in some cases the ratio is indeed higher in front of the vehicle and lower behind. (See example A&B). But in other cases, the difference is marginal at best or not existent and the ratio is virtually the same before and after vehicle (Example C).
The image shows the colour coded ratio with the approximate values for either semi-circle next to it.

Can anyone explain the intuition behind this? Essentially this shows the speed between the last two points. So what is the software doing? It moves the points away from the bus if it is close to the stop but not quite there yet?


texts: Geo/Geospatial PDF from ArcGIS to Adobe Reader

texts:
I exported a pdf from ArcMap. I opened it in Adobe reader. I can measure and calculate perimtere, but calculate area result is many times 0. Why?

Also, I have TerraGo installed in Adobe Reader, trial version, but none of the options from GeoPDF or GeoMark are enabled and at GeoPDF File Properties it says it is not an actual GeoPDF. Why?


texts:
When uploading CSV files to CartoDB through their web interface, all columns default to string as their data type, despite the CSV file containing a number of number-only columns. An example row is

1400000US55025000100,55025000100,"Census Tract 1, Dane County, Wisconsin",1401,118,1070,128,903,136,167,82,131,62,36,34,0,9,179,74,179,74,0,9,0,9,0,9,0,9,36,31,35,28,6,11,75,45

I know I can change the data type in the table editor, but when you have a large number of columns, this becomes very tedious. According to their documentation, CartoDB should automatically assigns the right data type. Any advice on how to make this work?


texts: Converting LiDAR files from LAZ to LAS format

texts:
I'm trying to convert LiDAR files from the LAZ format (the compressed version) into LAS (the uncompressed version) using LASzip software.

However, I am not really sure how it works. I created a new output folder as I entered in the app interface, but it is totally empty.

I also had tried the following code in the command prompt window:

 D:\LiDAR\Laszip\laszip.exe *.laz

and got a message saying 'no input specified'.

In my folder, there are about 100-ish.laz files as well as one imu.laz. Any suggestions?


texts:
In ArcMap there is an option in data frame properties "Clip Options" and inside that drop down there is "Clip to Shape".
Apparently there seem to be no option in ArcGIS Pro. Is there a way to do this ?


texts: Equal geographic coordinate grid intervals

texts:
Is there a way of creating an equal geographic coordinate grid interval in QGIS print composer? I tried editing the interval and offset but it does not give equal interval like 121°14'0" then 121°14'15" and then 121°14'30" and so on.

Attached below is an image I layout with some details.


texts: What are Folium style_function parameters

texts:
I'm trying to do a uniform style for each polygon, but I want to know further about what I can do with Python library Folium Style_function. What can I put in the style variable? Where are the resources that I can look up to?

style = {'fillColor': '#f5f5f5', 'lineColor': '#ffffbf'}
polygon = folium.GeoJson(gjson, style_function = lambda x: style).add_to(m)

I know that the style variable should be a dictionary, and I looked at the documentation. It seems like every resource that I have encountered has been trivial from other topics.


texts: Transfer geometry from shapefile to related table?

texts:
We would like to contact our volunteers based on their geographic location. We settled on zip codes as a reasonable proxy for location, and now have a table with volunteer contact information and zip code. I have a shapefile of the zip codes in our state, and have related this our volunteer table as it will be a many-to-one relationship. Now I can click between the two tables, but I can't figure out how to get the spatial information and the contact information into one place - ideally a shapefile - that I can use to select volunteers based on location (by selecting all volunteers within 30 miles of an event, for instance). I see in "transfer geometry of a feature class into a table" (Transfer geometry of a feature class into a table) that there is a way to transfer point data into the table, but not how to do that.

Is there a way to get the spatial information from a shapefile to attach to a table that contains many records matching individual polygons? The ideal outcome would be a point shapefile with all the volunteers appearing as overlaid points at the center of their zip code (or even better, overlaid zip code polygons with the volunteer's information associated with an individual polygon). If there's something less awkward than a relate, I'm happy to change methods.


texts: Turn a map canvas into a vector layer in QGIS

texts:
I ran a program that created points on the nearest edge of a polygon, but it only appears in the iface.mapLayer() canvas.

The code is taken from the answer in: https://gis.stackexchange.com/a/94428

You can see that no layer is selected but the points are still showing.

How do I get the points onto a vector layer or a shapefile?

EDIT:
This is the modified code

import math
from qgis.gui import *
from PyQt4.QtCore import Qt

lineLayer = iface.mapCanvas().layer(0)
pointLayer =  iface.mapCanvas().layer(1)
canvas =  iface.mapCanvas()
spIndex = QgsSpatialIndex() #create spatial index object
lineIter =  lineLayer.getFeatures()

for lineFeature in lineIter:
    spIndex.insertFeature(lineFeature)

pointIter =  pointLayer.getFeatures()

for feature in pointIter:
    ptGeom = feature.geometry()
    pt = feature.geometry().asPoint()

    nearestIds = spIndex.nearestNeighbor(pt,1) # we need only one neighbour
    featureId = nearestIds[0]
    nearestIterator = lineLayer.getFeatures(QgsFeatureRequest().setFilterFid(featureId))
    nearFeature = QgsFeature()
    nearestIterator.nextFeature(nearFeature)

    closeSegResult = nearFeature.geometry().closestSegmentWithContext(ptGeom.asPoint())
    closePoint = closeSegResult[1]
    snapGeometry = QgsGeometry.fromPoint(QgsPoint(closePoint[0],closePoint[1]))

    p1 = ptGeom.asPoint()
    p2 = snapGeometry.asPoint()

    dist = math.hypot(p2.x() - p1.x(), p2.y() - p1.y())
    print dist

    r = QgsRubberBand(canvas,QGis.Point)
    r.setColor(Qt.red)
    r.setToGeometry(snapGeometry,pointLayer)


texts: Any suggestions for a free simple portable GIS viewer

texts:
I am looking for a free, simple and portable GIS viewer. Any suggestions?

By 'free', I mean gratis long-term, and not some trialware version or a version with 'restricted' functionality (e.g. < 1000 objects).

By 'simple' I mean a very basic, easy-to-use GIS viewer for a non-GIS user, like zooming, panning, identifying, switching on/off layers, etc. It still needs to be able to handle large data files though. Portable versions of ArcMap or QGIS are far too complex.

By 'portable' I mean a viewer that can be:

installed on a USB memory stick or on a DVD without needing any
admin rights or without installing any files (e.g. DLLs) on the PC;
run from the memory stick or DVD

By 'viewer', I mean a GIS that doesn't allow creating, updating, or deleting the data.

I tried ArcGIS Explorer Desktop but didn't like it.

The whole point is that I can give my clients a memory stick with a GIS and the data on it, and he can just plug and play, and explore the data without having to bother his internal IT department for getting software installed.


texts: How do I check for existing ArcGIS Map Layer

texts:
I would like to know how I can check if I have an existing Map Layer before I call map.removeLayer(layer). I am having an issue because I am calling that even if there isn't one to remove.

if (document.getElementById('layer').checked) {
      layer = new esri.layers.ArcGISDynamicMapServiceLayer("---url here---", { "opacity": 1 });
      map.addLayer(layer);
  }
  else {
      if(map.layerIds.contains(
      map.removeLayer(layer);
  }

If the box is unchecked, it will try to remove a non-existing layer. How do I get around this?


texts: OpenLayers, Geoserver: TileWMS are displaying wrong

texts:
I'm trying to display some WMS with tiles, but at every zoom (in or out) the images are displaying wrong, with wrong proportions. This is how I'm creating the tile:

    var map = this.state.map;
    var layers =
        new ol.layer.Tile({
            source: new ol.source.TileWMS({
                url: 'http://XX.XX.XX:8080/geoserver/cite/wms',
                params: {'LAYERS': 'cite:clientes_ex', 'TILED': true, 'VERSION': '1.3.0',
                    'FORMAT': 'image/png8', 'WIDTH': 256, 'HEIGHT': 256, 'CRS': 'EPSG:3857'},
                serverType: 'geoserver'
            })
        })
    map.addLayer(layers);

This is what happens.

This is another example, in zooms very far way from the map:

Any idea how could I fix it?


texts: Open Feature form in multi edit mode using PyQGIS?

texts:
Is there a way to use PyQGIS to open the Feature form in the multi-edit mode for the active layer selected features?

It's the "standalone" version of the one existing for the attribute table.

https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/attribute_table.html#editing-multiple-fields

Or do I have to recreate the form like it's done in C++ in here:

https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L9236


texts: Openlayers 3 getGetFeatureInfoUrl geoserver problem

texts:
I try to use Openlayers 3 DragBox for BoxSelection ang get selected feature info from wms source. Layer projection EPSG:4326

    var host = 'http://x.x.x.x/geoserver/wms'
    var view = new ol.View({
        center: [12018110.072132599, 6954779.226347315],
        projection: 'EPSG:3857',
        zoom: 6
    });

    var wmsStation = new ol.source.TileWMS({
        url: host,
        params: {
            'LAYERS': 'baikalgeol:station_psg',
            'TILED': true,
            'VERSION': '1.1.1'
        },
        serverType: 'geoserver',
        crossOrigin: 'anonymous'
    });

    var layerStation = new ol.layer.Tile({
        title: 'Station',
        source: wmsStation,
    });

    var map = new ol.Map({
        pixelRatio: 1,
        controls: ol.control.defaults().extend([
            new ol.control.ScaleLine({
                units: 'metric'
            })
        ]),
        renderer: 'canvas',
        target: 'map',
        layers: [
            new ol.layer.Group({
                layerStation,
                ...
           })
        ],
        view: view
    });

var dragBox = new ol.interaction.DragBox({
    condition: ol.events.condition.platformModifierKeyOnly
});

map.addInteraction(dragBox);

dragBox.on('boxend', function(evt) {
    var info = []
    var extent = dragBox.getGeometry().getExtent();
    console.log(extent)
    // extent = ol.proj.transformExtent(extent, 'EPSG:3857', 'EPSG:4326')
    // extent = [extent[1], extent[0], extent[3], extent[2]]
    console.log(extent)
    var source = wmsStation;
    var viewResolution = map.getView().getResolution();
    var queryLayers = source.getParams().LAYERS;
    var url = source.getGetFeatureInfoUrl(extent, viewResolution, 'EPSG:3857', {
        'INFO_FORMAT': 'text/html',
        'QUERY_LAYERS': queryLayers,
        'VERSION': '1.1.1'
    });

    if (url) {
        // url = url.replace('&CRS=', '&SRS=')
        console.log(url)
        document.getElementById('info').innerHTML =
            '<iframe id="frame" seamless src="' + url + '"></iframe>';
    }
});

But geoserver not return feature, only empty html.

URL: http://x.x.x.x/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=baikalgeol%3Astation_psg&LAYERS=baikalgeol%3Astation_psg&TILED=true&INFO_FORMAT=text%2Fhtml&X=0&Y=255&WIDTH=256&HEIGHT=256&SRS=EPSG%3A3857&STYLES=&BBOX=0%2C0%2C626172.1357121639%2C626172.1357121639

I think the problem in the extent. I tried transform extent coordinates for layer projection and changed getGetFeatureInfoUrl projection:

extent = ol.proj.transformExtent(extent, 'EPSG:3857', 'EPSG:4326')
...
var url = source.getGetFeatureInfoUrl(extent, viewResolution, 'EPSG:4326'...

But geoserver return:

<ServiceExceptionReport version="1.1.1" >
     <ServiceException code="InvalidPoint">
        655, -176 not in dimensions of image: 256, 256
      </ServiceException>
 </ServiceExceptionReport>


texts: no MousePosition() while using FullScreen() in ol3 map

texts:
The problem is: the MousePosition() is working and shown. But in FullScreen it's not!?
I tried Rotate() and ScaleLine(). Both are working in FullScreen() but i never saw any coordinates.

I'm using it like this:

var mousePosition0 = new ol.control.MousePosition({
    coordinateFormat: ol.coordinate.createStringXY(3),
    projection: 'EPSG:4326',
    className: 'custom-mouse-position',
    target: document.getElementById('mouse-position'),
    undefinedHTML: '&nbsp;'
});
map.addControl (mousePosition0);

I'm using a DIV-element (mpb) around the DIV which is showing the coordinates. I did that to change its position ... like followes:

shows the coordinates

Any hints, suggestions or are there more details needed?


texts: Get JSON output from GeoServer to feed into OSMBuilding

texts:
OSMBuilding has a function which allows 3D json file be added to Leaflet as stated here. The question is how I can get the same format from GeoServer.

I have tried this

 http://localhost:9090/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=localhost%3A3D_sample&outputFormat=json&dataType=jsonp

as stated here and here, I could get a Json output like this:

   {"type":"FeatureCollection","totalFeatures":1,"features":[{"type":"Feature","id":"3D_sample.fid--57e9f8c8_15eeea74f64_-11f9","geometry":{"type":"MultiLineString","coordinates":[[[174.88757026,-36.90768287,24.4688],[174.88754738,-36.90774106,22.4855]],[[174.88754738,-36.90774106,22.4855],......]]},"geometry_name":"geom","properties":{"objectid":1,"recordstatus":"Current","heightminlidar":0.855906,"heightmaxlidar":6.61621999,"heightmeanlidar":4.5......,174.88764272,-36.90753397]}}],"crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4167"}},"bbox":[174.88743904,-36.90774106,174.88764272,-36.90753397]}

While I need sth like this as stated here

  {
    "type": "FeatureCollection",
    "features": [{
    "type": "Feature",
    "geometry": {
    "type": "Polygon",
    "coordinates": [
    [

    [174.749268, -36.853149],
    [174.751368, -36.854249],
    [174.752468 ,-36.855349],
    [174.753568 ,-36.856449 ],
    [174.749268, -36.853149]

    ]
    ]
    },
    "properties": {
    "color": "rgb(255,200,150)",
    "height": 220
    }
    }]}

this means I do not need this

 {"type":"FeatureCollection","totalFeatures":1,"features":[{"type":"Feature","id":"3D_sample.fid--57e9f8c8_15eeea74f64_-1205","geometry":

from Geoserver, but I do not know how I could get the right format.


texts: Add x y data from existing attribute table

texts:
In Quantum GIS, I already imported an excel or dbf table. Now I need to tell Quantum GIS which columns are Latitude and Longitude. How do I do that?

I know there is Add Delimited Text Layer which allows that, but it seems Unreasonable to me to convert XLS or DBF file to text file before importing! There must be some direct way of telling QGIS that these parameters of the imported attribute table are actualy x y data.


texts: Mapbox.js: parsing coordinates into latitude and longitude from GeoJSON

texts:
I am making my way through learning Mapbox and Mapbox.js. I have loaded my GeoJSON data from a URL:

var featureLayer = L.mapbox.featureLayer()
.loadURL('./data_frag.geojson')
.addTo(map);

Now I am trying to parse out the lat and lon coordinates. It makes sense to me to try something like:

var longitude = featureLayer.geometry.coordinates[0];
var latitude = featureLayer.geometry.coordinates[1];

but that is not right.

Should I be using the feature layer or the GeoJSON layer for this?


texts: Calculate Lat / Lon values in a Spatialite point layer

texts:
I've a point layer in Spatialite in EPSG32632 system reference.

Then I've added two columns to calculate x, y coordinates in this way

ALTER TABLE points ADD COLUMN X REAL
ALTER TABLE points ADD COLUMN Y REAL

and calculate the coordinates in this way

SELECT load_extension('mod_spatialite');
UPDATE points SET X=ST_X("Geometry") , Y=ST_Y("Geometry")

Now I need to calculate the Lat, Lon values too.

I've tried this

ALTER TABLE points ADD COLUMN LON double;
ALTER TABLE points ADD COLUMN LAT double;
UPDATE points SET LON=ST_X(ST_Transform(geometry,4326));
UPDATE points SET LAT=ST_Y(ST_Transform(geometry,4326));

No errors in the execution but if I try

select X,Y,LON,LAT from points;

the result is

492051.358020695|4927339.50750624||
488162.133600385|4919734.42606608||
527761.520720489|4906898.57798871||

so, LON and LAT are empty.

Suggestions?


texts:
I am trying to add a simple layer of security to my ArcGIS JS app. I do not want to prompt my users for a login to retrieve a token. So instead I pass the username/password inside this PHP proxy: https://github.com/Esri/resource-proxy/tree/master/PHP
This works great for all of my needs EXCEPT when I try to execute the PrintTask. I get a CORS error because the proxy is not getting prepended to the layer URLs inside the "Web Map as JSON" string.

I basically have my AMD javascript set up as follows:
//in init.js
defne(["dojo/ready", "esri/urlUtils", "esri/tasks/PrintTask", "app/myConfig"], function(ready, urlUtils, PrintTask, config){
ready(function(){
    urlUtils.addProxyRule({
        urlPrefix: "myMachine.org"
        proxyUrl: "myMachine.org/proxy/"
    });

    printTask = new PrintTask(config.helperServices.printUrl); //global
}

//in print.js
//do all my AMD loading stuff...
//within my printLayout: do stuff

var params = new PrintParameters();
params.map = map;
printTask.execute(params, function(){...}

I receive the following error if firebug:

I suppose it is breaking because my async scope/structure.
When I prepend the proxy to the urls in REST GP processing task it prints as expected.
Can anyone think of a workaround that would allow me to use the same logic of using this simple proxy.php to pass security credentials that also prepends my proxy to my web map as json url?


texts: Automatically fix overlaps by weight/occurrence

texts:
I'm working on a project where I have asked a number of individuals to digitize the same features on the same satellite image. For example, an image of a coast where a group of individuals each draw polygons for the sand, water, vegetation and urban land. Each individual creates 4 feature classes. I would like to combine their efforts to create a final digitised map where the boundaries between feature classes are delineated by occurrence (i.e., if 70% of individuals say this region is sand, 20% water and 10% vegetation, then class as sand).

My current workflow to achieve this is:

For each class, I combine their polygon feature classes into a single feature class using the "count overlapping features" tool in ArcGIS. The count value is the occurrence.

I then place all feature classes into a geodatabase topology with the following rule: "must not overlap with".

I now have a number of overlap errors, the majority being where a 1 or 2 individuals have mapped the area a different class.

Manually editing these tens of thousands of overlaps is too time-consuming. I, therefore, believe I should automate the assignment of polygon overlaps using this criterion.

Overlap Scenario 1: For a given overlap, if there is a difference in occurrence value between the labels, then select the label with the highest occurrence. (i.e., 3/7 users classified it as water and 2/7 as sand -> assign overlap as water).

Overlap Scenario 2: For a given overlap, if there is no difference in occurrence value between the labels, then select the label according to the following ranking "urban land > vegetation > sand > water". (i.e., 1/7  classify it as water and 1/7 classify it as sand -> assign overlap as sand).

How can I eliminate overlaps by feature occurrence and weight?

Images:

Here is a map of water by one individual

Here is a map of water by a second individual

Using the "count overlapping features tool" here is a map of water combined by several individuals, where darker colours = higher overlap occurrence.

Here is a map of water by occurrence and sand by occurrence, where darker colours equal a higher occurrence. There is a band of overlapping polygons along the boundary between sand and water. I wish to fix these polygon errors by selecting the polygons with the highest occurrence. If the occurrence value is equal between feature classes, then assign the overlap using the following ranking "urban land > vegetation > sand > water".