texts: Leaflet : How to update polyline ? Live Tracking

texts:
var ColorVar = '#bd0026';
        var firstpolyline = new L.Polyline(polyList, {
        color:ColorVar,
        weight: 8,
        opacity:0.8,
        smoothFactor: 1
        }
        );
        focusId.addLayer(firstpolyline);
        }

On the page load , i have using the above code after that i want to update the polyline based on the new data without page refreshing for Live Tracking Concept.


texts: Panchromatic Image Classification GRASS GIS

texts: How to perform an unsupervised classification of a single panchromatic satellite imagery in GRASS GIS? I tried it many times but I keep being prompted for a second image or other images in the sub-group (band 1-2-3 etc). I am using Landsat pan-chromatic data only only.


texts: QGIS print composer layout with several data frames: is it possible?

texts: I have to create a several data frame print composer layout: is there a command or a plugin in QGIS 2.4.0 Chugiak that allows to insert several data frame? I dont't know if QGIS can manage more than one data frame (maybe I'm talking with an ESRI language referring to "data frame").


texts: When dealing with rasters of varying resolutions should one resample to the highest or lowest resolution?

texts:
I'm looking for recommendations on best practices for dealing with raster data layers with different resolutions and projections. The advice I've been given is to always resample to the layer with the lowest resolution before performing any analysis, but this seems like huge waste of precision to me and I've never been given a solid explanation for why it should be done.

When is it reasonable to resample to match a higher resolution grid and what are the implications compared to resampling to a lower resolution?

I realize that this is likely highly situation dependent. I'm mostly looking for general guidelines, but here's my specific scenario for reference:

Scenario: I'm looking to construct a spatial regression model predicting land use based on a variety of environmental and socio-economic layers. My land use map is Landsat derived and hence 30m resolution. Examples of explanatory layers include the SRTM DEM (3 arc-seconds, ~90m) and Bioclim climate layers (30 arc-seconds, ~1km).


texts: Arcpy/python Syntax Error. Variable Creation

texts:
I'm having a problem when trying to create a new variable within python.

i = datetime.datetime.now()
tme = i.strftime('%d/%m/%Y')
print tme

This portion of the code creates a date variable (tme) in the format, 10/02/2015. It functions properly.

The second portion will create a expression variable.

exp = "DATE = '"tme"'"
print exp

This portion does not function properly. The problem occurs when I enter the tme variable.

The result I want python to output is a variable which prints:

DATE = '10/02/2015'


texts:
Is it possible to create GeoServer users for a list of usernames (and associated passwords) in one batch? (similar to using the Linux newusers command to create multiple users)

I've asked a related question about
How to batch create GeoServer stores for each user?. It seems that that's possible with the GeoServer RESTful API.

But how about the GeoServer users themselves?

Can I also batch create the users as well?

I searched about REST API for creating users/roles, but couldn't find anything.

I've tried the Geofence rest API as suggested: I deployed both geoserver-2.8-SNAPSHOT-geofence-plugin.zip and geoserver-2.8-SNAPSHOT-geofence-server-plugin.zip, rebooted, and when I used the REST API with

curl -v -u admin:geoserver -X POST -H "Content-type: text/xml" -d "<User> <username>testu</username> </User>" http://localhost/geoserver/rest/usergroup/users

, I got the following error, no user is added. Any ideas what I am doing wrong or any suggestions? (I can't change the system configuration files, so REST API is preferable.)

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'admin'
> POST /geoserver/rest/usergroup/users HTTP/1.1
> Host: localhost
> Authorization: Basic XXXXXXXXXXXXXX
> User-Agent: curl/7.47.0
> Accept: */*
> Content-type: text/xml
> Content-Length: 41
>
* upload completely sent off: 41 out of 41 bytes
< HTTP/1.1 405 Method Not Allowed
< Date: Tue, 24 Jan 2017 04:57:58 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Allow: GET
< Content-Length: 0
<
* Connection #0 to host localhost left intact


texts: Leaflet add data to GeoJSON without showing on map

texts:
I am adding using GeoJSON data pulled from a service. I want to load the GeoJSON layer but I don't want to display the data on map.
This code is adding myLayer with the default blue color to the map.  Why is my layer added to the map even if I have not called myLayer.addTo(map)? I just want to use it as source data for a search function, not to display them on the map.

fetch('url')
.then(function(response) {
    return response.text();
  })
  .then(function(res) {
    return JSON.parse(res)
  })
  .then(function(res){
    myLayer= new L.geoJSON(res);
  })


texts: Get value from an input select with getBounds

texts:
I have an input select (or select box, whatever), with some values, examples: 72, 73, 74... Where each value is an area on a map. I need that value for each option selected, so as to zoom in on the map in the respective area of that value. I tried the following code:

$("#numSearch").on('change', function(e) {

    var value = $(this).find(':selected').val();
    //var boundArea = value.target;
    //map.fitBounds(boundArea.getBounds());
    alert(value);

});

Where $("#numSearch") select's id.

The result is the select's values (72, 73, 74...) as a string type.

And this:

//var boundArea = value.target;
//map.fitBounds(boundArea.getBounds());

Doesn't work :(

Can somebody help me zoom in on a selected area according to the value selected in the select???

The complete code is here:

https://github.com/eltonsantos/leaflet-tests/blob/master/teste3/index.html

and the json is here:

https://raw.githubusercontent.com/eltonsantos/leaflet-tests/master/teste3/js/geoSetoresComerciais.js

I just want get value came to selectbox (I have it) and zoom on map according value choosed.


texts: Make two layers editable in leaflet draw

texts:
I use Leaflet draw to draw markers and polygons on a map. The created features are saved to two separate feature groups. One feature group for the markers and one for the polygons. Now I want to edit the features. How can I add two feature groups as editable layers:

'edit': {
  'featureGroup': featureGroupMarker, featureGroupPolygon
}


texts: How to download MODIS NBAR（MCD43B4）product?

texts:
Description:
The MODIS nadir bidirectional reflectance distribution function adjusted reflectance (NBAR) product (MCD43B4), 1 km spatial resolution and a composited 16 day temporal resolution.
Question:
I want to download this product for analysis, but can not find it in NASA  (https://lpdaac.usgs.gov/). However, I can find the data description in MODIS (https://modis.gsfc.nasa.gov/data/dataprod/mod43.php). So, how can I download it?


texts:
Using the selection button tool and selecting one point from a shapefile selects all points in that shapefile. Possible to select single points from the attribute table, Select by Attributes to select a single point, and will select a single point in editing mode. This is a new quirk. 10.3.1

Trying to recreate this (colleague in another state having the issue) and the only way I could was by setting the Selection Tolerance ridiculously high (default 3 pixels).


texts: Finding a route that ignores all "island" roads using ArcGIS Network Analyst

texts:
For many months I have been looking to get the distance from certain incidents/origins (wells) to the nearest facilities/destinations (rail car terminals) by road (trucking).

I have used Closest Facility Analyst and OD Cost Matrix but am hitting the same bump. Around 20% of the wells snap to "island" road network lines that do not ultimately route to any facilities/destination I need.

I have hundreds of thousands of roads that span southern Texas, downloaded from open street maps Geofabrik. I have approximately 15,000 wells.

Below you will see the results of an OD Cost Matrix on a selection of the data. Very few points route to the 2 facilities shown. This is using "end-point" network connectivity on the roads.

I also attempted with "any-vertex" connectivity but of course this problem does not help with the stranded islands, of which there are thousands. Even if I dissolve the lines and attempt to use the single largest "continent" (see an older question of mine Network Analyst's Closest Facility - starting from route-possible road segments) I am still left with hundreds of thousands of road islands. The number of road features only drops from 460,000 to 350,000 after this dissolve method.

How would you approach this problem?


texts: PostGIS union multiple tables, big dataset, faster approach?

texts:
My goal is simple. I want to union a given set of shapefiles. In the shapefile are stored polygons. The data bounding box is Germany, so the data is relatively big. I tried to use all functions implemented in QGIS. Either they failed or the precessing time is just too long to get any results. I read a lot of question throughout this forum and I set up a PostGIS Database.

My query is:

 CREATE TABLE dlm_union_2 AS
  SELECT
  a.gid AS ID,
  ST_UNION(a.geom,b.geom) AS geom
  FROM sie01_f a, sie02_f b

I added the Selection of the a.gid since I have no objects returned when I export the table via pgSHAPELOADER. I want to use more than two tables in one expression and is there a way to get this faster? With only two tables my processing time is now about 800,000 ms and the progress isn't finished yet.
After that I want to buffer the merged regions and would like to union it again afterwards. I have a lot of shapes that I have to union at different states of my project.

I am working on WIN 7, 4GB ram, Intel Core i5 M520. PostGIS and PostgreSQL should be up to date, because I installed the components today. Every suggestion are highly appreciated.

UPDATE: I have created a buffer on a multilinestring table. Processing time was about 300,000 ms what is actually great compared to functions implemented in QGIS. My problem is that I need to union the result for further analysis. I'am using ST_UNION with a single table with polygon geometry input. Objectsize is around 300,000 polygon features. At this point my processing time is 2,800,000 ms and I don't know when it will finish. Is there any way to get such a calculation faster?

After processing time 5,319,543 ms the query aborted with following exception. This was the try to use ST_UNION with one table including 300,000 polygons.

ERROR:  GEOSUnaryUnion: std::bad_alloc

********** Fehler **********

ERROR: GEOSUnaryUnion: std::bad_alloc
SQL Status:XX000

UPDATE:

According to Mattmakesmaps I tried the way of ST_Buffer(ST_Collect(geom),0) instead of using the UNION command. With the errors I am posted above I was not able the handle the whole extend of the data. So I split the problem into smaller ones. In my case I used the state-borders in Germany to divide my problem into 16 smaller ones. Mattmakesmaps solution works fine here. Recently I am try to use the ST_Simplify command to make the dimension of the polygons smaller giving me a chance to process all of the data at ones. I will keep you up to date.


texts: Do any of the USGS WMS services work with GeoServer 2.1.x as a store?

texts:
This page displays a number of WMS services: http://seamless.usgs.gov/service_access_list.php?serviceid=Dataset_7&dataset=HRO

In a local copy of GeoServer, I can successfully create a WMS store and publish a layer from the WMS URLs provided on that page, however the layer preview options all throw NullPointerExceptions:
at org.geoserver.catalog.impl.WMSStoreInfoImpl.getWebMapServer(WMSStoreInfoImpl.java:39)


texts: Need to Quickly Add Multiple Layers From Multiple Folders To QGIS Project

texts: I have downloaded several imagery Zip files (content of each is jp2, jpg, jpw, xml, htm, and .dbf, .prj, .sbn, .sbx, .shp, .shx) and would like to quickly add this imagery to my working project in QGIS 2.6.1. I am trying to avoid having to navigate to and add each file separately. Because each file is in a different folder, I have not been able to find a way to add multiple files at once.


texts: No data value in geotiff rendered as white backgroud in geoserver

texts:
I have a geotiff file which contains three bands and the value is 'no-data' at the edge of the image:

However after published in geoserver, I got this:

Note the white background in the image, while I want it is transparent.

Is this possible?

update:

I use the following command gdal_translate -a_nodata 0 -of GTiff D:/01.tif D:/02.tif in qgis to translate the geotiff file.

When publish in geoserver I set the InputTransparentColor to 0:

And the default raster style in geoserver:

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor>
  <NamedLayer>
    <Name>default_raster</Name>
    <UserStyle>
      <Title>Default Raster</Title>
      <Abstract></Abstract>
      <FeatureTypeStyle>
        <Rule>
          <Name>rule1</Name>
          <Title>Opaque Raster</Title>
          <Abstract>A raster with 100% opacity</Abstract>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
            <ChannelSelection>
              <RedChannel>
                <SourceChannelName>1</SourceChannelName>
              </RedChannel>
              <GreenChannel>
                <SourceChannelName>2</SourceChannelName>
              </GreenChannel>
              <BlueChannel>
                <SourceChannelName>3</SourceChannelName>
              </BlueChannel>
            </ChannelSelection>
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>


texts: QGIS 2.01 - raster transparency not working properly

texts:
I have loaded a color raster image (aerial orthoimagery) into a QGIS project.  The layer is visible but very transparent (in the enclosed image the vector polygons are below the imagery), but when I check Properties/Transparency the transparency is set to 0%.

The imagery is apparently color infrared. In QGIS 1.8 I simply went to the Color Map dialog and set the R-G-B color map to 4-1-2 respectively and the display was in perfect true color.  I cannot figure out how to do the same with 2.01. I have looked at the options under multiband and singleband pseudocolor and neither seems to give me the option to reset the color map as I was  able to do with 1.8. You can see that the image is displaying in true color, but highly transparent.  I did not change any color map settings.

When I view an older project that created with 1.8  with 2.01 imagery from this same data set displays perfectly, so it is not a problem with the source data. However, when I look at the Style settings for the older project with 2.01 I cannot find any differences between that project and the Style settings for the new project.

I don't konw if this is a color map issue or a trasparency issue, but I would simply like to get the image ot display properly.


texts:
Is it possible to use math in SLD file in Geotools? I want to get Orientation for lines and calculate its sine/cosine and then multiply it with some value. But when I do this nothing shows up. Here is part polygon symbolizer that I am using.
<PolygonSymbolizer>
<Geometry>
    <ogc:Function name="buffer">
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <ogc:PropertyName>Buffer</ogc:PropertyName>
    </ogc:Function>
</Geometry>
<Fill>
    <GraphicFill>
        <Graphic>
            <Mark>
                <WellKnownName>wkt://LINESTRING(
                0
                0,
                    <ogc:Mul>
                        <ogc:PropertyName>Orientation</ogc:PropertyName>
                        <ogc:Literal>200</ogc:Literal>
                    </ogc:Mul>
                    33 )</WellKnownName>
                <Stroke>
                    <CssParameter name="stroke">#000000</CssParameter>
                    <CssParameter name="stroke-width">1</CssParameter>
                </Stroke>
            </Mark>
        </Graphic>
    </GraphicFill>
</Fill>

Function for multiplication is
<ogc:Mul>
    <ogc:PropertyName>Orientation</ogc:PropertyName>
    <ogc:Literal>200</ogc:Literal>
</ogc:Mul>

for sine I am not sure what function is, but it doesn't work when only multiplication is used.
This is needed because when adding hatches to objects, there is need to draw a hatch with angle of 45 to one side of object. Something like this, but when object is rotated by some angle.


texts: Color correcting mosaic dataset in ArcMap

texts:
I am trying to use the Mosaic color correction tool. But even if I have selected the mosaic dataset the color balancing part of the tool is greyed out.
How can I do this?
I am using ArcMap 10.3


texts: Changing way r.cost and r.drain modules work?

texts:
Look at the picture #1. This is my cost surface raster that has only 2 values. Area restricted for path to cross (red one) and area that is free to go (yellow one). As I need it and as I undestand how it is should work, my least cost path shoul be look like a straight line between two points for most of a time. Practically I have what you can see on picture #2 (performed by r.drain). Cumulative cost gained by using r.cost module showed on picture #3. And to be more clear, what I want to get is showed on picture #4.
Basicaly I just need to get minimum distance beetween two points.

Is there a way to reach the goal?


texts: Using GeoPandas generated .gpkg in ArcMap

texts:
I am using GeoPandas to create .gpkg files. Using GeoDataFrame.to_file()
When opening the files in ArcMap, it takes a long time updating the file extent. Files already have an spatial index as this is a GeoPackage.
Is there a way to specify the GeoPandas GeoDataFrame extent and code that's in the GeoPackage?
Also, files open in ArcMap with a .main prefix in front of my specified layer name which may be an ArcGIS thing.
It’s looking good in QGIS.


texts: QGIS 2.6 Where did "Open from template" go?

texts:
In QGIS 2.4 there was a menu-point in "Composer" (Composer > Open template) where I could open a saved template, see the map I was printing and move the map in the frame to the exact position that I need. How to do that now? The menu-point is missing in QGIS 2.6

If I make a template and save it, I can reopen it, but not see the map, only the placeholder for it. If I delete the map in the template I can create a new, but this will require a lot of tweaking. I'll have to change the scale of the map, make a new ruler because the old one has no connection with the new map and change the layout (line thickness and color) of the ruler.


texts: Sharing WMS / XYZ / MapServer sources across multiple users / installations

texts:
Our organisation has multiple users using QGIS and using a lot of web-based ArcGIS mapserver / WMS data.

At present we share links to WMS/WMTS, XYZ, ArcGIS Mapserver resources via  Wiki, however it would be preferable that there was a database our resource list that we could load resources from and centralise new "finds".

XYZ connections have the ability to save and load libraries to XML but WMS / ArcGIS Mapserver lists don’t seem to have this capability at a group level.

Is there any functionality or plugin that would allow this capability?


texts:
Eurostat has established a link between postcodes and NUTS level 3 codes.

However, what I need is a link between postcodes and LAU level 2 codes. (The most detailed level of Territorial Units, usually municipalities)

In theory this should be available but I cannot find such a table. Does anybody know where I can get a list of LAU02 codes and corresponding postcodes?

Or does anybody know a source for a shapefile with all European postal codes?

Background:

I aim to work with survey data of participants form various European countries and I am interested in the degree of urbanization of the residential region of each participant. For each participant I have the postal code available. The degree of urbanization of each LAU level 2 would be available from Eurostat.


texts:
I'm simply trying to call a WPS process " JTS:dimension ". Code for executing this process is as shown below. I am able to configure this process but not execute it.

var map = new OpenLayers.Map('map',
{
    allOverlays: true,
    center: [114, 16],
    zoom: 4,
    layers: [new OpenLayers.Layer.Vector()]
});

var features = [new OpenLayers.Feature.Vector
                (OpenLayers.Geometry.fromWKT
                (
                'LINESTRING(117 22,112 18,118 13, 115 8)'
                ))];

var cbl = document.getElementById("cb1");
cb1.onchange = fea;
var cb2 = document.getElementById("cb2");
cb2.onchange = dim;

function fea()
{
    if(cb1.checked)
    map.baseLayer.addFeatures(features);

    else
    return;
}

var client = new OpenLayers.WPSClient({
    servers: {
            opengeo: 'http://localhost:8080/geoserver/wps'
    }
    });

function dim()
{
if (cb2.checked)
{
var dime = client.getProcess('local','JTS:dimension');
        dime.configure(
            {
                inputs:
                {
                    geom: features
                }
            });
        console.log("geometry type configured");
        dime.execute(
            {
                inputs:
                {
                    geom: features
                },
                success: function(outputs)
                {
                    console.log(outputs);
                }
            });
}
else
return;
}

when i execute this code i am getting an Openlayers error as shown below :

"  Uncaught TypeError: Cannot read property 'processDescription' of undefined "

Please help me with this error.


texts: Allowing user to create a polygon in Modelbuilder ArcGIS10.1

texts: Is there a way to enable a user to create a polygon 'on-the-fly' through modelbuilder? The output would feed into a other operation such as 'Clip'.


texts: Generating similar random points in QGIS

texts:
I have data (Lat, Lon) of 32 buildings, and their plot in QGIS is given below in red dots. Now based on the calculated mean distance (Nearest neighbor analysis) between these points, I want to generate similar kind of random points for the same area.
What I tried:
I already tried QGIS plugin "Random points" but it seems it only accepts the distance in degrees, not in meters.


texts: Offline maps for ionic mobile application

texts:
I am working on an Ionic app (Angular + mobile). This app needs to provide a (basic) map of New Zealand. The problem is that the map needs to be available while the phone is offline.

I have worked a lot with Openlayers and co on many projects over the years, but this is the first time that I need to have the map available offline.

What it is right approach? Can I create / download the tiles?

Sorry for the broad question, but I literally don't know where to start.

Any help welcome.


texts: Using MS SQL 2005 as the data store in GeoServer

texts:
In my project, I am trying to set up a simple WFS service in GeoServer in order to create a layer consisting of point features. I have succeeded doing so with the points being stored in a shapefile. However, now I need the data to be stored in MS SQL 2005.

I know that unlike the 2008 version, MS SQL 2005 does not support geometry/geography. Googleing for some advice, I kept encountering this article:

https://www.seegrid.csiro.au/wiki/Infosrvices/GeoserverMsSqlServer2005Connectivity

I followed the instructions, installed the MsSqlSpatial extension to MSSQL and the MSSQL plugin into GeoServer. Indeed, now I can add my database as a store into GeoServer and publish a table from it as a layer. However, this does not work entirely.

The table consists of several columns, most of them containing metadata like "town", "street" etc., one of them named "the_geom" contains the points themselves. The points are stored in the WKB (well known binary) format, so the datatype of "the_geom" column is varbinary(max). However, GeoServer doesn't seem to like this. When trying to publish the layer, GeoServer correctly reads all the columns with the metadata, but for the "the_geom" column, it publishes the message:

Could not find mapping for 'the_geom', ignoring the column and setting the feature type read only

The last chapter of the article I posted suggests to use the WKT (well known text) format to represent the points. In this case, the type of the database column would be Text. When trying to publish the layer, GeoServer recognizes the "the_geom" column, but with the type 'String' instead of 'Point'. Thus, when I request the WFS service with parameter geometryName = "the_geom", GeoServer throws an exception stating that

Property the_geom is not geometric

Have I misunderstood something? Is there another datatype to use for the points in the database? I have tried different approaches and none worked for me; however, the author of the given article claims he successfully managed to connect MS SQL 2005 to GeoServer, so it should be possible.

Finally, please do not reply in the manner "Upgrade to 2008". I want to. Or I would use PostGis. But, in this case, I just can't.

Thank you for your help in advance.

Imp


texts:
The main objective for our project is to create a portal website in Drupal. On this website, people must be able to upload their geographical datasets (mostly shape files, but also xml files that include metadata).

This has to be made as easy to use as possible for the users of the website. Secondly, the data has to be shown on a map or different maps depending on the needs of the user. The metadata also needs to be shown appropriately according to which data is shown on the map. Lastly, people should be able to modify their data online. This would make it very advantageous to use, compared to what they are using right now, although it is not mandatory for our project.

Together with the website, there must be a centralized database with all the data that has been uploaded so far. This can be saved into the GeoServer, combined with a PostGIS database.

What we've been thinking about:

Create bash scripts to make an automatic process (e.g. write data into database, create layers into GeoServer, ...)
Create an own made Drupal module for uploading AND processing the uploaded data into our database. This way the data is automatically processed and shown directly onto the website. (Not sure if that would be possible...)

What would be the best solution or is there any other solution/system that we should use?

We've now started working on our Drupal module. Basically a new question that rises here is "Is it possible to create GeoServer stores/layers automatically based on PostGIS data in the database itself?"
We're thinking about commands to accomplish this, but we're unsure about it.

This code we use to try to create our layer:

$createlayer=("curl -u admin:geoserver -v -XPOST -H 'Content-Type:text/xml' -d $(ls -t -r /var/www/cartaro/sites/default/files/uploads/*.shp | tail -n 1) http://localhost:8082/geoserver/rest/workspaces/cartaro/datastores/$storename/featuretypes");
exec($createlayer);

This is the result from the commandprompt:

* upload completely sent off: 66out of 66 bytes
< HTTP/1.1 500 Internal Server Error
< Transfer-Encoding: chunked
< Server: Jetty(6.1.8)
<
* Connection #0 to host localhost left intact
* Closing connection #0
 : only whitespace content allowed before start tag and not / (position: START_DOCUMENT seen /... @1:1)

What are the possible solutions?


texts: Removing grid lines from vector layer using ArcMap

texts:
I have merged 2 vector layers  but i'm getting the vertical line or grid line.
How do I remove it?
This is the image where I highlighted the vertical line:


texts: Vertical Datum conversion of a raster with gdal

texts:
Is there a tool available in gdal to do vertical datum conversion of a raster DEM? I'm looking for a single command line to execute the vertical datum conversion of a raster like the las2las of Liblas does for Point Cloud data.

I found out that gdalwarp were not doing this conversion even if the .gtx grid shift file exist in the PROJ_LIB folder and is correctly set in gdal.

I was able to do vertical datum conversion of a coordinate with gdaltransform, but I can't find a way to do the conversion for a complete raster file.


texts:
I am going through Generate renderer sample in ArcGIS Java Script API and I want to make similar example using my rest service.

I am going through the sample REST service and wondering that how they created dynamic legend in REST?

I searched and tried to generate the dynamic legend at my end but its not displaying in REST. I am classifying data in Arc Map (using layer properties--symbology) and publishing on server but not getting dynamic legend..

So any help will be great !! thanks in advance : )

Software's : ArcGIS Server & Desktop 10.1 and JSAPI 3.2/3.3


texts: How to clip GEE MODIS burnt area collection

texts:
I am using the MODIS Burned Area Monthly Global 500m product in GEE. I would like to export the information in a .tiff file for a designated area, which I have imported into GEE as a shapefile. The original code is as follows

var dataset = ee.ImageCollection('MODIS/006/MCD64A1')

              .filter(ee.Filter.date('2000-01-01', '2020-06-05'));
  var burnedArea = dataset.select('BurnDate');

  var burnedAreaVis = {

  min: 30.0,

  max: 341.0,

  palette: ['4e0400', '951003', 'c61503', 'ff1901'],
};

  Map.setCenter(30, 50, 6);

  Map.addLayer(burnedArea, burnedAreaVis, 'Burned Area');

I have tried to clip the collection to the shapefile using cliptocollection, but it consistently comes up with different error codes - and I really have no idea how to export a collection such as this to my drive.
Any help would be extremely appreciated.
Thanks.


texts: Geoprocessing with WCS layers using ArcMap

texts:
Beginner here with ArcMap and I'm having trouble using geoprocessing tools with WCS layers I uploaded.
Is this an issue of "can't technically use these tools on WCS layers"?
Should I reformat them into another workable format?


texts: Precipitation data for one day instead of 3-hourly data from TRMM in Google Earth Engine

texts:
I want to get daily precipitation data instead of 3-hourly data from TRMM in earth engine. How can I reduce it to daily precipitation data?

The following code is to get 3-hourly precipitation from TRMM over a feature collection of 19 points:

https://code.earthengine.google.com/b71d1fa3beb03f9254480882d5b354c2

var pcp = trmm.select('precipitation').filterDate('2000-01-01','2004-01-01');

print(bait.select([]));
bait.select([]).evaluate(function (featureCollection)
{
  featureCollection.features.forEach(function (feature)
  {
    print(ui.Chart.image.series(
    pcp.limit(5000),ee.Geometry(feature.geometry),ee.Reducer.mean(),1000).setOptions({
  title: 'Precipitation time series ' + feature.id + ' ('+ feature.geometry.coordinates+')',
  hAxis: {title: 'Year'},
  vAxis:{title:'mm/hr'}
 }));
 });
});

Map.addLayer(bait);
Map.centerObject(bait);


texts:
I built a model to import table data, create xy event, kernel density and clip density raster. I would like to export the clipped raster as a JPEG but I am not sure how to write the ExportToJPEG code.

Below is the model exported as a Python script.

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")

# Local variables:
Input_Table = "C:\\Users\\cbriglia\\Desktop\\GIS\\Worksheets\\accidents_jan_2013.xls\\Layer1$"
state_border_shp = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\state_border.shp"
Layer1_pytest4 = "Layer1_pytest4"
Ouput_Feature_Class = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\layer1_pytest4.shp"
Hot_Spot_Output = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\pytest5"
Clip_Output = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\pytest6"

# Process: Make XY Event Layer
arcpy.MakeXYEventLayer_management(Input_Table, "longitude", "latitude", Layer1_pytest4, "GEOGCS['GCS_North_American_1983_CSRS',DATUM['D_North_American_1983_CSRS',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", "")

# Process: Copy Features
arcpy.CopyFeatures_management(Layer1_pytest4, Ouput_Feature_Class, "", "0", "0", "0")

# Process: Kernel Density
arcpy.gp.KernelDensity_sa(Ouput_Feature_Class, "NONE", Hot_Spot_Output, "4.10886000000002E-03", "3.42405000000002E-02", "SQUARE_MAP_UNITS")

# Process: Clip
arcpy.Clip_management(Hot_Spot_Output, "-73.7275781441499 40.9867050023656 -71.7867901391991 42.0506901260974", Clip_Output, state_border_shp, "-3.402823e+038", "NONE")


texts: How to host kmz file for Google Earth Pro network link

texts:
I have a repository consisting of a large number of image overlays, polygons, and 3d polygons in Google Earth Pro. The image overlays are linked to and stored on a windows web server and it works fine if I save as a kmz or kml to send to others. New image overlays will be added and edited over time and colleagues need to have access to the most up to date version.

I want to have the repository saved as a kml or kmz on the web and share a network link with my colleagues instead of sending them a new kmz file each time it's updated. I tried saving it as a kml and kmz on the same web server and pasting the url in as the Network Link, yet nothing loads.

Everything loads if I set the file path to the web server via the network drive, just not as a link. Tried hosting the file as an attachment on Google sites but it was not a valid attachment type.

How can I host this kmz somewhere on the web and access it via Network Link in Google Earth Pro? Believe I'm married to Google Earth Pro because of support for 3D polygons.


texts: Extract WMS data from the OneGeology Portal

texts:
I am trying to extract geological information from the OneGeology portal unfortunately most of the data there only consists of WMS data.

For example, is it feasible to extract a particular legend class from
     http://services.azgs.az.gov/arcgis/services/OneGeology/AZGS_USGIN_Geology/MapServer/WMSServer

into a vector form? Or is the best that I can do is to use GDAL to translate the image into a geospatially referenced image?

Note -- OneGeologyPortal does allow for one to save the WMS into KML/WMC but I am unable to open either in a GIS program(ArcGIS/QGIS). Google Earth opens the file but the image resolution is severely deteriorated.


texts: Using Con Statement in Raster Calculator

texts:
I am using ArcGIS Desktop version 10.7.0.10450

I have previously used Con statements in the Raster Calculator that now do not seem to work. I did hundreds of these with raster data about five years ago and have come back to updated the project but cannot figure out what has changed. The basics are a simple if/then statement:

new_raster=(Con(("raster1" - 100) < 0, 0, ("raster1"  -  100))) * 31

The result would be 0 if raster1-100 is less than zero or raster1-100. The multiplier at the end is a constant and could be done outside this statement if needed.

When I run the raster calculator it completes quickly, shows the following results, but there is no output raster and no error message.

What am I missing here?


texts:
I have a button in a QGIS (3.4.1) plugin that should: create a new project; set it's CRS to EPSG:4326', then import various maps.

However, when I run it for the first time after QGIS has loaded, the maps are show with their own CRS of EPSG:3857(confirmed in the bottom right of the GUI).  If I click the button a second time/run the code again, the maps are shown in the intended  CRS of EPSG:4326 (again, confirmed in the bottom right).

The minimum code I can find to replicate the behavior is below:

    # Create new project
    iface.newProject(promptToSaveFlag=False)
    project = QgsProject.instance()

    # Create map tile layer (which by default uses EPSG:3857)
    map_uri = 'type=xyz&url=http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'
    raster_layer = QgsRasterLayer(map_uri, 'openstreetmap.org', 'wms')
    if raster_layer.isValid():
        project.addMapLayer(raster_layer)

    # Set CRS to EPSG:4326
    project.setCrs(QgsCoordinateReferenceSystem('EPSG:4326'))

Copy/pasting into the Python console seems to have the same results (i.e. first time after QGIS has loaded it doesn't work, second time it does).

Is this a bug in QGIS?

Can anyone propose a workaround?


texts:
I understand the use of domains and even that of subtypes, but in using them together is where I feel as though I am getting lost. I have taken the online course provided by ESRI to try and understand a bit more and I understand there too, but still lack some further understanding.

Software: ArcMap 10.7.1

So, my thought is as follows:

Domain Attribute: pipe_type
Coded Value: 1: Water, 2: Sewer

Subtypes: pipe_material
Coded Value: 1: Ductile Iron Pipe, 2: Concrete, 3: Polyethylene, 4: P0lyvinyl Chloride, 5: Copper, 6: Steel

Not all of these can run water or sewer, but some cross over and allow both. I would like to restrict the subtypes to that in which is selected either Water or Sewer.

In typing this I feel as though the subtype should be pipe_type and the materials should be the domain, but then again, how do I limit based on which is selected?


texts:
I have a PostGIS database with tables osm_admin (with contains all administrative boundaries from osm data) and osm_landusages (with contains all landuse areas form osm - like forests, industrial/residential areas etc, 35kk rows total)

In the query below I want to find all landusages that has bounding box intersecting with one of London's district.

with london as (SELECT *
                 FROM osm_admin
                WHERE osm_id = -184710)
SELECT ol.*
  FROM osm_landusages ol,
       london l
 WHERE l.geometry && ol.geometry

Query works fine, but it takes 50 seconds to complete.

Here is the explain analyze result

"Nested Loop  (cost=140.25..13930.01 rows=35341 width=543) (actual time=2067.725..49146.068 rows=4585 loops=1)"
"  CTE london"
"    ->  Index Scan using osm_admin_osm_id_idx on osm_admin  (cost=0.42..8.44 rows=1 width=7480) (actual time=0.028..0.032 rows=1 loops=1)"
"          Index Cond: (osm_id = '-51827'::integer)"
"  ->  CTE Scan on london l  (cost=0.00..0.02 rows=1 width=32) (actual time=0.032..0.038 rows=1 loops=1)"
"  ->  Bitmap Heap Scan on osm_landusages ol  (cost=131.81..13886.21 rows=3534 width=543) (actual time=2067.686..49136.460 rows=4585 loops=1)"
"        Recheck Cond: (l.geometry && geometry)"
"        Heap Blocks: exact=2247"
"        ->  Bitmap Index Scan on osm_landusages_geom  (cost=0.00..130.92 rows=3534 width=0) (actual time=2046.779..2046.779 rows=4585 loops=1)"
"              Index Cond: (l.geometry && geometry)"
"Planning time: 0.584 ms"
"Execution time: 49148.356 ms"

The Bitmap Index Scan looks fine, with cost of 130, and then there is Bitmap Heap Scan that has the same condidtion, and is increasing cost to 13886. Is there anything I can do with it?

I increased work_mem to 256MB, but it didn't change anything, also I ran cluster on the osm_landusages geometry index, and it still not finished, after 4 days.


texts: How to use field calculator from QGIS Sextante plugin

texts:
I am trying to use the Sextante field calculator to calculate a field for a buffer radius using a categorical text field. The formula works fine when I run it using the standard QGIS field calculator via the attribute table:

When I use the same formula from the Sextante toolbox however (algorithms for vector layers), it produces only null values.

This is the formula I'm using:

case when  "PointConfL"  =  '10-50 km' then 50000
when  "PointConfL"  =  '5-10 km' then 10000
when  "PointConfL"  =  '2-5 km' then 5000
when  "PointConfL" =  'centroid of farm' then 10000
else 50000
end

It seems to not matter whether the new field exists before or not: if it doesn't exist, it is created, but in both cases, all values are NULL.

Am I using the 'algorithm' incorrectly, or is this perhaps a bug in the plugin?

EDIT: I found the error log in ~/sextante, but it doesn't shed much light on the problem:

ALGORITHM|Wed Oct 24 2012 17:08:08|Sextante.runalg("sextante:fieldcalculator","/home/rudi/personal/GIS/projects/transform_count/364-236.shp","buffer_sextante","case when  "PointConfL"  =  '10-50 km' then 50000 when  "PointConfL"  =  '5-10 km' then 10000 when  "PointConfL"  =  '2-5 km' then 5000 when  "PointConfL" =  'centroid of farm' then 10000 else 50000 end")
ERROR|Wed Oct 24 2012 17:08:08|Problem evaluation formula: Wrong field values or formula


texts: Creating Mine Grid CRS in QGIS with point data?

texts:
Wondering if it's possible to create a custom mine grid CRS from point data?

I do not know the specific variables for the UTM to mine grid conversion, but I have point data for both projection sets.

Is it possible to create a shapefile of this point data in QGIS and then construct a custom CRS from the equivalent mine grid point coordinates? (Use UTM coordinates to correlate with mine grid coordinates)


texts: Understanding what levels to use in gdaladdo

texts:
I am trying to understand how tiles overviews and levels interact using GDAL so i know how to use it appropriate and optimize my rasters to use either in QGIS and/or geoserver.
So just to verify my understanding.
TILED=YES (using ex gdal_translate). Tiles the internal file structure of instead of reading it linear.
OVERVIEWS (using gdaladdo). Creates a pyramids. Can be created on individual GeoTiff or on a vrt.
My main issue is to understand levels.
For example
gdaladdo -ro -r
--config COMPRESS_OVERVIEW JPEG
--config PHOTOMETRIC_OVERVIEW YCBCR
--config INTERLEAVE_OVERVIEW PIXEL
––config GDAL_TIFF_OVR_BLOCKSIZE 256
--config JPEG_QUALITY_OVERVIEW 75
mosaic.vrt 2 4 8 16 32

Say I have a mosaic with aerial images for a large region, say a country.
What levels should I use to be able to render the entire country fast (as a guideline)?
What does 32 mean and how do I know where to stop? 64, 128? and how does it relate to the blocksize to use?
But if I understand correctly using these pyramids in geoserver would not work as it cannot read vrt files. Then I need to tile them with gdal_retile?


texts: Publish high resolution drone data as gpkg with mapproxy

texts:
I am currently sitting in front of the problem of publishing high resolution drone data via mapproxy as wmts service.
My approach is the following:

Calculation of an orthophoto with OpenDroneMap.
Creation of a geopackage with GDAL:

docker run -ti --rm -v D:/Kartendaten:/data osgeo/gdal gdal_translate -of GPKG data/D_Other/Drohne/Drohne_010321_HQ.tif data/D_Other/Drohne/Drohnenaufnahme.gpkg -co TILING_SCHEME=GoogleMapsCompatible -co TILE_FORMAT=JPEG -co QUALITY=75

Inclusion of the gpkg in mapproxy:

layers:
   - name: Drohnenaufnahme
     title: Drohnenaufnahme
     sources: [Drohnenaufnahme_cache]
caches:
    Drohnenaufnahme_cache:
        sources: []
        grids: drone_grid
        cache:
            type: geopackage
            filename: D:\Kartendaten\A_Daten\C_Drohne\Drohnenaufnahme.gpkg
            table_name: Drohnenaufnahme
grids:
    drone_grid:
           base: GLOBAL_WEBMERCATOR
           tile_size: [256, 256]
           srs: 'EPSG:3857'
            # zoom 0-23
            # See https://gist.github.com/gagan-bansal/db6fb206f61b38f2f1c3
           res: [156543.03392804097,
                78271.51696402048,
                39135.75848201024,
                19567.87924100512,
                9783.93962050256,
                4891.96981025128,
                2445.98490512564,
                1222.99245256282,
                611.49622628141,
                305.748113140705,
                152.8740565703525,
                76.43702828517625,
                38.21851414258813,
                19.109257071294063,
                9.554628535647032,
                4.777314267823516,
                2.388657133911758,
                1.194328566955879,
                0.5971642834779395,
                0.29858214173896974,
                0.14929107086948487,
                0.07464553543474244,
                0.03732276771737122,
                0.01866138385868561]

My problem is, if I output the data via ODM in high quality it is not possible to convert the data via GDAL. As soon as I remove the tag TILING_SCHEME=GoogleMapsCompatible, the process runs through, but is no longer readable for Mapproxy due to the COSTUM SCHEME. Also a previous reprojection of the data into the EPSG:3857 does not work.
The whole thing is related to the zoom levels, but I can't find a solution.
Has anyone implemented a similar project or does anyone have a solution that I haven't thought of?


texts: Cannot join feature layer with SQL Server table with query built in it in ArcMap

texts:
I need to join a feature layer with a SQL Server View with a common field in ArcMap. The View was successfully added to ArcMap as data table with some query built on it from Query Builder.

When I tried to make join on those two layers it returned nothing in the attribute table.

However, if I modified the view definition with exactly the same query in SQL Server, the View added to ArcMap and joined with the feature layer returned records in the attribute table.

I would like to enable the user to build their query on the added View as table in ArcMap rather than currently having to do it in View definition on the SQL Server side.

Just wonder if anybody came across the problem before. Is there any workaround for it?

Thanks

Alex


texts:
I have a point shapefile that includes meteorological data. I want to select and export some feature classes from that based on data observation date. This criteria is one of the fields in the original data but because of existing many rows, about 1 million records!, I must use iterate feature selection in model builder in ArcGIS.

I connect that iterator to Select tool to export selected records to my workspace in a Geodatabase. I use the inline in addressing to my outputs but unfortunately every exported feature class replaces the before one! So finally I just have a one feature class including of the last selected records.

What can I do to solve this issue?


texts: Using Query Layers with ArcGIS Server 10.0 for Java on Linux

texts:
I have an ArcGIS Server 10.0 for Java running under Red Hat Linux. I would like to be able to publish a Map Document that I have created which has a working Query Layer connecting to Oracle 11g. In ArcMap the layer works as expected. I have installed all the Oracle client software on the ArcGIS Server (the server is actually running Oracle also). I am able to connect via SQL Plus as the ArcGIS server user. I have set all the environment variables to the best of my knowledge. However when I publish the Map Document I get the following in the log

WARNING The Layer:'XXXXXXXX' in Map:'Layers' is invalid. No SDEHOME environment variable set
WARNING The Layer:'XXXXXXXX' in Map:'Layers' is invalid. No SDEHOME environment variable set

INFO3 Server Object instance on machine XXXXXXXX is created with errors. The Layer:'XXXXXXX' in Map:'Layers' is invalid. No SDEHOME environment variable set
INFO3 Server Object instance on machine XXXXXXXX is created with errors. The Layer:'XXXXXXX' in Map:'Layers' is invalid. No SDEHOME environment variable set

I don't have ArcSDE installed and I thought the idea of Query Layers was that you didn't need it? Very confused and Google didn't turn up much :-(

Any help would be most appreciated.

Regards

Colin


texts: How do you start a Toolbox tool from ArcObjects?

texts:
I want to put a couple of toolbox Tools onto an AddIn toolbar.  I tried to reference the ProgIDs in the toolbar section of the Config.esriaddinx, but that didn't work (only saw blank spaces where the buttons should have been).  But since tools aren't actually buttons, it makes sense.

I only want to start the tool from an AddIn button--I want to trigger the double-click on the tool from toolbox. I don't want to actually provide the parameters.


texts: Unwanted artefacts working with Raster analysis

texts:
I am trying to make a simple slope map from a DEM (tif). I already tried with the different slope-tools in QGIS (GDAL, SAGA, GRASS) and also the 3D Analyst in ArcMap. Boths bring the same result: a slope map with line shaped artefacts (see pic).

After reading other posts regarding this topic I tried: WARP, (bilinear)RESAMPLING, REPROJECT and changing the DEM from .asc to .tif format.
The extention of the DEM is about 4x4 km; the resolution 1x1 m.

@FelixIP Yes, the conversation is with float. What made you think that it could alter the output?
@lambertj The crosshatching is "bigger" than the cell size as you can see in the pics.


texts: Using mathematical hack (EPSG 4326 to EPSG 3395)?

texts:
I am currently in the process of writing my own GIS. While doing so I thought of a hack for transforming points from EPSG 4236 (WGS84, geographic coordinates) to EPSG 3395 (World Mercator, projected coordinates) and wanted to ask if this hack has any mathematical drawbacks.

I am drawing the coordinates using the graphics card (using OpenGL). OpenGL works on the basis that the coordinates in a window go from -1.0 to 1.0 - see this picture for illustration. OpenGL has a thing called a vertex shader. You can use it to transform the given coordinates in a highly parallel way (instead of transforming one coordinate at a time, you can transform millions at a time, it is very fast). The coordinates that I get are always in the WGS84 coordinate system.

Now, what I did was the following: I know the height / width of the window (let's say 800 x 600 pixel) and the DPI of the monitor. I also know the center coordinate (where the user is currently looking at) in WGS84.So what I do get the accurate scale is that I first transform the center of the screen into EPSG 3395 using the regular conversion. I calculate the real-world scale of the window in meter using the DPI number, scale the result by the current scale (let's say 40.000) and calculate the "bounding box" of the window in EPSG 3395 (add / subtract to the center of the screen). Then I transform said bounding box back to EPSG 4326 using the reverse formula. I do this every time the user zooms / pans the map / resizes the window. So I have to do only 5 coordinate transformations, instead of possibly thousands.

Then I upload the bounding box and the coordinates in EPSG 4326 to the GPU / OpenGL. The shader for transforming the EPSG 4326 coordinates into OpenGL coordinates (from -1.0 to 1.0) looks like this:

in float x;
in float y;

uniform float north;
uniform float east;
uniform float south;
uniform float west;

void main() {

    // x, y is "each coordinate"
    // this function will run for each coordinate pair in parallel

    float delta_east_west = (east - west) / 2.0;
    float delta_north_south = (north - south) / 2.0;

    float final_x = -1.0 + ((x - west) / delta_east_west);
    float final_y = -1.0 + ((y - south) / delta_north_south);

    gl_Position = vec4(final_x, final_y, 0.0, 1.0);
}

So I am basically setting the coordinate as a percentage of the window width, which gives me a value between -1.0 and 1.0 - if the coordinate is in the currently visible area. The result looks like this:

To me, this looks like a mercator projection, however I am not sure if it actually is. The intended use does not have to be highly accurate or measurable, discrepancies of up to a meter are OK, this is intended for cartography (only the scale is important). Does the mercator projection require me to run each point through the (quite complicated) conversion function? For highly accurate mapping, I would of course not do this and use a CPU-bound approach for increased accuracy, but I am wondering if I have a mercator projection now or something else. However, for cartography, it was very important that I can smoothly zoom in / out very fast, at the cost of accuracy. What I think is that my map may be accurate at the edges, but not in the middle.

I should not that the chosen UTM zone is always the zone that the middle of the screen lies in. For example, if the middle of the screen lies in UTM zone 30, the reverse transformation (from meters to degrees) of the screen bounding box will be done using this zone, although the coordinates may be in a different zone.


texts: How do I convert WGS84 to Lat, Long to Google Maps in R?

texts:
I have this coordinate which I believe it's in WGS84 format

x=1005740.867110, y=243957.356623

I want to plot that in Google Maps which I need to convert that to Lon, Lat.

I've found this script but it looks like it's not working correctly.

> library(proj4)
> proj4string <- "+proj=utm +zone=19 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs "
>
> # Source data
> xy <- data.frame(x=1005740.867110, y=243957.356623)
>
> # Transformed data
> pj <- project(xy, proj4string, inverse=TRUE)
> latlon <- data.frame(lat=pj$y, lon=pj$x)
> print(latlon)

And I get this

        lat       lon
1 -107.8364 -14.35746

I use that lat, long and try them n http://www.darrinward.com/lat-long/ which I don't think it points to the correct point.


texts: Should I use WFS, WMS or SOS considering performance and security?

texts:
My task is to develop a web application which will visualize the temporal data on map and produce a kind of data flow (or animation) from the images/data which have been received from server.

For this purpose, I am thinking to use OpenLayers API and OGC web services WFS or WMS or SOS.

One of the main requirements is to send data securely and fast with high performance.

The question I have is: Which service out of WFS, WMS and SOS will be good to use for such a web application in terms of performance, security, reliability etc.?

I know each web service provides different features. But, if I use WMS for my temporal data to get map images by performing some kind of aggregation in database (as it is temporal visualization), then my application will get slow on some devices like mobile phones/tablets as it may take lot of time to fetch images.

On the other hand, If I use SOS or WFS, there will be risk for our application to send raw data, which is really not secure.

It will be really great if anyone can give me an advice or thoughts on it.

If you think, this question can't be just answered, then can anyone give me an idea how should I proceed further for such an research based problem?


texts: Why do these CartoDB infowindows return "no data available"?

texts:
In my Cartodb map (not the map view of a dataset, but an actual "Map"), I have created custom infowindows for my points, and in Edit mode, they show up great. However, on the published map, when the user clicks on a point, an infowindow shows up that says "No data available."

Here's a screenshot of map editor:

Here's the published map:
https://uwm-libraries.cartodb.com/viz/c46ab240-bbae-11e5-af70-0e787de82d45/embed_map


texts: OpenLayers 6 many layers on the map performance

texts:
I have around 50 layers which I need to add to the map though wms, however the performance is really bad. Including that for each layer is triggered the wms layer events.
const source = new TileWMS({
   url: `${baseWmsUrl}${url.pathname}`,
   tileLoadFunction: (imageTile, src) => loadTileImage(imageTile, src),
   params,
});

new TileLayer({
  source,
  zIndex: 0,
})

I have read that it can combine multiple LAYERS in single wms request, however that seems not working for me as I have control which sets the opacity of each individual layer, including the click event which is looking for each layer at a pixel and also specific style per layer. I tried layer group but it doesn`t help to improve the speed.
Are there any options I can improve the OpenLayers performance with that much layers on the map?


texts: Moving geom.Polygon.circular in OpenLayers 3

texts:
I'm using Angular and OpenLayers to build an web-app.

I have a map which is working and I have added a Vector (icon) which is also working. I have made a circle with the same center as the icon which also works.

Now when the user clicks on a button I want that icon and circle to move to a new location which works for the icon but the not circle using:

$scope.iconFeature.getGeometry().setCoordinates(ol.proj.transform([long, lat], 'EPSG:4326', 'EPSG:3857'));
$scope.circleFeature.getGeometry().setCoordinates(ol.proj.transform([long, lat], 'EPSG:4326', 'EPSG:3857'));

The iconFeature is implemented using:

var iconFeatures=[];
$scope.iconGeometry = new ol.geom.Point(ol.proj.transform([long, lat], "EPSG:4326", "EPSG:3857"));
$scope.iconFeature = new ol.Feature({
  geometry: $scope.iconGeometry,
});
iconFeatures.push($scope.iconFeature);
var vectorSource = new ol.source.Vector({
  features: iconFeatures
});
var iconStyle = new ol.style.Style({
  image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
    anchor: [16, 32],
    anchorXUnits: 'pixels',
    anchorYUnits: 'pixels',
    opacity: 1,
    src: 'img/positions_marker.png'
  }))
});

The circleFeature is implemented using:

$scope.circleFeature = new ol.Feature(
  new ol.geom.Polygon.circular(
    new ol.Sphere(6378137),
    [long, lat],
    600,
    64
  ).transform('EPSG:4326', 'EPSG:3857')
);

    var circle = new ol.layer.Vector({
        source: new ol.source.Vector({
    features: [ $scope.circleFeature ]
    }),
        style: [ new ol.style.Style({
                fill: new ol.style.Fill({
                color: 'rgba(76, 181, 248, 0.2)'
            })
        }) ]
    });

How come the iconFeature is moving fine but the circleFeature isn't?

UPDATE: Solution

$scope.circleFeature.getGeometry().setCenter(ol.proj.transform([long, lat], 'EPSG:4326', 'EPSG:3857'));

$scope.circleFeature = new ol.Feature({
        geometry: new ol.geom.Circle(
            ol.proj.transform([long, lat], "EPSG:4326", "EPSG:3857"),
            600
        )
    });


texts:
I'm looking for a solution in QGIS for:
the distance measurements from each and every cell site (blue point) back to the Exchange(point) that they are connected with. We need to take the shortest path from the cell site to the Exchange, but it has to go along our design path (obviously, use the civils and direction that we already worked on).

In the picture below  the Blue circles are the cell sites and the Black lines are the Cell Fibre.
We need the measurement of the red line which is the total distance from the Cell Site to the Exchange.
The BLUE LINE is the Exchange Fibre.

This will be a very slow, manual process unless we can come up with a way to query this in QGIS?

So to clarify even more: for Cell #1 and Cell #2, we need distance to the exchange

Cell #1 distance is: A + B + C

Cell #2 distance is: B + C

Do you have any idea what we can do to solve this using QGIS automatically?


texts: How to share accurate location with Geodjango

texts:
I am new to GIS and have been working on a webapp for location sharing. I want to be able to have my users be able to "Pin" their location in a map. For this I installed Geodjango/PostgreSQL/Postgis did the Geodjango tutorial and have a fully working map.

My problem is that I am not sure what the next step should be to be able to get the request the user's information (their location) when they decide to "pin" the location and be able to accurately put it on the map.

I am using django 1.11


texts: lasnormalize() is creating large negative values?

texts:
I am trying to generate a normalized height values for a catalog of las tiles. I first generated a dtm using:

dtm = grid_terrain(ctg, knnidw(k=5))

Then, I normalize the values using:

normalized = lasnormalize(ctg, dtm)

The normalized data set shows some negative values, however they happen to be wildly large. I'm wondering what I might be doing that could cause this to happen. Here is some more info on the data I'm using:

> head(data.table(ctg@data)[, .(Min.Z)][order(Min.Z)])
    Min.Z
1: 396.91
2: 430.77
3: 456.20
4: 456.51
5: 458.07
6: 463.13
> dtm@data@max
[1] 753.7401
> head(data.table(normalized@data)[, .(Min.Z)][order(Min.Z)])
          Min.Z
1: -21474836.48
2: -21474836.48
3:      -183.38
4:      -171.77
5:       -19.05
6:       -17.92

Given the largest value in the dtm, I don't see how -21474836.48 could possibly be generated.

ctg is my catalog of las files.

dtm is the raster generated from grid_terrain.

normalized is the result of lasnormalize(ctg, dtm)

It turns out that none of the individual chunked/tiled .tif rasters have negative values. The grid_terrain.vrt file produced by grid_terrain has several huge negative values (looks like it might be the most negative number possible). Here is a summary of grid_terrain:

vrt
class      : RasterLayer
dimensions : 24000, 3000, 72000000  (nrow, ncol, ncell)
resolution : 1, 1  (x, y)
extent     : 535500, 538500, 4872000, 4896000  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
source     : memory
names      : grid_terrain
values     : -339999999999999996123846586046231871488, 753.7401  (min, max)

It looks like there are plenty of these too:

> length(vrt@data@values[vrt@data@values < 0])
[1] 21606964
> unique(vrt@data@values[vrt@data@values < 0])
[1] -339999999999999996123846586046231871488

So a better set of questions:

Should I be using grid_terrain.vrt as my dtm for normalization?

If so, why could there be so many of these huge negatives in grid_terrain.vrt?

If not, how should I be using the output of grid_terrain() to normalize my las files?


texts: How to determine which point lies in which polygon from a list of multiple polygons

texts:
I am new to python and currently working with Json file and I need to determine the location of each tweet and represent the grid in which they are present with the count of tweets in each grid cell.I tried comparing the xmin, xmax, ymin and ymax values of the polygon but it doesn't seems to be working.
Any sort of advice would be helpful.
This the function which i have used to return the grid_id but it returns only 3 gird ids , implying that all the tweets were made from those 3 grids, which is not the case

lt =[]
def match_tweets():

    for d in dic.values():
        for x in lst:

            if ((x['xmin'][0]<= tweet_long[1][0][0] and tweet_long[1][0][0]<=x['xmax'][0]) and (x['ymin'][0]<=tweet_lat[0][0][0] and tweet_lat[0][0][0]<x['ymax'][0])):
                x['count']+=1
                return lst.append(x['grid_id'])

The data in dic looks like this

    {0: [[[-37.95935781]], [[144.92340088]], [['melbourne']]],
     1: [[[-37.95935781]], [[144.92340088]], [['melbourne']]],
     2: [[[-37.95935781]], [[144.92340088]], [['melbourne']]],
     3: [[[-37.95935781]], [[144.92340088]], [['melbourne']]],
     4: [[[-37.95935781]], [[144.92340088]], [['melbourne']]],
     5: [[[-37.94917514]], [[144.92501796]], [['tb', 'tasmania']]],

The data in lst looks like

    [{'id': 'A1',
    'xmin': [144.7],
    'xmax': [144.85],
    'ymin': [-37.65],
    'ymax': [-37.5],
    'coordinates': [[[144.7, -37.5],
     [144.85, -37.5],
     [144.85, -37.65],
     [144.7, -37.65],
     [144.7, -37.5]]],
     'count': 0},


texts:
I have a raster stack with 11 layers that I am running through a triply nested lapply(). I expect 44 layers to be returned, but I'm only seeing 4!

Reproducible example:

# Load packages
library(raster)
library(pbapply)
library(magrittr)

# Reading in the data
dhm <- readRDS(gzcon(url('http://jacksonvoelkel.com/geog597/labs/DHM.RDS')))

# Looping through some terrain functions
terrain_opts <- c('slope'
                  ,'TPI'
                  ,'TRI'
                  ,'roughness'
                  ,'aspect'
                  #,'flowdir'
)

# Create terrain stack
dhm_terrain <- pblapply(terrain_opts, function(t) {
  r_terrain <- pblapply(c(4, 8), function(n) {
    r_neigh <- raster::terrain(x = dhm, opt = t, unit = 'radians', neighbors = n)
    names(r_neigh) <- paste0(names(dhm), '_terrain_', t, '_nb_', n)
    return(r_neigh)
  }) %>% stack()
  return(r_terrain)
}) %>% stack()

# Attach the original dhm to terrain stack
dhm_terrain %<>% stack(dhm)

Here's where I'm running into issues:

# Apply boundaries filter to terrain stack
terrain_bound <- pblapply(nlayers(dhm_terrain), function(i) {
  t_stack <- pblapply(c("inner", "outer"), function(t) {
    d_stack <-  pblapply(c(4, 8), function(d) {
      r_bound <- raster::boundaries(x = dhm_terrain[[i]], directions = d, type = t, asNA=F, classes=T)
      names(r_bound) <- paste0(names(dhm_terrain[[i]]), '_', d, '_', t)
      return(r_bound)
      }) %>% stack()
    return(d_stack)
    }) %>% stack()
  return(t_stack)
  }) %>% stack()


texts: Show datapoints in WGS84 EPSG4326 on basemap with Pseudo-Mercator Projection

texts:
I want to show datapoints in WGS84 EPSG 4326 on one of the basemaps of QGIS, which (as far as I know) come with a Pseudo-Mercator Projection EPSG 3857. If I zoom in, the points are allocated correctly, but if I zoom out (to see the whole globe) they shift. For my project, I have to see the points on their correct locations for the whole globe. I know that EPSG 4326 is in degrees and EPSG 3857 in meters, but is there a way to show the points without a shift even when zoomed to the whole globe?
Thanks for your help


texts: processing.runalg on a shape where lower left and upper right is a bad option

texts:
I'm trying to develop a plugin for QGIS where I want to extrapolate points to a surface. The plugin needs to handle 100,000 points rather quickly and following code works alright. The problem is the extent.
file_name&file_name_poly = string with the path to the files.
shpfile = path to shapefile with the points
extent = '%f,%f,%f,%f'% (shpfile.bbox[0],shpfile.bbox[2],
                         shpfile.bbox[1],shpfile.bbox[3])
processing.runalg("grass:v.voronoi", file_name + ".shp", False, True,
                  extent, -1, 0, 3, file_name_poly)

Here is a picture of the result, as you can see, the polygons to the left looks rather alright, but the polygons to right becomes huge.

So I wonder is it possible to set a maximum size for each polygon? Or is it somehow possible to set the extent as a polygon?
Edit!
I have tried to implement this solution hence the code became much slower and with the same problem. This picture is a part of the field, the dots are the original data points, the solid polygons are the ones from the grass processing voronoi algorithm and the dotted line polygons are from ST_DelaunayTriangles link.

This just a part of field, I wasn't able to run the complete field, since it was taking too long time. Hence, the problem remains that I can't set an outer boundary of the field.
Writing this post might solved the problem. The solution might be to do the grass voronoi diagram first and the make an st_within to remove the unnecessary parts afterwards.
I'll post again when I've tried that solution!


texts: Performing calculation in neighborhood 3x3?

texts:
I'm looking for the way to perform some calculation with each cell in neighborhood 3x3 and assign value to center cell. For example I'd like to sum z1 with z5, z2 with z5 etc. and then assign average from that to center cell.

I know that I should use something like focal statistics tool, but with my own condition. So far I didn't find any tool for that.

Does anyone have a solution for me?


texts:
Is there an easy path to visualizing LIDAR data in QGIS?

I have some USGS LIDAR data in .las format downloaded from http://lidar.cr.usgs.gov/. This means I have both the .las and metadata in .xml format. I am aware liblas, but not how to apply it to this task. I am running on Ubuntu 11.04 with QGIS 1.7.0-Wroclaw.

A similar question for ArcGIS is:  Converting LiDAR data to raster (DEM/DSM) for ArcGIS input?. I just need to get a sense of this data and the registration. Conversion to a DEM would be OK if I can visualize it.


texts: Adding INDEX to IFeatureClass with ArcGIS SDK for Java?

texts:
I want to add an index to a feature class. To do so, I used the very short and complete example given there:
http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm

My modified code is below. When I use that code, I obtain an exception due to a Cast problem; It cannot cast from a IFeatureClass to a ISchemaLock:

Exception in thread "main" java.lang.ClassCastException: com.esri.arcgis.geodatabase.IFeatureClassProxy cannot be cast to com.esri.arcgis.geodatabase.ISchemaLock

Are you able to run this code sucessfully without the error ?

If you want to run this code, you have to change the 2 first string inputs in the code (the path and name of your shapefile)

import java.io.IOException;
import com.esri.arcgis.system.AoInitialize;
import com.esri.arcgis.system.EngineInitializer;
import com.esri.arcgis.system.esriLicenseProductCode;
import com.esri.arcgis.system.esriLicenseStatus;
import com.esri.arcgis.datasourcesfile.ShapefileWorkspaceFactory;
import com.esri.arcgis.geodatabase.Fields;
import com.esri.arcgis.geodatabase.IFeatureClass;
import com.esri.arcgis.geodatabase.IFeatureWorkspace;
import com.esri.arcgis.geodatabase.IField;
import com.esri.arcgis.geodatabase.IFields;
import com.esri.arcgis.geodatabase.IFieldsEdit;
import com.esri.arcgis.geodatabase.IIndex;
import com.esri.arcgis.geodatabase.IIndexEdit;
import com.esri.arcgis.geodatabase.ISchemaLock;
import com.esri.arcgis.geodatabase.IWorkspace;
import com.esri.arcgis.geodatabase.IWorkspaceFactory;
import com.esri.arcgis.geodatabase.Index;
import com.esri.arcgis.geodatabase.esriSchemaLock;

public class classmain
{
    public static void main(String[] args)
    {

        try
        {
        // >>> Enter here the path and the name of your shapefile.
        String folderPath = "D:\\ShapeFolder\\test";
        String shapefileName = "myShape_022";

        // Step 1: Initialize the Java Component Object Model (COM) Interop.
        EngineInitializer.initializeEngine();

        // Step 2: Initialize an ArcGIS license.
        AoInitialize aoInit = new AoInitialize();
        aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);

        // Load the  ShapeFile into "featureClass"
        IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory();
        IWorkspace workspace = workspaceFactory.openFromFile(folderPath, 0);
        IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
        IFeatureClass featureClass = featureWorkspace.openFeatureClass(shapefileName);

        // Find the field "FID" in featureClass that will be used as an index
        int fieldIndex = featureClass.findField("FID");

        // Get the specified field from the feature class.
        IFields featureClassFields = featureClass.getFields();
        IField field = featureClassFields.getField(fieldIndex);

        // Create a new fields collection and add the specified field to it.
        IFields fields = new Fields();
        IFieldsEdit fieldsEdit = (IFieldsEdit)fields;
        fieldsEdit.setFieldCount(1);
        fieldsEdit.setFieldByRef(0, field);

        //Create a new index and cast to the IIndexEdit interface.
        IIndex index = new Index();
        IIndexEdit indexEdit = (IIndexEdit)index;

        // Set the index's properties, including the fields it will have associated with it.
        indexEdit.setFieldsByRef(fields);
        indexEdit.setIsAscending(false);
        indexEdit.setIsUnique(false);
        indexEdit.setName("IndexFID");

        //Attempt to acquire an exclusive schema lock on the feature class.
        ISchemaLock schemaLock = (ISchemaLock)featureClass;
        schemaLock.changeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock);
        featureClass.addIndex(index);
        schemaLock.changeSchemaLock(esriSchemaLock.esriSharedSchemaLock);

        //  Disconnect licences
        aoInit.shutdown();
    }
    catch (IOException ex)
    {
        System.out.println(ex.getMessage());
        System.out.println("App failed.");
    }
}
}


texts:
I found this tutorial about spectral using python and I will test kmeans classification using Landsat image.
I don't understand some things about this tutorial.
First thing I can't understand is about pylab, how to import class names dynamic in plot like class 1, class 2, class 3,... for any class create the kmeans algorithm?

first time to use python spectral.

can help me somone ?

here the simple code of manual :

from spectral import *
from pylab import figure, axes, pie, title, show
img = open_image('LT.lan').load()
(m, c) = kmeans(img, 10, 80)
import pylab
pylab.figure()
pylab.hold(9)
for i in range(c.shape[0]):
    pylab.plot(c[i])
pylab.show()


texts: Splitting up QGIS layer into multiple using QGIS

texts:
I have a layer (GeoJSON) with multiple features. I want to split the layer up into multiple shapefiles using QGIS.
I don't want a file for each individual feature. Is it possible in QGIS to select features and cut and paste them to a new file?


texts: Only positive number expression label in ArcMap?

texts:
I was just wondering if anybody knows of a way to write an expression to make all my numeric values in my labels positive.

I want to do 1234 cal BC 23 cal AD for example, as a label.

My data is - 1234 (being BC) and 23 for AD.

any ideas?


texts: What is the simplest approach to symbolizing points from a PostGIS-sourced layer by age?

texts:
I have a view in PostGIS that has a bunch of points and I want to symbolize in QGIS (3.2.2) by the age of the points. I am trying to use this expression (or something like it):
day(age(ts, now()))

But that doesn't appear to do anything (returns null).  The column is a timestamp (UTC).   Is there anything I need to do the ts timestamp value before passing into the age(,) function.

I know I could force it from the PostgreSql by adding a derived column in the view, but I feel like I wouldn't need to do that.


texts: Trouble installing PostGIS PlugIn for OpenJump

texts: I’m trying to install PostGISPlugin version 1.52 in OpenJUMP 1.7.1 release 4004. I moved the JAR file into my installation’s lib/ext directory, but I’m not sure how to access the plugin-specific UI components. I’m not even sure it’s been properly installed. Can anyone point me in the right direction?


texts: Copy an attribute in ArcPad EXCLUDING the unique Identifier

texts:
I'd like to use the toggle button to 'copy attributes' when creating points in ArcPad.  Currently, I can't because I'm using the date (+ time) field as my unique identifier to link to related tables.

Is there any way to exclude an attribute (in my case the unique id) from the copy attributes toggle action?


texts: How to use the Grass modules v.net.xxxx from within QGIS

texts:
I'm trying to create a an area that can be reached within a certain amount of time/distance from a single (or multiple) points. To do this i'm using the GRASS tool v.net.iso (via the GUI). I've succesfully made a Grass routable network with two layers (arcs and nodes) via the v.net tool.

The trouble starts when I want to use the v.net.iso tool. I select the input arcs and input nodes to be my created network. But than I have to input "cats (select from the map or using their id)" When I hover mouseover, it sais the following: "Categories of centres (points on nodes) to which net will be allocated. Layer for this categories is givan by nlayer option.

Do I just type the coordinates from one of the nodes? e.g. "xcoordinate|ycoordinate". Because if I do this, I get the following error: "Not enough centres for selected nlayer. Nothing will be allocated."

And can I let the cost isolines be dependant on an attribute? Or can I only manually enter the cost isoline in mapunits?


texts:
In QGIS (2.14.5LTR) when having an svg marker symbol it is not updated when editing it in inkscape and saving it to the same name/location. Even when switching to another svg symbol and then switching back to the one before, the old version of the symbol is displayed and not the one just edited. And simply loading the new version does not work too (the old one is still kept).

Obviously, QGIS is caching svg symbols, so the question:

is there a way to clear the 'svg symbol cache' (or however it is called)?
or is there a way to 'update' the editited symbols (a hidden 'refresh' button or slt)?


texts:
I found a lot of pieces of an answer to this question, but no complete and good one.

How does a GPS System calculate it's own accuracy at the moment?

Where does it get the known position to compare measured positions to?


texts: Where can I find wind maps for the Mediterranean/Middle East?

texts:
I do debris modeling, sim, and analysis for missile interceptions. I have been looking for hours and I can't seem to find the information I'm looking for. So my question is...

Where can I find historical wind speed data for multiple altitude (basically as high up as you can get data) in the Mediterranean/Middle East? And is there even a place you can get that?


texts: Need a projection like Azimuthal Equidistant (AEQD), but with polar coordinates

texts:
I have a geotiff in a simple latlon projection. I want to reproject its data on a plane tangential to Earth ellipsoid to make some further calculations.

Just now I'm using aeqd projection for it, but I'm looking for some similar projection that would give me not cartesian, but polar coordinates.

To reproject my geotiff raster I'm using rasterio.reproject(...) to convert my geotiff data (it's a good analog of cs2cs utility from PROJ.4):

dst_crs = CRS({"proj": "aeqd", "lat_0": lat_center, "lon_0": lon_center, "datum": "WGS84"})

lat_center and lon_center were the center of my geotiff.

aeqd projection gives me some raster in cartesian grid (x_j and y_i on the tangential plane):

But for my purposes it needs some extra interpolation to get the values in my polar mesh (by distance and azimuth on the tangent plane). Can you advice me some other projection?


texts: Indexing GIS data associated with user with timestamp

texts:
I have data for each user in this format user1:(timestamp,lattitude,longitude) user1:(timestamp1,lattitude1,longitude1).....

Here the 1 at the end of timestamp/lat/long is to specify a different point in 3d space.

I want to have a indexing structure where I can associate a point in 3d space (spatio-temporal) with a user and be able to do nearest neighbour queries based on either spatial data or temporal data or both. Is there a good indexing scheme for something like this or an algorithm in literature to look at?


texts:
Although the coordinate systems in QGIS for 2 different vector layers are the same, there are differences between the boundaries.

How can I superimpose this data?

With the plugin or another way, I can overlap this, not with the coordinate system, because they are both in the same coordinate. I think this is because the drawings are wrong but I couldn't find the solution


texts: How to adapt layerswitcher to include listboxs

texts:
For my project I needed something that allowed the user to change the application´s layers and the best solution I found was this one layer switcher since openlayers 3 does not support a layerswitcher by default. This solution allowed me to do so with ease ... until I noticed that I had way too many options and that checkboxs were not enough... I tried editing as much as I could so it could display a listbox but I have a problem. The box is being filled correctly but when I try to change a value it always selects the last option.

This is the code I edited

ol.control.LayerSwitcher.prototype.renderLayer_ = function(lyr, idx, selectList) {

var this_ = this;
var li = document.createElement('li');
var lyrTitle = lyr.get('title');
var lyrId = lyr.get('title').replace(' ', '-') + '_' + idx;
var label = document.createElement('label');

if (lyr.getLayers) {

    li.className = 'group';
    label.innerHTML = lyrTitle;
    li.appendChild(label);
    var ul = document.createElement('ul');
    li.appendChild(ul);
   this.renderLayers_(lyr, ul);

} else {

    var input = document.createElement('input');
    var option = document.createElement("option");

    if (lyr.get('type') === 'base') {
        input.type = 'radio';
        input.name = 'base';
        option.value = idx;
        option.text = lyrTitle;
        option.name = 'base';
        selectList.appendChild(option);
    } else {
        input.type = 'checkbox';
    }
    input.id = lyrId;

    option.selected= lyr.get('visible');
    selectList.onchange = function (e) {
        alert(e.target.selectedIndex);
        this_.setVisible_(lyr, e.target.selectedIndex);

    };
    li.appendChild(selectList);

    input.checked = lyr.get('visible');
    input.onchange = function (e) {
        this_.setVisible_(lyr, e.target.checked);
    };
    li.appendChild(input);

    label.htmlFor = lyrId;
    label.innerHTML = lyrTitle;
    li.appendChild(label);

}

return li;
};

and

ol.control.LayerSwitcher.prototype.renderLayers_ = function(lyr, elm) {
var lyrs = lyr.getLayers().getArray().slice().reverse();

var selectList = document.createElement("select");
selectList.id = "mapTypes";
selectList.size = 5;

for (var i = 0, l; i < lyrs.length; i++) {
    l = lyrs[i];
    if (l.get('title')) {
        elm.appendChild(this.renderLayer_(l, i, selectList));
    }
}
};

I know I have to change something in the onChange function but I am not that good with javascript so i am a little bit lost on what to do next.

(the onChange function)

ol.control.LayerSwitcher.prototype.setVisible_ = function(lyr, visible) {
var map = this.getMap();
var selectedid = 2;

lyr.setVisible(visible);

if (visible && lyr.get('type') === 'base') {
    // Hide all other base layers regardless of grouping

    ol.control.LayerSwitcher.forEachRecursive(map, function (l, idx, a) {

        if (l != lyr && l.get('type') === 'base') {
            alert(lyr);
            l.setVisible(false);
        }
    });
}
};

I left the input/radio button implementation since it helps with debugging

And this is the "original" js file Original JS

What would I need to change to have a fully functional listbox?
Or is there a better way to have a similar implementation that uses listboxs to change the layer?


texts: Why do area calculations return negative values?

texts:
I have created a shapefile with some polygons and am now trying to calculate the area of these polygons. The original CRS was WGS84, I have reprojected it to WGS 84 / World Mercator so unit is metres. On-the-fly projection is on. If I'm now using the field calculator to calculate the area of the polygons using $area, I first get some really weird values in my output column (far too high) and if I click 'save' or end the toggle mode, the values change to negative values which are the same for all polygons.
Switching to another CRS and reprojecting the file again e.g. to GDA94/MGA55 EPSG:28355 and calculating the area creates again funny values, some of them negative.
I can't figure out where the problem is and am grateful for any help! Thanks a lot!


texts: Open source replacement of ArcGIS select command

texts:
Is there an open source (gdal, pyshp, shapely etc.) programmatic option to the select command in ArcGIS. I want to select polygons within a shapefile based on an attribute value. This command is here:

Select (Analysis)

  Extracts features from an input feature class or input feature layer,
  typically using a select or Structured Query Language (SQL) expression
  and stores them in an output feature class.

I want a python based solution.


texts:
I have an application that generally uses .hgt files for 3-arc-second resolution of elevation data. A military user has asked us to use .dt1 files (also 3-arc-second resolution) that they have furnished to us for a portion of our terrain.  Apparently, their data has "smoothed out" some elevation points to reflect the presence of human-created features like airfields.

Is there a utility that converts .dt1 to .hgt -- preferably that can run on Linux?


texts: Troubleshoot editing features in feature dataset with ArcMap / ArcSDE Oracle

texts:
I am having trouble editing a feature class that is in a feature dataset.

We have added just the single feature class as a layer in ArcMap and are using the "Start Editing" function on the Editing toolbar to edit.

ArcMap reports that "All data sources in the map are registered as versioned or you lack privileges to modify data sources which are not registered as versioned.".

The database and feature dataset are versioned.  We confirmed this with ArcCatalog.  We are also unable to make non-versioned edits.

We have selected to edit a version from the Editing toolbar options.

sdelayer reports that the connecting user (also the schema owner) has SELECT, INSERT, UPDATE, DELETE permissions on the layer.

Oracle's dba_tab_privs reports that we have SELECT, INSERT, UPDATE, DELETE permissions on the business table.

If I connect to the geodatabase with the SDE user, I cannot grant new privileges to the schema owner to the feature dataset.  ArcCatalog reports an automation error.

If I connect to the geodatabase as the schema owner, I can grant new privileges (to "myself") to the feature dataset.  However, I don't know if they have made any effect.

This is ArcGIS 9.3.1.

What is left?  Are there any sure-fire solutions?

UPDATE: I copied the feature class to a new one (located outside the featuredataset), which I can edit.  When I put the feature class inside the feature dataset, I can not.  What has the final say on feature dataset permissions?

I need to iron out what's causing ArcMap to think "you lack privileges to modify data sources".

The feature class in question has many (hundreds) of relationship classes.  I suspect that these are the source of my troubles.  I will ask a separate question about those...


texts: Creating grid with statistics of merged shapefiles in QGIS?

texts:
I operate with QGIS. I have to split the shape files of the buildings and the roads of a city into a grid of 500x500m per square and into each square I have to obtain the total free area, the total area of the buildings and of the roads.

Can anyone help me?

I've tried to create a vector grid and merging the shape files with the intersection function but I've only multiplied the geometries.


texts: ArcGIS scripting convert FeatureClass to Shapefile with user-defined shapefile name

texts:
I am trying to convert a feature class inside a geodatabase to a shapefile at a location outside of the geodatabase. I am aware that I can use the function arcpy.conversion.FeatureClassToShapefile(Input_Features, Output_Folder) to convert a feature class. However, I think this function doesn't allow the user to specify the name of the shapefile and the output shapefile has the same name as the input feature class.
I want to specify the name of the output shapefile because I want to use the shapefile later in my script. I know that an alternative is to just use the default shapefile path generated by arcpy.conversion.FeatureClassToShapefile. This works for most situations. However, if there is a Shapefile in the Output_Folder with the same name (for example output.shp), this function will automatically rename the output Shapefile to output_1.shp and it is hard for me to keep track of which one is the one I created if there are multiple duplicates (many output_x.shp in the output folder) in the Output_Folder (rare scenario but still possible). Therefore, I want to specify my own pathname for the output shapefile. Does anyone know how to do this, maybe without using the arcpy.conversion.FeatureClassToShapefile function?


texts: How to get the length of a line inside a polygon

texts:
How can I get the length (brown marked part) of the "Road 7" inside the red polygon?

My start:

SELECT ST_Length(way) FROM lines WHERE road = "Road 7" AND ST_Intersects(line, polygon)?

With that, I get only the total length :( Someone has an idea?


texts: Expression for labeling line start and end points

texts:
I have a multi line string vector layer, on the map they display as straight horizontal lines and I want to display the label at the start and end point of the lines on the map.
What’s the best expression to use for this?


texts:
I'm having difficulty exporting a vector file of polygons (UK ward boundaries) in QGIS to kml format.  The error I get is:

'OGR error - failed to create kml file'.

Maybe I am getting the field names mixed up - I need the ward code to identify each polygon (a string beginning with E)- should this be the 'name' field in the export field to kml?  And what should be the 'description' field?  Although I notice in one kml file in the attribute table, all the polygons are listed but there are no labels or data attached to any of them.


texts: Thiessen Ploygon Bifurcated Areas Calculations

texts:
I have a SewerGEMS network of a sewerage scheme for a town. The town is divided into 17 wards having different population densities in (Population/Hectare). There is an AutoCAD drawing showing the ward boundaries with the number for each ward. I also have a separate Excel sheet containing 2 columns specifying ward numbers and population density for each ward (Population/Hectare). I have generated the Thiessen polygons for the 1476 manholes in the network specifying a buffering percentage only (i.e. no separate ward boundary used).

Now the issue is that many manholes will have areas of influence in 2 or more wards with different population densities and thereby different flows. How do I calculate the corresponding areas served by each manhole in different wards?

Once I get these bifurcated areas I can multiply it by the corresponding population density for the corresponding ward / wards (If the area of influence is in 2 or more Wards) to get the population count for each manhole.

I want to know the detailed process for getting these areas of influence of each manhole in separate wards i.e. the bifurcated Thiessen polygon areas for each manhole having areas of influence in 1 or 2 or more wards having different population densities.


texts: How to install MapServer and MapCache on Ubuntu 14.04?

texts:
I want to install MapServer and MapCache on Ubuntu 14.04. The MapServer installation succeeded but now I'm stuck with the installation of MapCache. This is what I did so far:

Install MapServer and MapCache:

sudo apt-get install cgi-mapserver mapcache-cgi libapache2-mod-mapcache

Store my raster images in /mapserver/data/tamale_2014ds.tif and tamale_2014ws.tif and create a map file in /mapserver/tamale.map:

MAP
  PROJECTION
   "init=epsg:3857"
  END
  IMAGETYPE      JPEG
  EXTENT         -94018 1048833 -92362 1049470
  SIZE           1000 400
  WEB
    METADATA
      "wms_title" "tamale"
  "wms_srs" "epsg:3857"
    END
  END
  LAYER
    METADATA
      "wms_title" "dry_season_2014"
      "wms_srs" "epsg:3857"
      "wms_enable_request" "*"
    END
    NAME         dry_season_2014
    DATA         /mapserver/data/tamale_2014ds.tif
    STATUS       OFF
    TYPE         RASTER
    PROCESSING   "BANDS=1,2,3"
    OFFSITE      0 0 0
  END
  LAYER
    METADATA
      "wms_title" "wet_season_2014"
      "wms_srs" "epsg:3857"
      "wms_enable_request" "*"
    END
    NAME         wet_season_2014
    DATA         /mapserver/data/tamale_2014ws.tif
    STATUS       OFF
    TYPE         RASTER
    PROCESSING   "BANDS=1,2,3"
    OFFSITE      0 0 0
  END
END

So far, everything is fine, see OpenLayers demo: http://geocre.net/mapservertest/ (code)

For MapCache I edited my apache configuration file /etc/apache2/sites-available:

<IfModule mapcache_module>
   <Directory /mapcache>
      Order Allow,Deny
      Allow from all
   </Directory>
   MapCacheAlias /mapcache "/mapcache/mapcache.xml"
</IfModule>

However, I cannot access MapCache. All I get is a status 403 Forbidden: http://78.47.251.2/mapcache

I already tried several owners and permissions for the directory /mapcache (even CHMOD 777). Any ideas on that?


texts: Resources for digitizing in webmap and export?

texts: Its possible with Google Map API to draw geometries and points. And exporting as well I assume. Is there other alternatives, probably based on Java that can do the same job? I've been researching on this, but without luck. I've read about geotools, wmts-service and more, but nothing close. Another solution could be a light version of QGIS as web interface with limited functions, but that's a major project to build.


texts: Erasing/Clipping Buffer layer at 90 degrees based on overlayed polygons QGIS3.0

texts:
My picture shows the basic idea of what I am needing to accomplish.

I can't find any tools that will do this.

It takes a buffer layer and chops out the pieces of it, at 90 degree angle to the buffer sides, for those areas not "infected" by the overlaid polygons.

So, the resulting polygon layer will have singlepart polygons of the areas that were "infected" along the buffer path.

It is critical that the resulting polygons are the same width as the original buffer, which is why a simple erase won't work.

So even though there may only be a small splotch of a polygon overlaid on the buffer, an entire slice of the buffer must be kept to preserve the area that was "infected".


texts: How to add a column/feature with PyQGIS 2.x?

texts:
I'm using PyQgis 2.2 and I'm creating a plugin.
I want to add one feature/column to a shapefile. But I get error..

I've tried to do this as it's shown in Cookbook:

 if caps & QgsVectorDataProvider.AddFeatures:
     feat = QgsFeature()
     feat.addAttribute(0,"hello")
     feat.setGeometry(QgsGeometry.fromPoint(QgsPoint(123,456)))
     (res, outFeats) = layer.dataProvider().addFeatures( [ feat ] )

but I only get error:

 AttributeError: 'QgsFeature' object has no attribute 'addAttribute'


texts: Software for reducing manual theodolite observations

texts:
I have a set of survey data as a baseline traverse with side observations done using a manual theodolite (my elderly Cooke Tavistock).  This is mostly horizontal and vertical circle readings plus chained measurements for the legs of the traverse. I do not have distance measurements for the side shots. In short a standard triangulation survey.
I tried to process this using COPAN as "field data" but it seems to complain about the lack of SD measurements.
Here is a trivial example with single baseline 1 to 2 and two side observations. I can obviously reduce this trivial example by hand. Copan objects to the to=3 line, I think because of lack of SD (the error isn't clear)
at= 1   az=180.0    HC=0.0
    to=2    HC=165.4351 VC=90.0 SD=7.65
    to=3    HC=39.1521  VC=90.0
    to=4    HC=51.1922  VC=90.0
at= 2   ref=1   HC=297.1256
    to= 3   HC= 334.0115    VC=90.0
    to=4    HC=339.1919 VC=90.0
end=close

Is there any trick to reducing this?


texts:
Similar questions have been asked, but since my reputation is not enough I am unable to comment on answers.

(The following is from an answer by nickves for this question Loading raster data to postgis)

Example:
raster2sql -s  -t 50x50 -f -I -Y myRaster.tif rasterSchema.RasterName > raster.sql`
psql -h localhost -U someuser -d mydb -f raster.sql

Question1:
What does the following mean in relation to the above example:

rasterSchema.RasterName
raster.sql`psql
-f raster.sql

Question2:
Given the following information, what would the syntax look like for loading a raster to a PostGIS 2.0 database?

Image location = C:\Users\Desktop\dem.tif
SRID = 2048
Database name = Rasters
Schema = Elevation

My os is windows 7 (not sure if this makes a differnce).

Regards


texts:
I am using HTML code under a Layer's Properties -> Display to show a maptip on hover that includes a picture.

Previously, when I hovered over, the maptip would show, and let me hover over it and click a link on the bubble. That has stopped for some reason.

I see in Settings -> Options -> Canvas & Legend I can specify the delay before a maptip opens (in ms) but not for how long it should stay open.

Like I said, this is a new problem, so either I changed a setting somewhere accidentally, or a recent update changed a setting.

Using QGIS 3.8.2


texts: Hydrology, operational rainfall-runoff models

texts:
I am trying to collect information about operational rainfall-runoff models used around the world. I hope to build database with country outline with attached information what organization is covering operational rainfall-runoff models and what mathematical approach/models do they use.

Any help would be appreciated, including redirectioning the question in to (maybe) more appropriate forum.

Also would appreciate any other data sources regards surface(active) run-off.

My question may not be very relevant to GIS itself, however this is the only forum that I know where are active hydrologists, so I hope that moderatars will let the question to be posted for at least a day.

Thanks
T.


texts: How many layers are too many layers in ArcMap?

texts:
I work on ArcGIS using a Citrix virtual software connection at work.  It is dreadfully slow at times, and without any changes to the MXDs I'm working on, one minute ArcMap can be operating at a reasonable rate, and then the next minute it can slow to a crawl.  The IT Department believes the cause of the problem is too many layers in my map.  I have a hunch the problem may instead be hardware or software configurations, or just the fact that we're using Citrix in the first place.

Anyways, I have, in my standard MXD that I use for editing, 57 SDE layers and 2 file geodatabase layers.  The vast majority are layers I need to check for editing.  I have to check to see if any data exists for each of the layers because they need to be edited and QC'd for each pipeline construction project.  Only a few layers are basemap layers that I need to reference on a regular basis.

The IT Department wants me to reduce the number of layers I'm using to 10.  In an ideal world, this would be fine.  But in the real world, it isn't practical.  With such a suggestion, I'll have to use some 5 different MXDs just to carry out an editing task for a given project.  I've experimented with using only 10 layers and it is severely limiting.  I lack the context of my data with relation to other data, and I have to revisit the same area multiple times just to make sure all of the data has been updated.  All this for only a slight improvement in performance and a modest reduction in the number of crashes while editing.

So I have to ask, is there an ideal number of layers?  How many is too many?