texts: Object in webscene layer gets jagged when processing complete model

texts:
After converting a Revit model to a WebScene I see some edges are jagged:

Where the edges in the original are sharp:

When this jagged part of the model is processed separately the results are as expected:

The steps I followed are:

In Revit, using the FME Exporter for Revit Add-in to create a .rvz (essentially an IFC export).
In FME Desktop (2018), read the .rvz, scaled the model (XYZ 0.001, mm to m), added a (projected) coordinate system and wrote it as MultiPatch to a File Geodatabase.
In ArcGIS Pro 2.3.1, created a Project, created a Local Scene, added the FeatureClass from the File Geodatabase, used the "Create 3D Object Scene Layer Package" tool to export a Scene Layer Package.
In ArcGIS Online, tab My Content, added the package via the Add Item button.

Initially I suspected scaling the model from millimeter to meter caused this. But when the only the jagged item is processed it works fine, so I think I can rule this out.
Would be very happy if someone can point me in the right direction.
Disclaimer: I'm just getting started with 3D data like Revit models and WebScenes, so I probably ask something obvious. Do work with 2D / 2.5D vector data and ArcGIS for Server for a while so not a complete novice.
Update 201903050902:

Processed via Shape instead of File Geodatabase, no difference.
Found and used the "Validate Scene Layer Package" tool in ArcGIS Pro. Some interesting results:

In the complete package generated by ArcGIS Pro I get a lot of errors like:
-------------------------------------------------------------------------------
Node validation:
...
    Warning: Invalid Value:
        The mbs of node 0 extends outside the mbs of its parent, node root, by 5949660% of the radius of the mbs of its parent (10543395,33 meters).
        The mbs of node 1 extends outside the mbs of its parent, node root, by 5237936% of the radius of the mbs of its parent (9282148,94 meters).
        The mbs of node 2 extends outside the mbs of its parent, node root, by 1348704% of the radius of the mbs of its parent (2390038,83 meters).
        The mbs of node 3 extends outside the mbs of its parent, node root, by 2754633% of the radius of the mbs of its parent (4881487,30 meters).
        The mbs of node 4 extends outside the mbs of its parent, node root, by 1475275% of the radius of the mbs of its parent (2614336,32 meters).
        The mbs of node 5 extends outside the mbs of its parent, node root, by 2329187% of the radius of the mbs of its parent (4127553,01 meters).
        The mbs of node 6 extends outside the mbs of its parent, node root, by 2344830% of the radius of the mbs of its parent (4155273,86 meters).
        ...

The complete package generated by FME has also issues, but the are different:
-------------------------------------------------------------------------------
Node validation:
...
    Warning: Missing Value:
        Node 0 has no content and is empty.
        Could not get attributeData array for node 0.
        Node 0-0 has no content and is empty.
        Could not get attributeData array for node 0-0.
        Node 0-0-1 has no content and is empty.
        Could not get attributeData array for node 0-0-1.
        Node 0-0-1-1 has no content and is empty.
...

As we have other models without this kind of issues I suspect the cause of the problem is in the source (Revit) model.


texts: Height transformation parameters between any model and EGM-96

texts:
Dear Mr/Mrs Geodesy Engineers

I have a quite deep question here,

AIP data locations are determined by geographic coordinates /X & Y axis/ and vertical values /Z axis/ via Geodesy science.

ICAO adopted EGM-96 is standard for Vertical Reference System.

Question is raised regarding to Annex-15, 1.2.2.3  "......When a geoid model other than the EGM-96 model is used, a description of the model used, including the parameters required for height transformation between the model and EGM-96, shall be provided in the Aeronautical Information Publication (AIP)."

In Mongolia, We are not using EGM-96 for Vertical Reference System. We are using Baltic sea level value /1940-1970/ in Air Navigation.

Question is: How to figure out the parameters required for height transformation between any model and EGM-96 for AIP publication?

In my thinking the parameters must contain following values: delta X, delta Y, delta Z, X rotation, Y rotation, Z rotation, Scale... etc. Is this correct?


texts: Creating contours with meaningful values from point data

texts:
I recently obtained a CSV containing the locations of all recorded bicycle accidents in Boston over the past few years. As an avid cyclist, I'd like to create a simple contour map that draws attention to the intersections with the greatest accident densities to share with friends, colleagues, and city officials.

Using the Heatmap QGIS plugin and GDAL's contour tool, I created an aesthetically pleasing contour map, but my concern is that the numerical values are not easily digestible, largely because the heatmap plugin computes density using KDE, rather than point density.

I'd like to create contours that reflect the number of crashes within 400m of a given point. (So for example, any point within the highest "elevation" contours is within 400m of at least 8 crashes, while any point within the lowest "elevation is within 400m of at least 1 crash.) Is this possible? Or is there another, better way to visualize point densities using contours?

If it's any help, I generated my heatmap with a radius of 400m, a decay of 0, and X and Y values of 10 (so each cell is 10m x 10m). I converted the heatmap into contours using an elevation value of 1.

I'd be grateful for any tips or solutions to my quandary.

Thanks!


texts: Is there a way to change Table to Table import parameters in ArcCatalog?

texts:
Is there a way to change Table to Table import parameters in ArcCatalog to either import text longer then 255 characters or truncate the input text to 255 characters?

I have 350 tables in a CSV format and I am using import Table (multiple) function in ArcCatalog. Majority of the table import fine but some fail because the source field text is longer then 255 characters.  Instead of making the text field longer automatically ArcCatalog importer fails with the following error (identical in all cases):

Failed to convert C:\Users\Jakub Sisak\Desktop\LIDS_Jan2013\Processed_TBL\arasurpt_ara_survey_point.csv. ERROR 001156: Failed on input
OID -1, could not write value 'Area upstream of culvert appears to have been ponded recently, possibly due to culvert blockage/beaver
activity. Sampling started upstream of ponded area. Only fish sampling was done. Station UTM is downstream end. Pond at upstream is
man-made dam of earth and debris and is in poor repair.' to output field COMMENTS
Failed to execute (CopyRows).

Is there a way to change the "importer" paramaters to either truncate the string (accaptable) or increase the length of the text field (ideal)

I am using File Geodatabase, ArcGIS Standard (ArcEditor). There is no memo field option in FGDB but text field (default length 255 characters) can be more then 255.


texts: Field calculating many fields in ModelBuilder?

texts:
I am trying to field calculate data between two large feature classes. I started to set up a model in ModelBuilder to do this until I thought I would ask if anyone has a better way to do this.

A brief description of the project: We have a large feature class of street center lines that have truck route information embedded to them. The routing information along with dates, and string fields need to be transferred to a property parcel feature class. There are about 50 or so fields that need to be transferred over.

What I have set up so far in model builder is two feature classes being joined and then 50 or so field calculate tools with a remove join at the end.

Does anyone know a more clever way to do this?


texts: Live database connection to ArcMap for Linear Referencing?

texts:
Is it possible to have a live ArcMap 10.4 connection to a database that will update database changes without the need to export the database table as a GDB?

Do I always have to do the export?

I mean this particularly in regards to linear referencing.


texts:
I have a web mapping app running on Heroku.  My app is written in python.  Using pip I was able to install various pure python libraries that were needed.  I would now like to install Shapely too. This is simple enough (with pip) but I am unsure how to install the geos pre-requisite within the virtualenv (venv) directory.  I would much appreciate any pointers.

Thanks,
John


texts: Does projection matter for Zonal Statistics as Table on world raster

texts:
My goal is to take a world population grid (2.5 arcmin) and perform zonal statistics as table inside country borders (and also inside the cells of a 1-degree fishnet intersected with country borders). I see on the tool description that one shouldn't use geographic coordinate systems for Zonal Statistics as Table. However, I just tried to project my input raster to an equal-area projection and it seemed like it would never finish - also projecting required me to choose a "resample" option - I want the same values that I started with!

So, will I be okay if I perform ZS as table in my starting system (which I think is WGS 84)? I just want to add up pixels inside shapes. I'm most concerned about allocation happening properly across borders - of the countries and fishnet. And I don't understand why projection matters in this case, as my raster grid cells have a specific location and my polygons do too, so no matter what projection, wouldn't their relative placing remain the same?

Bonus question: does projection matter for plain Zonal statistics, too? What about for converting a polygon to a raster?


texts: How do I generate grid square polygons from a 5m DTM file?

texts:
For my dissertation I have collected point features as coordinates and want to relate their distribution around a lake to elevation to see if there is any pattern/relationship between them.

I have downloaded the 5m DTM file for the location but want to be able to automatically calculate the number of points within each grid square of the DTM but I'm unsure how to do this.

I then want to be able to create graphs from this data of elevation vs. number of points.

As a relative newbie to GIS, I don't have much experience doing what appear to me, to be more complicated processes.

I'm using ArcMap 10.2.2 and I believe I have access to all toolbox functions whether on my laptop or a university computer!


texts:
The GEE tutorial shows how to mask an image for one pixel value using .eq(pixel value).

However, I want to mask all pixels in an image with a value of 15 or less in this dataset

var riverflow = ee.Image('WWF/HydroSHEDS/15ACC');

var flowAccumulation = riverflow.select('b1');

And now I need to use .updateMask. This must be very straightforward right?


texts:
Is it possible to download full regions of OpenTopoMap data ?

I saw that it is possible for Garmin devices (http://garmin.opentopomap.org), however, I am looking for jpg/png tiles and I could not find any easy way to convert Garmin format to tiles.

I am interested by OpenTopoMap as I guess this is the best data available for hiking in Europe.


texts: I was able to make my pie charts in one mxd transparent, which I prefer, but I cannot replicate it. When I try to look it up it seems pie charts can't be made transparent. They are two different layers but both are point layers. I just adjusted the transparency in one but for the second even when I adjust it nothing changed.


texts: How can I densify only selected features. checkbox is grayed out for this in QGIS 3.8.1:


texts:
I need to get the JSON from a feature using ArcObjects. According to  I tried to following code, but it does not work:

var jsonWriter = new JSONWriterClass();
jsonWriter.WriteToString();

var jsonSerializer = (IExternalSerializerGdb2) new JSONSerializerGdbClass();
var options = new GeometryResultOptionsClass();
var fieldIndexes = Enumerable.Range(0, feature.Fields.FieldCount).ToArray();
serializer.WriteRow("", feature, feature.Fields, fieldIndexes, options);
var json = Encoding.UTF8.GetString(jsonWriter.GetStringBuffer());

I allways get the error in the line serializer.WriteRow("", feature, feature.Fields, fieldIndexes, options):

  Value does not fall within the expected range. (Source: ESRI.ArcGIS.Geodatabase)

Does anybody know how to call the WriteRow(...) method correctly


texts: How to identify the co-ordinate system (CRS, SRS) of a GeoJSON file?

texts:
Suppose you have an arbitrary GeoJSON file, and the publisher didn't give much supporting documentation - or perhaps it's been provided by a third party who don't know much about it.

Is there a standard way to identify what CRS or SRS the file is in? For example, is there a readily available tool (like a web tool) that can read such a file and identify this?

I'm writing some documentation for a process that is to be used for preparing spatial boundary data files for a process, for converting files from arbitrary publishers into accepted formats, and I'd like a step that users (who usually won't have much specific GIS experience) can follow to see if they need to convert their file's CRS/SRS and if so, what from.

I've seen Identifying Coordinate System of Shapefile when Unknown? but that seems to be exclusive to Shape files.


texts: Are there pre-built virtual machines available for download that serve as a Tile Server for OpenStreetMaps?

texts:
The steps outlined here go over how to install an OpenStreetMaps Tile Server on Ubuntu. The steps are quite long and will be copy / paste over and over again.
Is there any chance somebody has followed these steps on VirtualBox and generated an OVA file somewhere that I can download? That would save me (and many other people) a ton of time.


texts: GeoServer Error decoding CRS: Error in "PROJECTION": No transform for classification

texts:
What I would like to do is to project world map from EPSG:4326 to other ones in geoserver ,special for the Esri EPSG world projection methods.
GeoServer has so many EPSG codes in the demo/srslist, but seems most of them do not work.
For example,from EPSG 4326 to 54052 PROJCRS["World_Goode_Homolosine_Land"], I put the gt-epsg-extension-23.2.jar which mainly support the Esri EPSGs to the GeoServer lib path，it should have done for it's projecion, but nothing happens.
So how to make GeoServer support the Esri world map projection, like "World_Goode_Homolosine_Land" 54052, "World_Bonne" 54024 or "World_Winkel" 54019? GeoTools maybe supported the Esri EPSGs, does some errors happen in the GeoServer inside?


texts: Batch convert GeoTIFFs to JPEG keeping GPS info

texts: How can I convert a batch of GeoTIFFs files to JEPG preserving GPS info on EXIF?


texts: How to construct dataset in memory that is built from CSV and VRT file?

texts:
I'm using GDAL .Net wrapper, GDAL.Net.

I have a list of scattered points ( in X,Y,Z coordinates) that I would like to rasterized via the function GDAL_GRID( or via the underlying .Net wrapper, Gdal.wrapper_GDALGrid(). Currently this is what I do:

I write the list of scattered points to CSV file
Then I construct the .vrt file that maps to the previous CSV file, by using relevant .Net XML libraries.
And then I use the GDAL.Dataset ds =Gdal.OpenEx(vrtFile, 0, null, null, null)) in .Net to read the contents of vrt file and CSV file into Gdal.Dataset, so that I can use the Gdal.wrapper_GDALGrid(tiffFile, ds, null, null, string.Empty) to create the raster file tiffFile.

Note that step 1 and 2 touch the file system, which I'm thinking of doing away with.

Is there anyway that I can create the GDAL.Dataset ds straight from the scattered points, all in memory, without writing the scattered points to CSV, and create vrt file on disk?


texts: How do I split a vector layer into separate grid layers?

texts:
I need to split a vector layer into 1km x 1km squares so I can carry out some calculations for these individual areas.

Is there a feature to do this?


texts: Is there a way to perform zonal statistics-like operations with feature zone data without doing feature-to-raster transformation?

texts:
I want to use zonal statistics on Chinese counties (which can be very small) from a fairly coarse (0.5 degree) raster grid. The problem with zonal statistics is that it returns a much smaller number of counties after the feature-to-raster transformation. This means a lot of my counties won't be assigned any data.

Can this be overcome somehow?

For example, I would like for example to have a list of raster cells that lie within each county, along with the cell's value and the share of the cell that lies within the county. This way, I would be able to construct a nice measure.


texts: Calculating floodplain for river section using DEM only in ArcGIS Desktop?

texts: I'm looking to create areas where water might go when a river floods its banks. I have a pretty good resolution DEM (5ft^2 for each "square"). I'm not looking for anything super accurate or precise but just so that I could go and check the areas out whenever a flood event occurs on the river. Below is a pictures of what my DEM looks like. I was just going to consider the banks to be where it goes from almost black in color to more of a dark grey (like I said, I'm not looking for anything exact).


texts:
When I import MapInfo files into QGIS only the shapes of the MapInfo elements are imported and not the associated table data. How does one retain the Table data saved in the .DAT file?

I have a series of MapInfo contour files. I can import the shapes, but the altitude for each of the shapes cannot be loaded in. How is this done?


texts: Can total ascent be hard-coded into GPX, TCX or FIT files?

texts: Indoor workouts (including heart rate data) can be saved as GPX. The file can then be edited to hard-code total distance of the workout. Can total ascent also be saved in the file, or alternatively in the TCX or FIT formats allowed by Strava?


texts: Why does gdalinfo -hist give values outside of [0 - 65535]?


texts: Create public transport lines map with the ArcGIS schematics extension

texts:
I want to build a transport lines in a map schematics.Like the one we see on metro stations, I know that is possible with schematic extension of ArcGIS

Here some explications on how
Create route maps with the ArcGIS schematics extension
But I want an easy example.


texts: Primary Key field needs to be filled with UUID in QGIS before insert

texts:
I have a postgres database with a postGIS extension. Some of the fields in the database tables are primary keys that are automatically being generated either with a UUID genarator or based on another column. Now, within a postgres/SQL IDE with a 'before insert on' trigger function this is no problem because it is generating the UUID before the insert.
However, I want to achieve the same within QGIS. But because of the NOT NULL characteristic of the PK I can't leave this field empty and thus not being able to save it. Is there a way to solve this?


texts: Error 010240: Can't save my con statement as a tiff?

texts:
I want to write a conditional statement and save it as a .tif file. I have looked through the documentation from ArcGIS and as far as I can tell, my code should work, but I keep getting an error that the computer can't save what I want as a raster. I have saved .tif files earlier in my code, so I'm not sure what the problem is. I've tried to save in different file formats as well, but I got the same error message.

import arcpy
from arcpy import env
arcpy.CheckOutExtension("Spatial")
from arcpy.sa import *

path = 'folderlocation'
env.workspace = path  #this is the work environment
template = 'actualrd.tif'
env.extent = template  #set the extent
env.cellSize = template  #set the cell size
env.overwriteOutput = True  #set overwrite output to true

tempEuc = 'temp_dist.tif'
outEucDist = EucDistance(actualrd, 500)
outEucDist.save(tempEuc)

tempCon = r'temp_con.tif'
outCon = Con(((tempEuc >=0) & ('actualrd' == 1)), 1)
outCon.save(tempCon)

I can save the euclidean distance raster file, but not the conditional statement raster file.

  RuntimeError: ERROR 010240: Could not save raster dataset to [file
  location] with output format TIFF.

I am using ArcGIS 10.4.1


texts: QGIS export "save as image" automate with python?

texts:
Have several hundred grid views with OpenLayers WMS that are being exported in QGIS using Project > "Save as Image". Doing it manually selecting individual grids, "zoom to selected", Project tab > "Save as Image", save as tiff, repeat...

Seems Python could automate this with a simple script yes?


texts: Convert a group of lines into a single polygone to style it

texts:
I have a group of lines (bus lines, some of them coincident in some sections) that I want to convert into a single polyline (or polygone) to style it as a single entity.
I know how to put them into one single shapefile, using "Vector > Data Management Tools>Merge Shapefiles to one".
The problem I have is that I want to show the whole shapefile with a single style, but QGIS keep working with all the lines separately, even if they are in a single Shapefile. Here an example of this:

The first thing I tried is to use the Dissolve Geoprocessing tool from Vector menu, but I get the same result as merging shapefiles.
I've tried to convert all the lines into polygones, through "Geometry Tools > Lines to polygones", but this is what i get:

I've also tried using the Polygonize tool from Processing plugin, and this is the result:

I don't know how to convert all the lines into a single polygon that i can style to obtain something similar to the first image but with no overlaping (just the outer segments in black, with no crossing of black lines).
The only solution I can imagine would be very time consuming and not very elegant (and may not work) is to create buffers for all the lines and then dissolve all this buffers. That may create a single polygon that can be styled as I want. The problem is that I have more than 70 lines.
Any solution / approach?
(QGIS 2.8.6 on Windows 7)


texts:
I realized that osm-data is not as complete as I need to have it for my work.
I'm considering trying a branch of navteq and later buy the data branch for my region.

Has anyone tried routing with navteq data? Is there an importtool like osm2pgrouting, which would make life very easy!

Where can I download a simple shapefile with a bunch of nodes and ways? All the dev. stuff seams to be very overloaded and in GDF3.0 format.

Thanks!


texts: Erdas Er Mapper: Annotation vector layer to Shapefile

texts:
I mapped some lines on Er Mapper 2014 with the Annotation tool (Add vector layer > Annotation/Map composition), so these lines are georeferenced and they got a specific width and colour.

I saved these lines in .erv format (actually, er mapper vector format).
And now, I would like to open them with QGis as Shapefile so I used the export tool to export the annotation map into a shapefile : Utilities > Export Vector and GIS formats > ESRI Shape File > export

But when I do that, I lost the colors and width of each lines (actually, the color mean a group of line and the width a subgroup of each color). The information is not stored on the shapefile (because it's a shapefile, so no problem here) but I wanted that the conversion stored an id for each color and same for each size.

Is that possible to do something like that ?

I also convert the Annotation layer to an autocad file and then, convert it into Google Earth file, the color is stored but not the size. Do you know how to stored the size while converting an Annotation layer to an autocad file then a KMZ file ? On kmz file, I should be able to read color and size of each lines and so, a python script will do the job to classify all the lines.


texts: How to calculate depth from Esri ocean basemap?

texts:
I need to find potential routes for undersea power cables in South East Asia, therefore I need to select all areas where the ocean is less than 4000m deep.
I load the "ocean basemap" from Esri but it looks like it is only a picture and no attribute table with data about how deep the ocean is at an specific point.
Is there a way to create a attribute table out of a map or do I have the wrong map?


texts: Defining categories adds previously unselected attributes (ArcMap)

texts: I am using ArcMap 10.5.1 and want to create a layer from a selection of another layer (Selection > Select by attributes..). This works fine and my new layer is displayed. Now I want to assign different colours to the different attributes of one feature class (Properties > Symbology). Clicking "Add All values" results in the correct number of attributes. However, once I have assigned colours and click "OK", ALL observations appear in the layer (i. e. also those that I didn't select in the other layer). How can I prevent this so that I really do only have my selected observations in the new layer?


texts: Creating seamless/uniform topography with multiple raster tiles?

texts:
I have multiple elevation raster tiles of an archaeological site and it would be extremely useful for me to visualize the topography as one 'uniform' image/layer. I have attempted to merge the rasters, build a virtual raster, and copy/paste the style from one layer to others, yet I have been unable to produce a seamless image from any of the said methods.

The tiles overlap considerably, most more so than the two tiles in the example. I have checked the elevations between layers of some of the overlapping areas and they appear to match, so the problem doesn't seem to be incongruous elevation data.

When I have copy and pasted styles I have made sure to change the elevation data to the min/max values among the tiles and as well as make sure the break values also match. Yet, inconceivably, this makes it worse.


texts: Customizing CartoDB infoWindow HTML removes 'header' text

texts:
Trying to change the HTML of the 'click' infoWindow causes the header text to disappear.

I've got an infoWindow configured to display correctly.

I'd like to use the 'email' field in my table as a hyperlink on the 'email' text.

However, whenever I add the {{email}} tag, then click 'apply' (or CTRL+S) to save the changes, the header in the infoWindow disappears. (the email link works just fine...)

My full 'custom' HTML is below:

  x

city

{{city}}

email

{{email}}


texts:
I am using QField for some mobile GIS on Android and would like to have a hyperlink in the attribute table that opens a file stored locally. If not in QField directly then in excel would work. None of the paths I use work; What should paths look like for hyperlinks pointing to files on an Android device? What should they look like if using relative paths?
Is there a way to do it in spreadsheets?


texts: Find distance and heading from a point to a polygon in lat, lon coordinates

texts:
I have counties mapped using polygons in Shapely with latitude/longitude for coordinates. Given a complex polygon x and single point y, how would I find the shortest distance between x and y as well as the heading needed?

Using the distance function in Shapely, I can get the closest distance, but I'm unable to come up with a fast solution to get the heading. I tried determining the closest point, but this solution was unreasonably slow to run on 10 polygons.


texts: Converting LAS to TIFF using Arcpy - TIFFs writing out empty

texts:
I am using ArcPy to convert large batches of LAS files to GeoTIFF format.  It seems like a lot of the data I have acquired from a particular source is giving me the same error: I am able to convert the LAS file to a LAS Dataset in Arc, but the conversion to TIFF usually writes out to an empty TIFF (i.e. I pull the resulting TIFF into a viewer software and there is no terrain data stored in it, just a blank screen.)

What's really weird is that all of these erroneous files have the same size, ~1300kb, so there's SOMETHING there, just not the data that should be written out into it.

If I process them manually - without automating the process with ArcPy - they come out fine, but I am processing thousands and thousands of these tiles so this is just not sustainable for the project I am working on.

This problem is only with data that I have downloaded for Virginia, I have been able to process other states' data with the same code without any problems.

import os
import arcpy
import glob
import shutil
from arcpy import env

arcpy.CheckOutExtension("3D")

#ws (workspace) is the location of the LAS files that I would like to
#process.  I am running the script from a location other than this folder
#containing the LAS files, however the LAS files and resulting LASD and TIFs
#will remain in the same location, unless an exception is thrown and the
#files are moved by my script.

ws = "list of LAS files"
os.chdir("working directory")

#inLas uses glob to specify all files in the ws folder with the .las
#extension will be processed.

inLas = glob.glob(os.path.join(ws, '*.las'))

#This first loop goes through the entire list of las files and creates a LASD
#file for them using the ArcPy CreateLasDataset tool.  Since I was having
#trouble with some of the LAS files during this step I added an 'except'
#block that moves any files that this step fails on to another folder.

for las in inLas:
    try:
        arcpy.CreateLasDataset_management(las)
    except:
        print "Error with " + las
        shutil.move(las,"Folder for segregating erroneous files")

#This next loop is just a repeat of the first loop, but this time I am
#taking all of the resulting files with the .lasd extension and using the
#ArcPy 'LASD to Raster'tool.

inLasDataset = glob.glob(os.path.join(ws, '*.lasd'))

for lasd in inLasDataset:
     try:
        lasdLayer = arcpy.MakeLasDatasetLayer_management(lasd, class_code=[1,2,9])
        arcpy.LasDatasetToRaster_conversion(lasdLayer, sampling_value=1)

     except arcpy.ExecuteError:
        print "Error with " + lasd
        shutil.move(lasd,"Folder for segregating erroneous files")

print "Done"

Any ideas?


texts: Openlayers with multiple TileLayers with WMTS source, second layer shifted

texts:
I'm trying to create map widget with multiple layers. Base layer is OSM base map. Upon that I add two more layers with different CRS. Layer A is added with EPSG:3912. Layer B is added with EPSG:3857 (which is acctually WGS 84 / Pseudo-Mercator). Layer B also has a feature layer that can be queried.

Layer B was generated via ArcGIS Online services from a feature layer.

Layers are added to ol.Map as VectorTileLayers like this:

const layer = new TileLayer()
layer.setSource(new WMTS(async (source: MapServerSource): Promise<WMTSOptions> => {
    const wmtsParser: WMTSCapabilities = new WMTSCapabilities();
    const response: Response = await fetch(source.url);
    const capText: string = await response.text()
    const capablilities: any = wmtsParser.read(capText);
    const options: WMTSOptions = {
      ...optionsFromCapabilities(capablilities, {
        layer: source.layer,
      }),
      attributions: [source.copyRight],
    };

    return options;
  }))

Layer A perfectly aligns with the base layer. But layer B is off for a few meters (maybe 10). It's shiffted. If I query layer b feature layer, when user clicks on the map, the result I get and I render falls approx. 10 m off the point rendered from the TileLayer. If I use the same layer on google maps it's OK. Also if I try to create web-map on ArcGIS Online and use LayerA and LayerB, they both align perfectly.

Any clue what the issue could be?


texts: Identifying isolated polygons within other polygons ArcGIS for Desktop?

texts:
I am using ArcGIS 10.4 for Desktop.
I have a single feature class with one attribute with 5 levels describing the state of grasslands and how they have changed over time. The attached image shows a piece of this shapefile.

Red = "grasslands lost" from 1909-2008 (now forest),
light Green = "grasslands retained" that have remained constant,
dark green = "grasslands gained"areas that were forest in 1909 but
are now grassland in 2008
Grey = "forest" areas in 1909 still forested in 2008
pale blue = nonvegetated.
white = no data

I want to isolate the Grasslands Lost (Red) that are

completely surrounded by Grasslands Retained (light green) (ie like polygons circled in red in picture)
touching forest (grey) (circled in blue)

In both a) and b) it is okay if the red polygons are bordering white (no data).
NOTE: there is no overlap of any polygons, they only share edges.
How can I select Red polygons that ONLY have light green or light green+white as neighbours?
How can I select Red polygons that have Grey as a neighbour?


texts: I want to label the names of locations from a shapefile field in ArcMap.  I tried to do it by going to Layer Properties>Labels.  However, as I have multiple observations per given location, I am getting multiple labels for that location.  I have numerous locations over a large area and I don't want labels to clutter the map.  Is it possible to display a single label representing each unique location in this situation?


texts: Clipping polygons and lines at exact borders within PostGIS

texts:
I have OSM data of the whole world in a PostGIS db.
For some reasons, I want to work with tables which have only data from a given bounding box inside.

I create this tables with following command:

CREATE TABLE export.osm_adminareas_a AS
  SELECT *
  FROM public.osm_adminareas_a
  WHERE geom && ST_MakeEnvelope(12,47,13,48, 4326)

But only when doing this with point geometry, the result is what I expect, e.g. only the points inside the bounding box.
When doing this with lines or polygon, I will get data not only outside the box, but also from regions which were absolutely far away from my box.

(For example my box is in the border region of Austria and Germany and I will get admin borders from France, and even Russia or the USA,....)

What are your recommendations for clipping polygon and line geometry exactly at the borders of my bounding box?


texts: Coordinates with no decimals when opening GeoJSON in QGIS

texts:
When I open the following GeoJSON file in QGIS 2.18 (drag and drop), all point coordinates lost their decimals going, for example, from (-9.350659,44.32844) to (9,44).

The same file is correctly shown by online GeoJSON validators.

<code>
{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -9.350659,
                    41.32844
                ]
            },
            "properties": {
                "name": "",
                "description": ""
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -9.31515,
                    41.324892
                ]
            },
            "properties": {
                "name": "",
                "description": ""
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -9.345253,
                    41.347425
                ]
            },
            "properties": {
                "name": "",
                "description": ""
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -9.373701,
                    41.332987
                ]
            },
            "properties": {
                "name": "",
                "description": ""
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -9.312632,
                    41.3205906
                ]
            },
            "properties": {
                "name": "",
                "description": ""
            }
        }
    ]
}
</code>


texts: programmatic DEM downloads similar to landsat-util

texts:
I recently discovered landsat-util, and was wondering if there was an equivalent command-line application for global elevation data, (for data around 1 arcsecond resolution, preferably geotiff) or if there is a particularly clean programmatic way of downloading this kind of data. So far i've only found bulk downloads (whereas i would only like to download relevant tiles since i will be downloading them mid-script) and the NED (which correct me if i'm wrong but I believe it only covers the US?)

I hope this isn't too similar to the linked queries.


texts: Serving a QGIS Project to Leaflet / MediaWiki Maps Extension

texts:
I'm currently serving a custom map with qgis-mapserver and that works well. However, my next step is Mediawiki integration, and for reasons of GeoJSON overlays, I must use the Leaflet option there.

It appears to me that Leaflet only accepts TMS with x/y/z coordinates, not WMS with bbox parameters. If I am mistaken, please tell me how to make Leaflet use WMS.

If not, I have set up tilecache.cgi but that also works with a bbox parameter, though it creates the x/y/z tile structure on disk. I could also throw gdal2tiles at it.

Does anyone have the workflow from QGIS to MediaWiki Maps (with Leaflet) set up successfully? I've found nothing in Google nor the Maps or Leaflet documentations.

QGIS 3.8, MediaWiki 1.33.0 with Maps 7.3.0

The intended effect is similar to this: https://www.semantic-mediawiki.org/wiki/Extension:Maps/Geojson -- just with my own map source.


texts:
I have a large set of aerial images (thermography) some of them are very tilted due to the airplane turning. I want to merge all the images into a unique orthorectified image. I have not the GPS information but I know the place where the termography was taken. Which is the best way to proceed? Is there any free software available?
 I have been trying Microsof ICE but the results are very distorted.


texts: I am currently upgrading 9.3 codes to 10.1. There used to be ToDataSet() function in ESRI.ArcGIS.Utility.Converter class. Class still exists in ESRI.ArcGIS.ADF, but ToDataSet function is gone. Does anyone knows if there was a replacement provided, or there is an easy way to convert geodatabases IRecordSet to System.Data.DataSet?


texts:
I’m reading an article that the authors talk about extracting values of SOA (slope of aspect). I can’t find anything related to that on Google.

This article reference is : ZHOU, Yi et al. Automatic detection of lunar craters based on DEM data with the terrain analysis method. Planetary and Space Science, v. 160, p. 1-11, 2018.

When they relate to SOA in the text they say: “SOA represents the rate of change of the aspect in the horizontal direction and is generally obtained by extracting the slopes from the aspect matrices of the DEMs. Mathematically, SOA is a derivative function of the aspect; therefore, the maximum value of the SOA is located at the dividing line between the inside and outside crater walls (that is, at the crater rim position). Therefore, the experiment needs to extract only the largest SOA values to identify the crater's rim position.”

Can anyone help me understanding that?


texts: Applying ee.Reducer to get mean values for polygons for each year in a time series

texts:
I am looking at the soil moisture levels across districts in India between the years 2000-2019 using Google Earth Engine. I have been trying to use reduceRegions to get an individual mean value of soil moisture for each district in each year. This seems to need a reducer over space and time. Is there a way to combine two reducers to get these values?

Ideal output is .csv file containing the year, the district and the district's average soil moisture value for the 20 year period.

Here is what I have tried so far:

// Example code that gets mean value of time period for region
var districtSM2017 = meanSM.reduceRegions({
  collection: fusionIndia,
  reducer: ee.Reducer.mean(),
  scale: soilMoisture.first().projection().nominalScale(),
});
//print(districtSM2017);

// What I actually want is just the mean soil moisture for the district for each year,
// not an average for the whole time period

// Tried the below code but this function does not work with an ImageCollection

var districtSM = soilMoisture.reduceRegions({
  collection: fusionIndia,
  reducer: ee.Reducer.mean(),
  scale: soilMoisture.first().projection().nominalScale()
});
print(districtSM);

I have attached a link to my code in GEE to show what I have tried so far.


texts:
I managed to import a layer from a MySQL database in QGIS with PyQGIS.

Now I'm looking to import a layer from QGIS into MySQL.
I explored several ways :

Using ogr2ogr on the command line, the loading was really very very slow.
Using the MySQL Importer plugin: I looked at the script, it also uses ogr2ogr on the command line, the result was similar.
Using PyQGIS (although I think it uses ogr2ogr too). I encounter the following error:

  Unable to load mysql data provider

My code is the following :

layer = iface.activeLayer()
uri = "dbname='result' host=localhost port=3306 user='root' password='charlotte' key=id type=POINT table=\"result\".\"test\" (geom) sql="
crs = QgsCoordinateReferenceSystem()
error = QgsVectorLayerExporter.exportLayer(layer, uri, "mysql", crs, False)
if error[0] != 0:
    iface.messageBar().pushMessage(u'Error', error[1], Qgis.Critical, 5)

I looked at the documentation which specifies that the method QgsVectorLayerExporter.exportLayerwaits in 3rd parameter the providerKey. I tried several of them in vain.

I use QGIS 3.10.


texts:
I started a new project in which I'm be measuring beta diversity between grids. The most appropriate metric to use is the Bray-Curtis dissimilarity index. I can perform calculations between raster files that contain a single data type (i.e. species richness or abundance), but I haven't been able to find a package or any script in R I can use to perform more complex calculations, as a dissimilarity index in which two different data are used from each grid (i.e. species richness or abundance).
Any ideas or guidance?


texts: Extract area of polygons inside larger polygon and sum their values to a new column

texts:
I have two landcover classifications (as shapefiles) created using eCognition. "Level0 (FID)" consist of larger polygons and "Level1 (FID, ClassName, Area_Pxl)" of smaller polygons within these. I would prefer a solution using arcpy but other solutions will also do (R, geopandas). Script is preferred since I need to repeat this many times.

I will describe my current workflow here emphasizing what is missing:

Create a new column Level0_ID to Level1

Done

Extract ID from Level0

I need to extract the ID of that segment in Level0 to Level1_ID column when Level0 polygon contains Level1 polygon. What tool should I use?

Create new field agric_perc to Level0

Done

I need to create a loop that goes through the attribute table and does the following function:

If Level0_ID (in Level1) == ID (in Level0) Then agric_perc (Level0) is agri_perc + Area_Pxl (in Level1)

I think this should do the trick but I am having trouble formulating the script and finding the right tools. I know there is a solution for this where the Level1 shapefile is converted to raster, but I have very large dataset (millions of segments) and original pixel size is very small so the raster solution is very slow and would rather keep the classifications as shapefiles.

What I was thinking looks something like this, but maybe there is better solution:

import arcpy
from arcpy import env
import os
import sys

# Set workspace
arcpy.env.workspace = "C:\HY-Data\RPIIROIN\documents\Rami_opetus\eCognitionWorkshop\DevelopingMethods\PolyPerc"

#Create datareader
Cursor1 = arcpy.UpdateCursor("Level1.dbf")

#Create column Level0_ID to Level1
arcpy.AddField_management(Level1, "Level0_ID", "SHORT", 5, "", "", "Classified", "NULLABLE", "REQUIRED")

#Extract ID from Level0
- How to do this?

#Create column agric_perc to Level0
arcpy.AddField_management(Level0, "agric_perc", "SHORT", 5, "", "", "Classified", "NULLABLE", "REQUIRED")

#Create the loop to update agric_perc column
- How do I create a loop that sums the Level0_ID values from Level1 to Level0 agric_perc column


texts: Does mapbasic support function overloading?

texts:
I am creating application with mapbasic. Now that it's been some time with mapbasic I found that the language is very fundamental and does not support functionality that I took for granted in Java or Other language.

  How do I know what mapbasic supports or does not support?

I had a look at reference guide as well as user guide but could not find anything.


texts: Getting bathymetric contours confined only within river banks using QGIS?

texts:
I have bathymetric survey data in the form of XYZ. X and Y are coordinates while Z is river bed level (elevation) from a datum. These are about 14000 irregularly located points within a river. Now I want to create a contour maps and afterward a 3D surface to show spatial pattern of river morphology.
I have created DEM in the form TIFF raster using ‘Topo to Raster’ tool of ArcToolbox of ArcGIS 10.2.  But when I generate contour from the TIFF file created, it generates contours not only for the river but also for area outside of river bank. Even more the outer contours are not only unwanted but unrealistic as well.

After ‘Topo to Raster’ what do I do to get the contours in required shape?

I am not an expert but have beginner level command on ArcGIS 10.2, QGIS 3.4 and Surfer 13.

How do I make contours (and 3D surface) only confined within a river ( and not outside) using QGIS


texts: Extracting one band from multiple stacking raster layers using PyQGIS?

texts:
I've got 1000 (one thousand) RapidEye raster images. The stacking layers has bands 1, 2, 3 and 4. I need to extract the bands 1, 2 and 3, then save the new file discarding the band 4.

I've tried to save RGB bands in QGIS, using the "Rendered Image" function. It works. How do I do that in batch mode or Python script?


texts: Trouble “extracting by mask” with a raster (land cover) layer and a shapefile?

texts:
I cannot seem to get clip to run.  I am a bit of a novice and do not know where to start to try to resolve the issue.  I am attempting to clip a raster (of land cover values) by a set of polygons.  I have pasted below the error messages from the two most recent attempts of Extract by Mask and Raster Clip, and an image of a small portion of the map
Any ideas of where I should start?


texts: QGIS reprojection is identical to original map; Deir ez Zor / Levant Stereographic (EPSG:22780) to WGS 84/UTM zone 36N (EPSG:32636)

texts:
I have a topo map which I want to georeference into Deir ez Zor / Levant Stereographic (EPSG:22780) and then transform into WGS 84/UTM zone 36N (EPSG:32636).

My goal is have as little divergence to the BING satellite imagery provided by the QuickmapServices QGIS plugin as possible. The map depicts an area in Lebanon.

So, I use the coordinates which are specified through the topo maps grid, to georeference the map, E.g. x: 355700 y: 72800. From the additional information given by the author. The given information is sparse, as the author did not give any type of identifyier but called the crs he used only the "syrian system" of which there are several in Lebanon accorsing to epsg.io.

After some trying-out, I concluded that he most likely used  Deir ez Zor / Levant Stereographic. I also found out that the coordinates are in fact negative: x: -355700 y: -72800.

After georef. the map appears significantly off of the underlying satellite imagery (some 20 - 30 m). However, I thought this might fix itself by reprojecting the map into UTM 36N. But no matter what parameters I choose for reprojection, the transformed map is identical to the originally referenced one, and thus still off of the satellite imagery. The project CRS was also set to UTM 36N.

I have some gps data in WGS84 / UTM 36N from the same area, which aligns perfectly with the satellite imagery. So, I don't think the problem is caused by the inaccuracy of the projected satellite image.

Any thoughts?


texts: What web GIS is this? (And how can you tell?)

texts:
I'm trying to understand a site that serves maps using a URL like this (URL de-coded):

http://www.bom.gov.au/jsp/weave/server/request/execute.do?
crs=EPSG:3112&
mapengine.id=mapengine.ngis&
_OLSALT=0.48120216676034033&
request.id=com.cohga.GetMap&
request.format=json&
request.context={"core":{"entity":"ngis_bore"}}&
request.data={"map":{"layerids":[3,4,5,6,7,8,17,18,19,20,21,22,23,24,25,26,27,28,111,112],"extent":{"crs":"EPSG:3112","minx":-4846381.323291771,"miny":-5287521.9259454515,"maxx":4291040.883039461,"maxy":-1372651.4099949505},"scale":30890123.16326136},"image":{"type":{"returnType":"MIMEDATA"},"display":{"size":{"width":1118,"height":479}}}}

How can I work out if it's ESRI, GeoServer or something else? It doesn't seem to respond to ?service=wms&request=getCapabilities (TomCat error). How can I interact with it?

Googling some of the terms like "mapengine" seems to lean towards ArcGIS: https://melb.cohga.com/wiki/display/weavedocs1/Map+Engine+ArcGIS


texts: What is the black shadow that appears after a geographic transformation?

texts: I just did a geographic transformation of an orthophoto using the project raster tool in ArcGIS.  The output file has a dark shadow around it that is offset from the image by about 20 degrees.  Does anybody know what this shadow is?


texts: Create a PostgreSQL read-only profile to prevent users from modifying data in QGIS

texts: I would like to create a specific profile (a user/role?) on one of my PostgreSQL server databases. QGIS users (connected to the PostgreSQL database) should only be able to view the data and not modify it (read-only). I do not understand the method to create this kind of profile. I am using PgAdmin 4.


texts: How to show variable values in message bar in QGIS?

texts:
I know that I can write custom text to message bar with the QgsMessageBar.pushMessage() method. But if I understand the documentation right, there's no room for variables added to a string where they are escaped (like in print() function), and I get "arguments did not match any overloaded call" error when I try to call it like this. I want to print some variables for debugging my new plugin. How can I print them from the plugin's gui dialog? If message bar is not an option, how to do it?

I want to test how the plugin interacts with my QGIS plugin controls, so printing the values in Python console is not enough for me, though it's generally better for debugging.


texts: pgrouting 2.0 package for postgresql 9.3

texts:
I'm trying to install pgrouting 2.0 on a postgresql 9.3 database (with postgis 2.1).
Are there any packages on ubuntu 12.04 or do I have to install from source?
Is postgres 9.3 supported at all in this configuration?


texts: Accessing WMS with Basic Authentication?

texts:
I am trying to access a Basic-Auth secured WMS Service. When requesting the Capabilities document, the service will always list some layers, even without authentication. But with authentications, more layers should be listed.

Unfortunately it won't work, only publicly available layers are listed in ArcGIS Pro. When I look at the HTTP request I can not see an Authorization header.

What kind of authentication is used in ArcGIS Pro (or ESRI products in general) when adding username/password in the "Add WMS Server Connection" Dialog? How is this intended to work?

I am completely in control of said service, it is possible to debug and configure any way we like. At the moment it supports HTTP Basic only but other methods could be implemented. I tested this service with a Browser and QGIS, where everything works as expected.


texts:
enter code here
  L.control.scale({ position: 'bottomleft' }).addTo(leafletMap);
var searchcontroloption={position: 'topleft'};
 L.Control.geocoder(searchcontroloption)
.on('markgeocode', function(e) {

         })
 .addTo(leafletMap);

I want to get search value, which user has typed in leaflet search box is there anyway to get it.
i want to get what user has enter in serach input field of leaflet .


texts: How can i use WFS in Openlayers 3 with mapserver and PostGis?

texts:
I didn't find a documentation to display features ( vectors ) combining
MapServer ( mapfile ) and PostgreSQL/PostGIS and OpenLayers 3 ?


texts: I have been having problems with the Convert Time Field tool. I am able to convert the date with no problem but the time is being deleted. One time it worked OK but then when I selected a subset of records and did an Export Data on the Shape file, the time part to the date field was deleted during the export. The input date string (as string) looks like this yyyy-MM-dd'T'HH:mm:ss'Z'  I have tried both preset and custom string specifications. The log claims that the process was successful, but the result is not what I need.


texts: How to setup portable ArcGIS (ArcMap, Catalog) installation on flash drive?

texts:
How can I setup a portable ArcGIS installation (ArcMap, Catalog) to run from a flash drive / USB stick?

I think there may be an existing solution but I didn't find it yet.

Can I make it myself, and if yes how?


texts: Clipping raster using vector polygon in ArcGIS Desktop without having Spatial Analyst?

texts:
I have ArcView 10 and I'm trying to clip a DEM (TIFF) to a wilderness boundary (polygon). I know ArcView won't let me do this without Spatial Analyst which I do not have.

I tried exporting my raster and vector in QGIS but I can't get the two to line up (different coord systems).

I've tried to "DEFINE COORD SYSTEM" in ArcToolbox, but something just isn't right.


texts: Geoserver source code: Understand what's happening when calling a WMS request

texts:
I try to get in touch with geoserver source code. I set it up in Eclipse like stated here (http://docs.geoserver.org/latest/en/developer/quickstart/index.html) and it's running.

Then I call a getCapabilities request with this URL:
http://localhost:8080/geoserver/wms?REQUEST=GetCapabilities

I try to understand now what's happening step by step in the code when calling this request. How would I do that?

I tried it with the eclipse debugger but it only shows what happens when calling the start.java class and not what actually happens on the running server.

The problem is that until now I only worked on code which I developed from scratch like in university lectures or some hobby stuff but never on a finished program source code.


texts:
I have a set of coordinates, that I receive from GPS. I store them in database, its geometry is 4326. I am using the next query to calculate the travelled distance:

ST_length(ST_Transform(st_makeline(points), 26986)) AS distance_travelled

Everything was working fine until i got the next error:

Couldn't project point (741.695 176.355 0): latitude or longitude exceeded limits (-14)

The error is probably due to GPS device malfunction. What is the most efficient and elegant way to filter out the 'out of bounds' points (any alternative to filtering by [180, -180, 90, -90] in WHERE clause) - is there any built in Postgis function that is able to do the filtering based on SRID?


texts: OpenLayers 2 - move vertex programmatically

texts:
is there a correct way to move a single vertex programmatically in OpenLayers 2?

The problem is, I need to prevent users from drawing invalid (eg. self-crossing) polygons. To do that, I created a function to validate polygons, and then I validate the polygons in dragComplete method of OpenLayers.Control.ModifyFeature class (I created my own class based on this one).

Basically, I save current vertex position in dragStart method, then I validate the polygon in dragComplete method, and if the polygon is not valid, I change the coordinates of the vertex to the coordinates I've saved before.

It's working, the vertex moves back to the previous position. But there is a problem with dragging and rotation handlers. These handlers don't care that this vertex has been moved, they're positions are set to the center of the geometry with this wrong vertex (before it was moved). Both of these handlers come back to correct position when I drag or rotate the feature. I need them to be set correctly when this vertex is moved.

Is there some event or method I need to invoke to make it work correctly?

This is what I have put at the beginning of the dragComplete method.

dragComplete: function (vertex) {
    if (this.feature.geometry.isValid &&
        !this.feature.geometry.isValid()) {
        vertex.geometry.x = this.vertexPosition.x;
        vertex.geometry.y = this.vertexPosition.y;
        this.layer.drawFeature(this.feature);
    }

    ...
}

It moves the vertex to given position correctly. The thing is it doesn't affect dragging handler and rotation handler. This is what I tried to use, without effect (it goes just below vertex.geometry.y = this.vertexPosition.y; in dragComplete method):

this.layer.events.triggerEvent('vertexmodified', {
    feature: this.feature,
    vertex: vertex
});
this.layer.events.triggerEvent('featuremodified', {
    feature: this.feature
});
this.layer.events.triggerEvent('refresh');
this.onModification(vertex);
this.onModification(this.feature);
this.layer.drawFeature(vertex);
this.layer.redraw();

None of this works. Is there a way to make these handlers refresh?


texts: How to highlight features on user click in Leaflet?

texts:
I'm new to leaflet & javascript.

I made local tiles using maperitive,
I can draw Polygons, Polyline & Points using GeoJson over the tiles using leaflet,
I can serve the both (tiles & layers) through a local server (intranet).

My problem is:

If a user click at a Point, corresponding Polygon/Polyline should get highlighted & a label should pop-up.

Assume, the Point as Bridge. If, I click on the bridge, the corresponding, Stream (Polyline) & Lake (Polygon), should be highlighted & the details about the lake / bridge (data within GeoJson file) should pop-up.

Hope I explained my problem. Kindly help.

As suggested by underdark, posting the code here,

Code

This gave this output

What I need is, if click on Br No. 117, this particular lake (from where the stream comes), should get highlighted.

Thanks..


texts: Arcpy 10.0 using update cursor completes but ArcGIS crashes

texts:
I'm using an update cursor to iterate through my feature class, create a selection and then delete the row if it meets the condition. It partially works - I get no error messages and the script completes but then a couple of seconds later ArcGIS crashes and the resulting feature class does not have all the selected features removed. I presume I must be using the update cursor incorrectly. Here is my code:

newcur = arcpy.UpdateCursor("outlayer")
for row in newcur:
    if row.LAND1 =="Single Family ( Attached/Detached )" and row.LAND2 =="Single Family ( Attached/Detached )":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1 =="Multi Family Residential" and row.LAND2 =="Multi Family Residential":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1  =="Multi Family Residential" and row.LAND2 =="Single Family ( Attached/Detached )":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1 =="Single Family ( Attached/Detached )" and row.LAND2 =="Multi Family Residential":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1 =="Public Institutions: Schools" and row.LAND2 =="Public Institutions: Schools":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1 =="University Semi Govt" and row.LAND2 =="University Semi Govt":
        newcur.deleteRow(row)
        newcur.updateRow(row)
    if row.LAND1=="Park / Recreation / Open Space" and row.LAND2 =="Park / Recreation / Open Space":
        newcur.deleteRow(row)
        newcur.updateRow(row)
del newcur,row
gc.collect()


texts: Can I draw a new irregular polygon in QGIS 3.16?

texts:
I have a geotiff raster of Indonesian landsystems which I need to clip to the Papuan provinces in New Guinea. Unfortunately, I can't use a rectangular extent (as this would include some of the nearby islands) and I can't find a boundary shapefile that's accurate enough (some tiny islands belonging to Papua get left out).
I'd like to draw a polygon round the area - just drawing the lines through the sea between Papua and the other islands, setting the vertices etc - so I can clip out the islands I don't need. But does QGIS even allow me to do this? The digitizing toolbar only has certain shapes and even then, you have to be editing an already existing vector layer. So you can't draw a new polygon...?
I'm new to GIS and this question may sound obtuse. Apologies if so - but really, what's the use of a GIS app if you can't draw your own shapes? Is there any other app out there I could use in Windows?


texts: Calculate maximum value from a subset of fields ending with a standard suffix

texts:
I'm using the Python built-in function in the calculate field tool in Modelbuilder to calculate maximum values for each record from a list of fields:

This is the field calculator expression I use in the moment:
max[(!field1_abc!, !field2_abc!, !field3_abc!)]

It worked perfectly so far. But I selected the fileds that are calculated manually. So now I'd like to find a way to automate it.
I'd like to calculate the maximum from all fields ends with "abc".

Is it possible to combine the built- in fuction with something like "calculate the max from all fields .endwith("abc")"?

I tried something like: max([!endswith("abc")!]) but it is not working.


texts:
i have a basemap which was created with arcmap and i want to use it for my application with cached. in my viewport in arcmap there is no any Turkish character problem on it but when i cache my work it makes character problem.

how can i accomplish this subject with settings ?


texts: postgresql pgrouting define C function function with int* arguments

texts:
I want to create a psql-C function with an undefined length list of integers (GIDs for example).

An erratic example using V0 function definition that works is like:

int mytest4(int *x, int i){
  int *a  = &(x[6]);
  int j;
  for (j = 0; j < i; j++)
     printf("Passed on %d", a[j]); // sent to logfile
  return a[i];
}

My question concerns the V1 functions to read an int array. I don't understand how to do

PG_FUNCTION_INFO_V1(mytest5);
Datum mytest5(PG_FUNCTION_ARGS){
int *x = PG_GETARG_???(0);
int i = PG_GETARG_INT32(1);
...

Does anyone know how to write the same function, please??


texts: Importing CSV file with GlobalIDs in QGIS?

texts:
I have a csv file which only contains GlobalIDs, no addresses, no lat/long.

Can I import it into QGIS to create a new layer?


texts:
I would like to change the default color ramp that ArcMap uses when I add a new raster layer to my map.  I found through the menu Customize/ArcMap Options.../Raster that I can change the Stretch Type, but I haven't found where to change the default white-to-black color ramp to a different, colored one.

This would be useful because I am adding many raster layers to my map and would need to change the color ramp (and stretch type) on each one manually.  I am exporting an image of each map made with a raster representing a different year to create an animation of change over time.


texts: Cloud mask on Landsat 8 TOA image in Google earth engine

texts:
I am working on cloud masking on Landsat 8 TOA images. But when I perform this some extra region also masked in image where no cloud present specially upper part of image where glacier (snow and ice) present . my Code link is code: https://code.earthengine.google.com/192f0b1fdd1f5ffb39903f46d16808ed
var L8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA");
var images_C = L8.filter(ee.Filter.eq('WRS_PATH', 147))// Path filter
               .filter(ee.Filter.eq('WRS_ROW', 38))//row filter
               .filter(ee.Filter.calendarRange(2019,2019,'year'))//year filter
               .filter(ee.Filter.calendarRange(7,10,'month'))//month filter
               .filterMetadata('CLOUD_COVER', 'less_than', 10)//cloud filter

var getQABits = function(image, start, end, newName) {
    // Compute the bits we need to extract.
    var pattern = 0;
    for (var i = start; i <= end; i++) {
       pattern += Math.pow(2, i);
    }
    // Return a single band image of the extracted QA bits, giving the band
    // a new name.
    return image.select([0], [newName])
                  .bitwiseAnd(pattern)
                  .rightShift(start);
};

// A function to mask out cloudy pixels.
var cloud_shadows = function(image) {
  // Select the QA band.
  var QA = image.select(['BQA']);
  // Get the internal_cloud_algorithm_flag bit.
  return getQABits(QA, 7,8, 'Cloud_shadows').eq(1);
  // Return an image masking out cloudy areas.
};

// A function to mask out cloudy pixels.
var clouds = function(image) {
  // Select the QA band.
  var QA = image.select(['BQA']);
  // Get the internal_cloud_algorithm_flag bit.
  return getQABits(QA, 4,4, 'Cloud').eq(0);
  // Return an image masking out cloudy areas.
};

var maskClouds = function(image) {
  var cs = cloud_shadows(image);
  var c = clouds(image);

  return image.updateMask(c);
};

var images = images_C.map(maskClouds)

var img = images.first()

var firsti = images_C.first()
var img2 = firsti

Map.addLayer(img)
Map.addLayer(img2)


texts:
I'm trying to add a Polyline (2 mappoints with different z values) graphic that has arrows on both ends (or at least one end).
I've tried using SimpleLineSymbol, but the arrows are not visible (the line itself is rendered correctly with z value though).
I've also tried making a MultilayerPolylineSymbol with a stroke symbol layer and a vector marker symbol layer. The lines are rendered with z values, but the markers are on the surface.
I've tried to separately add in a SimpleMarkerSceneSymbol with a cone shape, but that requires the pitch value to look "correct."
Is there something in the API that I can use to plot an arrow or cone at the end of a line, without manually doing the complex math to find the pitch?
If it's impossible to do with the API, is there a simple formula or guide that I could use to do so (I'm not strong in this type of maths though)?


texts: Convex hull for selected features - PyQGIS

texts:
I changed the code to create a convexhull for selected features from this question (Convexhull for selected features and performing buffer for the resultant convexhull using python) to adapt it to QGIS3, but something does not work. Where is the problem?

layer = iface.activeLayer()
feat = layer.selectedFeatures()[0]
geom = feat.geometry()
convexhull = geom.convexHull()
CRS = layer.crs().postgisSrid()
URI = "Polygon?crs=epsg:"+str(CRS)+"&field=id:integer""&index=yes"
mem_layer = QgsVectorLayer(URI,"convexhull","memory")
mem_layer.startEditing()
feat2 = QgsFeature()
feat2.setGeometry(convexhull)
feat2.setAttributes([1])
mem_layer.addFeature(feat2, True)
mem_layer.commitChanges()
QgsProject.instance().addMapLayers([mem_layer])
iface.mapCanvas().refresh()

EDIT: To be more clear, using this code this is what I get. It's a convexhull for just one feature.

And this is what I want. It's for all selected features. I reached this using Minimum bounding geometry from processing toolbox.


texts: Removing string to the right of a character using QGIS Field Calculator?

texts:
I have a string field and I want to delete the part of the string after a specific character in this case a '/'. I am looking for a way to do this using the field calculator in QGIS.

I know I can use the replace function to replace a specific string but I need a way to do this with a wildcard as the strings after the '/' character are not the same in the table.


texts: Filtering a raster asset using list of values in Google Earth Engine

texts:
I am trying to filter a raster asset that uses numeric values to define land uses. My initial purpose is to use a list of values to filter all the areas corresponding to bushes (codes 410, 420 and 430).

With the updateMask method this can be easily done with the following code:

var landuse = ee.Image('users/xxx/cover2014');
var masked = landuse.updateMask(landuse.eq(410).or(landuse.eq(420)).or(landuse.eq(430)));

My problem relies on the fact that I want to use another land uses through a checkbox, so I was thinking in a code like this (I did not include the code used for panel and checkbox):

var forest = ee.List([211, 212, 221, 222, 231, 232, 241, 251]);
var bush = ee.List([410, 420, 430, 440, 450]);

var filterList = forest.cat(bush);

var landuse = ee.Image('users/xxx/cover2014');
var masked = landuse.updateMask(landuse.eq(filterList));

Map.addLayer(masked);

Sadly, the updateMask method gives an error because I am using a list instead of a image. I have also tried with the operator 'in', 'inList', without success.

Is there any way to use values contained in a list to update the mask or filtering a raster asset?

EDIT:

The final code, using the provided solution is:

var forest = ee.List([211, 212, 221, 222, 231, 232, 241, 251]);
var bush = ee.List([410, 420, 430, 440, 450]);

var filterList = forest.cat(bush);

var landuse = ee.Image('users/xxx/cover2014');

var masked = landuse.updateMask(landuse.eq(ee.Image.constant(filterList)).reduce(ee.Reducer.anyNonZero()));

Map.addLayer(masked);


texts: Simulating navigation bar in attribute table of ArcMap using ArcPy?

texts:
I want to focus on specific record in the attribute table when it is open.
I have made several experiments with SearchCursor but that just selects the record, even focusing on the feature on the map but it does not focus on the record in the attribute table.

In conclusion, I want to simulate the navigation bar to the bottom of the attribute table..

Is there a way to do it?


texts:
Iam using ArcGIS Desktop 10.3 with a Basic level license.

Working on different projects, with different data, for different locations. For the most part I get vector data like parcels and buildings for the area of interest and thats it. But to publish also nice looking maps I have to use Esri basemaps/ services.arcgis.online like their topographic map or OpenStreetMap wms data too. Basically, I am satisfied with the layout of this basemaps (streetnames, hillshade, waters, forrest etc.), but it could be better. For example if I want to show the landuse or points of interest of an area it could be confusing for the reader of the map because in the Esri basemap you can find landuse (in the OSM basemap you can find POIs) too.

On the other hand you have nice looking tools like Mapbox, wich allow you to manipulate the layout of the map, for example you can turn off the landuse or the POIs.

Is it possible to use a self builded map style from Mapbox like a basemap or a wms service in ArcGIS 10.x for Desktop?


texts: LRS plugin does not return measure field.

texts:
Does anyone know how to use the LRS plugin in QGIS 2.18.14?

I have a layer of roads and points I need to determine the distance along the roads. I tried but I can not get a measure field.

Does anyone know the step by step what needs to be processed first and what fields should layers contain?


texts: Identify the length and orientation of the features in P2 relative to features in P2? (ArcGIS)

texts:
I try to measure the maximal length and orientation of features in one shapefile (S1) relative to polygons in another shapefile 2 (S2). My goal is to evaluate the spreading of patches of beetle-induced tree mortality from one year (S1) to another (S2).

I can measure near distances and position (angle) of the feature S2 to S1 using NEAR Tool http://pro.arcgis.com/en/pro-app/tool-reference/analysis/near.htm.

To measure the length and orientation of shapefiles in S2, I can apply Mimimum Bounding Geometry, Rectangle_by_Width, as mentioned here: MBG_Orientation: ranges from 0-180, instead of 0-360? (ArcGIS, Minimal Bounding Geometry).

However, the resulting orientation of the "rectange_by_width" ranges from 0-180, and it is not relative to the polygons in S1. The NEAR_ANGLE, derived from NEAR Tool, does not reflect the orientation of the individual polygons.

Combining these two tools I can identify the relative locations of individual features towards polygons from S1, and the length of polygons of the S2.

Is there any other way how to record also the orientation of the spots S2?


texts: Adding height to polygon with different height points

texts:
I have a polygonZ (representing a gravel deposit area) that currently has a "flat" top, but in reality it slopes in different directions. I have the height data for 6 points (in red on the image) around its edges (barely visible stipled line) and would like to add this to the polygon to calculate exact cubic meter filling. The slope is fairly linear from one edge to another. How can I do this?

I use arcgis 10.3 with a basic license.


texts: Is it possible to create a scalebar in ArcMap that shows distances in custom units? I understand how to do this manually, but it would be great if I could define a custom unit of measurement (let's say "1 swimming pool") and use that to dynamically generate a scalebar.


texts: Unable to get shape data from ArcGIS REST API

texts:
I'm trying to download hurricane data from ArcGIS.  There are two things I can do.

I can go to their web interface at
https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Active_Hurricanes_v1/FeatureServer/1/query
Set a few values ('Where' field I set to 1=1, 'Out Fields' I set to *)
Then scroll to the bottom and click the "Query(GET)" button.  Some values come up on the screen.
All Good, but no shape data.

I can use Python (this is my real goal).
I have a script to do this.

import urllib.request, urllib.error, urllib.parse
import json

url_json= 'https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/Active_Hurricanes_v1/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=pjson&token='

response = urllib.request.urlopen(url_json)

webContent = response.read()  # byte string of the JSON result

jsonContent = json.loads(webContent)  # create a JSON object from the byte string

for object in jsonContent['features']:
    rec = {}  # create an empty dictionary for each feature

    for k in object['attributes'].keys():
        rec[k] = object['attributes'][k]

To get the url I used in the python program, I just pressed the button on (1) and then used the info in the url bar.  Only difference is I selected json instead of html for output.
Problem: I can't figure out how to get it to return the blob for the shape info.
Does his API permit that?
If so, what do I do to in the query window and in the url to get it?


texts: PostGIS - Finding hanging line at both ends (not connected to point)

texts:
I need to find lines(line1) that are not connected to points at both end not connected by any lines e.g line1., line2 in this case.

I tried below query but Its taking too much time even with limit 10. it keeps running.

SELECT DISTINCT ON (1) t1.objectid,
                   t1.properties
FROM line1 t1,
     line1 t2,
     point1 t3,
     line2 t4
WHERE NOT ST_Intersects (t1.geom, t2.geom)
  AND t1.objectid <> t2.objectid
  AND NOT ST_Intersects(t1.geom, t3.geom)
  AND NOT ST_Intersects(t1.geom, t4.geom)
ORDER BY t1.objectid


texts: Calculating minimum distance in meters of two polygons (defined in lat/long)

texts:
I need to calculate the minimum distance (in meters) of two polygons which are defined in lat/long coordinates (EPSG:4326) using Python.
shapely geometries have distance() method which almost does what I need but as I understand first I need to reproject my polygons to some other coordinate reference system (maybe using pyproj module) to get the distance in meters.
As I understand the coordinate reference system I should use depends on which region on earth my polygons are located, but how should I find the right projection I need given the polygon coordinates.
My two polygons might be located anywhere on the earth but they will be within 10km distance from each other and 0.5m accuracy is good enough.
I have found this code on Internet, which I suppose does what I need (I'm not sure), but I understand 'EPSG:26944' is meant to be used only in California, so wouldn't work let's say in Australia, right?
from functools import partial
from shapely import ops
import pyproj

def reproject(geom, from_proj=None, to_proj=None):
    tfm = partial(pyproj.transform, pyproj.Proj(init=from_proj), pyproj.Proj(init=to_proj))
    return ops.transform(tfm, geom)

polygon1_m = reproject(shapely_polygon1, 'EPSG:4326', 'EPSG:26944')
polygon2_m = reproject(shapely_polygon2, 'EPSG:4326', 'EPSG:26944')
distance_in_meters = polygon1_m.distance(polygon2_m)


texts: Using Python in field calculator to extract highest value from 3 columns

texts:
I have three columns, one for percentage White, percentage Hispanic, and percentage African American per census tract. I'm trying to use Python to extract the population subtype with the highest percentage into a new column called "highest_percentage". The highest percentage category will have 3 classes: 1,2, and 3. I can not figure out how to set a conditional statement so that I can automatically assign a value of 1,2, or 3 to the census tract to use in a classified map.

I was able to write code to find the highest percentage and assign the new field the same value as that percentage, but i'm trying to find which field has the highest value and assign it 1-3 based on a classification. 3 white, 2 Hispanic, 1 African American

I've attached a screenshot of the table and the code window below.


texts: Splitting field in ArcGIS field calculator using Python Parser?

texts:
I'm using field calculator in ArcGIS Desktop 10.2.1.

I have field1 which has a values of "A_B" (example).  I created two fields out of this, values to the left of the underscore go in fielda and to the right of the underscore go in fieldb.  I used the code below in field calculator to separate them out into two fields.

fielda =

field1.split("_")[-1]

fieldb =

`field1.split("_")[-1]`

I now have field1 with values of A_B_C_D.  I need to separate the A_B_C_D into four separate fields using field calculator.  fielda = A, fieldb = B, fieldc = C and so on.
I'm not sure how to go about this.  I basically need to parse the values by the underscore.


texts: QGIS - exporting open source tiled maps at high dpi or zoomed in scale

texts:
I have been using and learning QGIS for a few years. What I can not figure out is how to get better map quality when I output maps to use in my book projects.

Example 1: I set QGIS to output a JPG map at 300dpi. This causes the street names to shrink on the JPG image to near unreadable using OpenStreet base maps.

Example 2: I tried using OpenTopoMaps. All looks great on my screen and when I go to output the maps, there are a few blank white squares. This is likely a result of zooming in too much. Many of my maps are around 1:25000 or closer.

I guess this is a resolution issue between monitor screen and 300dpi files.

So what is the solution? Higher resolution base maps, or a setting I missed?

I need to use good base maps of Ontario, Canada.


texts: How to create GeoServer layer with native CRS?

texts:
I try to upload (create) on to GeoServer layers with different CRSes, possible unknown for GeoServer (and not presented in user_projections/epsg.properties).
First I do this, for example:

c:\OSGeo4W\bin\ogr2ogr.exe -skipfailures -f PostgreSQL PG:"dbname='dbgis' host='localhost' port='5432' user='postgres' password='123456'" "be32d51207af4b1a8d0cf6163c282274.mif"

Then I do this:

C:\curl\bin\curl.exe -u admin:123456 -XPOST -H "Content-type: text/xml" -d "<featureType><name>be32d51207af4b1a8d0cf6163c282274</name></featureType>" http://localhost:8080/geoserver/rest/workspaces/a77x7/datastores/PostGis/featuretypes

And this:

C:\curl\bin\curl.exe -u admin:123456 -XPUT -H "Content-type: application/xml" -d "<layer><enabled>true</enabled></layer>" http://localhost:8080/geoserver/rest/layers/be32d51207af4b1a8d0cf6163c282274

But setting CRS failed:

C:\curl\bin\curl.exe -u admin:123456 -XPUT -H "Content-type: application/xml" -d @"...\crs.xml" http://localhost:8080/geoserver/rest/workspaces/a77x7/datastores/PostGis/featuretypes/be32d51207af4b1a8d0cf6163c282274

Where crs.xml is (by gdalsrsinfo -o wkt ...), for example:

<featureType><enabled>true</enabled><nativeCRS>
PROJCS["unnamed",GEOGCS["unnamed",DATUM["Pulkovo_1942",SPHEROID["Krassovsky",6378245,298.3],TOWGS84[24,-123,-94,0.02,-0.25,-0.13,1.1]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",75],PARAMETER["scale_factor",1],PARAMETER["false_easting",13500000],PARAMETER["false_northing",0],UNIT["Meter",1.0]]
</nativeCRS><srs>EPSG:4326</srs><projectionPolicy>NONE</projectionPolicy></featureType>

GeoServer says "200 OK", but projectionPolicy stays FORCE_DECLARED.
If I set empty srs tag, GeoServer answer "500 Server Error".

How I can publish layers with any CRS in GeoServer through REST?

By web interface projectionPolicy of NONE not saved too (see images).


texts: Iterating through a FC and clipping by muliple areas of interest

texts: I know how to build a model to iterate through a FC and clip that FC to ONE specific AOI, but is there a way (model or script) to iterate through that same FC but clip it to 35 different AOIs? I would prefer to not have to input the clip features 35 times but there might not be a way around that.


texts: Can I modify the Action of multiple attributes at once in an AttributeManager transformer?

texts:
I'm joining a point feature class to a table in FME, to provide a spatial attribute to the tabular data.

The point feature class has about 50 attributes that I don't need -- all I want is its ID field (to join on) and its geometry. So I'm running it through an AttributeManager transformer before connecting to a FeatureMerger. However, it's tedious to select "Remove" as the Action for dozens of attributes (and I need to do this to about ten different input feature classes!)...

Is there a way to select all the attributes and change their Action to the same thing at the same time?


texts: How to save a virtual layer (from a filtered join) with features from original layer in QGIS?

texts:
To be specific, I have a shapefile on census block groups (CBGs) in Georgia, but I only want to use those in Atlanta's commuting zone (CZ).

However, commuting zone is not a field in the census shapefile, so I join the layer with a different table that links CBG IDs to CZs. If I want to filter this layer, I am prompted to define a virtual layer, which I duly do.

Yet when I save that virtual layer (showing all the original fields, and CZ, and only for CZ=141, which is Atlanta) the shapefile is empty, thus the geography is lost somewhere along the line.

What is the proper way to do this?

I am on QGIS 2.18.2.


texts: Can I mimic the "open" action in QGIS with python and manipulate the field content used for the action?

texts:
I am using QGIS actions (type: "open") to link ECM searches to objects on the map.

The basic syntax is very simple:

protocol://searchterm1=[%"field1"%]&searchterm2=[%"field2"%]

However, some fields used for the search contain spaces and the system can't handle them. For example, "York" works. "South Hampshire" however doesn't.

Can I somehow mimic the open action with python, and use it to manipulate the value from the field? Like picking the first word before a space and using only that for the search?


texts: OpenLayers polygon fill not working with GeoJSON file as source

texts:
I'm trying to visualise some data in a custom shape on a map, and I'm stuck with styling it.
I'm currently using the openlayers framework in combination with a geoJSON file that I generate in code. I've spent a whole day trying to get a fill or stroke on the shapes I have made,but without success.

An example of my problem can be found here
It would be great if anybody could spot what I am clearly doing wrong.

Here's how I define a style: I want to fill the shapes with a color depending on their value.
I've set their value as an attribute, as needed.

var myStyles = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
            strokeDashstyle: "dash",
            fill:true,
            fillColor: "${getColor}",
            strokeColor: "${getColor}",
            strokeWidth: 2,
            fillOpacity: 1,
            graphicZIndex: 1
        },
        {
            context: {
                getColor : function (feature) {
                    var value = parseFloat(feature.attributes.value)

                    return value > 3100 ? '#FFFF00' :
                           value > 3000 ? '#BD0026' :
                           value > 2900 ? '#E31A1C' :
                           value > 2800 ? '#FC4E2A' :
                                          '#FFEDA0' ;
                }
            }
        })
   });

After defining a style, I'm adding a layer to the map that's coupled with that styleMap and my GeoJson data

//add collection of features to the map
var geojson_layer = new OpenLayers.Layer.Vector("GeoJSON", {styleMap:             myStyles,rendererOptions: {zIndexing: true}});

geojson_layer.addFeatures(geojson_format.read(collection));
map.addLayers([geojson_layer,layer]);

Although I'm a newbie in this area, I'm quite sure my geoJSON file is well-formatted.

I basically want to have a different fillColor for the shapes that I defined in the geoJSON file according to their value. At this moment I can't event get a regular fillColor for any of them.
Any help will be greatly appreciated.

Pepijn


texts: Path ending with an arrow: need to improve symbology

texts:
Based on  @BERAs answer to Arrow head at the last path segment of Bezier curve I made an arrow at the end of a path with geometry generator
make_line(point_n( $geometry, -2), end_point($geometry))

I need to improve my symbology:

When I adjust the thickness of the line, it goes beyond my arrow.
How can I get a thin line beginning like on my other arrows?


texts:
How can I get Torque's cumulative setting to draw the data points in their correct locations versus artificial grids?

http://cdb.io/OAgzRD

My dataset of global locations looks fine under non-cumulative setting, but cumulative wants to add the locations in a grid that looks very artificial.


texts: How to create unfilled circles (style) for point layers?

texts:
I have a point layer and want to visualize it with unfilled circles.

It is only possible to change the colors and size of the symbology layer (single mark).

But I would like to change the filled color of the circle to transparent and the thickness of the border. How can I do that in QGIS?

Thanks for any advice!


texts: Changing labels language on XYZ tiles using QGIS?

texts:
I added quite a few XYZ tile basemaps to my project, they all come out with Hebrew letters (I am in Israel). I overridden the ISR locale with no success.
I gues there is a URL parameter that will do the trick but can't find it anywhere.

To clarify, My XYZ tile URL is (nothing mentioning none English):
http://a.tile.openstreetmap.org/{z}/{x}/{y}.png

and my basemap (Below) has Hebrew labels which I cant use in English manuscript:


texts: How to convert cartesian to lat-lon with Topojson?

texts:
I've been following the "Let's Make a Map" tutorial by mbostock about converting files for use for d3.js. I have been able to get things working with files from Natural Earth, but when trying to convert the shapefiles from the MBTA website (http://www.mass.gov/anf/research-and-tech/it-serv-and-support/application-serv/office-of-geographic-information-massgis/datalayers/trains.html), which stores lineshapes with cartesian coordinates and arcs (with topojson -t_srs EPSG:4326...), I get an error:

/usr/local/lib/node_modules/topojson/bin/topojson:303
  var i = file.indexOf("=");
               ^
TypeError: Object true has no method 'indexOf'

I get this even trying different values for EPSG such as 26986. How can I represent these files in d3 (alongside other topojson files that use lat/lon), or convert the coordinates to lat/lon?


texts: Exporting map as tif in CMYK colour space

texts: I am getting my maps from QGIS ready for publication in a journal. The journal requires colour images to be tif format in the CMYK colour space. I understand how to save images as tif, but I cannot see a way to see whether I am saving them in the right colour space. Can anyone help me??


texts: How to retrieve color from a polygon in ArcObjects?

texts:
I tried the following code the get the polygon color, but it returns the same color (0, 0, 255) for all polygons. How can I get the color of a polygon with ArcObjects?

        // Get polygon.
        IGeometry geometry = feature.Shape;
        IPolygon4 polygon = (IPolygon4)geometry;

        // Get color.
        IElement element = new PolygonElementClass();
        element.Geometry = feature.Shape;

        IFillShapeElement fillElement = element as IFillShapeElement;
        IFillSymbol fillSymbol = fillElement.Symbol;
        IRgbColor color = fillSymbol.Color as IRgbColor;

        MessageBox.Show(color.Red.ToString() + " " + color.Green.ToString() + " " + color.Blue.ToString());

I also tried to retrieve an element from IGraphicsContainer as:

            IEnvelope2 envelope = polygon.Envelope as IEnvelope2;

            IGraphicsContainer graphicsContainer = map as IGraphicsContainer;

            IEnumElement enumElement = graphicsContainer.LocateElementsByEnvelope(envelope);

            enumElement.Reset();
            IElement element = enumElement.Next();

But the obtained enumElement is null. Any ideas why?


texts:
I built a wep app storing GPS coordinates, as SRID 4326. Coordinates are stored as Lon/Lat, and that was working fine on MySQL 5.6 and MySQL 5.7.
Since I upgraded to MySQL 8, I get the following error when trying to construct such a geometry:
SELECT ST_GeomFromText('POINT(-118 0)', 4326);

Latitude -118.000000 is out of range in function st_geomfromtext. It must be within [-90.000000, 90.000000].

I checked the MySQL documentation on SRS, which shows this entry for SRID 4326:
DEFINITION: ...
            AXIS["Lat",NORTH],AXIS["Long",EAST]

Confirming that they assume it's Lat/Lon.
I've always seen SRID 4326 referenced as Lon/Lat before:

spatialreference.org shows longitude first in bounds
this answer on gis.stackexchange says "The coordinates in (EPSG) 4326 are long/lat", this post on postgis.net says the same
... and many more answers here and there on StackExchange and other sites

However, I just discovered the epsg.io site, that may be the canonical reference on the subject (?) that states that latitude comes first:

Axes: latitude, longitude.

So, which one should I trust? Is it Lat/Lon or Lon/Lat?


texts:
I am currently using Maxent to model species distribution over time using climate change data and species occurrence. I am working with three environmental variables which are all set to the same geographic projections and dimensions and saved as ascii files. I am also using my species occurrence data, which is displayed in three columns: species, UTME, and UTMN in a CSV file.

I am trying to use a minimum convex hull as a bias file to account for sampling bias in my occurrence data. I created these masks, by using the "Minimum Bounding Geometry" tool in ArcGIS, I input the species occurrence data, which was point data, to create a minimum convex polygon (MCP) mask. The result was a polygon that included all of the species occurrence points. In order to load the minimum convex polygon mask into maxent I had to convert the polygon -> raster, and then raster -> ascii. The aim is to use the MCP mask during Maxent model training, so that all cells that fall within the MCP polygon have equal likelihood of being selected as background locations.

When I plug all of my data into Maxent, I get an error message that says my climate layers (ascii files) and the bias mask have different geographic dimensions. How do I get them into the same geographic dimensions if they are displaying different types of data?

I am not sure on how to fix this problem, and can't move forward with my models until I can fix it. Any thoughts?


texts:
I installed mapguide opensource and mapguide maestro but I have a problem accessing the remote server Site

administrator is not responding to the default password


texts: Using ArcPy to query ArcSDE geodatabase?

texts:
I have three variables: view_name, column_name, and column_content.

column_name contains id, name, address, etc.
column_content contains 123, John, 200 King st, etc.

user specifies the column_name and column_content

a SDE connection file located: c:\gdb.dmz.sde

how to query the database in the view = view_name where column_name = column_content?

using arcpy.da.SearchCursor() function.


texts:
It is possible to label QgsRubberBand or QgsVertexMarker with a text annotation (QgsTextAnnotationItem).

See this MWE:

...
r_polyline = QgsRubberBand(iface.mapCanvas(), False)
r_polyline.setToGeometry(QgsGeometry.fromPolyline(points), None)
r_polyline.setWidth(2)
r_polyline.setColor(QColor(0,255,0,255))
seg = QgsFeature()
seg.setGeometry(QgsGeometry.fromPolyline(points))
length = seg.geometry().length()
self.distance_list.append(length)
symbol = QgsMarkerSymbolV2()
symbol.setSize(0)
lbltext = QTextDocument(str(round(length,2)) + ' m')
label = QgsTextAnnotationItem(iface.mapCanvas())
label.setMapPosition(seg.geometry().interpolate(length/2.0).asPoint())
label.setDocument(lbltext)
label.setFrameSize(QSizeF(lbltext.size().width(),lbltext.size().height()))
label.setFrameBorderWidth(0)
label.setFrameColor(QColor("#ffffff"))
label.setFrameBackgroundColor(QColor("#ffffff"))
label.setMarkerSymbol(symbol)
...

In the moment it looks like this:

Is it possible to label a rubber band (or edit the text annotations) like in this picture?


texts: How to visualize the water equivalent between two raster layers in arcmap 10.1?

texts: I do have two raster layers (interpolated with Empirical Bayesian Kriging), that show the elevation of a glacier in April, and September. I want to show the change in elevation between the layers in water equivalent. Any suggestion on how I can do that?


texts:
Is there any way available to restore my unsaved python script in qgis? Yesterday I forget to save my scripts and now I open QGIS project I lost my all three scripts.

I used notepad++ or different IDEs that automatically save all your scripts but I guess this feature is not available in QGIS.


texts: Spatial join polygons to points in ArcPy

texts:
I am trying to spatially join a polygon shapefile to a point shapefile such that every point is matched to the characteristics of the polygon it falls inside. I have succeeded to do this spatial join within the ArcMap following the steps below and in the picture:

Right-click on point shapefile --> Joins and Relates --> Join
What I have selected in the picture

Now I am trying to replicate the result with ArcPy which is more convenient for me because it will allow me to replicate the results in the future. This is the code I tried:

### Define input, output etc.
target_features = "data/raw/population_weights/nhgis0009_shape/CA_block_2010.shp"
join_features = "data/raw/voting_precincts/shapefile/voting_precincts.shp"
out_feature_class = "data/raw/population_weights/nhgis0008_shape/block_points_merged_2.shp"

### Do spatial join
arcpy.SpatialJoin_analysis(target_features, join_features, out_feature_class)

However, I then end up with a polygon shapefile (the points must be somehow joined to the polygons and not vice versa). I have tried to switch target feature and join feature but the result is the same.

Is SpatialJoin_analysis the correct tool for what I am trying to do? How would the correct python code look that will replicate the steps I described above?

Edit (see comments below): Results window for the spatial join I want to perform


texts: One or more dropped items were invalid and will not be added to the control - Color Balance Mosaic Dataset

texts:
I am having some issues dropping a processed Landsat 8 image into the Color Balance Mosaic Dataset.  The image has been processed through the following:

Atmospheric correction QGIS
Pan-sharpening ERDAS
Topographic correction ERDAS model maker
Cloud/shadow removal using unsupervised classification Arcmap

I have multiple images of the same area.  I removed the cloud/shadow coverage and need to merge my images back into one to get only vegetation coverage.  I read that I can use the color balance mosaic dataset tool to do histogram matching, but it will not open my file.  The file format is .img.  I tried saving it as a .lry, but I get the same error.  I have also tried browsing to it through the folder button and can open the saved .img.lry file, but then get an error "The value is not a Mosaic Layer".

Any suggestions?


texts: How to convert an endmember collection spectral signature file from OLI sensor to TM and ETM+ sensors

texts:
I'm working on some supervised classifications using scenes from the landsat legacy archive wich include ETM+, TM 5 and OLI data from 2001 to 2014. I have training and validation points for each scene for the different classes I have defined. Because of this, the fact that every scene is different on its own, and that the bands used in each classification vary in spetral resolution from one sensor to the other, I want to apply the spectral signature defined for the OLI scene (because it's the newest and I can actually go and validate it in the field) to the other scenes as well.

I'm working with ENVI 4.8 and 5.1, using the MLC classifier. Is there a tool in ENVI that can "translate" the spectral signature made from the OLI data to the other sensors?