texts: Field Calculator in ArcGIS - keep equation

texts:
I'm using Arc 9.3.1 (Arc Editor).

In edit mode I've created a simple field calculation.  For example's sake let's make it [Field3] =  [Field1] + [Field2]

How do I 'keep' the calculation so Field3 will update as I change the values or add values in Field1 and Field2.

I have to keep running the calculation everytime I add data.  Cannot it not update automatically?


texts: Changing the raster layer symbology in QGIS with PyQGIS is not reflected in the layer properties. How to fix this?

texts:
I have managed to alter the raster layer symbology, even creating my own symbologies, in its different variants 'multibandcolor', 'paletted', 'singlebandpseudocolor' and 'singlebandgray'.
Changes are reflected in the view but not in the layer properties. How to fix this?
I leave a code example to assign three classification ranges to a raster, with red, yellow and blue colors:
capa=iface.activeLayer()
provider=capa.dataProvider()
#Statistics
stat= provider.bandStatistics(1)
max =stat.maximumValue
min=stat.minimumValue
#Defining the three ranges
range = max - min
add = range/2
interval = min + add

#new renderizador
sha = QgsRasterShader()
shaf = QgsColorRampShader()
lst=[]

colDic = {'red':'#ff0000', 'yellow':'#ffff00','blue':'#0000ff'}
valueList =[min, interval, max]

lst= [QgsColorRampShader.ColorRampItem(valueList[0],QColor(colDic['red'])),\
QgsColorRampShader.ColorRampItem(valueList[1],QColor(colDic['yellow'])),\
QgsColorRampShader.ColorRampItem(valueList[2],QColor(colDic['blue']))]

shaf.setColorRampItemList(lst)
shaf.setColorRampType(QgsColorRampShader.Interpolated)
sha.setRasterShaderFunction(shaf)

pseudoRenderer = QgsSingleBandPseudoColorRenderer(provider, capa.type(),sha)
capa.setRenderer(pseudoRenderer)
capa.triggerRepaint()

Note: with the createShader method if the changes are reflected in both the view and Layers properties, but I have no control to assign the ranges of values


texts:
I tried adding labels to my cesium application using the below code

var entities3 = dataSource3.entities.values;

    var colorHash = {};
    for (var i = 0; i < entities3.length; i++) {
        var entity = entities3[i];
        var label;
        var name = entity.properties.Height;
        var color = colorHash[name];
        if (!color) {
            color = Cesium.Color.BROWN;
            colorHash[name] = color;
        }
        entity.polygon.extrudedHeight = entity.properties.Height;
        label = {
            text: entity.properties.Name,
            font : '12px Helvetica',
            fillColor : Cesium.Color.WHITE,
            outlineColor : Cesium.Color.BLACK,
            outlineWidth : 4,
            style : Cesium.LabelStyle.FILL_AND_OUTLINE,
            verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
            pixelOffset : new Cesium.Cartesian2(0, -9)
        };
        entity.label = label;
    }

But there is no labels appearing.


texts: Raster does not clip according to polygon feature

texts:
I'm trying to cut my raster to fit a polygon, but it keeps doing this weird thing pictured below. I've tried the following things:

Merging and dissolving the polygon into 1 polygon
Converting the polygon to a raster

Neither has worked. Any ideas on how I can solve this?


texts:
I am trying to clip my .tif image using qgis(Zanzibar) as before but having trouble to get it in .jpg or .jpeg as it appears black (as picture below) after the function is performed. I choose the option of Raster>Extraction>Clip Raster by Extent, which is not giving me the colored image that I had before clipping and saving it in .jpg format.

Is there any solution to get the clipped image in colored version in .jpg or any version that gives the small size of image?


texts: Using a shapefile in QGIS makes it unusable in ArcGIS?

texts:
We currently use ArcGIS 9.2, and we are looking at moving forward with other software, and we have been testing QGIS recently.

Basically we are trying to copy the existing projects we have, and re-create them in QGIS.

But I have came across quite a big problem, re-created a project which has a couple of polygon shapefiles. They came into QGIS fine as always.
I then opened up the .mxd project in ArcGIS, and noticed a couple of deadlinks... they were the two shapefiles I had just brought into QGIS!

Tried a couple of other random shapefiles and the same thing happens... seems a single shapefile can't be used in both QGIS and ArcGIS at the same time? Looking at the shapefile in catalog and it shows as a green question mark. If I close QGIS the shapefile opens fine again in ArcGIS.

I could of course create a copy of each shapefile and point QGIS to the copies, but it means duplicating A LOT of shapefiles, which is far from ideal.

Anyone else come across this? And if so, is there a solution/work around?


texts: pgrouting/PostGIS Trying to set nearest node to airports in a region brings the same node for each airport

texts:
I need to make a distance matrix from all the nodes in the Canary Islands to every airport in the region. I'm following the method set here but it brings the same node for all airports. Trying the method here has brought me similar problems. The query I'm running is as follows
create table aeropuertos_canarias as (SELECT * from rt_aerodromo_p WHERE cod_iata in ('LPA', 'VDE', 'FUE', 'GMZ', 'SPC', 'ACE', 'TFN', 'TFS'));
ALTER TABLE aeropuertos_canarias
   ADD COLUMN nearest_node integer;
select * from aeropuertos_canarias

CREATE TABLE temp AS
   SELECT a.nombre, b.id, min(a.dist)
   FROM
     (SELECT airport.nombre,
             min(ST_Distance(ST_SetSRID(airport.geom, 4326), ST_SetSRID(node.the_geom,4326))) AS dist
      FROM aeropuertos_canarias as airport, edges_can_noded_vertices_pgr as node
      GROUP BY airport.nombre) AS a,
     (SELECT airport.nombre, node.id,
             ST_Distance(ST_SetSRID(airport.geom, 4326), ST_SetSRID(node.the_geom,4326)) AS dist
      FROM aeropuertos_canarias as airport, edges_can_noded_vertices_pgr as node) AS b
   WHERE a.dist = b. dist
         AND a.nombre = b.nombre
   GROUP BY a.nombre, b.id;
select * from temp;

However, this brings me the following result.
"Aeropuerto de El Hierro"   74411   3625064.97072886
"Aeropuerto de Fuerteventura"   74411   3625066.16827048
"Aeropuerto de Gran Canaria"    74411   3625065.96589645
"Aeropuerto de La Gomera"   74411   3625065.07375698
"Aeropuerto de La Palma"    74411   3625064.29973004
"Aeropuerto de Lanzarote - César Manrique"  74411   3625065.83955541
"Aeropuerto de Los Rodeos"  74411   3625065.05111873
"Aropuerto Reina Sofía" 74411   3625065.34297412

Which is pretty obviously not true. Any idea about what I'm doing wrong and where will be most welcome.


texts: Locking fields in ArcGIS to maintain integrity of last_edited_user field

texts: I have a Collector for ArcGIS application which records the last_edited_user from the field, however post-processing needs to occur and overwrites my users from the field to my desktop user.  Is there a way to lock the last_edited_user to maintain my initial edited user?  I am using ArcGIS For Server 10.2.1 and SQL Server Database 2008 R2.


texts: Which QGIS installation for Windows comes with r.in.lidar?

texts:
I am running QGIS 2.18.14 (QGIS code revision: ff83b9a479) on a windows 7 machine, it comes with GRASS 7.2.2 (Code Revision r71496), but it does not come with r.in.lidar. I have noticed QGIS 2.18.16.1 has the same problem and it shares the same GRASS 7.2.2 (Code Revision r71496).

I know there were some issues with it and later solved as I read here, I also certailny used it short ago in 2017, so I wonder which version should I go for before starting the always risky attempt of a new installation.


texts: Can't get Landsat-8 images after 2017-06-01 in Google Earth Engine Python

texts:
Using the Google Earth Engine Python API, I can get a Landsat-8 TOA image for anytime before 2017-06-01 but not for any dates after that.

Getting a Landsat-8 TOA image for before 2017-06-01:

from IPython.display import Image
import ee
ee.Initialize()

landsat8_collection = ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
   .filterDate('2017-01-01', '2017-01-30')
   .first()

landsat8_collection.getInfo()

Getting an output:

{'type': 'Image', 'bands': [{'id': 'B1', 'data_type': {'type': 'PixelType', 'precision': 'float'}, 'dimensions': [8201, 8281], 'crs': 'EPSG:32623', 'crs_transform':...

Then, when I try to get an image for anytime after 2017-06-01 I get no output:

landsat8_collection = ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
     .filterDate('2017-06-01', '2017-06-30')
     .first()

landsat8_collection.getInfo()

Getting no output:

None

I can obtain images for after 2017-06-01 through the JavaScript interface in Google Earth Engine, but for some reason not using the Python client. Any ideas why?


texts: ArcObjects - Geometry type select with Vbnet

texts:
How can I read the geometry type of shapefiles with ArcObjects and Vbnet?

I want to check whether it is a point, polygon, or a line.


texts: Using ConvertTableToCsvFile tool with ArcPy

texts:
I would like to export a table from a geodatabase to a csv file with the ConvertTableToCsvFile tool. I have read through the esri help file and adapted the code for my purpose:

import arcpy, os

### Set project path
project_path = r"C:\Users\..."
arcpy.env.overwriteOutput = 1

### Set current directory
gdb = project_path + "data/raw/ACS/ACS_2014_5YR_BG_06_CALIFORNIA.gdb/"
out = project_path + "data/ACS/"

### Convert to csv
    arcpy.ConvertTableToCsvFile_locref(gdb + "X14_SCHOOL_ENROLLMENT", out + "X14_SCHOOL_ENROLLMENT", "COMMA")

However, I get the error that

  the 'module' object has no attribute 'ConvertTableToCsvFile_locref'.

What do I do wrong? I have looked for similar questions but apparently the problem is so trivial that noone would ask. (I am still a beginner with ArcPy and Python.)


texts: Alignment/Projection issue when opening a shapefile in ArcMap that was created from DotSpatial code

texts:
I have a number of Polyline and Point features stored in a SQL Server 2012 database.  I am using a website with C# and DotSpatial to create and export a shapefile of any one of these features successfully, however when I import the file into ArcMap, the points are mis-projected onto the map (they are all about 6.6 miles to the northwest of where they should be, to be exact).

I have checked some of the individual points by converting them to lat/lon, and they are exactly what they should be. I've checked the shapefile's projection information (NAD83 State Plane Oklahoma North feet), and it looks good:

PROJCS["NAD_1983_StatePlane_Oklahoma_North_FIPS_3501_Feet",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-98.0],
PARAMETER["Standard_Parallel_1",35.56666666666667],
PARAMETER["Standard_Parallel_2",36.76666666666667],
PARAMETER["Latitude_Of_Origin",35.0],UNIT["Foot_US",0.3048006096012192]]

I have a different shapefile of the same points that was created using a different third-party tool that is displaying in ArcMap correctly.  I've checked the projection information for both files and they both have the above projection information.

Any ideas as to why they aren't projecting right in ArcMap?  It seems like the projection may just not be working at all, and not have to do with the specific State Plane coordinate system, because when I use WGS 84 I still have the same problem.

Here is the C# code I use for exporting the shapefile.  Thanks!

var featureSet = new FeatureSet(FeatureType.Point);
var dt = _dataAccessLayer.GetTableByFeature(shapeFileName);

// Copy all of the columns from the database table to the feature set
for (int colIdx = 0; colIdx < dt.Columns.Count; colIdx++)
{
    var col = dt.Columns[colIdx];
    featureSet.DataTable.Columns.Add(new DataColumn(col.ColumnName,
        col.DataType));
}

int rowIndex = 0;
foreach (DataRow row in dt.Rows)
{
    // Convert the projection from Spherical Mercator to
    //   NAD1983 State Plane Oklahoma North (feet)
    var vertices = new double[2];
    vertices[0] = Convert.ToDouble(row[COL_X_COORD]);
    vertices[1] = Convert.ToDouble(row[COL_Y_COORD]);
    var z = new double[1];

    Reproject.ReprojectPoints(vertices, z, KnownCoordinateSystems
        .Projected.WorldSpheroid.Mercatorsphere, KnownCoordinateSystems.Projected
        .StatePlaneNad1983Feet.NAD1983StatePlaneOklahomaNorthFIPS3501Feet, 0, 1);
    featureSet.AddFeature(new Feature(new Coordinate(vertices[0], vertices[1])));

    // Add the rest of the attributes to the feature set
    for (int colIdx = 0; colIdx < dt.Columns.Count - colOffset; colIdx++)
    {
        featureSet.DataTable.Rows[rowIndex][colIdx] = row[colIdx + colOffset];
    }
    rowIndex++;
}

featureSet.Projection = KnownCoordinateSystems.Projected
    .StatePlaneNad1983Feet.NAD1983StatePlaneOklahomaNorthFIPS3501Feet;
featureSet.SaveAs(shapefilePath + shapeFileName, true);


texts: Saga clip raster with polygon missing cells entirely within the polygon

texts:
I am using SAGA's Clip Raster with polygon tool in QGIS 2.18.4. It is missing an entire row of cells which are entirely contained within the clipping polygon (see image, original DEM in colours, clipping polygon in red outline, output in greys - just looking at the very top of the polygon).

I have checked my project and layer CRSs are all the same.
I also considered using gdal's "Clip raster by mask layer" but found SAGA's easier for the batch processing as I'm running this for many different layers so would prefer to stick with SAGA if possible.

Does anyone know what's going on here?


texts: Disable panning/dragging on leaflet map for div within map

texts:
Does anyone know how to suppress panning when you click and drag over top of a div box embedded within the map itself?

For example here, when you click and drag over top of the legend, the map drags with you. I want to suppress that function.
I am aware if this technique, but i want to know if this is the only way:

map.dragging.disable();


texts: How to install GDAL/OGR with GRASS vector support?

texts: The GRASS 6.4.3Svn for Windows that i have in my machine does not have GDAL/OGR support. Is there any library (libgrass) for Windows to add into existing GRASS installation. If not, how to build or install GRASS with OSGEO4W installer including GDAL/OGR support?


texts: Making ArcMap layer file with "live" link so updating it changes any document with layer loaded from it?

texts:
I don't know if this is possible, but can I have a layer in an ArcMap MXD which is loaded from a layer file, and if that layer file changes, the MXD layer updates to those changes next time I launch the MXD?

For example, Document1 has a point layer symbolized as a square, I save that layer as a layer file.  I open Document2 and load that layer file, seeing the point show up as a square.  I change the symbology from a square to a triangle and re-save the layer file.  I go back to Document1 and reopen it, and now the point layer shows up as the triangle.

The use case is trying to get multiple users working off the same symbology, and have a way to centralize control of the symbology changes so that I just have to change something in one place, but have that change show up in multiple MXD's for multiple users.

Is that possible in ArcMap?


texts:
I am trying to render citygml files. I am using NWW for rendering purpose. I have used citygml4j library to extract the GroundSurface, roof, and walls geometry, and was able to render them. But due to the huge data specification of citygml, I am having troubles with more complex files. So I am looking for some java library that can convert citygml file to kml data format, which can be easy visualized in World wind. I have seen the 3dcitydb and found that pretty cool, but couldn't find any set of apis that can be used for my purpose.(haven't completely explored that).

Does there exist some java library that can fulfill my purpose?


texts: Calculate Polygon Main Angle in QGIS with Python

texts:
At the moment I have split my imported shapefile into the parts with the function 'qgis: explode' (pic1 & pic2):

Next I want to the polygon main angle of each "exploded" element.

In ArcGIS there is the function "Calculate Polygon Main Angle (Cartography)" which solves this problem, but I didn't find a suitable function for it in QGIS. "Calculate Polygon Main Angle (Cartography)" creates a new column in the. dbf file and fills it with the angles of each element.

Is there an equivalent function in QGIS?


texts: QGIS Raster Layer - Black rectangle appears as background

texts: I have looked at solutions to what seem to be somewhat similar problems but they don't seem to solve my problem.  A georeferenced raster layer loads into the correct location in relation to other layers, so CRS is obviously OK, but has this black background which I don't know how to remove.


texts: Improving performance on OD Cost Matrix in ArcGIS Network Analyst?

texts:
I have no programmer's background therefore, I try to avoid use python scripting, however If I there is no other choice I am willing to improve my skills.

My question is how to improve performance on OD Cost Matrix for 200,000 origins and 1,000 destinations i.e. finding a way to improve the performance on OD cost matrix analysis on ArcGIS 10.0?

I use ArcSDE with postgresql and keep my origins and destinations on the database. I have uploaded 200.000 origins in about 75 minutes and it took minutes to load the destinations.

Currently I have waited around half an hour and my work seems to progress around 0%. However It is not crashed yet and according to the status bar it jumps to another location every 5-10 seconds.

It seems to be I am doing something very wrong. Do you have any advises to improve performance or at least make sure that my calculations will not crash?

I can only divide origins to smaller parts, I will have to keep my destinations all together.


texts: R: Why is my map including the entire world WSG84 space, when all I want plotted is New Zealand?

texts:
This seems to be a very easy problem to solve, but about two hours of searching hasn't led me to the answer.

I have a GIS file that I downloaded in WSG84 ESPG:4326. I read in the file using readOGR.

I can't get the file to plot() correctly.

Code:

NZAreas <- readOGR("[FILEPATH]/area-unit-2013.shp")
proj4string(NZAreas)
[1] "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

When I plot(NZAreas), I get a very small New Zealand off to the far right of an otherwise-empty plot (apart from one small polygon to the very left) - I seem to be plotting the entire world WGS84 instead of just New Zealand

Thinking it might be to do with the apparently absent EPSG code, I also tried:

NZAreas <- spTransform(NZAreas, CRS("+init=epsg:4326"))
plot(NZAreas)

This gives me the same small New Zealand on the large empty world map.

Earlier today I had this working. Then after working on some later code, and coming back to this map to plot, the plot no longer limits the area to New Zealand. I can't pinpoint what I am doing wrong. For example, this blog post gives an example of using WGS84 with Brazil data, and having the map limited to only Brazil. To my eye, which is now tired, I am using the same code and getting a different result.

Can someone please point out what I am doing wrong, and how to fix it?

Is the map plot output controlled by something other than the coordinate information in the shapefile? I don't do GIS very often, and I recall this problem bit me the last time I was working in GIS. Looking at my files from back then, I can't see how I solved the problem. But I used all different data for that work.


texts: How to publish shapefiles to web with no programming required?

texts:
I am new to GIS web development.

I do not have any programming background and I want all the maps that I design in GIS (shapefiles, using ArcGIS Desktop 9.3) to be published on the web.

Please tell me the direct or easy way to do this?


texts: Distortion of City -Boundary-Polygons proportional to population size in QGIS?

texts:
Is there a way to distort the size of polygons proportional to their population size (as in column in the attribute table)? I want to create a map that looks similar to this:

the cartogram2 plugin works with small datasets, but trying to make the same for all regional units in Germany (around 400)  QGIS crashed with this report:

h2. User Feedback

h2. Report Details

Crash ID: a6e72007607c25de38558d32493d43e2f01c1ba4

Stack Trace

PyInit_sip :
PyInit_sip :
PyFrame_New :
PyObject_Call :
PyInit_sip :
PyInit__core :
PyCFunction_FastCallDict :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyObject_GenericGetAttr :
PyEval_EvalFrameDefault :
PyErr_Occurred :
PyFunction_FastCallDict :
PyObject_CallFunctionObjArgs :
PyObject_Call :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
PyInit_QtCore :
QMetaObject::activate :
QThread::started :
QThread::start :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.2.1-Bonn
QGIS code revision: commit:1edf372fb8
Compiled against Qt: 5.9.2
Running against Qt: 5.9.2
Compiled against GDAL: 2.2.4
Running against GDAL: 2.2.4

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.17134

Update: When trying a different number of iterations than the default (10) in cartogram3 it works! I tried 5, 8 and 15. All gone well.


texts: Summing pixel values within polygon zone in QGIS?

texts:
I have two layers: a raster layer and a vector layer (polygon). I can see the values of the raster pixels but I don't know how to combine them with information from the polygon layer. More specifically, I would like to :

sum values of all pixels within a the borders of a polygon
count the number of pixels with a specific value within the
borders of a polygon

Can anybody help and advise on how to do this in QGIS?


texts: Python libraries for correlating Photo to GPX file?

texts:
Can anyone recommend a Python library(s) that can geotag a photograph with the lat/long coordinates by correlating the timestamp of the photograph to the timestamp of a waypoint within a GPX file?

I am aware of desktop applications like GeoSetter which will do this for you, but I would like to write an automation procedure that I could run on a nightly basis that emulates this process:

User takes a GPS and a camera into the field.
User drops a folder onto a server with a GPX file and the photos taken that day.
A Python process geotags the metadata each photo in the folder with the lat/long coordinates by comparing the photo timestamp to the nearest equivalent timestamp (+/- 30 seconds?) of a waypoint in the GPX file.
Convert the coordinates found in the photo's metadata to a point in a GIS system.

I have procedures in place for steps 1, 2, & 4 but either need to find a library that already accomplishes step 3 or write my own.  Any suggestions?


texts: I am in need of the correct syntax for performing transaction on WFS layer using OpenLayers. I have gone through many examples on the OpenLayers site and other examples, but can't figure out how to use the necessary and optional options like geometryname, schema etc


texts: How do I apply phase center corrections to IGS satellite positions?

texts:
I'm trying to use the International GNSS Service's SP3 precise orbit files (found here) to calculate the position of GPS satellites for a Precise Point Positioning solution.
It appears that they're given relative to the satellite's center of mass, though, and not to the actual antenna, which is what I need to get a precise solution. The website refers me to a paper by Montenbruck, et. al., (2015) that gives a lot of information about body frames and such, but I can't make much sense of it.
Is there a simple, concise way to get the position of a GPS satellite's antenna, such that I can use it in a Precise Point Positioning solution, in ECEF coordinates, at a given point in time? I have the necessary SP3 files and the IGS's .ATX file to get the antenna offsets relative to the satellite's body frame.


texts: Layer still in map after running arcpy.mapping.RemoveLayer?

texts:
I'm trying to run a script that removes a group layer from a set of map documents, the code runs and the correct zone to be deleted prints out, However, when I check my map documents, the layer is still there. What am I doing wrong?

This is what I have so far:

import arcpy
import os

PATH2 = r"C:\Users\Daimon Nurse\Desktop\DFMPROJECT"
arcpy.env.workspace = PATH2
arcpy.env.overwriteOutput=True

for file in arcpy.ListFiles("*.mxd"):
    filePath = os.path.join(PATH2,file)
    MapDoc = arcpy.mapping.MapDocument(filePath)
    lyrList = arcpy.mapping.ListLayers(MapDoc,"Zones","")
    for Lyr in lyrList:
        for df in arcpy.mapping.ListDataFrames(MapDoc):
            print Lyr
            arcpy.mapping.RemoveLayer(df,Lyr)


texts: How do I add precise border with longitude and latitude for any country using mapinfo?

texts: I have a plain image that I need to add international border with precise longitude and latitude but I have no experience with Mapinfo. How is it possible? Is there any way to import maps from Bing or Google Earth with that information?


texts: OpenLayers 5: To display the label for a point

texts:
In my project there are two GeoJSON point layer, both has the same attribute 'name'. I would like to use this attribute for labeling all points.

I've found this similar question but it is for OpenLayers 3.
However I've used a part of code:

var getText = function(feature) {
    var text = feature.get('name');
    return text;
};

var style = new ol.style.Style({
      image: new ol.style.Circle({
          radius: 7,
          stroke: new ol.style.Stroke({
            color: 'rgba(200,200,200,1.0)',
            width: 3,
          }),
          fill: new ol.style.Fill({
            color: 'rgba(255,0,0,1.0)'
          })
      }),
      text: new ol.style.Text({
          text: getText(feature),
          font: 'bold 11px "Open Sans", "Arial Unicode MS", "sans-serif"',
          placement: 'point',
          fill: new ol.style.Fill({color: '#fff'}),
          stroke: new ol.style.Stroke({color: '#000', width: 2}),
      }),
  });

var addPointsSource = new ol.layer.Vector({
  source: new ol.source.Vector({
    url: '{% url 'points_geojson' %}',
    format: new ol.format.GeoJSON(),
  }),
  style: style,
});

var freezedPoints = new ol.layer.Vector({
  source: new ol.source.Vector({
    url: '{% url 'points_freezed_geojson' %}',
    format: new ol.format.GeoJSON(),
  }),
  style: style,
});

This is an example of GeoJSON:

{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:4326"
    }
  },
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Napoli",
        "publishing_date": "2019-07-30T08:14:57",
        "updating_date": "2019-07-30T08:15:15.317",
        "timestamp": "2019-07-30T08:15:15.317",
        "pk": "1"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          14.254760740203487,
          40.855370527204315
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "name": "New York",
        "publishing_date": "2019-07-30T08:15:15",
        "updating_date": "2019-07-30T08:15:49.464",
        "timestamp": "2019-07-30T08:15:49.464",
        "pk": "2"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.99017332954408,
          40.738933236426014
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "name": "Petra",
        "publishing_date": "2019-07-30T08:15:49",
        "updating_date": "2019-07-30T08:19:56.621",
        "timestamp": "2019-07-30T08:19:56.621",
        "pk": "3"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          35.44249534113302,
          30.33036084747055
        ]
      }
    }
  ]
}

When I use that code I see this error:

  Uncaught ReferenceError: style is not defined

My map is based on GeoDjango and I know that my knowledge of javascript are very very low.


texts: Viewing route in GPX format together with POIs in KMZ format?

texts:
I've got a route for an ultra endurance cycling event (1000 miles unsupported) as well as a KMZ file with all of the churches in the country (Denmark).

Churches are of great help since they have running water and oftentimes toilets as well.

I'd like to study the course together with the churches plotted, but don't know how.


texts:
I am new user of QGIS and I am facing this problem
I created a map in my main project and so some layers. it was working pretty good.
But I don't know what I'd changed in parameters. and it gave me a blank map or dark.

so my projection configuration is:

and the layer is

its grid projection is


texts: schools: how are they tagged - with the same method all over the world?

texts:
are all schools tagged in the same way?  or do some countries do use a specal tag-(system)?

update: thanks to the responders: what does this mean  https://taginfo.openstreetmap.org/tags/amenity=school

Typ

countl Objekte
all: 592 443
0.02%

[Node] Node 325 974
0.36%

[Way] Way 260 384
0.11%

[Relation] Relation 6 085
0.23%

end of update: thanks

we have the central ressource for the tag-system
http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dschool

  how can we evaluate that?

  This area should envelop the full grounds of the school including all
  the buildings, sports facilities and grounds. For schools with
  multiple sites the multipolygon relation can be used. Tag the element
  with amenity=school and name=* for the name of school. Suggested
  additional tags include:

operator=* - Name of operator, often the local education authority.
addr=* - Address details
capacity=*, for the number of pupils taught at the school
isced:level=*, for the educational level (proposed tags)
fee=yes if the the school makes a direct charge for core services.
religion=*, if the school is associated with a particular religion (also denomination=*)
wikipedia=*, for a link to a Wikipedia article about the school
website=*, for a link to the school's own website

 Public-images-osm logo.svg building = school Convent School's Pippal.JPG Description A generic school building. Used on these

  elements may be used on nodes should not be used on ways may be used
  on areas may be used on relations Useful combination

name=*
amenity=school
amenity=college
amenity=kindergarten
See also
building=university

How to map

  there is just one school building:  Map the outline of the area Area
  of the building and  add the tags amenity=school and building=school.
  Of course you can add name=* and address as well.

Well - i wonder how we can get a concrete and concise result if we do a request for all the schools in the world

<!--
This query looks for nodes, ways and relations
with the given key/value combination.
Choose your region and hit the Run button above!
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “building=school” -->
    <query type="node">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="way">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
    <query type="relation">
      <has-kv k="building" v="school"/>
      <bbox-query {{bbox}}/>
    </query>
  </union>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

btw - this above code does not function - and this below also not.
what is wrong here?

This query looks for nodes, ways and relations
with the given key/value combination.
Choose your region and hit the Run button above!
-->
<osm-script output="json" timeout="25">
  <!-- gather results -->
  <union>
    <!-- query part for: “building=school” -->
    <query type="node">
      <has-kv k="building" v="school"/>
      <bbox-query {51.5557914,0.2118915,51.5673083,0.2369398}/>
    </query>
  <!-- print results -->
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton" order="quadtile"/>
</osm-script>

can you help out!?


texts: Testing symbol file existence in Mapserver

texts:
I have a set of PNG images I want to use as symbols in a point type layer in Mapserver. The file names come from the database in the DATA keyword, and if a file exists, it's all right. But if it does not exist, I'd like to use some default symbol. Something like this:

CLASS
    EXPRESSION ([symb_name] exists)
    STYLE
        SYMBOL [symb_name]
    END
END
CLASS
    STYLE
        SYMBOL 'default.png'
    END
END

Is there any way to accomplish this?


texts: JAVA GIS create shapefile from FeatureLayer

texts:
The title kind of saids it all. I am attempting to export a featurelayer to a shapefile and am not having any luck finding a library which includes this functionality or relevant code to see where to get started here. Is this possible? If so, any ideas on how to accomplish the task?

I currently have made a button to make a featurelayer from a selection as follows:

protected void doActionPerformed(ActionEvent e) {
    IFeatureSelection featureSelection = getFeatureSelection();

    if (!(featureSelection instanceof IFeatureLayer)) {
        return;
    }

    FeatureLayer featureLayer;
    try {
        featureLayer = Casting.cast(featureSelection, FeatureLayer.class);
        Date currentDate = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd hh:mm:ss");
        String dateString = dateFormat.format(currentDate);
        IFeatureLayer selectionLayer = featureLayer.createSelectionLayer(featureLayer.getName() + " " + dateString,
                                                                         true,
                                                                         "",
                                                                         "");
        ActiveMapContainer mapContainer = ActiveMapContainer.getInstance();
        mapContainer.getMap().addLayer(selectionLayer);
    } catch (Exception e1) {
        Log.error("CreateLayerFromSelectionAction.class doActionPerformed(ActionEvent e)", e1);
        e1.printStackTrace();
    }
}


texts: Create a list of .TIFF without losing the metadata in R

texts:
I have a series of images (.tiff) that I would like to put into a list and then convert each image into a data frame.

For that, I have created a list with my images.

list.pics<-list.files(path="/Users/Documents/0003SET/000/", pattern="*.tif")

By doing that I am losing the metadata that each image has:

> class(list.pics)
[1] "character"

If I do one image at the time, I get the following,

mydf<-read_exif("/Users/Documents/0003SET/000/IMG_0000_1.tif")
class(mydf)
> class(mydf)
[1] "tbl_df"     "tbl"        "data.frame"

does anyone knows how to create a list of .tif files and not lose its metadata on the process?


texts: Merging of two maps having different data in ecognition

texts:
I would like to synchronise two maps having two data (map1 for building and map2 for

vegetation) into main map.I used the rule set of "working with maps".But it doesn't merges the

data.I am using eCognition 8.7 version.My task is to classify building in one map and

vegetation in another map of the same area.After classification I want to synchronise the

extracted building and vegetation into the main map.I could do up to this level , but it comes

as two levels in main map.I have to get it in a single level in main map.


texts: Using Feature Class "Name" from Iterate Feature Classes to Calculate Field with ModelBuilder?

texts:
I am using ArcGIS 10.1 for Desktop.

My goal is to create shapefile that contains merged feature classes from a geodatabase. I would like for there to be a new field in the resulting shapefile that contains the name of the original feature class. The tool that I have created is successful in merging the FCs into one shapefile however the "Name" field is blank for ever record.

The field that is intended to be populated is set up as a text field (length 50). I have set the "Name" variable from Iterate Feature Classes as a precondition to calculate field. My expression in Calculate field is "%Name%" with Expression Type Python.

What do I need to change to make this work?

Link to Image : http://imgur.com/R0h4U78


texts: Cesium CZML file for billboard with trailing line

texts:
I am looking for some tips on creating a CZML file that has uses a billboard to track a pedestrian walking over a terrain (and has a few custom properties for each time sample). About 18K samples. My naive assumption is to put this in one or more packets.

And then have a seperate id for a path that grows as trace of the path (with the head being the billboard). And this would be in a seperate packet,

and Both would have a epoch for the start and then sample properties for each time step

I.e. the epoch would be today at noon, and the sample properties would be 1 second intervals for each position of the pedestrian which would be duplicated for both the polyline and the billboard.

But is there a better way, and I assume someone has done a sandcastle with an example, right?


texts: Working w/ Shapefiles Containing 50,000 to 300,000 Features

texts:
I work daily with shapefiles that are quite large in number of features using ArcGIS. Sometimes I am able to perform operations (joins, selections, exports, etc) on these shapefiles (though they do take quite a bit of time to run- usually ~5 to 10 minutes) and sometimes I am not. I am working in ArcMap 10.2.2 and have tried many things from clearing my cache to closing all other programs while these operations occur to attempting to break down the size of these files. I should also note that my system far exceeds Arc's minimum requirements.

Any tips/advice?


texts:
I have a folder with a gdal2tiles output: 6 levels of zoom (and folders), with subfolders and  .png tiles.

Is there a gdal tool to merge in a single geotiff file these .png tiles?


texts: Making one part polyline from multipart polyline?

texts:
I have a polyline which is divided into multiparts and these parts are not well ordered so that the vertex's ID are not following the polyline's plotting.

This polyline is a representing a bus line and I need to have the plotting following the driving way of the bus. I would like to know how to merge the multiparts of this polyline?

I have already tried to Split and Unsplit, as well as Multipart to Single Part, Union, Merge, etc. but no one is giving me the result I want.


texts: How to get User and Password of a PostGIS layer from PyQGIS

texts:
I wonder if it is possible to get the user and password for a PostGIS database if they are stored in the PostGis connection information.

I get the connection information at the moment from the active layer like this:

connInfo = QgsDataSourceURI(layer.dataProvider().dataSourceUri()).connectionInfo()
print connInfo
dbname='test_geodata_project' host=10.0.4.111 port=5432 sslmode=disable

userInfo = QgsCredentials.instance().get(connInfo, None, None)
print userInfo
(True, u'testuser', 'test')

But the user has to type in the user/password manually. Is there something like the connectionInfo() but with user/password?


texts: Obtaining contiguity matrix from layer of polygons using ArcGIS Desktop?

texts:
I have a layer of statistical areas, and would like to obtain the contiguity matrix, that is, the matrix W in which an entry w_ij equals 1 if i and j are neighbors (share a border) and 0 otherwise.

There must be some simple tool to do this in ArcGIS, but I could not find it.


texts: QGIS ordered set from layer.getFeatures()

texts:
I need a list of all values of a certain field in a QGIS dataset. To get this, I am using

  for festure in layer.getFeatures():
     value=feature[fieldname]

This is kind of working, but I have two issues with it, they may have the same solution:

I want the data sorted by id, it seems to me that some of the points are not coming in the correct order.
It seems rather slow. I have a dataset with a few thousand records and it uses several seconds to go through it.

(the base dataset is a PostGIS table if that matters)

So I have these questions:

Is there any way to sort the data returned by getFeatures()?
Is there any way to speed up getFeatures()
or
Should/could I use any other way of getting all values from a field?


texts: How to get the intermediate points between a route origin and destination?

texts:
I use Redshift and recently Amazon Redshift has updated the database to be able to use some spatial functions.

https://docs.aws.amazon.com/redshift/latest/dg/geospatial-functions.html

In a table I have a customer origin and destination (store) coordinates.

In another table, I have all the coordinates of all the stores (including the destination one).

How can I know the points (red) that the client has to go through to reach the destination?

I could simplify the model using the shortest algorithm of the camimo, but I have not seen if redshift currently has this function.

Attached example image


texts: I produced an excel file with the historical solar radiation of Australia (the file has 679 rows and 839 column and the filled cells have the shape of Australia). How can I link the cells in the excel files to a pixel on my map?


texts: Can't find CRS for Idaho DOT data in Qgis 2.18

texts:
I downloaded a mile marker geojson from the Idaho DOT and the CRS is listed as 102605, which doesn't seem to exist outside of the DOT office.

This is the extent of the layer metadata:

XMin: 2254295.3529000003
YMin: 1199867.0130000003
XMax: 2743212.4619000005
YMax: 1980420.2782000005
Spatial Reference: 102605  (102605)

link to mapserver info:
https://gis.itd.idaho.gov/arcgisprod/rest/services/ArcGISOnline/MilePointLayers/MapServer/3


texts: Straight lines as output of flow accumulation in ArcMap 10.5

texts:
I'm quite new to ArcMap and I have a question regarding the flow accumulation  tool.
What I did so far:

converted TIN into raster (sample_distance/sampling_method distance: CELLSIZE 1 m)
calculated flow direction
filled sinks
calculated flow accumulation
calculated two new rasters with a threshold of 100 and 500 cells, respectively
converted each stream raster into a polyline feature.

What bothers/surprises me is that many of these polylines are unnaturally straight. I expected a much more irregular pattern. I have actually been in the field and seen the area. There are no artificial channels that could explain why the lines are so straight.

Is there any mistake in my calculation process?

Any step I missed?

Have you ever had a similar output when using the flow accumulation tool?

Or would you say that the result makes sense?


texts: Making GeoServer SLD style for double dashed line

texts:
Is it possible to make SLD style for GeoServer maps to represent a street that has 3 tracks (or more) with something like this

I know that it is possible to make single dashed line ------ so the street will apear to have 2 tracks, but I was unable to make double dashed or triple dashed line.  I just need to represent each track on street.
I think it might be possible with using custom shape along with textsymbolizer and then making it appear as double dashed line, but I cannot use that because of all vendor options for displacement cause I will have street name, street direction etc. also with textsymbolizer.
I was wondering is it possible with some line displacement or something similar?


texts: Listing file formats to represent georeferenced 3D data?

texts:
I am looking for an overview of file formats that can store geo-referenced 3D geometries. There are no further requirements such as texture support, etc.

I have found the following formats so far and seek extensions to that list:

Shapefile
GML
KML/KMZ
GeoJSON


texts:
I am new to GIS world. I am trying to host raster images (TIFF) which I need to convert in tiles and host on GeoServer and prepare the service URL so that any user using that service zoom to any location, the service will get the tiles of that location and display it.

I am able to convert the raster image to tiles which create multiple folders and put the tiles into it using gdal2tiles. Now I am not getting the option to upload that folder in the GeoServer to achieve my task.

Can anyone explain what I need to do or guide me to any tutorial where I can study and achieve my task?


texts:
I want to get the lineregress parameters of 2 numpy arrays (that both come from the same shape mask, so they should have the same shape) but I get this error message:

    ValueError                                Traceback (most recent call last)
<ipython-input-11-9eba54f5694d> in <module>()
----> 1 slope, intercept, r_value, p_value, std_err = linregress(a, b)

C:\Anaconda3\lib\site-packages\scipy\stats\_stats_mstats_common.py in linregress(x, y)
     77
     78     # average sum of squares:
---> 79     ssxm, ssxym, ssyxm, ssym = np.cov(x, y, bias=1).flat
     80     r_num = ssxym
     81     r_den = np.sqrt(ssxm * ssym)

C:\Anaconda3\lib\site-packages\numpy\lib\function_base.py in cov(m, y, rowvar, bias, ddof, fweights, aweights)
   2493     else:
   2494         X_T = (X*w).T
-> 2495     c = dot(X, X_T.conj())
   2496     c *= 1. / np.float64(fact)
   2497     return c.squeeze()

ValueError: shapes (2,1471,769) and (769,1471,2) not aligned: 769 (dim 2) != 1471 (dim 1)

No idea of what is happening here, It seems that one matrix is flipped. I have been looking for something about this, but nothings works for me.

My code:

import rasterio
import numpy as np
from scipy.stats import linregress

stack1 = r'path/to/raster1.tif'
stack2 = r'path/to/raster2.tif'

with rasterio.open(stack1) as stck10:

    STCK1 = stck10.read()

with rasterio.open(stack2) as stck11:

    STCK11 = stck11.read()

slope, intercept, r_value, p_value, std_err = linregress(STCK10, STCK11)

Stacks 1 and 2 comes from the same mask, so there should excatly the same size, shape, etc.


texts: How to export latitude and longitude values of each pixel corner?

texts:
I want to extract latitude and longitude values for each pixel's corner of a TIFF image. The latitude and longitude values for the top right and top left are known.
How should I perform this task in ENVI or IDL?


texts: Connect QGIS to Remote PostgreSQL Server

texts:
I am trying to connect to my database on a remote server using QGIS. From what I've read I have to edit the pg_hba.conf and the postgresql.conf files. I think I have edited these files to allow any IP to connect using the password (not very secure but I'll sort that out when I get this issue figured out). I have verified that my parameters in the PostGIS connection tool are correct.

When I try to connect to the database it says theres an error. I'm not sure if I missed a step or if I did anything incorrect, can anyone give me some suggestions on how to get this accomplished?

# IPv4 local connections:
host    all             all             0.0.0.0/0            md5
# IPv6 local connections:
host    all             all             ::0/0                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    replication     all             0.0.0.0/0            md5
host    replication     all             ::0/0                 md5

Versions: QGIS 3.4.14, PostgreSQL 10, pgAdmin 4

OS: Client side -> Windows 10, Server side -> Windows Server 2012


texts: Defining Latitude and Longitude before defining Datum?

texts:
Reference material:

The Five Key Ingredients for Mapping the Earth

There are five important steps to producing a map of the Earth's Surface.  These are:
sphere with north and south through the middle:

Firstly, a reference system which is used to describe the locations of points on the surface of the Earth.

For maps of large areas of the Earth this would be latitude/longitude and for simpler ‘sketches’ or maps of local areas this would be a grid.  Some more complex maps may use both latitude/longitude and a grid reference system.
Spheroid Diagram

Secondly, a Datum which defines the geometry/mathematics of how to transfer this coordinate system onto the surface of the Earth.

This is necessary for all maps of large areas of the Earth, but may not be needed for simpler ‘sketches’ or maps of local areas where features are able to be visually located relative to each other.

A feature of the modern electronic era is that many map users are now also using Global Positioning Systems (GPS) when they are using maps.  An interesting impact of this is that more and more maps are being forced to use the same datum as the GPS system (even ‘sketches’ and maps of local areas maps) so that the reference coordinates on the map agree with the coordinates shown on the GPS receiver.
Surveyor using surveying equipment.

Thirdly, a measurement system which is used calculate the coordinates of points on the surface of the Earth.
World map.

Fourthly, a projection which allows the coordinates, which have been calculated using a measuring system, to be displayed on a flat piece of paper.
Colourful timezone map of Australasia.

Fifthly, the Map Maker’s Art.

Link: https://www.icsm.gov.au/education/fundamentals-mapping/overview-fundamentals-mapping

Question:
My perception of Latitude and Longitude is that:

Since, earth is wobbly in shape, we define a datum with a particular center and particular shape. Using that datum as a reference, write down latitude and longitude into that framework.

But according to the given link and the snippet of information presented, latitude and longitude are defined first and then a datum is created to transfer the coordinate system onto the surface of the earth.

The confusion now is then, on what basis/surface/reference the latitude and longitude are defined upon?


texts:
I am trying to use the task manager to run a long operation (uploading layer to a GeoServer instance, for the Geoserver Explorer plugin), but I am finding some issues.

Here is the code that I am using:

def _publishLayers(catalog, layers, layersUploaded):
    task = PublishLayersTask(catalog, layers)
    task.taskCompleted.connect(layersUploaded)
    QgsApplication.taskManager().addTask(task)

class PublishLayersTask(QgsTask):

    def __init__(self, catalog, layers):
        QgsTask.__init__(self, "Publish layers")
        self.layers = layers
        self.catalog = catalog
        self.exception = None
        self.errortrace = None

    def canCancel(self):
        return False

    def run(self):
        try:
            //Upload layers here
            return True
        except Exception as e:
            self.exception = e
            self.errortrace = traceback.format_exc()
            return False

    def finished(self, ok):
        if ok:
            //show confirmation message
        else:
            //show error message and log error details

The issues I have are mainly two:

1) After adding the task to the task manager, it doesnt start. I have to add some call that refreshes the UI, such as logging a dummy message to the QGIS log or calling processEvents() to have it started. I have tried in Win and Mac, and in both cases the task is not triggered. Docs say that the task manager will take care of running it when it can, but that never happens, no matter what I do on the QGIS UI.

2) The finished() method is not always run when the task is finished. The layersUploaded method that is connected to the taskCompleted signal is always run when the task is correctly finished, but the finished method of the task is only called sometimes. That doesn't depend on the success of the task. If it fails, the finished method is only run sometimes, and I could not find any pattern in it.

Any ideas or suggestions?


texts: Inability to use Road Grapher plugin in Q Gis 2.18.2

texts: I am a QGis 2.18.2 user who is unable to use road grapher plugin as the system says it is not configured. However, I can see the plugin in the side panel.


texts: How to use a grid to divide a feature in ArcMap?

texts: I am using National Land Coverage Data (NLCD) for a project. I am trying to divide a feature into separated features via a grid system so that I can alter and calculated the different land coverage per grid cell. I have created a ten by ten fishnet, but I have been unable to divide the NLCD into separate feature either as rasters or polygon shapefile. I've used the split function, but it did not keep the extent nor the orientation of the grids.   Also, I tried intersecting but that didn't work either. What would be the best way to accomplish this? 10 by 10 grid


texts: Is there a possibility to use the ring-points from displacement renderer in qgis for map-tips?

texts:
I've got as "layer 1" a point data-set and as "layer 2" a point-dataset (with the identical geometries of layer 1) with a varying number of photos (=identical points) to every point of layer 1.

Is there a possibility to get all photos from the overlapping (photo-)points within a map-tip ? (The QGIS map-tip seems to show only the first object/photo of the overlapping objects.)

The displacement-renderer point-symbols on the ring do not show map-tips - only the central point.

I think there may be two different approaches:

1) It would be nice to get map-tips from the displaced symbols (I've looked up the QgsPointDisplacementRenderer Class Reference API docs but I didn't get a hint how to use it regarding my question) or

2) Is there a inside map-tips usable html expression which can be used to deal with this task (showing a list of photos from a PostgreSQL-database created photo-path-array by group-function) ?


texts: I have a slope created in percentage of declivity and I class this slope in some ranges (see the image), and I need to know how much % in 0 to 15 in that slope, how much % in 15 to 20 range.


texts: GeoServer - WMS CQL_FILTER id = 'XXX' works but id IN ('XXX') does not

texts:
I have a WMS that I need to filter with CQL_FILTER parameter using an array of srting IDs.
The layer is published from a PostGIS Table View which is declared like so:
create view mob.daily_origin_all
as select "date", "start", "end", id, inc, totinc, diaginc, offdiaginc, mob.calculateSignalLevel(inc) as "level", country, wkb_geometry as geom from
    (select "date", "start", "end", origin as id, sum(inc) inc, avg(totinc) totinc, avg(diaginc) diaginc, avg(offdiaginc) offdiaginc, max(country) country
    from mob.signals
    where freq = 'daily'
    group by "date", "start", "end", origin) as dlorgall,
    mob.geo
where zone_id = dlorgall.id;

In the GeoServer Layer Preview page, I can try to apply a CQL_FILTER parameter.
Supposing the id I am looking for is XXX, when I do id = 'XXX' I receive the correct response and can visualize the area I need in the map.
However, when I try with id IN ('XXX'), I receive an empty image. So, it seems the request is correct but the result is empty, when it should be equal to the one given by id = 'XXX'.
I also looked at this other question, but it did not help apparently.
And, when I look at the GeoServer log, I see this warning:
WARNING: ID IN (...) is a deprecated syntax, you should use IN (...)

So I am guessing this is a matter of naming the column differently than id. But why should it work in one way and not the other?


texts:
I'm using Java with ArcGIS 100.1.0—ArcGIS Runtime SDK for Android. I have a number of locations(Point s) on the map, after I added all the markers as graphics (on a graphic overlay), I want to zoom the map to be able to see all of them with the zoom adjusting to fit them on the map. I tried drawing a polygon and getting its envelope. And used

Envelope envelope = graphicsOverlay.getExtent();
mapView.setViewInsets(  envelope.getXMin() - DEFAULT_PADDING,
                        envelope.getYMax() + DEFAULT_PADDING,
                        envelope.getXMax() + DEFAULT_PADDING,
                        envelope.getYMin() - DEFAULT_PADDING);

and I get a very bad zoom (too close) and not displaying the whole graphics.

Then I tried :

//1-we create a polygon out of these locations
PointCollection corners = new PointCollection(spatialReference);
for(Point point : points){
    corners.add(point.getX(),point.getY());
}
Polygon polygon = new Polygon(corners);

//2- we get the extent
Envelope envelope = polygon.getExtent();
mapView.setViewInsets(  envelope.getXMin() - DEFAULT_PADDING,
                        envelope.getYMax() + DEFAULT_PADDING,
                        envelope.getXMax() + DEFAULT_PADDING,
                        envelope.getYMin() - DEFAULT_PADDING);

I still have the same unwanted result.
 Does anyone has and answer?
Coming from Google Maps API v2 Android, I used to use the latlongBound to achieve this behavior.

Another solution would be to be able to evaluate the scale that I should apply to the mapview once I am able to get the extent of the overlay on which my markers/graphics (coming from Google Maps) are displayed. Does anyone know how to get that scale?


texts:
I'm trying to get the zonal statistics output (mean), do some operations and add to my main archive the output value. I wrote this code, but it's not running, the error message is:

Traceback (most recent call last):
  File "Z:\04 - Temp\Charles\NDVI_tempo\NDVI_py3.tbx#Script3_NDVIpy3.py", line 21, in <module>
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\sa\Functions.py", line 6328, in ZonalStatistics
    ignore_nodata)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\sa\Utils.py", line 53, in swapper
    result = wrapper(*args, **kwargs)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\sa\Functions.py", line 6321, in Wrapper
    ignore_nodata)
  File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Object: Error in executing tool
Failed to execute (Script3).

import arcpy
import os
import datetime
from arcpy import env
from arcpy.sa import *

#Declarar as variáveis

arcpy.env.workspace = 'Z:\\04 - Temp\\Charles\\NDVI_tempo\\NAL_PL'
fcs = arcpy.ListFeatureClasses()
rasters = arcpy.ListRasters("test*", "All")
fc = 'Z:\\04 - Temp\\Charles\\NDVI_tempo\\NAL_PL\\MA02ASEZ3S'
arcpy.CheckOutExtension("Spatial")

for tiff in rasters:
#Zonal statistics
    Zonaltif = ZonalStatistics(fc, ["ID_TALHAO"], tiff, "MEAN")
    Zonaltif.save('Z:\\04 - Temp\\Charles\\NDVI_tempo\\NAL_PL\\teste')
    Zonalper = Times (Zonaltif, 100)
    Zonalint = Int (Zonalper)
    RasterToPolygon_conversion (Zonalint, Zonalpoly, "SIMPLIFY", "VALUE")
    Intersect_analysis ([Zonalpoly, fc], 'Z:\\04 - Temp\\Charles\\NDVI_tempo\\NAL_PL\\teste\\intertif', "ALL", "", "")

What am I doing wrong?


texts: How to add mappanel back to container once removed?

texts:
I am trying to test following scenario:

A Ext.Window has one gx_mappanel item;
both Ext.Window and gx_mappanel are stored in variables;
One button is to remove gx_mappanel item from Ext.Window container;
The other button is to add this gx_mappanel item back to Ext.Window
container;

However:
    Once mappanel is removed, it cannot be added back to its container.

The issue happens in IE browser, and the error is:

SCRIPT5007: Unable to get value of the property 'removeChild': object is null or undefined

which is in OpenLayers.js, line 825 character 412:

render: function(div) {
    this.div = OpenLayers.Util.getElement(div);
    OpenLayers.Element.addClass(this.div, 'olMap');
    this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
    this.div.appendChild(this.viewPortDiv);
    this.updateSize();
}

Codes I've tried:

    <! DOCTYPE HTML>
<html>
    <head>
        <title>GeoExt MapPanel Example</title>

    <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script>
    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/examples/shared/examples.css" />
    <script src="http://www.openlayers.org/api/2.10/OpenLayers.js"></script>
    <script type="text/javascript" src="http://api.geoext.org/1.0/script/GeoExt.js"></script>

    <script type="text/javascript">
    var mapPanel;
    var parentWin;

    Ext.onReady(function() {
        var map = new OpenLayers.Map();
        var layer = new OpenLayers.Layer.WMS(
            "Global Imagery",
            "http://maps.opengeo.org/geowebcache/service/wms",
            {layers: "bluemarble"}
        );
        map.addLayer(layer);

        mapPanel = {
            xtype : 'gx_mappanel',
            id : 'MAP_PANEL',
            map : map,
            zoom: 6
        };

         parentWin = new Ext.Window({
            title: "GeoExt MapPanel Window",
            height: 400,
            width: 600,
            layout: "fit",
            items: [mapPanel]
        }).show();

    });

    function mapGone() {
        parentWin.removeAll();
        parentWin.doLayout();
    }

    function mapBack() {
        parentWin.add(mapPanel);
        parentWin.doLayout();
    }
    </script>
</head>
<body>
    <input type="button" onclick="mapGone()" value="map gone"></input>
    <input type="button" onclick="mapBack()" value="map back"></input>
</body>

I really wish somebody can give me some advice...
appreciate in advance!!


texts: Why do QGIS 2.99 and 2.18 behave different when I use canvas.setDestinationCrs?

texts:
I started with the same setup in QGIS 2.99.0 (bc08a79) and QGIS 2.18.6 (both on Windows 10):

The project CRS is set to EPSG:3857
I added 1 layer: An XYZ tile layer with OpenStreetmap tiles: http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
I Zoomed out to see the entire world
In QGIS 2.18.6 OTF is set to enabled. In version 2.99.0 OTF is always enabled.

When I run the following script in the Python Console to set the project CRS to EPSG:31370:

canvas = iface.mapCanvas()
target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( 31370, QgsCoordinateReferenceSystem.EpsgCrsId )
canvas.setDestinationCrs(target_crs)

I get the following correct results in QGIS 2.18.6:

The map is reprojected
The coordinates in the status bar are correct when I move the mouse pointer over the map
The code of the CRS in the status bar is correct: EPSG:31370 (OTF)
When hover that CRS code in the status bar it shows "Current CRS Belge 1972 / Belgian Lambert 72 (OTF enabled)"
When I click on that CRS code in the status bar, it opens the Project Properties with EPSG:31370 selected

All these results are as I expect them to be.

When I run the exact same code in QGIS 2.99.0, I get the following expected results:

The map is reprojected
The coordinates in the status bar are correct when I move the mouse pointer over the map

But I also get the following unexpected results:

The code of the CRS in the status bar is not correct: EPSG:3857
When hover that CRS code in the status bar it shows the incorrect "Current CRS WGS 84 / Pseudo Mercator"
When I click on that CRS code in the status bar, it opens the Project Properties with EPSG:3857 selected

When I use a global Natural Earth shapefile I get the same results.

What do I have to do to get the same correct result in both versions of QGIS? Can anyone explain what's happening in version 2.99.0?

EDIT:

Solution

I modified my code based on the answer by ndawson. Using the following code in QGIS 2.99.0:

target_crs = QgsCoordinateReferenceSystem()
target_crs.createFromId( 31370, QgsCoordinateReferenceSystem.EpsgCrsId )
QgsProject.instance().setCrs(target_crs)

gives the same result as the original code gives in QGIS 2.18.6. This modified code can't be used in QGIS 2.18.6.


texts:
Browsing the API at http://qgis.org/api and importing qgis and qgis.core I could not find any version information.

Is there a way to test in PyQGIS the version, like

if ( qgis.foo.VERSION == '2.99' ):
  print('on nightly')

So far I found PyQt:

In [11]: qgis.QtCore.PYQT_VERSION_STR
Out[11]: '5.5.1'

And I guess I could try&catch a new method.

But maybe there is a "cleaner" way to do this?


texts: Selecting a polygon area in a raster image - rasterio.mask vs roipoly

texts:
How should I select a polygon area in a raster image?

So far, I have seen two methods:

use a vector mask or a shapefile (some examples here: http://www2.geog.ucl.ac.uk/~plewis/geogg122-2011-12/vectorMask.html and here: https://rasterio.readthedocs.io/en/stable/topics/masking-by-shapefile.html)
use roipoly function, such as in matlab or python, which are often used in image processing applications (for example https://pypi.org/project/roipoly/ and https://it.mathworks.com/help/images/ref/roipoly.html)

In which cases one method is better than the other and why?


texts: arcgis flex api turn on/off group layers

texts:
I just started using ArcGIS API for Flex. In my case I need to provide a widget to turn on and off several layers together, which means these layers need to be turned on together or turned off together. Is it possible to do so? Should sublayer in operationallayers cater for it?

I am using Adobe Flash Builder 4.6 and ArcGIS API for Flex 3.6.


texts:
What is the real radius of earth?

Google says 6378.1 km
Wiki says 6371 km
And there are references for 6378.7 km

I'm using maximum radius 6378.7 km in distance calculation in spherical law of cosines formula. What would be the impact of using maximum radius rather than average radius which is 6371 km. When does using one over the other make sense?


texts: Removing feature layer using ArcPy script?

texts:
I have an ArcPy based script where I'm trying to intersect two layers where one layer must have its centroid in the other layer.

Since I need to know that one layer (feature_layer below) includes the centroid of the other, I'm using the arcpy.SelectLayerByLocation_management() tool.

I do not have a Map Document (*.mxd) open so in order to do this, I have to use Make Feature Layer to feed into it.

The documentation notes that the feature layer will disappear when the program exits, but I need it to disappear sooner since I have it in a loop similar to below

for feature_class in large_list_of_feature_classes:
    some_function(feature_class)

def some_function():
    feature = "{path to feature class}"
    feature_layer = "feature_layer"
    HUCs_layer = "all_HUCs" #HUCs being Hydrologic Unit Codes

    arcpy.MakeFeatureLayer_management(feature, feature_layer)
    arcpy.MakeFeatureLayer_management(feature, HUCs_layer)
    arcpy.SelectLayerByLocation_management(HUCs_layer, "HAVE_THEIR_CENTER_IN", feature_layer, selection_type="NEW_SELECTION")

    arcpy.CopyFeatures_management(HUCs_layer, selection_name)

I'm looking for a function to remove feature layers and I haven't been able to find one.

I realize I could put some sort of count in there or something to make each one unique within the scope of the program, but that's not ideal unless there is no way to remove feature layers.


texts: Raster conversion to vector with multiple fields retained

texts:
I have a raster which I have successfully polygonised using:
raster / conversion / polygonise (raster to vector).

However, my raster has multiple fields (data columns) within it and I've only been able to convert the first of these into my vector. I've done some online forum rummaging but can't find an answer.

What settings are needed to retain all data?

I presume it's something to do with the field name option, but can't figure it out.

I've added a picture to show what I mean about the different bands. The info shown is linked to one of the squares, I feel there should be a way to retain this in conversion.


texts: Downloading NDVI time-series using python API

texts: Are there examples of an API where I can pass a lat, lon, date-range and get NDVI time-series for that location based on Sentinel-2 data without having to download entire tiles and without having to run on GEE? I haven;t seen any complete examples of this e.g. with sentinel-sat API


texts:
Running lasground on input cloud produces no visible effect in lasview?

It runs and writes an output file, which seems unchanged from the input file, when viewed in lasview.

What could be wrong?


texts: QGIS connection to PostGIS showing wrong TYPE

texts:
I've got a user that it trying to edit his polygon layer but gets a message PostGIS error while adding features: ERROR:  Geometry type (Polygon) does not match column type (MultiPolygon) When you have a look at his PostGIS connection details, the TYPE reads as polygon but if I log as an administrator into PostGIS via QGIS and edit the same layer i dont get an error message but see the TYPE as multipolygon.

I'm not sure where the error lies, in PostGIS or with QGIS not updating itself!


texts:
I would like to do some watershed delineation at national/regional level (using SRTM-90 data).

I have experimented with r.watershed (GRASS 6.4.3) but it fell over when I tried to do big stuff.

I have tried r.terraflow (GRASS 6.4.3) but don't really know what I am doing with this... Seems quite old so maybe there is something better these days?

No luck with ArcGIS at all for big stuff (but available to me if somebody has a solution using this software).

Can anybody recommend practical tools for big watershed delineation projects?


texts:
I need to create a dock plugin for QGIS using QT designer and Python.
I've created a basic plugin in "plugin builder". Then I've changed the .ui so now I dont have standard QDialog box but a QDockWidget.
So now i have "plugin_module_dialog.py" that looks like that:

import os

from PyQt4 import QtGui, uic

FORM_CLASS, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), 'testing_module_dialog_base.ui'))

class testing_classDialog(QtGui.QDockWidget, FORM_CLASS):
    def __init__(self, parent=None):
        """Constructor."""
        super(testing_classDialog, self).__init__(parent)

        self.setupUi(self)

and "plugin_module.py" like that:

class testing_class:

    def __init__(self, iface):

        self.iface = iface

        path = os.path.dirname( os.path.abspath( __file__ ) )
        self.dock = uic.loadUi( os.path.join( path, "plugin_module_dialog_base.ui" ) )
        self.iface.addDockWidget( Qt.RightDockWidgetArea, self.dock )
        ...

Now when i run that plugin i get:

AttributeError: 'plugin_classDialog' object has no attribute 'exec_'

And the plugin window pops up normally. Not docked.
I am new to that. Please explain me what should I do to get working dock plugin.


texts: import arcpy failed Python 2.7 with ArcGIS 10.3 64-bit Background geoprocessing RuntimeError: NotInitialized

texts:
I want to run a python script that uses arcpy. It was running earlier on a 32-bit machine without problems. On a 64-bit machine I get a MemoryError. The 64-bit backgroundgeoprocessing of ArcGIS 10.3 should solve this problem. If I type import arcpy to the IDLE which is 64-bit too I get the following error message:

Traceback (most recent call last):
  File "<pyshell#20>", line 1, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\__init__.py", line 21, in <module>
    from arcpy.geoprocessing import gp
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 598, in <module>
    env = GPEnvironments(gp)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 595, in GPEnvironments
    return GPEnvironment(geoprocessor)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 551, in __init__
    self._refresh()
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 553, in _refresh
    envset = (set(env for env in self._gp.listEnvironments()))
RuntimeError: NotInitialized

To make sure I installed everything correctly:
ArcGIS 10.3 (Advanced Concurrent License);
ArcGIS 10.3 64-bit backgroundgeoproessing patch;
Python 2.7.9 x64

I also adapted the system paths fron ...\bin to \bin64 and from Python27\ArcGIS10.3 to \ArcGISx6410.3


texts: Where can I find information concerning rivers?

texts: I'm looking for information I can visualize in Google Earth concerning rivers, such as rapids, put-in points, take-out points, campsites, etc. Any idea how I can look for this kind of information?


texts: Using videos (as headers) in CartoDB Infowindows?

texts:
I need to know how to embed a video (YouTube or Vimeo) into an infowindow in CartoDB in the same way that an image appears as an image header. Potentially more complicated, when there is no video link I'd like an image to appear instead.

Can anyone assist me (as a non-programmer) with the code for this and WHERE to insert it in the HTML?

I have viewed the "How do you embed iFrame content into a CartoDB infoWindow?" question, but I cannot make that work for either YouTube or Vimeo videos. Also what I am asking for is for it to be a part of the "image header" in CartoDB which is not what that question answers.


texts: Extract the coordinates from a GeoJSON file that displays point on my Map in OpenLayers 4

texts:
Well I have this GeoJSON file :

{"type": "FeatureCollection", "features": [{"id": "1", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8039556,35.7903036]},"properties": {"gid":"1","name":"Tanger Ville","link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "2", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8053745,35.7896316]},"properties": {"gid":"2","name":null,"link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "3", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8035001,35.7894603]},"properties": {"gid":"3","name":"Tanger Ville","link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "4", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8026494,35.7909747]},"properties": {"gid":"4","name":"Tanger Ville","link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "6", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8000892,35.7912068]},"properties": {"gid":"6","name":"Tanger Ville","link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "5", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8034242,35.7892276]},"properties": {"gid":"5","name":"Tanger Ville","link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "7", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8055798,35.7912481]},"properties": {"gid":"7","name":null,"link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}, {"id": "8", "type": "Feature", "geometry":{"type":"Point","coordinates":[-5.8046302,35.7890426]},"properties": {"gid":"8","name":null,"link":"C:\\xampp\\htdocs\\final4\\img","layer":"Points"}}]}

I want to retrieve only the coordinates , I used this function but It didn't work

var features = point_layer.getSource().getFeatures();
                features.forEach((feature) => {
                console.log(feature.getCoordinates());
                });

it says " feature.getCoordinates is not a function" .

The main purpose is to get the coordinates to campare them to pixel clicked on map.


texts: How to get speed and acceleration from trajectory data?

texts:
I am using Java and netbeans as a IDE to develop a project. I have got some trajectory data by applying a spatial query. My question is, how can I get speed and acceleration for these trajectory data? Does java has useful library for me?
for more information: points has (x,y,z,t)


texts: How do I get GeoServer to run on my Web server?

texts:
Thanks to iant, dariapra, RK, & rangvald, as the combination of setting up the GeoServer Proxy in the interface, and making changes to the Apache-HTTP and Tomcat worked. I can now click on the OpenLayers and a new window pops up with a blank image within the map surrounding box, all within out IP Address.

So, solving one issue raised another.

I now need more assistance to fix the new pop up window (after I click the OpenLayers from the Layer Preview pane) in order to show the map that is to be displayed. Within the window, there is the bounding box, text in the bottom left hand corner "Click on the map to get feature info" as well as the bottom right hand corner "location", and in the IE window, the bottom left identifies a yield sign with paper behind it saying "errors occurred".

Is there a way to set this up so the map shows within the new pane after clicking the OpenLayers?

Again, thank you to those who have assisted me.

My initial question was: How do I configure GeoServer to show my shapefiles/maps on my Webserver(a specific location as http://www.name.net/geoserver) at work, and not on the localhost:8080?
The web server is running Apache and also tried the Tomcat install.
Any help is greatly appreciated.


texts: Windows & Python 2.7: Import and DLL load failed with GDAL 2.1.2

texts:
Is there a difference between the python-binaries with the gdal-core-setup and the libraries within the zip-files?

I used the zip-files due to the rights-management on my desktop-computer.

But please read for yourself:

I use following setup: Python 2.7.10, 32bit, compiled with MSCV 1500; Windows 7 64

According to this I downloaded the following zip-file from  gisinternals.com:

release-1500-gdal-2-1-2-mapserver-7-0-2.zip

I unzipped it and set all the environment variables according to Mr Szekeres' description:

SET "PATH=%SDK_ROOT%bin;%SDK_ROOT%bin\gdal\python\osgeo;%SDK_ROOT%bin\proj\apps;%SDK_ROOT%bin\gdal\apps;%SDK_ROOT%bin\ms\apps;%SDK_ROOT%bin\gdal\csharp;%SDK_ROOT%bin\ms\csharp;%SDK_ROOT%bin\curl;%PATH%"
SET "GDAL_DATA=%SDK_ROOT%bin\gdal-data"`
SET "GDAL_DRIVER_PATH=%SDK_ROOT%bin\gdal\plugins"
SET "PYTHONPATH=%SDK_ROOT%bin\gdal\python;%SDK_ROOT%bin\ms\python"
SET "PROJ_LIB=%SDK_ROOT%bin\proj\SHARE"

Please note, that %SDK_ROOT% is C:\Python27\GDAL in my environment

With this setup, Iam able to successfully run ogr/gdal-commands via windows-cmd, f.e.:

Unfortunately I cannot use the tools within python:

I had a look into the mentioned __init_.py file within the osgeo-python-bindings. There I checked, that the imp.find_module()-function is able to find the given '_gdal'-module and delivers back file, pathname and description as stated in the python docs

But when calling the the imp.load_module with this parameters the error occurs. It doesn't matter if I start python via cmd or via Idle.

Any idea what could be still wrong?


texts: Converting tif to format for TIMESAT using BEAM VISAT or ERDAS IMAGINE?

texts:
How can I convert tif image into a format for TIMESAT software to create a time series?

I am using BEAM VISAT or ERDAS IMAGINE program.


texts:
I am working on a road network for routing operations using postgis and QGIS.

I am new to both of these tools and need to calculate the slope for each edge (by retrieving the Z value for the start and end node for the edge from a raster). Any ideas of the best approach to this?

I know postgis can dump points and get the value from a raster, but can I get the slope attribute to the edge without breaking the network topology (with edges that have corresponding start/end nodes) using this method?

thanks


texts: My laptop is Windows 10. Can I install QGIS 2. 14 ? If not which version will support Windows 10?


texts: I'm struggling with a projection question.  I have some data in California State Plane and am trying to align a NED with NAD83.  I thought these would just natively align, but they don't seem to without project on the fly turned on in QGIS.  In ArcMap all is fine, I suppose because project on the fly is working there.  This works fine in the end, but when I try to export a raster layer from QGIS/Grass to be used in ArcMap, it projects about 2000 ft off with the data frame set to NAD_1983_StatePlane_California_V_FIPS_0405_Feet.


texts: Pixel-based and object-based classification!

texts:
I would like to understand if pixel-based classification algorithm (e.g. Maximum Likelihood classification ) can be used for object-based classification (i.e. after a segmentation procedure).
On the other hand,  can object-based classification algorithm (e.g. random forest, SVM) be used for pixel-based classification?


texts: GEE: Select random sample on known-NDVI-range for supervised classification

texts:
I intend to get random samples for training the supervised classification in Google earth engine.
The code here, for example, I calculate NDVI and mask out NDVI < 0.65 (i.e. NDVI >= 0.65 is vegetation). Then, I convert the regions to the vector region. And, I take random samples on the vector region.
For example, The number of samples I would like to get is 200. But, It returns more than 200.
The reason here, I guess due to vector layer contains many polygons.
So, any solution for this problem?

// region roi
var roi =
    /* color: #d63000 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[100.51605775066919, 13.73170620808265],
          [100.51605775066919, 13.620954851424335],
          [100.72239472576685, 13.620954851424335],
          [100.72239472576685, 13.73170620808265]]], null, false);

// Image collection
var cloudMaskL457 = function(image) {
  var qa = image.select('pixel_qa');
    var cloud = qa.bitwiseAnd(1 << 5)
          .and(qa.bitwiseAnd(1 << 7))
          .or(qa.bitwiseAnd(1 << 3));
    var mask2 = image.mask().reduce(ee.Reducer.min());
  return image
  .select("B[1-5]*")
  .updateMask(cloud.not()).updateMask(mask2);
};

var collection1 = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
    .filterDate('2003-01-01', '2003-12-31');

var l7 = collection1
    .map(cloudMaskL457)
    .median()
    .clip(roi);

// NDVI calculation
//var tool = require('users/Plant_phenology/functions:func_general');
//var ndvi = tool.diff_index(l7, 'B4', 'B3', "ndvi");
var ndvi = l7.expression(
    ' ((NIR - RED) / (NIR + RED))', {
      'NIR': l7.select('B4'),
      'RED': l7.select('B3'),
}).rename('ndvi');

// Mask out NDVI < 0.65
var vi = ndvi.updateMask(ndvi.gte(0.65));
var mask = vi.gte(0.65);
var vi = mask.multiply(0).add(1);
Map.addLayer(vi, {min: 0.5, max: 1}, "vege");

// Convert to vector
var vege = vi.reduceToVectors({
  reducer: ee.Reducer.countEvery(),
  geometry: roi,
  scale: 30,
  maxPixels: 1e8
});

// get random samples
var getSamples = function(image, samplesFcs, samplesPoints, nsamples, label){
  var samplesCollection = ee.List(samplesFcs).iterate(
    function(sample,totalSample){
        return ee.FeatureCollection(totalSample).merge(sample);
      }
    ,ee.FeatureCollection([]));

    samplesCollection = ee.FeatureCollection(samplesCollection);
    return samplesCollection;

    var randomPoints = ee.FeatureCollection.randomPoints(samplesCollection, nSamples, 1989);

      samplesPoints.forEach(function(points) {
        randomPoints = randomPoints.merge(points);
      });c

     return randomPoints;
};

var class4 = [vege];
var class4Points = [];
var nsamples = 200;

var test = getSamples(vi, class4, class4Points, nsamples);
print(test.size(),'samples Vegetation');


texts: Making a shapefile or kml tiles from a file that says it has no GCP

texts:
Learning my way through the GIS world, i was able to create a nice script to handle some geotiffed nitf files.    Could create png, thumbnails and even kmls from these files with GDAL.

Then I have another file type: .cos, and I can get imagery and thumbnails but cannot use gdal2tiles.py to build kmls from these.   That gives me an error (which my n00bness to gis stuff means little to me yet):

gdal2tiles.py -g geodetic -k IMAGE_XDetc.cos
Usage: gdal2tiles.py [options] input_file(s) [output]

gdal2tiles.py: error: There is no georeference - neither affine transformation (worldfile) nor GCPs. You can generate only 'raster' profile tiles.

Either gdal2tiles with parameter -p 'raster' or use another GIS software for georeference e.g. gdal_transform -gcp / -a_ullr / -a_srs

So it looks like there is no georference in the file, is it impossible to create tiles/kml or a shapefile (just a rectangle of where this would be on a globe) from these kinds of files?

I did a gdalnfo on this cos file type and got

python gdalnfo.py IMAGE_XDetc.cos
Driver: COSAR/COSAR Annotated Binary Matrix (TerraSAR-X)
Files: IMAGE_XDetc.cos
Size is 6048, 5993
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 5993.0)
Upper Right ( 6048.0,    0.0)
Lower Right ( 6048.0, 5993.0)
Center      ( 3024.0, 2996.5)
Band 1 Block=6048x1 Type=CInt16, ColorInterp=Undefined
Traceback (most recent call last):
  File "gdalnfo.py", line 613, in <module>
    sys.exit(main(sys.argv))
  File "gdalnfo.py", line 512, in main
    ( hBand.GetOffset(), hBand.GetScale()))
TypeError: float argument required, not NoneType

I am not sure what I am missing or how to process this file.   I know the UpperLeft and LowerLeft are coordinates I could use but as I posted in this help question :

Creating superoverlay from geotiff covered whole globe, shouldn't of?

I need other things besides that LowerLeft corner etc number to properly process this geo file into a kml for google earth or something.

EDIT:  Did find a GEOREF.xml file with some pieces of the snippet here:

There are a ton of these entries:

<gridPoint iaz="12" irg="22">
  <t>7.75109087050168455E-01</t>
  <tau>3.13007399728248718E-05</tau>
  <lat>3.13670474258092860E+01</lat>
  <lon>-1.10901922952670986E+02</lon>
  <row>6434</row>
  <col>5160</col>
  <inc>2.69587903322477729E+01</inc>
  <elev>-9.00217208666371427E+00</elev>
  <height>1.17917304198257625E+03</height>
</gridPoint>

There is like 312 or so of those entries above, and before that has a bunch of information on like signalPropegationEffects, rangeDelay, azimuthShift, platformParameterProcessing...which I am guessing this is all very specific data to the sensor that colleceted the information.   No idea if or what is needed to generate some nice KML for this to plot onto a virtual earth??b (more gdal commands?)  This script I have running is in python and works pretty well... and I can call through os commands from python gdal2tiles. If there is a command line solution, then cool!, if there is one i can programmatically use that might be better.


texts: Merging attributes from point with containing polygon?

texts:
I need to develop a process for merging the attributes of each point in a SDE feature class with a polygon in a SDE feature class that contains the point to create a third feature class. The third feature class should contain the attributes of the point with the geometry of the polygon. This seems to be a spatial join. Is that assumption correct?

The points represent incident locations. The polygons represent counties. The team is requesting I intersect the incident with the county to create the third feature class. There will be multiple incidents per county so they expect to see a row for each incident and the county geometry will be repeated.

I've been using ArcToolbox > Analysis Tools > Overlay > Spatial Join. Setting the Target Feature to the incidents layer and the Join Features to the counties layer yields the correct number of rows but the geometry is a point. I need a polygon. Switching the Target Feature and Join Features yields the correct geometry but not the correct number of rows.

How should I be approaching this?


texts:
I'm struggling with making Leaflet show a GeoJSON file. From what I can tell it's loading properly and according to geojsonlint.com and other websites the file is valid and displays properly there.

I'm not getting any errors in my debug console.

I originally had major issues getting my map to project properly with Leaflet, turns out that it's using some kind of weird local projection. (EPSG:32633)
I solved this issue by adding Proj4 and Proj4Leaflet to my project and setting up the map like this:

// Spatial reference
var crs = new L.Proj.CRS('EPSG:32633', '+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs', {
    origin: [-2500000.0, 9045984.0],
    resolutions: [
        21674.7100160867,
        10837.35500804335,
        5418.677504021675,
        2709.3387520108377,
        1354.6693760054188,
        677.3346880027094,
        338.6673440013547,
        169.33367200067735,
        84.66683600033868,
        42.33341800016934,
        21.16670900008467,
        10.583354500042335,
        5.291677250021167,
        2.6458386250105836,
        1.3229193125052918,
        0.6614596562526459,
        0.33072982812632296,
        0.16536491406316148
    ]
});

// Geodata maps
var GeodataBasis = L.esri.tiledMapLayer({
    url: 'https://services.geodataonline.no/arcgis/rest/services/Geocache_UTM33_WGS84/GeocacheBasis/MapServer'
});
var GeodataBilder = L.esri.tiledMapLayer({
    url: 'https://services.geodataonline.no/arcgis/rest/services/Geocache_UTM33_WGS84/GeocacheBilder/MapServer'
});
var GeodataGraatone = L.esri.tiledMapLayer({
    url: 'https://services.geodataonline.no/arcgis/rest/services/Geocache_UTM33_WGS84/GeocacheGraatone/MapServer'
});
var GeodataLandskap = L.esri.tiledMapLayer({
    url: 'https://services.geodataonline.no/arcgis/rest/services/Geocache_UTM33_WGS84/GeocacheLandskap/MapServer'
});

// Map
var map = L.map('map', {
    crs: crs,
    maxZoom: 17,
    minZoom: 2,
    attributionControl: false,
    layers: [GeodataBasis]
});

// Basemaps
var baseMaps = {
    "Kart": GeodataBasis,
    "Gråtonekart": GeodataGraatone,
    "Landskapskart": GeodataLandskap,
    "Flyfoto": GeodataBilder
};

// Add a map controller
L.control.layers(baseMaps).addTo(map);

However, when I try to add the GeoJSON data, nothing seems to happen at all. No errors, no warnings, nothing. It seems to load just fine, but never get added to the map at all.

var geojsonlayer = new L.GeoJSON.AJAX("../data/tracks.js", { local: true });
geojsonlayer.addTo(map);

When I take a look at the geojsonlayer variable, I can see that it loads the file. I'm at my wits end.

Here is the GeoJSON file I'm trying to load within Leaflet.

What am I missing here?


texts: Cross platform development when using GDAL

texts:
We want to use GDAL in our Java application and the application will deployed in different environment like Win/Linux/Docker. Out development env based on Win 10.
Since the GDAL java binding depends on the native library, and the native library is platform dependent.
So the packaged application will not work in another environment.
How do you solve that?


texts: Ways to extract DEM for urban areas using Google Maps?

texts:
Is Google maps' elevation API suitable to obtain the high resolution elevation data for areas that have 3D building such as Manhattan?  Would the API for example yield a significant different value on the street next to One WTC than on the roof? This is a prerequisite before I invest time in learning Javascript and how to use the API.

Edit: SRTM DEM is a far cry from the resolution/ quality of the 3d buildings map of Manhattan for example.

I am really interested in the elevation of these 3d shapes. Google should have this dataset and maybe it is available.


texts:
Whenever I execute this query:

SELECT ST_Length3D(ST_GeomFromEWKT('LINESTRING(0 0 0,5 0 3,5 10 5)'));

Postgresql is throwing an error:

  ERROR: function st_length3d(geometry) does not exist SQL state: 42883

but this query running fine and showing result:

SELECT ST_Length(ST_GeomFromEWKT('LINESTRING(0 0 0,5 0 3,5 10 5)'));

It seems that ST_Length3D is not added in my system defined function any idea how to recover this ?


texts: Kernel Density with quantity values in bands

texts:
I have very limited knowledge of ArcMap.

I am trying to use a density heat map to portray the number of incidents in an area. I have used the Kernel Density tool in ArcMap 10.1. However, instead of the standard output in the legends, I am wondering if there is a way I can set the parameters to show something like:

Color 1= 1-99 Incidents,
Color 2= 100-199 Incidents,
Color 3= 200-299 Incidents,
...

I believe that the normal output is the number of occurrences over the given search area.  This gives a good visual output as to where the greatest number of incidents are.

When trying to provide a quantity for a field unit how do I accurately change the information?


texts: PyQGIS esri ascii grid to .bil conversion

texts:
Esri ASCII GRID can be converted to esri .bil format by following way in a desktop
From QGIS desktop menu-->Raster-->conversion-->Translate(convert format)
How can I write a python code because I have 864 esri ascii grid data?


texts: Install the MySQL driver to work with GDAL on Mac OSX

texts:
How can I install the MySQL Driver to work with GDAL?
I have currently followed the following steps on my Mac:

Installed python 3.8 from python.org
Ran the following command to install gdal brew install gdal
Upgraded gdal to the latest version brew upgrade gdal
Checked the gdal version info using gdalinfo --version and response GDAL 3.1.2, released 2020/07/07
Installed gdal with python pip install gdal
Ran the following  snippet from the ogr cookbook to check for the available drivers

from osgeo import ogr
cnt = ogr.GetDriverCount()
formatsList = []  # Empty List

for i in range(cnt):
  driver = ogr.GetDriver(i)
  driverName = driver.GetName()
  if not driverName in formatsList:
      formatsList.append(driverName)

formatsList.sort() # Sorting the messy list of ogr drivers

for i in formatsList:
  print (i)

but did not find the mysql driver in the list
JPEG2000
KML
MBTiles
MSSQLSpatial
MVT
MapInfo File
MapML
Memory

I even tried installing the mysql-connector-python
and
brew tap osgeo/osgeo4mac
brew install osgeo-gdal-mysql

but no luck with that either.


texts: How To Invoke Anonymous Function on Map Load

texts:
I have a JS code like this which I have assigned an anonymous function to photos variable in map.on("load", function() {} now it seems the photos is never invoking! as even I tried to do a simple console.log("Is This working") it is not loading the log!

I am using the second function instead of ESRI's builtin esriRequest(); since the native function is already taking URL to read JSON file from server but I am making points dynamically on fly. so I tough I must use mu own function here.

 var photos;
 map.on("load", function() {
          domStyle.set(query("a.action.zoomTo")[0], "display", "none");
          photos = function(){
            for (var i = 0; i < projects.length; i++) {
            var point = new Point(projects[i].Longitude, projects[i].Latitude);
            var pointSymbol = new SimpleMarkerSymbol();
            pointSymbol.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
            pointSymbol.setSize(9);
            var pointInfoTemplate = new InfoTemplate();
            pointInfoTemplate.setTitle("Project Details");
            pointInfoTemplate.setContent('   ');
            var pointGraphic = new Graphic(point, pointSymbol).setInfoTemplate(pointInfoTemplate);
            points.push(pointGraphic);
        }
        for (i = 0; i < points.length; ++i) {
            map.graphics.add(points[i]);
        }
        console.log(points);
        };
            photos.then(addClusters, error);
        });

Can you please let me know why this is not working?


texts: How to group POIs and display labels for all members of the group?

texts:
My client have POI coordinates she wanted to be mapped. She define a fixed extent in wish all POI should be mapped at that extent.
I got a cluttered points at that the extent, is there a way so i can group the poi into many group, where each group are nearby poi that will be represented as one point at map and displays label for all member of the group?

I am using QGIS 2.8.3


texts: Calculate line density in multiple overlapping polygons

texts:
I am working with two layers. One is polygons (animal locations buffered by 5 km), and the other is polylines (for example, roads). I would like to calculate the line density for each polygon, separately.

I did this for multiple other buffer sizes (ex 2km) and was able to do it easily by creating a line density raster, and then using Zonal Statistics as Table to extract the mean pixel value.

However, when I run this with my 5km buffers, I get a number of errors such as "number of unique values exceeds 500 .." and "Error in executing grid expression". I'm afraid my raster cell size might be too small (ie many unique values), but I would like to continue using this raster layer, if I can.

Anyone have any other ideas as to how I can extract this information? I've also tried Extract my Mask, playing around with Line Density, and Isectpolyrast in GME, to no avail. I'd also like to avoid running this for each polygon separately, as there are hundreds of thousands, unless I can write a python script (my coding isn't up to par...).


texts: Defining "Window" in Google Maps JavaScript API v3?

texts:
I am trying to use Google Maps Javascript API in a java application through Nashorn (basically lets you run javascript in java). Anyway when I load the API I get an error that "window" is not defined in the API.

Does anyone know where I might be able to find documentation on "window" or where in the API it might be defined?


texts: Can I consider QGIS OpenLayers basemaps as WMSs?

texts: I am writing a manuscript about QGIS, and I categorized the data types into 3 classes according to popularity (raster, vector, web-data). Then I separated web-data to WMS and WFS. Under the heading WFS I introduced the OpenLayers Plugin in QGIS as WMS basemap catalog, am I right?


texts: Getting Original Size from Tiled PostGIS Raster

texts:
Does anybody know of a quick and easy get the original height and width (rows and columns) of a tiled raster in PostGIS?

Using a combination of items I know this can be calculated so just wondering if there is a canned function I am missing somewhere.  I am running PostGIS 2.1.4.


texts: How to set urban areas to NoData in a DTM?

texts: In ArcGIS 10.1, I have a DTM and a polygon layer representing urban areas. For processing reasons, I want to exclude the urban areas from the DTM (i.e., setting urban areas to NoData). How can I accomplish that? My guess is that I have to preliminary convert the polygon layer to raster, and then using Raster Calculator. But I am stuck on this latter step.


texts: How can I make a raster surface out of bathymetric points that are not equally spaced? The points are from a USGS hydrographic survey of a section of the Ohio River. I need to make a depth profile map for a school project. I have attached an example of the bathymetric points.