texts: ArcPy: DDP Error in exporting only occurs with "SELECTED"

texts:
I'm trying to use DDP (Data Driven Pages) and am running into a problem. I'm using  arcpy.SelectLayerByAttribute_management to select a series of records, and then trying to use the ddp.exportToPDF(pdfddp, "SELECTED") but keep running into an error (below). It shouldn't be the select by attribute function as I run it in ArcMap and it runs correctly and I can see the selected features highlighted. Also, I can successfully use the ddp.exportToPDF(pdfddp, "CURRENT") but what I need is to be able to have a user select a series of features and have those be passed.

 mxd = arcpy.mapping.MapDocument("C:\\temp\\Graffiti_DM4.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
pdfddp="C:\\temp\\pdfddp1.pdf"
arcpy.SelectLayerByAttribute_management("C:\\temp\\test.lyr","NEW_SELECTION", '"Incident_Z" ='  + "'10002'")
ddp.exportToPDF(pdfddp, "SELECTED")

And here is the error

Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
    return fn(*args, **kw)
  File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\_mapping.py", line 446, in exportToPDF
    return convertArcObjectToPythonObject(self._arc_object.exportToPDF(*gp_fixargs((out_pdf, page_range_type, page_range_string, multiple_files, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info, jpeg_compression_quality, show_selection_symbology), True)))
AttributeError: PageLayoutObject: Error in exporting pages

As always, any help is EXTREMELY appreciated!


texts: Importing .sbx, .dbf, .prj, .idx, and .sbn files into ArcMap?

texts: I tried to open bathymetry map to the ArcMap but I just can open .shp file but I could not open other files accompanied with shp file because of the file type. How do I import .dbf, .prj, .sbn, ,sbx, file to the ArcMap?


texts: Python error while executing plugin GFA in QGIS 2.14.22

texts:
While processing with plugin GFA still loading 3% and error. anyone have solution for this issue?
An error has occurred while executing Python code:

KeyError: 7.0
Traceback (most recent call last):
  File "C:/Users/asus/.qgis2/python/plugins\GeomorphicFloodIndex\doGeomorphicFloodIndex.py", line 732, in accept
    x=x+di[fd]
KeyError: 7.0

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.14.22-Essen Essen, 6af20113ec

Python Path:
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python
C:/Users/asus/.qgis2/python
C:/Users/asus/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.14/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS2~1.14\bin\python27.zip
C:\PROGRA~1\QGIS2~1.14\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.14\bin
C:\PROGRA~1\QGIS2~1.14\apps\Python27
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/asus/.qgis2//python
C:\PROGRA~1\QGIS2~1.14\apps\qgis-ltr\python\plugins\fTools\tools


texts: How to place coordinates points on a vector layer?

texts:
I have got GPS coordinates collected from a number of farms in my country (Malawi). But when I plot these GPS coordinates on a vector layer (my country map) using QGIS, the points are falling outside the country. Actually the points fall in Indian Ocean.

The coordinates were collected in decimal degrees. I tried to change them from decimal degrees to UTM still it did not work. The CRS in a GPS gadget was WGS84 same was used in QGIS. Pleases help?

These are some of the coordinates:

S 15.04074, E 34.71926, 1037 m
S 15.05633, E 34.71407, 1053 m
S 15.03052, E 34.70221, 1165 m
S 15.03939, E 34.69643, 1334 m


texts: How to use ITrackCancel to escape IRubberBand track?

texts:
I have a BaseTool for AX_MapControl and AX_PageLayoutControl that allows to draw a polyline via IRubberBand. But once the rubberband is started, you can't cancel it e.g. by hitting escape. I found ITrackCancel but unfortunatly no way to use it properly.

ITrackCancel2 esc = new CancelTrackerClass();
esc.CancelOnKeyPress = true;
esc.Reset();

IRubberBand2 rubberBand = new RubberLineClass();
IGeometry geometry = rubberBand.TrackNew(screenDisplay, null);
IPolyline polyline = (IPolyline)geometry;

How do I use ITrackCancel to cancel the rubberband tracking?

Update:
ITrackCancel can be retrieved from IScreenDisplay but my m_hookHelper.ActiveView.ScreenDisplay.CancelTracker is null. I use the tool with AX_MapControl and AX_PageLayoutControl.

Update 2:
I found out, that even Esris own tools like esriControls.ControlsNewLineTool can't be canceled with escape in my application. Maybe there is a deeper flaw somewhere. Going to dive deeper into it...

Update 3 (Solution):
There is a glitch in my WPF application. It seems, that on startup no key events arrive the MapControl until you change the window size once. So this is not a problem with ITrackCancel but with the interaction between WPF and ArcEngine.
Thanks anyways for your help.


texts:
I have data for Chicago, Illinois, that is in WGS84 CRS. I need to convert it to a metric projected CRS, and I've found several possible options:

EPSG 3528
EPSG 6454
EPSG 2790
EPSG 26971

Among these, 6454 seems to have the latest revision date. Other than that, how should I know which one is the "best"? I don't have any special requirements (or perhaps I don't know what I should look for...)


texts: How to split a large point vector layer in QGIS?

texts:
I need to split my shapefiles into much smaller pieces so that I can upload them onto the Postgis server. Shapefiles have DBF files with 14 Go (1,000,000 rows) and I need them to be under 2 Go.

I've tried selecting 100,000 rows to then try and save the selected features as a different file but QGIS just instantly freezes.

Is there a better way to do this?


texts:
Working for an environmental agency, they ask me to edit in ArcGIS the sizes of the buffers for the same layer.

Is that possible to change it using python in the field calculator?

If yes, I seek an example of python code or if there is another way I'll take too.


texts: Browser support for ArcGIS API for JavaScript?

texts:
Can anyone give me information or a good pointer on browser version support in the ESRI ArcGIS JavaScript API v2.4?

I can't find much in their documentation beyond changes in support for specific browsers in each API version's "What's New".

I have seen that the API uses SVG for some client-side rendering, which must affect cross-browser support. Beyond this I imagine there are some peculiarities for older versions of all major browsers.

I will most likely be targeting recent versions of desktop-based browsers in my upcoming project but I would like to know any issues in advance as we are probably going with JavaScript over Silverlight specifically for the wider platform support.


texts: What are the bugs in this code using leaflet-heat + leaflet-sync?


texts: How do I upgrade from PostGIS 2.0 to 2.1?

texts:
I'm using homebrew on OSX. I have a working postgres 9.2 + postgis 2.0 database installed.

The main problem is that the 9.2 dump contains all the postgis 2.0 tables and functions, which don't need to be imported.


texts:
I am a bat enthusiast and volunteer regularly with the local bat groups on bat surveys. In them we record bats with a bat detector - making a note of the different species (there are 18 in the UK), the activity and its location on a map (which can be inaccurate). Once home I will then take this information and on word put different coloured dots (depending on the species) on a digital map to be sent away to be filed. I was wondering if there a way to do the recording part on my android phone.

I've downloaded various waypoint recording app which give me a gpx or kml file. With this i need a mapping system that can take this information and lay it onto a chosen map. also, the program needs to be able to distinguish between the various colours (species) and these colours need to show up on the map. Also, if there are more than one species recorded on the same location the dot needs to be twice its size. so to reiterate the program needs to give me flexibility to modify what the dots look like.

hope someone can help.

thanks.


texts: Why does this R code that maps points into polygons cause a segmentation fault?

texts:
As in this question/answer, I have a data frame of points (which also includes some necessary, non-coordinate data columns) and a shapefile. In this case the shapes are US states. The last line of the following code causes a segmentation fault:

library(dplyr)
library(ggplot2)
library(magrittr)
library(sf)
library(USAboundaries)

# Load state shapefile from 1990 Census
map <- USAboundaries::us_states(map_date = "1991-01-01", resolution = "high",
                                states = c("CA", "OR", "WA", "NV")) %>%
  select(state_name, geometry)

map %>%
  ggplot() +
  geom_sf(aes(fill = state_name))

# Firm/business identifiers, coordinates, and book values
firms <- data.frame(
  "firm_id" = c("A", "B", "C"),
  "lon" = c(41.245696, 38.573965, 44.235577),
  "lat" = c(-118.484406, -121.264677, -115.873234),
  "book_value" = c(15174, 482020, 238592)
)

pnts_sf <- do.call("st_sfc",c(lapply(1:nrow(firms),
                                     function(i) {st_point(as.numeric(firms[i, c("lon", "lat")]))}),
                              list("crs" = 4326)))

pnts_trans <- st_transform(pnts_sf, 2163)
map_trans <- st_transform(map, 2163)

# intersect and extract state name
firms$state <- apply(st_intersects(map_trans, pnts_trans, sparse = FALSE), 2,
                     function(col) {
                       map_trans[which(col), ]$state_name
                     })

The traceback is straightforward:

Traceback:
 1: CPL_geos_binop(st_geometry(x), st_geometry(y), op, par, pattern,     prepared)
 2: st_geos_binop("intersects", x, y, sparse = sparse, prepared = prepared)
 3: st_intersects(map_trans, pnts_trans, sparse = FALSE)
 4: apply(st_intersects(map_trans, pnts_trans, sparse = FALSE), 2,     function(col) {        map_trans[which(col), ]$state_name    })
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault

I'm using R 3.5.2 and sf 0.7-3, if it helps. I'm assuming this is a bug in my code and not the libraries, but can someone replicate this? Is there something wrong with my code?


texts: Dissolve and join features based on an attribute range

texts:
I have a CSV file of Postal Codes containing average energy usage information. Furthermore, I have Feature Classes (both points and polygons) of Postal Code areas in a File Geodatabase. I wish to join these files based on Zip Code. However, due to privacy reasons, some of the Postal Codes are reported as Postal Code ranges in one row in the CSV file. The CSV file is structured as shown in the picture.

Note that Postal Codes AC, AD and AE form a range, as well as Postal Codes AH to AK. So in essence, it is a CSV file of Postal Code ranges.

In order to Join the data from the CSV file to the Postal Code Area geometry, I require a unique field on which to base the join. Simply joining on postal code will not work because the CSV data concern postal code ranges and not actual postal codes. Of course the ranges have a unique ID (index), but I cannot join these to any attribute in the Postal Code area Feature Classes.

The solution is probably to assign the unique ID of the postal code ranges to the postal code Feature Classes, and then dissolve on that unique ID. However, there is no attribute on which to base a join in the first place, so an alternative solution is required.

I have a theoretical solution, but I do not know yet how to implement it. It involves the following steps:

Export the CSV to a File Geodatabase table in the same GDB that contains the Postal Code area Feature Class.
Each Postal code area in the Feature Class receives a unique number from 1..n. We call this unique number indexNum.
Table join is performed on ZipCodeFrom and the joined table is exported to a new table. The new table is again joined on ZipCodeTo and again exported to a new table. This results in two attribute fields that contain the unique numbers from both the ZipCodeFrom and ZipCodeTo fields.
A new attribute (called indexRange) is made in the range table which combines both unique numbers in a semi-colon separated value, as such: 1;1, 2;2, 3;3, or, in the case of a range: 4;6.
The next step would involve creating a new, separate table which splits the numerical ranges, but which preserves the range as an index, called indexRange. The picture below illustrates this.

This new table is joined to the Postal Code areas based on both indexNum and splitRange. This way the rangeID attribute is transferred to the Postal Code areas.
The Postal Code areas are dissolved on the rangeID field.
Finally, the dissolved Postal Code areas can be joined to the Postal Code ranges using the rangeID field in the Postal Code feature class and the indexRange field in the Postal Code ranges.

I think I can execute all steps except step 5: how to create a new table which splits the ranges and retains the ranges as an index? I imagine this might be possible using a Python script, but I do not know Python well enough to write it myself.

I work with ArcGIS 10.3.1 for Desktop.


texts: How to batch the import of DWG files in QGIS?

texts:
I can import and open DWG files to geopackage one-by-one with the

  Project -> Import/Export -> Import Layers from DWG/DXF

command.
This window use the QgsDwgImporter cpp function: https://github.com/qgis/QGIS/tree/master/src/app/dwg

Can I call this function from PyQGIS for batch import?


texts: TableToGeodatabase result to Attribute Index

texts:
I am converting a csv to a Geodatabase, then I want to add an index using the AddIndex_management().  How do I get the output of the TableToGeodatabase() method to be a layer I can use as the input for the AddIndex_management() method.  I tried using result.getOutput(0), but that did not seem to work.

def convert_csv(csv_file, ws):
    '''converts csv to geodb'''
    parcel_info_fc = arcpy.TableToGeodatabase_conversion(csv_file, ws)
    return parcel_info_fc
    '''This doesn't return anything, it simple transfers something,  I need to figure out
    how to create an output.'''

def add_attri_index(feature_class, index_field, ws):
    '''adds attribute index to parcel info table
    and the parcel shape file table'''
    arcpy.env.workspace = ws
    print("Working on index for ", feature_class)
    arcpy.env.workspace = ws
    arcpy.AddIndex_management(feature_class, index_field, 'PI2', 'NON_UNIQUE', 'NON_ASCENDING')

    time.sleep(10)

def main(csv_file, parcel_layer, ParcelID_field, ws):

    parcel_info = convert_csv(csv_file, ws).getOutput

    add_attri_index(parcel_layer, ParcelID_field, ws)
    add_attri_index(parcel_info, 'APN', ws)

I get a RuntimeError: Object: Error in executing tool. I am guessing this is because the result type from my convert_csv function is a <bound method Result.getOutput of <Result 'D:\\...\\MyGeoDB.gdb'>>


texts:
I have an application on a SLL domain. Loading all the ArcGIS Javascript files is correctly done over https. But when actually using the application, the tiles of the basemap are loaded over http, resulting in security warnings in firefox en chrome. You can see it working at https://topografieindeklas.nl/topotrainer/nederland/.

Edit: For debugging I isolated the script at https://topografieindeklas.nl/SSLtest.php. The code would be down to snippet below (I know this is legacy code; AMD made no difference whoever).

Edit2: from there, it becomes more clear where things go wrong. Looking at the JSON url, the tile sub-servers are having http instead of https!

Edit3: As it turns out, this is caused by a Bug on Esri's side. Their planing to fix it in the March release of ArcGIS Online. As a workaround a Proxy is suggested.

What could be causing the tiles being loaded over http, while the rest of the page is loaded over https?

<link rel="stylesheet" href="https://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.7/js/esri/css/esri.css">


texts:
I just stumbled across something weird: I had point-data in EPSG:3059 and wanted to add the coordinates to the attribute table using $x resp. $y - which returned NULL. x($geometry) on the other hand worked out.

Which leads me to the question: What exactly is the difference between the two functions?


texts:
Using my standalone pyqgis application the user is able to draw moving points with an refresh rate of 1 second. These points come from a sensor that moves around and transmits data over a wireless network. While running, maplayers can be switched on and off. Some layers have a lot of features, so it happens that the canvas is refreshed before the background layers are drawn completely. This results in an unexeptable flickering.

Is it possible to preload and cache a maplayer without actually draw it, such that drawing it is much quicker?

The application is build upon QGIS 2.8 on a Linux machine, which is a hard requirement.


texts: How to include a Mapbox Studio Tileset in Leaflet?

texts:
I would like to include in my Leaflet map a vector tile set that I uploaded to Mapbox Studio. I first uploaded a tileset to the tiles page of Mapbox studio. Then I created a new style and added my tile set to this style. I would like to include the vector tile set in my Leaflet map by referencing the protobuf file URL with VectorGrid. Like this...

L.vectorGrid
  .protobuf(
    <the protobuf URL>,
    getTileOptions....
  )

I believe this is the correct URL. https://api.mapbox.com/styles/v1/gideongrossman2/ck9i7cvp32an61ik0p8ciublg/tiles/256/{z}/{x}/{y}@2x?access_token=pk..xxxxxxxxxxx-jw4dvQ However, when I go to this page. For example, substituting 7/32/38 for {z}/{x}/{y}, to see part of Illinois, the screen is black. I think I might have created a style and am in fact looking at it, however it appears I have made the style completely black. All I need to import into my Leaflet map is the outlines of zip codes. What is the simplest way to create a tile set that I can import into a Leaflet map that just includes the zip code boundaries? I started with a shapefile from the US Census Bureau's shapefiles repository.


texts: Selecting max values using Dissolve + keeping other fields?

texts:
I have a large feature class table with wind measurements from weather stations. It has the following fields:

Station ID field (repeated hundreds of times)
Measurement result
Date of the measurement

I'd like to select the highest measurement result from each of the stations and preserve both the measurement result and the date fields.

Using Dissolve tool (with the statistic field set to max for the measurement field) means I lose the date field. A later join will not give the exact date for the highest measurement.

I've considered Split features by station ID to iterate selecting the highest value (with the aim of merging them with only the selected max values), but cannot find a SQL expression that returns the max measurement value. I've tried

    [MeasurementField] in (SELECT max([MeasurementField]) FROM WindMeasurementTable)

But with no success.

I am using both ArcGIS Desktop 10.3 and Pro.


texts: Is there a WFS and WFS-T Java library that plays nicely with Android?

texts:
I have a GeoServer database and various programs that query it and so forth using GeoTools. Now I'm making a map app for Android, but not only is GeoTools quite large with all it's dependencies (15 mb after stripping out everything I don't need), but it doesn't like working with Android (first, it has an awful time failing to compile, but even if it did finish, I know that JDom, at least, doesn't work on Android).

Considering I only need WFS and WFS-T, is there any other Java library(ies) that I can use? Something more lightweight, hopefully.

EDIT: This is for adding a feature to an app I've already been working on for quite some time, which is why I'm looking for something this specific.


texts: How do I accurately resize a map to match the scale of the next map I want to build a bigger map from?

texts:
I have exported a group of maps that I want to tile together in Illustrator.  Since the maps are not of the same scale I tried calculating the factors between each scale to the largest number of map scale sizes, hoping to multiply the smaller maps to match the alpha map size proportionally.  That thinking did not work in application.
Can I figure out a formula to resize the smaller maps to match the largest map numerically?
I do not want to have to scale using Illustrator's center point-based resize.


texts: Why does transformation of coordinates to UTM fail with GDAL in R

texts:
I have a CSV-list of coordinates that I know are coordinates in Gauß-Krüger (Transverse Mercator) and I want to transform them to UTM in R with GDAL.
I read the csv in, separated the columns, added the original source proj4string while creating a SpatialPoints object. Then I tried to transform the data with ogr2ogr but always get the error message:
"Error in as.character.default(new("SpatialPoints", coords = c(3480702.68,  :
no method for coercing this S4 class to a vector"
library(gdalUtils)
library(rgdal)
library(rgeos)
library(sp)

ExamplePoints <- read.csv2("C:/Users/Desktop/Test.csv", header = TRUE,
  dec = ",")

points_SRC <- ExamplePoints[3:4]

ExamplePoints_SRC <- SpatialPoints(points_SRC,
  proj4string=CRS("+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0
  +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m
  +no_defs"))

Transform_test <- ogr2ogr(src_datasource_name = ExamplePoints_SRC,
  dst_datasource_name = "C:/Users/Desktop/Test.shp", f = "ESRI
  Shapefile", t_srs = "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996
  +x_0=32500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m
  +no_defs", s_srs = "+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000
  +y_0=0 +ellps=bessel +towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7
  +units=m +no_defs", a_srs= "EPSG:4647")

I do not understand the error message. What kind of input does ogr2ogr expect instead? I could not get an answer to this until now unforunately.
Did anyone experience a similar error or does understand what GDAL wants instead?
This is how the CSV file looks like in the editor (the decimal separator is ',' and the column separator is ';' :
point number;source CRS;x;y;target CRS;x;y
1;31467;3480702,68;5380141,08;4647;32480635,05;5378428,48
2;31467;3516958,39;5423993,28;4647;32516876,30;5422263,10
3;31467;3533028,71;5384162,09;4647;32532940,13;5382447,91
4;31467;3504712,87;5405841,58;4647;32504635,69;5404118,72

This is the table of coordinates before the making a SpatialPoint object out of it:


texts: Showing popup on mouse-over, not on click using Leaflet?

texts:
Is it possible in Leaflet that popup opens on mouse-over, not on click?

This is working for just one marker at a time, but I need it for a bigger number of markers:

marker.on('mouseover', function(e){
    marker.openPopup();
});


texts: Clustering Markers from a KML file within openlayers

texts:
Is there a way to cluster markers within openlayers as there is within leaflet.
I have many markers which display the various listed buildings within wales and I am wondering if I am able to cluster them and then as a user zooms in the clusters get smaller until an individual marker is left.
And then on zoom out a the markers regroup/cluster showing a cluster with numbers on such as how many markers are within a set distance of lets say 10 miles or so?
Is there also a way to ensure that when a cluster size is at 1 it could show the LSMarker style being that of the original cross showed in the image below?
Link to current project so you can see what I mean by the need to cluster data:
https://ces-web2.southwales.ac.uk/students/18018815/mitchtut/giscw2/openlayer.htm

UPDATE 1 (THIS ISSUE HAS BEEN SOLVED)
Currently getting the error
current code

Uncaught ha {message: "Assertion failed. See https://openlayers.org/en/v4.6.5/doc/errors/#58 for details.", code: 58, name: "AssertionError"}

UPDATE 2
Error fixed but geo data not loading within correct area
Current code
var distance = document.getElementById('distance'); //getting the distance from the slider

<!-- var count = 1000; -->
<!-- var features = new Array(count); //creating an array to hold the amount of features for the cluster -->

<!-- var e = 4000; -->
<!-- for (var i = 0; i<count; i++){ -->
<!-- var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e]; -->
<!-- features [i] = new ol.Feature(new ol.geom.Point(coordinates)); -->
<!-- } -->

var clusterSource = new ol.source.Cluster({
        distance: parseInt(distance.value,10),
        source: new ol.source.Vector({
                url: 'geoJSON/LSB.kml',
                format: new ol.format.KML({
                extractStyles:false,
            }),
        })
    });

var styleCache = {};

var clusters = new ol.layer.Vector({
    source: clusterSource,
    style: function (feature) {
        var size = feature.get('features').length;
        var style = styleCache[size];
        if(!style) {
            style = new ol.style.Style ({
                image: new ol.style.Circle({
                    radius:10,
                    stroke: new ol.style.Stroke({
                        color:'#fff'
                    }),
                    fill: new ol.style.Fill({
                        colo:'#3399CC'
                    })
                }),
                text: new ol.style.Text({
                    text: size.toString(),
                    fill: new ol.style.Fill({
                        color:'#fff'
                    })
                })
            });

            styleCache[size] = style;
        }
            return style;
    }
});

var raster = new ol.layer.Tile({
    source:new ol.source.OSM()
    });

distance.addEventListener('input', function(){
    clusterSource.setDistance(parseInt(distance.value));
});

//instantiation of the map within the div class 'mapspce'
var Omap = new ol.Map({
    layers:[raster, clusters],
    target:'mapspce',
    view: new ol.View({
        center: ol.proj.transform(cWales,'EPSG:4326','EPSG:3857'),
        zoom: 8
    })
});


texts:
I installed an addIn toolbar for the U.S. Geological Survey's National Cooperative Geologic Mapping Program and I can see it, but all the tools are greyed out.

Any idea why I can't see it? I am inserting a jpg of what I see.


texts: Time Series of buffered geometry point in Earth Engine

texts:
I am trying to plot a time series of MODIS Aqua chl from a geometry point that has been buffered. The single point works but every time I used the buffered point it says:

  Error in map(ID=A2018001): Image.reduceRegion: Too many pixels in the
  region. Found 41018279, but maxPixels allows only 10000000. Ensure
  that you are not aggregating at a higher resolution than you intended;
  that is a frequent cause of this error. If not, then you may set the
  'maxPixels' argument to a limit suitable for your computation; set
  'bestEffort' to true to aggregate at whatever scale results in
  'maxPixels' total pixels; or both.

Is there a solution to this issue?

var locations = [China.buffer(100000), LA.buffer(100000), CB.buffer(100000)]
var pts = ee.FeatureCollection(locations)
print(pts)
Map.addLayer(pts)

var ChinaBuff = ee.Geometry.Point(125.44074307149285,32.56968304972528).buffer(100000)

// Compute the mean sea surface temperature (SST) value for each pixel by
// averaging MODIS Aqua data for one year.
var chl = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI')
            .select(['chlor_a'])
            .filterDate('2018-01-01', '2020-06-01')

print(chl)

// Create and print the chart.
var chart = ui.Chart.image.series(chl, China, ee.Reducer.mean(), 30)
print(chart)

// Create and print the chart.
var chart = ui.Chart.image.series(chl, ChinaBuff, ee.Reducer.mean(), 30)
print(chart)

code: https://code.earthengine.google.com/5a5582e84cc3324c832ded4752192e19


texts: Module QGIS work in Pycuda processing it through the card

texts:
Is it possible when I speak through processing.runalg('saga:changegridvalues)
format rasters .tiff there was a process not through the processor and graphics card through, that would speed up the processing and working with rasters larger


texts: I am working in an project.I have a point Shapefile its projection is NAD83(HARN)Pennslyvaniasouth(ftUS)*EPSG3365* when I measure its distance(between two points) it gives me the answer in feet .yes its acceptable for me.I also calculated its x-coordinate and y-coordinate for the points in field Calculator it displays me the answer in feet.This is the problem.In my company they are insisting me to show the LAT-LONG value in Decimal Degrees.Is it possible to show the Lat-long in Decimal degrees in QGIS?


texts: How to get feature class name using ogrinfo

texts:
I am importing kmz into postgres

  $ogrCommand = 'ogr2ogr -f "PostgreSQL" -a_srs "EPSG:4326" PG:"host='.env("DB_HOST").' port='.env("DB_PORT").' user='.env("DB_USERNAME").' dbname='.env("DB_DATABASE").' password='.env("DB_PASSWORD").'" -append '.$absFilePath.' -nln '.$schema_table.' -sql "SELECT *,'.$proj_id.' AS project_id,\''.$dbFileName.'\' AS filename,\''.$this->generateRandomFileCode().'\' AS filecode FROM '.$fileName.'"; echo $?';

I need to get feature class name from ogrinfo filename
currently, I am getting this using below command

ogrinfo SampleOperationArea_v2.kmz

  INFO: Open of SampleOperationArea_v2.kmz

  using driver `LIBKML' successful.

  1: SampleOperationArea

I just needed SampleOperationArea name.


texts: Creating osm2pgsql hstore tags using PostGIS column

texts:
This is the opposite question to this one: Creating columns in PostGIS using osm2pgsql hstore tags

First, I changed default.style to make separate 'lanes' column. Then I extracted osm database using osm2pgsql with --hstore.
Now I want to have 'lanes' column moved to tags instead of separate column. How to do this?

Will simple

UPDATE table
SET tags->'lanes' = lanes;

work?
After this I would like to restore default.style to default (without lanes column), so that next data will be extracted in my desired form.


texts: How to select multiple features by mouse click event in ArcGIS JS API 3.x

texts:
I am trying to select multiple features in a feature layer by using "hold 'ctrl' button and mouse click event". I am using ArcGIS JS API 3.x.
I have created the US State boundary FeatureLayer by using FeatureCollection and able to display the layer on map. User wanted to select multiple states by mouse click while holding 'ctrl' or 'alt' key.
var featureLayer = new esri.layers.FeatureLayer(featureCollection, {
    id: stateLayer,
    opacity: 0.30,
    visible: true,
    infoTemplate: infoTemplate
});
g_esri.map.addLayer(featureLayer);
featureLayer.on("click", onBoundaryClick);

function onBoundaryClick(evt) {
    var g = evt.graphic;
    g_esri.map.infoWindow.setContent(g.getContent());
    g_esri.map.infoWindow.show(evt.screenPoint, g_esri.map.getInfoWindowAnchor(evt.screenPoint));
    formatInfotemplate(false, g);
}

I tried to follow some of the below links,
a. https://community.esri.com/t5/arcgis-api-for-javascript/selecting-multiple-features-with-graphics/m-...
b. https://community.esri.com/t5/arcgis-api-for-javascript/select-multiple-features-by-mouse-clicks/td-...
But couldn't able to get through,
Any help welcome


texts: Zoom to and Spiderfy MarkerClusterGroup, open popup of target marker

texts:
I am trying to zoom to a specific marker and open its popup using an external onclick event. To achieve this I need get the leaflet ID of the target marker, spiderfy the MarkerClusterGroup and call openPopup() on my target marker. I am able to to do all of this, however it takes 2 clicks to complete. Is there a way to do this with one click?

JsFiddle here


texts: How to use Eclipse/PyDev's debugger with ArcGIS

texts: Has anyone successfully been able to configure ArcGIS 10 to use PyDev's debugging server for debugging?  How do you set that up?  I have PyDev working fine by itself, with ArcPy working fine, but I can't bind the debugger to scripts I run from ArcToolbox.  I notice you can specify a debugger in ArcGIS, so I was wondering if it's possible to use the PyDev debug server.  Anyone have opinions/tips/guidance?


texts: How to build a GRASS network with node IDs from the line dataset?

texts:
I have a dataset of street network links (line geometries). Each network link has a link id, start node id, and end node id attribute. I want to use this network in GRASS, so after importing the lines, I want to create the network nodes. v.net node should create the nodes but as the docs say "nodes created and stored in data layer 2 will not have any associated attribute information".

My question therefore is: How to get the node id information from the links to the nodes?

Input:

line layer

line id | from node id | to node id
123     | 901          | 902
124     | 902          | 903
125     | 902          | 1102

Result:

node layer

node id
901
902
903
1102


texts: Embedded GeoWebCache in active cluster with shared data_dir

texts:
I have 7 instances of GeoServer with active JMS Master/Slave p2p cluster setup and data_dir shared by NFS on RHEL 7 machines with XFS over LVM. I want use embedded GeoWebCache and encountering, I suppose, synchronization issues: after publishing new sql-view layer some of instances threw exceptions

2019-04-05 00:50:49,650 WARN [platform.resource] - Failed to rename file resource gwc-layers/LayerInfoImpl--1d7ef2f_169ea383aa3_-7fe9.xml.tmp to gwc-layers/LayerInfoImpl--1d7ef2f_169ea383aa3_-7fe9.xml
java.io.FileNotFoundException: Source '/DATA_DIR/gwc-layers/LayerInfoImpl--1d7ef2f_169ea383aa3_-7fe9.xml.tmp' does not exist
        at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2995)
        at org.geoserver.util.IOUtils.rename(IOUtils.java:530)
....

2019-04-05 00:50:49,668 ERROR [gwc.layer] - Error saving tile layer 'layer_name_here'
java.lang.IllegalArgumentException: TileLayer with same name already exists: layer_name_here: <LayerInfoImpl--1d7ef2f:169ea383aa3:-7fe9>
        at org.geoserver.gwc.layer.DefaultTileLayerCatalog.save(DefaultTileLayerCatalog.java:210)

And other instances throws

2019-03-21 14:31:09,172 ERROR [config.impl] - Error occurred processing a configuration change listener
org.geoserver.catalog.CatalogException: Error persisting GeoServerInfoImpl[null] to global.xml
        at org.geoserver.config.GeoServerConfigPersister.persist(GeoServerConfigPersister.java:614)

It's all looks like locking/synchroniation issues. I tried to set "Global locking" in GeoWebCache and then "NIO" in Global GeoServer settings, also adding

<lockProvider>nioLock</lockProvider>

into /DATA_DIR/gwc/geowebcache.xml with no luck.
NFS mounted on clients as

rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=X.X.X.X,local_lock=none,addr=Y.Y.Y.Y

And exported on main server with options

rw,sync,fsid=0

But I also tried to mount with noac,nocto,noatime (and combinations) - some exceptions just changes to, e.g. "Stale file handle", still not working.
I also have enabled disc quota via JDBC (PostgreSQL).
So - how can I get working clustered embedded GeoWebCache with shared data_dir on JMS cluster of GeoServer?


texts: Error importing NOAA’s National Geophysical Data Center as delimited text layer in QGIS version 1.02

texts:
I've been struggling with trying to import the most recent data from NOAA’s National Geophysical Data Center earthquake information into Quantum GIS 1.02 for weeks now for a class assignment.

I'm attaching three screen shots which show some of what I'm running into.

The first is where I import the information in a delimited text layer.

The second is the error I continue to run into every time I load the file which I've re-downloaded and attempted to use multiple times with the same error.

Lastly, is where I'm attempting to make use of the Points in Polygone feature which will load to 100% and then freeze the program.

Any advice or suggestions?


texts: Clipping layers in dataframe with polygon in Python?

texts:
I'm trying to clip layers in a dataframe with a polygon using python and I've done this python script but it's giving this error:

  ERROR 000840: The value is not a Feature Layer

import arcpy, os
from arcpy import env
from arcpy import mapping
mxd = mapping.MapDocument("Current")
df = mxd.activeDataFrame
polygon=r'C:\temp\extentPoly.shp'

for layer in mapping.ListLayers(mxd,"", df):
    FL=arcpy.MakeFeatureLayer_management(layer,"_outlayer")
    clipped_fc = env.scratchFolder + os.sep + "_clipped.shp"
    arcpy.Clip_analysis(FL, polygon,clipped_fc)

del layer
del mxd
del df


texts: Feature class to Feature class not working

texts:
I am trying to use the Featureclass to Featureclass conversion tool to make a copy of an existing layer (in a geodatabase). My primary motive is to copy over only a few (2 out of 18) fields to the new feature class. I have put a simple script to do this, but this copies all the fields even tough I specify the field names that should be copied.

Can someone please let me know what am i doing wrong.

I want the output feature class (Test) to have two fields A and B.

# Import arcpy module
import arcpy

# Local variables:
Input = "C:\\Work\\Projects\\0a_IL_Naperville\\Segmenter_v8\\1 00001 IL Naperville 2013.gdb\\Streets"
Out_location = "C:\\Work\\Projects\\0a_IL_Naperville\\Segmenter_v8\\1 00001 IL Naperville 2013.gdb"

keep = ['ST_NAME','FUNC_CLASS','Shape_Length','OBJECTID','Shape','A']

arcpy.FeatureClassToFeatureClass_conversion(Input,Out_location, "Test",field_mapping=keep)


texts:
I have installed GeoServer 2.14.1 on server 92.20.100.12 at port 8080. Now I want to access that GeoServer from my computer like that

http://92.20.100.12:8080/geoserver

I added new "Inbound Rule" for port 8080 but I could not access GeoServer.
What do I need to change?

Operation system that GeoServer installed: Windows Server 2016


texts:
How can I create a polygon overlay that correctly handles holes? This answer provides a method of creating a polygon overlay that does not handle holes. Can it be modified to correctly handle holes?

Software Versions:

PostgreSQL 9.2.1
PostGIS 2.0.1 r9979
Windows Server 2008 R2


texts: Configuring QGIS Pop Up like in WMS with QGIS2WEB

texts:
I need a QGIS pop up window like in the WEB Version of QGIS2WEB plugin, when I click on a object to get information of the feature.

The pop up I want in QGIS is like in this photo.


texts: Global Mapper: Slovenian LiDAR very little shift on projection

texts:
I downloaded LiDAR data from Slovenia (link on the bottom). After searching google for the right projection, I found that normally I should use MGI 1901/Slovene National Grid; EPSG:3912 or Slovenia 1996/Slovenian national grid EPSG:3794.

With these EPSG codes, the projection is somewhere in the water.
So I went on searching and found the EPSG code 3787. That's something Military Geographic.

These projection is almost correct, but I still have to shift the False Northing about 8 Meters. Yet I have very little difference on the Lidar projection.

In Global Mapper my main projection is set to Mercator and I am using the normal World Imagery as my base map.

The LiDAR files are from this site:
Lida GIS Viewer (on the right side, check one of the checkboxes and click in one or more square on the map to download)

What do I have to do, to get the projection correct?


texts: How to obtain buildings base (Ground) Height from Esri Terrain Dataset?

texts: How can I join Height data (surface, DTM) from terrain dataset to buildings polygons ?


texts: Show flow direction for pipes as arrows in QGIS

texts:
I have a vector layer (line features) which consists of different pipes. In the attribute data I have fields that indicate the upstream elevation and downstream elevation values.

I am trying to visually depict the flow direction in these pipes using arrows based on the upstream and downstream elevation values. I cannot seem to work out a method in QGIS. Is anyone here able to assist?


texts: Finding the local extrema contour line on a DEM

texts:
I need to trace the top of a small levee on the side of a riverbank, based on a DEM.

This line is similar to a contour line, except that it goes through the local maximum instead of a constant level.

The local maxima from SAGA returns a point, not a line. I couldn't find any tool to do something similar. Did I miss something?

(for HEC-RAS users, that would allow me to extract a breakline on top of said levee for 2D modeling)


texts: PostGIS help writing a ST_MakeSimple method for self intersecting lines?

texts:
I have imported Open Street Map lines into PostGIS 2.1 and I need to clean up the self intersecting ways. I have done some manual edits in the past but there are many more ST_IsSimple(way) = false than I have time to do by hand. Is there a quick way to find rings and split off their dangles? I would like to write a ST_MakeSimple(the_geom) function for handling these in the future, it would be equivalent to ST_MakeValid(the_geom) that makes polygons valid.

An example is shown selected in green in the image. What will make it simple is to cut the tail off of the ring.

For the linestring pictured above ST_IsSimple(ST_Node(way)) is false. Adding nodes is not able to self intersection. However the linestring below is fixed, it just doubles back on itself, so it can be made simple.


texts:
Schema locks are not showing up in the Oracle Instance when viewed using ArcCatalog. Data is being using in different applications but for some reason I'm not able to view the locks as the data owner/geodatabase administrator on Oracle instance.

Does it need any specific permissions assigned on Oracle for GDB Admin to access the locks?


texts: Using shape to find and merge photos in FME?

texts:
We have a directory with over 300 aerial photos of our town. Every photo has an unique name. Using an georeferenced Esri shapefile of a specific area we want to copy the photos that are coverd by the shapefile to another directory.

We want to merge these photos to one single photo after the first process automatically.

Is this possible with FME?


texts: Converting "From-To" matrix (wide format) to long format in QGIS?

texts:
I am importing a csv  matrix (non spatial table)

        |ALLIER |AISNE |ALPES
|ALLIER | -     |10    |200
|AISNE  |70     | -    |100
|ALPES  |10     |100   |-

What I want using Qgis

|FROM   |TO     |VALUE
|ALLIER |AISNE  |10
|ALLIER |ALPES  |200
|AISNE  |ALLIER |70
|AISNE  |ALPES  |100
....

My real data displayed in LibreOffice Calc (my matrix is  100 x 100)


texts: I know that there are a lot of leaflet extensions that makes the GIS just awsome ; I would like to know if there is a way may be an extension to calculate route path from origine to destination by roads or by bus line.


texts: How to toggle editing on a virtual layer?

texts:
When I'm adding a virtual layer to a project using QGIS 3.12.2, it cannot be toggled to edit mode. That is: the pencil icon is greyed colored. This can be said for layers created either by the Create Virtual Layer or the DB Manager SQL query.

Is it possible to edit a virtual layer? If so, how can it be done? If not, is there any documentation or reference regarding this aspect?


texts: QGIS 2.8 PrintComposer, no coordinates shown

texts:
I tested under MacOS 10.10.3 and 10.9.5 now: In the QGIS v2.8 Print Composer I don´t get coordinates shown when I want to create a map sheet and activate "Draw coordinates". I can do all settings under "Item Properties" but can only see the coordinates when I finally export the map as e.g. PDF. It´s of course quite unproductive to export everytime a PDF to see the changes I made...
I just upgraded from QGIS 2.4 and there it was working fine. Any Ideas?


texts: How to use %value% (from For iterator) in SQL expression of Calculate Field in ModelBuilder?

texts:
I have a shapefile with data of fish specimens and the coordinates where they were tagged for research purposes. One of the fields in the attribute table of these shapefiles is the fish length in centimeters (ReLenCM). I am building a model that will create three new fields in the shapefile with weight values calculated with three different estimations of the length-weight relationship for that species. To make my enquire simpler, instead of using those functions yet I´m trying to just have the length value multiplied by an iteration.
My For iterator is From 2, to 4, by 1. Meaning my three iterations are 2, 3 and 4.
Therefore, for instance for the first row in the table (see pic) I am aiming to have something like this:

ReLenCM = 79; W_2 = 158; W_3 = 237; W_4 = 316

This is the configuration of the ArcGIS 10.1 for Desktop model:

ADD FIELD:

Field Name_Add = W_%value% (resulting in W_2, W_3 and W_4)
Field type = Double
Input table = Model parameter (shp of tagged fish releases)

CALCULATE FIELD

FieldName = %Field Name_Add% (not entirely sure about this one)
Expression = Here is where I want to multiply length by each of the iterations. You can see my attempt in the picture ([ReLenCM] * [W_%value%]), but with that expression all I get are "0" values...

Basically, I just need to know how to insert the %value% variable from the iterator in the SQL expression. I have found some posts describing a similar issue, but always with String variables, not numeric.


texts: How to Correct Landsat 8 Imagery with TOA Reflectance >1 and <0?

texts:
I recently downloaded Landsat 8 T1 imagery and have ran into some difficulties during pre-processing. I applied the TOA reflectance and sun elevation corrections to Bands 2,3,4,5,6 using ArcGIS's raster calculator after clipping each band to match the extent of my study area.

However, Band 5 (NIR) has a minimum value of -0.00916394 and the maximum values of my bands exceed 1 (1.18148 - 1.34319). How do I got about bringing my values back into the 0-1 range?

I read elsewhere that values in this range are typical of Landsat 8 imagery, but I cannot find a guide that walks me through the necessary corrections.


texts: What is Non-Static Map from ArcGIS for Desktop?

texts:
This is what I received from my client:

  He needs to be able to interact with the map, enlarge certain
  sections, etc.  Can you send this over in a non-static format?

What does this entail as I created a standard map for the company using ArcView 10.1.


texts: Making QGIS display plugins that are installed on PC?

texts:
How can I make QGIS 2.16 display plugins that are installed on my PC?

I'm getting what is shown in the picture below.


texts:
I have a working code for a project, but right now to run through the data it would take years to be completed. Please help me to improve it:

import laspy
import laspy.file
import numpy as np

  (ch1)

header = laspy.header.Header()
inFile2 = laspy.file.File("C:\\Users\\Geri\\Desktop\\Sync\\CODETEST\\inverz2.las", mode = "r")
inFile3 = laspy.file.File("C:\\Users\\Geri\\Desktop\\Sync\\CODETEST\\inverz3.las", mode = "r")
inFile = laspy.file.File("C:\\Users\\Geri\\Desktop\\Sync\\CODETEST\\final.las", mode = "rw")

  (ch2)

point_records = inFile2.points
point_records = inFile3.points
zstarter=3285017.181
zrange=219.768
t=0

  (ch3)

listx1=np.array([], dtype=float)
listy1=np.array([], dtype=float)
listz1=np.array([], dtype=float)
while t < 1155817:
    z=0
    q=0
    p=0.1
    while z==0:

        xmin=inFile3.x[t]-p
        ymin=inFile3.y[t]-p
        xmax=inFile3.x[t]+p
        ymax=inFile3.y[t]+p
        print t
        n=0
        for points in inFile2.points:
            ax=inFile2.x[n]
            ay=inFile2.y[n]
            if ax > xmin and ax < xmax and ay < ymax and ay > ymin:

Till this point the code tries to find the closest neighbor for the input point. The method only works for a data with a few hundred points, but it's too slow for a bigger one.

  (ch4)

                                print inFile3.x[t]
                                print inFile2.x[n]
                                newx = [inFile3.x[t]-((inFile3.x[t]-inFile2.x[n])/2)]
                                newy = [inFile3.y[t]-((inFile3.y[t]-inFile2.y[n])/2)]

  (ch5)

                                processz = newy-newx

                                ratioz=(processz-zstarter)/zrange
                                newz = [inFile3.z[t]-((inFile3.z[t]-inFile2.z[n])*ratioz)]

  (ch6)

                                listx1=np.append(listx1, (newx))
                                listy1=np.append(listy1, (newy))
                                listz1=np.append(listz1, (newz))

                                n+=1
                                q+=1
                                t+=1
            else:
                n+=1
                print n
        if q>0 or p==1:
            z+=1
        else:
            p+=0.1

inFile.x = listx1
inFile.y = listy1
inFile.z = listz1
inFile.close()

Unfortunately I can't install the pyflann or the scipy (for k neighboor) to use them so that's why I tried this workaround. I'm wondering if it's posibble to create a buffer around the selected point and just select by that polygon the new point (like in ArcGIS) (FYI I have an ArcGIS 10.2.2 and a standalone python 2.7)

Description:
The code ultimate purpose: (gonna label the code with chapters) get 2 las files (ch1) take one of the point from the first one (ch2), find the closest point from the second file (ch3), create a new point based on the two input points (ch4), calculate new z value adjusted by how far is the new point from the edge of the dataset (ch5), save the new point into a new las file (ch6)


texts: Clip Data Layer to only include continental United States

texts:
I'm very much a beginner to ArcMap. Is there an easy way I can clip the Continental United States from this data layer and get rid of Alaska, Hawaii, and the other islands.

I saw some tutorials using ArcSwat. Would that be a useful option? I have ArcMap 10.6.1 and I know the ArcSwat tool only goes to ArcMap 10.4. I'm using a work computer and am not sure that I would be able to get an older version of ArcMap.


texts: What is the default unit for QGIS scales and how do I set it to Km?

texts:
I want to render a specific layer only between 0-12km but have no idea how to set it in QGIS because the scales dimensions are high numbers.
My project and layers CRS is EPSG:2039.


texts: WMSGetFeatureInfo on MapServer WMS layer in OpenLayers 2?

texts:
I am trying to get a WMSGetFeatureInfo request to work on my MapServer WMS layer but I am not sure how to correctly configure my map file and the request in OpenLayers.

I have setup a jsFiddle with my WMS overlay and the WMSGetFeatureInfo request.

http://jsfiddle.net/goldrydigital/YBWRz/

The request is as follows:

var getFeatureInfo = new OpenLayers.Control.WMSGetFeatureInfo({
    url: 'http://137.117.37.130:8081/cgi-bin/mapserv.exe?map=c:/ms4w/wms_sample.map&',
    title: 'Identify features by clicking',
    layers: 'estados'
})
getFeatureInfo.events.register('getfeatureinfo', map, function (e) {
    alert(e.text);
});
map.addControl(getFeatureInfo);
getFeatureInfo.activate();

The layer takes the data from a Mapinfo tab file. The Layer definition in the Map file is as follows:

    LAYER

    NAME "estados"
    TYPE POLYGON
    STATUS ON
    CONNECTIONTYPE OGR
    CONNECTION "estados.tab"
    TEMPLATE "blank.html"
    DUMP TRUE

    CLASS

        OUTLINECOLOR 10 10 10

    END
    METADATA

        "wms_title"          "estados"
        "gml_geometries"     "geom"
        "gml_geom_type"      "polygon"
        "gml_include_items"  "all"
        "wms_include_items"  "all"
        "wms_feature_info_mime_type" "text/plain"

    END

    END

Can you put me in the right direction with this?


texts: Coloring polygons in a vector tile on a map

texts:
I have a GeoJSON file corresponding to blocks from the Census website.  I'd like to display them on a map with them shaded a certain color as determined by various data stored in a PostGIS database.  Since blocks are so small, I'd like to use a tile layer to only serve the necessary amount to the client as the entire dataset is way too big (300+ MB).

Is there a way to color polygons individually based on corresponding datapoints either on the client or server side?  I have all the polygons along with their corresponding datapoints stored in a PostGIS database.  I'm using TileSplash to retreive the polygons and serve up a vector tile layer which then gets rendered by leaflet (react-leaflet).  Is this possible to do with a vector tile layer or do I need to use a raster tile layer?


texts: GeoTiff convert to PNG with transparency?

texts:
I need to convert a GeoTIFF image to PNG format with "NoData" pixels in the original image being transparent in the output.

Is there any tool particularly in ArcGIS ArcToolbox or GDAL for this purpose?


texts: PyQgis How could I open the "identify results" dock using "onSelectionChange()"

texts:
Using iface.mapCanvas().selectionChanged.connect(function) I'd like to open the Identify result dock for the selected feature as shown below:

it could be manually done by selecting the feature with the identify tool, but how is it done connecting the selection signal to it?


texts: Avoiding save changes before closing dialog of Acrobat Reader when viewing PDF from ArcPy of ArcGIS Pro?

texts:
I often write PDF files using ArcPy with ArcGIS Pro 2.0 using code like:

import arcpy
aprx = arcpy.mp.ArcGISProject(r"C:\temp\test.aprx")
lyt = aprx.listLayouts("Layout")[0]
lyt.exportToPDF(r"C:\temp\test.pdf")

I view them using Adobe Acrobat Reader DC, and when I close them I am asked:

  Do you want to save changes to 'test.pdf' before closing?

This means every close is two clicks instead of one, and I am not making any changes to the PDF so I am always choosing No.

I have not been able to disable this dialog being triggered from the Adobe side and am wondering whether there is a way to set a property on the PDF created by ArcGIS Pro to prevent it instead?


texts: Using list of polygon.txt files in Onedrive to show those files in ArcGIS Pro

texts:
I have many polygon text files of different cities around the  world, I was wondering how I could show these files in ArcGIS Pro. So far I have transferred these files to my C drive, and linked that folder to ArcGIS Pro, however, they show up as text files and not as points or polygons.
How can I get these files to show up as either points or polygons?


texts: How to display dynamic text together with date during timelapse?

texts:
I'm using time enabled data showing how environmental risks of gas development increases over three scenarios (reference, exploration only, small-scale development, large-scale development) in four environmental sensitivity classes (polygons). Each of the scenarios has a time tied to it - from the reference 1/1/2016 (current) and going into the future up until 1/1/2050 for large-scale development.

I know how to have the time display as dynamic text, but would also like for the scenario name to appear and change as text on my map over time. For example:
"1/1/2016; Reference case";  "1/1/2025; Exploration only";  "1/1/2030; Small-scale development";  "1/1/2050; Large-scale development" as the time slides along.

Can this be done with ArcGIS for Desktop?


texts: Linking Mapinfo polygon to MS Access DBMS records?

texts:
Does anyone know of simple way or bit of code to link a MS ACCESS DBMS point to an associated polygon, so that spatial attributes of the polygon can be recorded into the DBMS fields.

I am a user not a tech programmer.


texts:
I currently have a Leaflet.js map system. It's OK, although extremely slow on anything but the fastest computer once you have loaded any non-trivial amount of markers or overlay images.

Anyway, what I would like is for the existing maps to "wrap around" a sphere representing Earth, with a black background to represent space (if zoomed out enough). I'd love to be able to toggle this on/off with a button, switching between the standard 2D view and the 3D globe.

Additionally, I would like to be able to put some sort of "height data" files (such as what I can get from a government site for my country) in a dir and tell Leaflet about these, and then have the relevant area on the 3D globe get "height differences".

All the markers and stuff would display in this mode, just like in the 2D mode. This is important.

(Of course, I would like a Google Maps-like actual 3D environment with 3D objects, but I consider that "science fiction" at this stage, especially since I want it for free and without relying on a third party service.)

Is what I ask for possible already in Leaflet? I have a vague memory of a few plug-ins that attempt to do something similar, but from what I can remember, they all suck. I would love for Leaflet itself to support this, without a plug-in required, and it seems like it would be trivial to accomplish for somebody who managed to make Leaflet in the first place, as it's essentially "just" putting the 2D textures onto a sphere in WebGL or something, and the height differences part isn't even a requirement -- it would just be a bonus.

I hope you have some happy news for me, such as: "Yeah, this is a very requested feature and has been prioritized by the Leaflet.js team. We're adding it in the next version which is due to be released next week. Then you can simply use the config option "use3DGlobe: true". Enjoy!"


texts:
i am using sensor nodes and their antenna to calculate GPS coordinates as notation of (degrees/minutes/seconds), i have some question of how to do these things:

how can i convert latitude and longitude to X,Y coordinate, then
plot X,y points on a scale, also need to specify one node as
reference one to calculate xy related to it.
what is the Euclidean distance between GPS position, or it is
applicable to calculate distances between the converted XY points ?
i need equations to convert GPS to XY, please any helpful links !!


texts: CRS_Transform Error in Google Earth Engine?

texts:
I've written below code for crs_transform extraction from sentinel2 images but it returns null value. How can I solve this problem?
var B5 = ee.ImageCollection("COPERNICUS/S2")
.filterDate('2016-01-01','2016-02-01')
.filterBounds(table)
.select('B4');

print(B5.get('crs_transform'));


texts: Problem with QGIS Layer view / Layer Properties view

texts:
If I open the Layer Properties of my project all is fine.
All styles shown in there stylegroups like shown in the following screenshot sample

But in the Layerview the groups gone. All styles of an layer shown flat in a row. no groups/ subgroups shown.

[


texts: How to import GeoTIFF via postGIS into GeoServer?

texts:
As a simple test case, I'm trying to configure the software stack of OpenGeo such that I can display a GeoTIFF as an overlay to a normal map like OSM. So I perform the following steps:

Create a spatial data base with postGIS
Load the GeoTIFF into the data base
Import the data base to GeoServer
Preview it as a map overlay in GeoServer (e.g. with GeoExplorer or OpenLayers)

In contrary to a direct import of the GeoTIFF to Geoserver (which works formidably), the table imported from the data base is marked as "vector data" and not "raster data" in the GeoServer web application.
In the Layer Preview, GeoExplorer does not display anything from the GeoTIFF and OpenLayers returns a WMS file reporting a ServiceExeption:

The requested Style can not be used with this layer.
The style specifies an attribute of geom and the layer is: opengeo:test

I believe the solution is quite simple but it seems I do not understand how GeoServer interprets raster data stored in postGIS.

Can anybody tell me what point I'm missing?

My steps in detail:

Create a spatial data base with postGIS as documented, taking template_postgis as a template and port 5432 as I operate on Ubuntu 12.04.
Load the GeoTIFF into the data base from the command line using raster2pgsql as in (http://suite.opengeo.org/docs/dataadmin/pgGettingStarted/raster2pgsql.html)

raster2pgsql -I -C -s 32632 test.tif public.testTable
| psql -d test -h localhost -U opengeo

where

-I: flag to create the spatial GiST index for performance
-C: flag to apply the raster constraints
-s 32632: SRID of test.tif reported by tool gdalinfo
test.tif: proper test GeoTIFF
public.testTable: new table in target schema
-d test: spatially enabled database
-U opengeo: owner of database (standard username)

Import the data base to GeoServer as described in the official workshop


texts: Symbology for multiple attributes within the same feature class in ArcMap

texts: How to represent two variables in one graduate symbol "figure", colors and graduate size circles.


texts: Using Polygon or Multipolygon for mapping fields in QGIS?

texts:
I'm trying to map medieval field systems in QGIS, this means that I'll be drawing quite a few polygons. I've mapped quite a few fields already using Spatialite layers using polygons, though I was wondering if using multipolygon would be better?

Ultimately I want to calculate the Acreage of these fields, something which I have found to be very difficult at the moment in QGIS.


texts: For loop only reads last row using ArcPy

texts:
Trying to Create a for loop within a script and for some reason, it returns only the last row?  The script will go onto geoprocess on each row,  but for some reason it doesn't want to play the game,

I think it must be syntax related, but not sure where?

import arcpy
from arcpy import env
import time

#Settings
baseDirectory = 'B:\\Non_Contigous_Working'
fileworkspace = baseDirectory + '\\Non_Contiguos_Working.gdb'
Holdings = fileworkspace + '\\Holding\\NTLLS_Holding_190617'

#arcpy Settings
arcpy.env.overwriteOutput = True
env.workspace = fileworkspace

#SearchCursor
arcpy.MakeFeatureLayer_management(Holdings, 'Holdings_Layer')

with arcpy.da.SearchCursor(Holdings, ['Holding_Reference_Number']) as Holdings_Ref_cursor:
for row in Holdings_Ref_cursor:
       refNumber = str(row[0])
print 'Holding:' + refNumber


texts:
Getting this error while exporting an shapefile to svg (courtesy to iant):

The weird thing is I wasn't getting this error before, but I just suddenly starting getting it after running my application, what could have happened?

Code can be found here: Exporting Shapefile to SVG using Java & GeoTools?

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.geotools.swing.MapLayerTableCellRenderer.getListCellRendererComponent(MapLayerTableCellRenderer.java:259)
at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:208)
at javax.swing.plaf.basic.BasicListUI.paintImpl(BasicListUI.java:317)
at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:240)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:779)
at javax.swing.JComponent.paint(JComponent.java:1055)
at javax.swing.JComponent.paintChildren(JComponent.java:888)
at javax.swing.JComponent.paint(JComponent.java:1064)
at javax.swing.JViewport.paint(JViewport.java:731)
at javax.swing.JComponent.paintChildren(JComponent.java:888)
at javax.swing.JComponent.paint(JComponent.java:1064)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5232)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452)
at javax.swing.RepaintManager.paint(RepaintManager.java:1249)
at javax.swing.JComponent._paintImmediately(JComponent.java:5180)
at javax.swing.JComponent.paintImmediately(JComponent.java:4991)
at javax.swing.RepaintManager$3.run(RepaintManager.java:808)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718)
at javax.swing.RepaintManager.access$1100(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


texts: How to fix the QGIS for Android GPS panel?

texts:
I have installed GIS on my Samsung Galaxy S1, but I can't test the GPS.

I found how to turn the GPS on, but I cannot open the GPS panel to do it.
When I press view->panels nothing happens.


texts: I am definitely new to this area. I found it is difficult to find high quality data on the web. The OpenStreetMap is the most sophisticate data source I met, but clearly many other map services such as Google map provide way more information than OpenStreetMap, such as location of shopping mall, shape of residential areas. It looks like that they are the vector format in the background, but is rendered like a raster layer for web services. I understand this question is too broad, but can anyone provide a hint on how to get information from these map services? or any other services which can provide similar data.


texts: Correcting merged LiDAR DEM with outliers in inner edges?

texts:
I've created a DEM from LiDAR data. After combining all the files, I could see that there are some problems through the tile borders. This is an screen focused in one of the cross section of 4 files connected.

All the values are around 800m, while the "black lines" contain values around 400. I'm looking for a raster tool where those values can be interpolated.

Here is the peace of raster (.tif, epsg:25829) to try by yourself. https://drive.google.com/open?id=18LgIp6VNyCphDpnRVPlZelLFd3m8JF4y


texts:
I have my own OSM server which is updating every few minutes in shyncrony with OSM original servers, using a PostGIS database and rendering with renderd.

I can see offline downloaded maps through an Apache server (using OpenLayers).

I would like to use this database as a repository for Maps.me, but, the format of these maps is .mwm, while mines are stored in database, and, the downloaded raw data maps are .osm.pbf files.

Is PostGIS database useless for this purpose?Or do I have to convert the .osm.pbf files into .mwm format files?


texts:
from arcgis.gis import GIS
import sys
import urllib.request as req
from pathlib import Path
from zipfile import ZipFile
import os
import trace
import urllib.request as req

Zip_Loc = r'C:\Folder'
data_item_id = 'someId'

def downloadData():
    gisx = GIS("https://xyz.123.arcgis.com", username='12344353', password='abcdef',proxy_host='***.***.***.**',proxy_port=****)

    data_item = gisx.content.get(data_item_id )
    data_path = Path(Zip_Loc)

    zipPath = data_path.joinpath('Data.zip')
    data_item.download(save_path=data_path)

def main():
    downloadData()

if __name__ == '__main__':
    main()

The error I get is

  urllib.error.URLError:

  OSError: Tunnel connection failed: 407 authenticationrequired

I'm geting error in data_item.download....... line

I already passed proxy in GIS line, and I can download normally in browser.

This data_item_id is secured one and this user got access, do I need to generate token and download?


texts: Simplifying adjacent polygons using QGIS Simplify Geometries tool

texts:
I have a big Shapefile with 200,000 polygons but the file is too big for the application that will use it. I would like to generalise these polygons and create much smaller file.

I have tried to do this in QGIS using "Simplify Geometries" tool. I have tried this on a very small portion of my Shapefile and I am happy with the results but have small problem which I do not know how to solve.  I have appended the image to show the problem.

WHITE boundaries are boundaries before simplification. RED boundaries are after simplification. The problem areas are circled with orange colour.
As you can see "simplified boundaries" contain some areas that after simplification do not belong to any of the previous polygons.

How do I simplify this Shapefile and keep common boundaries between polygons as a single line and eliminate areas that have been created after simplification?

ADDITIONAL INFORMATION:

After following suggested instructions

Convert polygons to lines
Simplify lines
Convert lines back to polygons

I get the following results. It is slightly better than before but still I get areas outside original polygons (see white areas in the picture below).

@Andrew suggested that I associate each line with adjacent polygon but I do not know how to do it in QGIS.

I am still trying to complete simplifying polygons process. I have followed instructions suggested in this post and when I thought I got acceptable results one more problem appeared. Below is the summary of what I did with images of results. All steps have been performed using PROCESSING toolbox in QGIS.

First, I converted polygons to lines
Second, I cleaned lines using v.clean with break option. This resulted in CLEANED VECTOR LAYER and ERROR LAYER. Error Layer (green dots on the provided image) has green dot on every line intersection. I do not know what this means.
Third, I simplified lines using "SIMPLIFY GEOMETRY" tool (result in red lines in the images). Comparing simplified red lines and original orange lines I am happy with the result.
Fourth, I wanted to convert lines back to polygons using "Polygonize" tool in "PROCESSING" and got results that I did not expect (second image with a shaded dark olive colour polygons). It looks like polygonizer connected error layer intersections and created completely different set of polygons ignoring simplified lines.

Could someone explain what went wrong here?

Why red simplified lines were not converted properly to simplified polygons?

As you can see I am not an GIS expert but need to do this myself. I do not know if I am too far from the solution but it is frustrating that I can see simplified lines that I found acceptable for what I'd like to do but cannot convert them to polygons.

Here are two images with results of last two steps of the process:


texts: How can one install the ECW plugin for QGIS 2.18 for mac? I would simple step by step for this.


texts: Decode SRID information from a PostGIS WKB string in Python using the standard library

texts:
TL;DR
I want to decode a WKB string which comes from a PostGIS database using the Python standard library. The WKB string seems to actually embed the SRID information, but I'm not 100% sure and shapely in agnostic to that.
Details
I have a PostGIS point:
SELECT ST_AsText(ST_SetSrid(ST_MakePoint(2670599, 1207749), 2056))

which one can load in Python this way using a psycopg2 connector:
sql = """SELECT ST_SetSrid(ST_MakePoint(2670599, 1207749), 2056)"""

with psycopg2.connect(**DATABASE_PARAMETERS) as conn:
    with conn.cursor() as curs:
        curs.execute(sql)
        pt = curs.fetchone()

point = pt[0]

Now point looks like '010100002008080000000000800360444100000000C56D3241' which is a WKB string.
Great. But shapely is agnostic to the SRS information, so this:
from shapely import wkb

shape = wkb.loads(point, hex=True)
wkb.dumps(shape, hex=True)

prints '0101000000000000800360444100000000C56D3241', which is not equal to the first string.
And if one need to dump this, one has to manually specify the SRID this way:
wkb.dumps(shape, hex=True, srid=2056)

which prints '010100002008080000000000800360444100000000C56D3241' and which is now equal to the first string:
>>> point == wkb.dumps(shape, hex=True, srid=2056)
True

So, is the difference an actual encoding of the SRID information or not?
If yes, how to decode it properly using only the Python standard library?
I know it can be easily done using, e.g. GeoPandas:
import geopandas as gpd
sql = """SELECT ST_SetSrid(ST_MakePoint(2670599, 1207749), 2056) as geom"""  # <-- give it a name so that GeoPandas doesn't compain.
with psycopg2.connect(**DATABASE_PARAMETERS) as conn:
    with conn.cursor() as curs:
        curs.execute(sql)
        pt = curs.fetchone()

G = gpd. gpd.read_postgis(sql, connector())

Then:
>>> GG.crs

<Projected CRS: EPSG:2056>
Name: CH1903+ / LV95
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: Liechtenstein; Switzerland.
- bounds: (5.96, 45.82, 10.49, 47.81)
Coordinate Operation:
- name: Swiss Oblique Mercator 1995
- method: Hotine Oblique Mercator (variant B)
Datum: CH1903+
- Ellipsoid: Bessel 1841
- Prime Meridian: Greenwich

I'm simply curious about this, because for the moment, my workaround to avoid loading an other library, is to query it separately, which works nicely:
sql = """SELECT ST_SetSrid(ST_MakePoint(2670599, 1207749), 2056) as geom,
         ST_SRID(ST_SetSrid(ST_MakePoint(2670599, 1207749), 2056)) as srid"""

with psycopg2.connect(**DATABASE_PARAMETERS) as conn:
    with conn.cursor() as curs:
        curs.execute(sql)
        pt = curs.fetchone()

point = pt[0]
srid = pt[1] # <- this prints the integer: 2056


texts:
I'm using ArcMap 10.6.1 and have 50 layers each with a validated definition query.
A typical layer definition query is: autocad_layer = 'Week 25 - Program Element 147.01.23 - 01-06-18'.
The data source is a file geodatabase on a AWS server with UNC path of

\\awsservername\ProjectData\ProjectA\GDBs

I want to publish the MXD as a map service but when I run the analyze tool in service editor I get a number of invalid layer definition queries. I have tried redefining the definition queries for the layers that report invalid ones but while those are accepted, new ones appear in the analysis window. I have tried running the analyze tool several times without changing anything and each time I get a different set of invalid layer definition queries listed.
What is going on here?
Anybody else had a similar issue?
My MXDs are on an AWS disk and I have published other services (without layer definition queries) from that location previously without an issue.


texts: Enabling hover popup window for feature IDs in Mapview package for R

texts:
I've been working with interactive mapping within R for a while now and most of my experience lies in Leaflet (mostly the R package, but also a bit in Javascript). I just recently delved into mapview as an alternative and have a quick question about enabling the hover popup windows.

As you can see in this example with polygons, when you move your mouse over each polygon, a small popup window appears with each feature ID. The vector data description states:

  in case you have the latest version of leaflet installed the map will
  also have a scale bar in the bottom left corner and provide labels of
  feature IDs if you hover over the features.

I have both Leaflet and Leaflet for R updated on my computer, yet this hover feature is not activated. The scale bar is also not shown. I used the mapview example of gadmCHE, as you'll see in the image below:

Does anyone know if this "latest version of leaflet" refers to leaflet.js or the R package leaflet? I just downloaded Leaflet 1.0.0-rc3 here and also made sure that I updated the leaflet package, so I'm not sure where to go from here to enable that hover/scalebar feature.


texts: How to connect ArcMap 10.0 query layer to a different port?

texts:
I have an instance where I have a server that has postgres 8.3 and postgres 9.2 on it. I have the 8.3 version on port 5432 and 9.2 on port 5433. I want to connect to the 9.2 instance, here is a screenshot of the setup:

This however is not working. It comes back as an invalid username and password because it is trying to connect to the 8.3 version, which the username and password does not exist on. However, if I do try one with the username/password of the 8.3 it works. I believe I am missing something with how ArcMap wants to configure the port number in the configuration box.


texts: How to specify unit of measurement when accessing Geometry() object's 'length' attribute?

texts:
Using the CalculateField_management tool, one can specify the unit of measurement when calculating shape length:

#Calculate polyline lengths in miles
polylines = "C:\sampleShape.shp"
arcpy.CalculateField_management(polylines, "shapeLen", "!Shape.length@MILES!", "PYTHON_9.3")

I'd like to do the same thing within a cursor using the 'SHAPE@LENGTH' of each feature, with the length returned in a unit of my choosing:

#hypothetical example 1
with arcpy.da.UpdateCursor(polylines, field_names=["SHAPE@LENGTH.FEET", "shapeLen"]) as upCurs:
    for row in upCurs:
        row[1] = row[0]
        upCurs.updateRow(row)

Or possibly by using the (less efficient) @SHAPE geometry object?:

#hypothetical example 2
with arcpy.da.UpdateCursor(polylines, field_names=["@SHAPE", "shapeLen"]) as upCurs:
    for row in upCurs:
        row[1] = row[0].length@FEET
        upCurs.updateRow(row)

Is there some way to do this?


texts: GeoTools and PostGIS coordinate transformation gets different result

texts:
I've got a problem transforming coordinates. The result differs in PostGIS and GeoTools.

I want to transform from EPSG:4326 to EPSG:3398.

PostGIS:

indicia=> select ST_AsText(ST_Transform(ST_GeomFromText('POINT(13.387527 54.094434)', 4326),3398)) as converted;
                converted
------------------------------------------
 POINT(4590768.20978302 5996697.68142438)
(1 row)

CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3398");
WKTReader wktReader = new WKTReader(new GeometryFactory(new PrecisionModel()));
WKTWriter wktWriter = new WKTWriter();
MathTransform mathTransform = CRS.findMathTransform(sourceCRS, targetCRS, true);
Geometry geom = wktReader.read("POINT(54.094434 13.387527)");
Geometry transformed = JTS.transform(geom, mathTransform);
System.out.println(wktWriter.write(transformed));

Returns: POINT (5996634.451525969 4590769.450296965)

This means the GeoTools result is about 60m south of the PostGIS result.

rgdal for R is giving the same result as PostGIS.

Am I doing something wrong in using geotools/jts?


texts:
At this time, I'm able to create a relation (1:M) between two table or geometries. After, I user Identify tool to exploit the relation. It is only possible to use this feature when your Identify tool is done on one (1) geometry.

Here my question:
Is it possible to select multiple geometries in parent table (select by attribute or location) and communicate to the child table the same selection based on their common attribute (pk,fk).

QGIS 2.8


texts: from qgis.gui import QgsMapCanvas - ModuleNotFoundError: No module named 'qgis'

texts:
I created a form with QT Designer, then converted it to a .py file. An error occurs with the line import : from qgis.gui import QgsMapCanvas. It's not recognized. How can I resolved this error in order to run the app ? I'm working on eclipse, on ubuntu. I don't see python in this folder /usr/share/qgis/python/

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(453, 323)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 0, 0, 1, 1)
        self.widget = QgsMapCanvas(self.centralwidget)
        self.widget.setObjectName("widget")
        self.gridLayout.addWidget(self.widget, 1, 0, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.pushButton.setText(_translate("MainWindow", "Shos Map"))

from qgis.gui import QgsMapCanvas

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())


texts: Creating a Line based on the outline of two polygons

texts:
I have two polygons and where they meet, I need to create a new line shapefile. I have used the trace method, but it keeps giving me a polygon. Under construction tools, "line" is not an option.

Do I just have to use the "Draw Tool"?


texts: Remove L.esri.query featureLayer from map ESRI Leaflet

texts:
Using ESRI Leaflet I am adding markers to the map from an ArcGIS online feature service.  I do this using the L.esri.query method similar to:

function slideChange(time1, time2, service) {
    L.esri.query({
        url: service
    }).where("(date_cst BETWEEN DATE '" + time1 + "' AND DATE '" + time2 + "')").run(function (error, pings) {
        trucks = L.geoJSON(pings);
        // remove previously added markers
        removeAllLayers();
        map.addLayer(trucks);
    });
}

Each time I try to call the function I need to remove previously placed markers using leaflet removeLayer() function.

    function removeAllLayers() {
        map.removeLayer(trucks)
    }

The markers are never removed and the map freezes.  How can I remove this specific layer from the map using esri leaflet?


texts: can't save a polygon with grid1.store.proxy.protocol.commit

texts:
I create a polygon but I can't save.. I use a button to draw the polygon
text: "Draw",
    handler: function() {

        var p1 = new OpenLayers.Geometry.Point(-4.5, 32);
var p2 = new OpenLayers.Geometry.Point(-4, 32);
var p3 = new OpenLayers.Geometry.Point(-4, 31.5);
var p4 = new OpenLayers.Geometry.Point(-4.5, 31.5);
var p5 = new OpenLayers.Geometry.Point(-4.5, 32);
var pnt= [];
pnt.push(p1,p2,p3,p4,p5);
var ln = new OpenLayers.Geometry.LinearRing(pnt);
var pf = new OpenLayers.Feature.Vector(ln, null, style);
pf.state=OpenLayers.State.INSERT;
vecLayer1.addFeatures([pf]);

and to save it I use
text: "Save",
    handler: function() {

        grid1.store.proxy.protocol.commit(
            vecLayer1.features, {
                callback: function() {
                    var layers = mapPanel.map.layers;
                    for (var i=layers.length-1; i>=0; --i) {
                        layers[i].redraw(true);
                    }
                    grid1.store.reload();
                }
        });
    }

but it works when I replace the "draw" button code with this
var drawControl = new OpenLayers.Control.DrawFeature(
    vecLayer1,
    OpenLayers.Handler.Point,
    {handlerOptions: {multi: true}});
}

map.addControls([modifyControl,drawControl]);

var draw = Ext.create('GeoExt.Action',{
        control: drawControl,
        text: "Create",
        enableToggle: true
    })

var draw_but = Ext.create('Ext.Button', draw);

I don't want OpenLayers.Handler.Point I want to save a polygon using xy coordinates


texts:
Possible Duplicate:
  How to develop a map with layers in Geoserver?

I'm trying to create a simple map for my city. I have a shape file my city, but I can't create on the web.

I tried to take from geoserver to use geojson format but I didn't. Can you help me please.


texts: Use of RRC(Range Rate Control) in Pseudo Range Correction for satellite

texts: Can anyone tell me the use of RRC in order to calculate the value of PRC(pseudo range correction) in PPK(post processed kinematics)?


texts: How to add intersection vertices to a ShapelyLinestring?

texts:
Assume that I have two shapely LineStrings. I want to find their intersection and then add the intersection point as vertices into the respective LineStrings.
from shapely.geometry import LineString

# Create two LineStrings which intersect at (2,2)
l1 = LineString([[1,1],[3,3]])
l2 = LineString([[1,3],[3,1]])

# Find the intersection of the two lines
newvtx  = l1.intersection(l2)

In this case this would be easy to do manually, but is there a way to do so automatically for more complicated LineStrings?


texts: Doing supervised classification on google maps image to show only hedgerows?

texts:
I would like to then use the hedgerows by bringing it into QGIS as a layer. I need to know what software to use and the method to make such a layer?

I would like to use a google earth image in Grass and do a supervised classification on it for the Wigan, Bolton, Manchester and Salford area (England) They join up as a square and it is in this area I need to identify where hedgerows are located if possible. I have access to QGIS, Grass and Arc. ( I could also use free to download software).

Does anyone know of a way to achieve this?


texts:
I'm trying to manipulate an .IGE file, which I understand is a raster data format developed by Erdas Imagine. The data I've downloaded is the National Land Cover Database (NLCD) 2006 Percent Developed Imperviousness data, available here: http://www.mrlc.gov/nlcd06_data.php

I've tried using winzip and winrar to unzip the file, both of which bring up error messages during the unzipping process. Files do appear, however, in the folder I have designated for extracting the files, including an .IMG file. I can load this .IMG file into ArcMAP 10.1 and QGIS 1.8.0. In either of those programs, I can view the image, but I can't clip it to a shapefile, lest error messages appear. I have tried loading this .IMG file into Opticks 4.10.0 32-bit as well, but an error message comes up indicating the opticks cannot find the file it needs to import.

I wonder if I didn't unzip the compressed file properly? Any suggestions will be greatly appreciated, thanks!


texts: ArcGIS Server 10.4 and ArcGIS Desktop 10.2

texts: I have ArcGIS Desktop 10.2 and ArcGIS Server 10.4 and I wonder if is these two versions are compatible and if it is possible to install and use both of them?


texts: Problem with loading big data (GeoJSON) via PHP

texts:
I have a problem with loading (big) data via PHP from a spatial database. I let run this project on a localhost Apache Server.
From a data count of about 30.000 edges I get an error

VM885:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.success (test.html:197)
    at u (jquery-3.3.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.3.1.min.js:2)
    at k (jquery-3.3.1.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery-3.3.1.min.js:2)

For a smaller amount of data there is no problem and I can easily display the data. So I guess the php-script works.

Why does this happen?

I am calling a php-file via AJAX call (with a parameter which represent the amount of data I want to receive - I do it simply with the ID).

function refreshEdges(whr, callback) {
            if(whr) {
                var objData = {tbl:'laendliches_strassennetz', where:whr};
                } else {
                    var objData = {tbl:'laendliches_strassennetz'};
                }
            $.ajax({
                url:'php/load_data.php',
                data: objData,
                type:'POST',
                success: function(response) {
                    if (response.substring(0,5)=="ERROR") {
                        alert("ERROR: "+response);
                        callback(false);
                    } else {
                        jsnEdges=JSON.parse(response);
                        if (lyrEdges) {
                            lyrEdges.remove();
                        }
                        callback(jsnEdges);
                    }
                }, error: function(xhr, status, error) {
                    alert("ERROR: "+error);
                }
            });
        }

The answer will be handled by a callback function.

var anzahl = $("#loadDataAnzahl").val();
refreshEdges("id < "+anzahl, function(response){
  if(response) {
    lyrEdges = L.geoJSON(response).addTo(mymap);
    });

The php-file just loads data from a spatial database and send it back as a GeoJSON Feature Collection.

$table = $_POST['tbl'];
if (isset($_POST['where'])) {
            $where = " WHERE ".$_POST['where'];
        } else {
            $where = "";
        }
$result = $pdo->query("SELECT {$fields}, ST_AsGeoJSON(geom) AS geojson FROM {$table} {$where}");
$features=[];
                foreach($result AS $row) {
                    unset($row['geom']);
                    $geometry=$row['geojson']=json_decode($row['geojson']);
                    unset($row['geojson']);
                    $feature=["type"=>"Feature", "geometry"=>$geometry, "properties"=>$row];
                    array_push($features, $feature);
                }
                $featureCollection=["type"=>"FeatureCollection", "features"=>$features];
                echo json_encode($featureCollection);


texts:
I'm working on applying some KML files to a google map on a mobile device, and have really been impressed with how easy everything is (so long as you stay inside the norm).

I have run into some trouble, however, in trying to display some text next to the polygon I define in the KML. I would rather not use any more libraries if at all possible.

In example I have seen the name attribute appear next to a marker, but not next to a polygon.

Thanks in advance for your time and please let me know if you want some more info!

Brad


texts: What does "Q" (Quantum) stand for in QGIS?

texts:
I'm one of the QGIS users.

Why did Gary Sherman use 'Quantum' for this software name?


texts:
Context
I have a dockerized QGIS server project running and serving tiles through an OGC WMTS.
E.g. this URL:

http://{baseurl}/?SERVICE=WMTS&VERSION=1.3.0&REQUEST=GetTile&LAYER={my_custom_layer}&STYLE=default&TileMatrixSet=EPSG:3857&TileMatrix=22&TileRow=1079050&TileCol=2274423&format=image/png

shows me a tile in Firefox:

This works great.
But this is an HTTP request and I need to enable HTTPS.
If I query the same tile using HTTPS instead of HTTP, I have to wait forever, nothing happens, and the server stdout doesn't display any incoming requests.
Question
How could I enable HTTPS in my QGIS server?
I didn't find any information about it, either here or there.
Environment
The aforementioned docker image hosted on a Ubuntu 18.04 server machine.
Which gives:
# qgis --version
QGIS 3.10.6-A Coruña 'A Coruña' (ec80021f49)


texts: postgis update multipolygon with st_makevalid() gives error

texts:
I have a table with a few invalid geometries (empty rings, self-intersections). I'd like to fix them up something like this:

update mytable
set geomcolumn = st_makevalid(geomcolumn)
where id = 123;

and I get "ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)"

is there some other function I need to wrap the st_makevalid() in to get a compatible type, or something else?


texts: QGIS status line wrong coordinate format

texts:
I have a QGIS [2.14.5.LTR] project with crs EPSG:31468 which has metric units. In the status line at the bottom of QGIS main window the coordinates are displayed in degree lat/lon:

However, when switching from coordinates to extent the format is correct:

Bug? Feature? Am I missing some hidden secret settings?


texts: Instantiating QgsFeatureFilterModel using PyQGIS

texts:
When I try to create an instance of QgsFeatureFilterModel with PyQGIS like this:
self._model = QgsFeatureFilterModel()

I got this message:

QgsFeatureFilterModel represents a C++ abstract class and cannot be instantiated

This definitely works in the older QGIS version (3.6), but after upgrade to 3.14, it starts to complain.
What is the proper solution?


texts: Fiona + Shapely: Loading a set of LineStrings and writing their centroids to a shapefile, including original properties

texts:
I am using Fiona to load a set of links. Then I put every record in the rows of a pandas.DataFrame. Then I get the centroid of each LineString using Shapely. Afterwards I copy the schema of the original links.shp and change its geometry to 'Point'. Then I write the records from the DataFrame, changing only the coordinates. Take a look:

import pandas as pd
import fiona
from shapely.geometry import LineString
def links_centroider(links, name_for_centroids):
    collection = fiona.open(links)
    records = []
    for i in range(len(collection)):
        records.append( next(collection))
    collection.close()
    geoDF = pd.DataFrame({'type': [i['geometry']['type'] for i in records],
                          'properties': [i['properties'] for i in records],
                          'coordinates': [i['geometry']['coordinates'] for i in records]},
                         index = [i['id'] for i in records])
    geoDF['centroid'] = geoDF.coordinates.apply(lambda x: LineString(x).centroid.coords[:][0])
    with fiona.open(links) as source:
        source_driver = source.driver
        source_crs = source.crs
        source_schema = source.schema
        source_schema['geometry'] = 'Point'
    with fiona.open(name_for_centroids,
                    'w',
                    driver=source_driver,
                    crs=source_crs,
                    schema=source_schema) as collection:
        print(len(collection))
        for i in geoDF.index:
            a_record = {'geometry':{'coordinates':geoDF.loc[i].centroid,
                                    'type': 'Point'},
                        'id': str(i),
                        'properties': geoDF.loc[i].properties,
                        'type': 'Feature'}
            collection.write(a_record)
        print(len(collection))
    print collection.closed

The output shapefile has no info for string properties. For numbers in those properties I get mostly zeros. In other words, values in the fields of the original attribute table of links.shp are not being written to the centroids.shp I want to get.

Any idea about how to solve this?


texts: copy/paste style to multiple layers in QGIS

texts:
I have many shapefiles in QGIS. How can I paste the style of one layer to all the other ones? So a "batch" copy and paste solution.

If I make a multiple selection the the paste style option is not available anymore.


texts: Rgeos drops associated values when intersecting polygons

texts:
I am trying to intersect two SpatialPolygonsDataFrames and get a SpatialPolygonsDataFrame as the result.  Unfortunately, using the gIntersection function from rgeos (which works impressively quickly to intersect the polygons), I cannot seem to retrieve the associated dataframes.  Consider the following example:

> fracPoly <- gIntersection( toSingle, fromSingle )
> class(toSingle)
[1] "SpatialPolygonsDataFrame"
> class(fromSingle)
[1] "SpatialPolygonsDataFrame"
> class(fracPoly)
[1] "SpatialPolygons"

I can write a wrapper function which handles the transfer of data.frames, but it will be a minor pain to get all the checking right and before I did I was hoping someone could either confirm that there's no better way or point me towards another function (or option for gIntersection) which would allow me to retain the associated data.frames.

Update

On further reflection, this may may be very deliberate behavior by gIntersection.  After all, of the two SPDFs, whose data.frame do you pass along?  So I may have to write a wrapper which merges the two.


texts: libmysql.dll-procedure entry point error

texts:
Possible Duplicate:
  How to fix QGIS error “Entry Point could not be located”?

I am working with qgis,pyqt4 and python2.5.
I was getting error qtcore4.dll could not be located.so i set PATH variable as  C:\Python25\Lib\site-packages\PyQt4 so i get rid off it.
But now m getting the error:
  procedure entry error point free_defaults could not be located in the dynamic link library  LIBMYSQL.dll.
what path to set? is it of mysql?


texts:
What is the most easy way for a noob guy in coding to create interactive web-maps ?
In GIS field I've worked with QGIS as open-source software, but keept my project on desktop.
In my research I've found this combination for web maps-- Geoserver+Leaflet.
Right now I'm studying Geoserver's documentation.
Any tutorials to recomend ?


texts: Why Different 2D Coordinate Transformation Methods Exist

texts:
It is a homework question but I couldn't find a satisfactory answer by googling. There are 4 different transformation approaches I'm asked for:
- Conformal,
- Affine,
- 2D Projective,
- 2D Polynomial

I know there are more than these. And I saw how they are implemented, the transformation process, their results etc. The thing I need to know is the task they are used. When should I use 2D Projective transformation and why shouldn't I use conformal transformation instead? What are the real world applications or field of applications for those transformation methods?

The questions above are not from the text I've given, I tried to make the topic clear.
Thanks in advance.