texts: What can the GeoTransform parameters tell me about an incorrectly georeferenced map?

texts:
I have two GeoPDF maps of the same area published a few years apart. There are only minor updates so virtually identical. However the newest map appears to be incorrectly georeferenced. I ascertained this by; loading the map in QGIS and checking the location of various features including the intersection of the UTM grid, extracting the UTM grid to JSON and looking at the grid node coordinates (should be even 1000 multiples), merging an adjoining map using gdal and noticing grid and features like contours are misaligned.

The incorrectly referenced map appears to be rotated (or skewed) slightly such that near the corners the georeferencing is out by about 25-30m.

Adjoining maps seem to be skewed the opposite direction so features crossing over the join are misaligned by about 50-60m

What can the GEOTransform parameters (Esp parameter [2] and [4]) tell me about how the map is rotated or skewed?
I have the two maps parameters below. I would have thought that two maps of the same area with identical datum, projection and scale should have pretty much the same GEOtransform parameters. (Of course the Origin may be different as the map might not be centered the same) What I noted was the older correctly georeferenced map has parameter [2] and [4] that are not much different verses the newer map where they are quite different and this may indicate more rotation or skew?

Latest MAP

PROJCS["GDA_1994_MGA_Zone_56",
    GEOGCS["GCS_GDA_1994",
        DATUM["Geocentric_Datum_of_Australia_1994",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",10000000.0],
    PARAMETER["Central_Meridian",153.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0]]
GeoTransform =
  221129.6669699433, 4.231395266408159, 0.1346913327803821
  6248054.609901944, 0.1185136891607636, -4.231917721984926

Older Version

PROJCS["GDA_1994_MGA_Zone_56",
    GEOGCS["GCS_GDA_1994",
        DATUM["Geocentric_Datum_of_Australia_1994",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",10000000.0],
    PARAMETER["Central_Meridian",153.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0]]
GeoTransform =
  221155.2896939424, 4.233371207500782, 0.1186483868760786
  6248057.969519025, 0.1186525653949765, -4.234389541308537

You can check out the georeferencing of the actual map at:
http://maps.six.nsw.gov.au/etopo/geopdf/25k/8930-3S%20KANANGRA.pdf
Adjoining map:
http://maps.six.nsw.gov.au/etopo/geopdf/25k/8930-3N%20JENOLAN.pdf
The older (correct) map version is not publicly available

I would really like to know an easy way to correct the georeferencing. I am hoping by playing around with the geotransform I can do this.
I can programatically get a number of reference points by extracting the UTM grid node coordinates and rounding them to the nearest even thousand to get the correct coordinates, but not sure the best way to re-reference the map. I would like to do this for 100 maps so want to do it programatically.


texts: I am dragging and dropping this GeoJSON file into QGIS but for some reason I cannot reproject it from WGS 84 (EPSG:4326).  It remains at the original LAT/LONG even in a new project where UTMs are expected.


texts: Generate source_id and target_ id for every segment in a multilinestring geometry (PostGIS|PgRouting)

texts:
I am working on a project that requires finding the shortest path and to achieve this, I've used the PgRouting dijkstra function and it's all worked out perfectly.

Initially, the road network was imported using an osm file. The table created consists of multilinestring geometry types.

How can I transform the multilinestring into linestring and give  each of them a source id and targer id so that dijkstra function gives the shortest path starting next to the point it has localised.

Thanks all !


texts: Gdal Ogr2Ogr Split polygon shapefile by line shapefile

texts:
I have two shapefiles, a polygon shapefile (lake) and a line shapefile (boudary) I want to create a new shapefile containing the polygon splitted by the polyline using ogr2ogr.

how can i do this?


texts: Adding WMS layer without crossdomain.xml after map load in Flex

texts:
I have a problem with loading a WMS layer using a widget made for Flex Viewer. The server I want to use doesn't have a crossdomain.xml file. I'll show a lot of info here so sorry for a little chaos, but I need a clue what's going wrong.

When I add this layer to config.xml, its working. The site makes a call for crossdomain.xml (results 404) but the layer somehow still works. The code:

<layer url="http://mapy.geoportal.gov.pl/wss/service/pub/guest/G2_BDOT_BUD_2010/MapServer/WMSServer"
    alpha="1"
    visible="true"
    type="wms"
    label="BDOT"
    visiblelayers="3,4,5,6"
    version="1.3.0"
    skipgetcapabilities="true"
    imageFormat="png"/>

However if I try to load this layer using a widget it gives a security error.

[FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="62DC1CFD-5BD7-DD2E-44A2-9D0782B55D4C" type="fault" bubbles=false cancelable=true eventPhase=2]

Everything is working when I'm running a local version (using Flex Viewer debug). However if I build the app and put in on server, that's a call for crossdomain.xml the security error occurs.

Widget works like this:

1. call layer URL with GetCapabilities as XML
2. declare new WMSLayer object
3. set the WMSLayer object parameters using values form XML
4. add layer to map

The separate call for GetCapabilities its from my predecessors code. I tried disabling it and turning skipGetCapabilities="false" but it gives me error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/createChildren()
    at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/onLayerLoad()

on the 472 line of TocMapLayerItem.as file, that's this line:

if (wmsVisibleLayers.source.indexOf(wmsLayerInfo.name) !== -1)

I tried to make a proxy, but that's not working - when on a server my app just tries to call server with WMS layer for crossdomain.xml, and that's all, not trying to use proxy at all.

I'm glad for any help or a clue of what's going on. I'm pretty new to Flex Viewer, I know the crossdomain.xml is needed, but they are not willing to set it up on server, the client wants layers from this server to be available, and THEY ACTUALLY WORK when I simply put them in config.xml instead odd trying to add to map later.

Also my app gives me an error just after loading, don't know if this has something to do with the WMS problem but here it is:

TypeError: Error #1034: Type Coercion failed: cannot convert _index_mx_managers_SystemManager@d3a0999 to flash.display.Bitmap.
  at spark.primitives::BitmapImage/contentComplete()
  at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::loader_completeHandler()


texts: Configuration of QGIS Server with Apache Web Server on Windows 7 (64 bit)

texts:
I have installed QGIS Server(version 2.X) on my machine (Win. 7 64 bit OS & installed on C:\OSGeo4W64) while installing I found that for 64 bit Apache web server was not available hence its separately installed on C drive (C:\Apache24)

Now tested Apache server installation and it works successfully in web browser for port 80.

I am following this question and this link for installation reference so where should I put "OSGeoW64" folder in Apache web server, to test http://localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities& this URL?

Any help will be great


texts:
Instead of georeferencing the image and deforming it, I'm trying to find the projection used by the author of the image.

I've got tens of these distribution maps to digitize. The idea is to avoid image distorsions and to find only the parameters of pixel dimension and top-left corner coordinates to move maps in the correct position. To do that I need the original coordinate system.

I used ArcGis 10.2.1 to compare and customize different coordinate systems, but no one matched and the variable parameters for every projection were few. I used Flex Projector, but it's not possible to import and overlap an image for a comparison, moreover the software exports many parameters I cannot use in a desktop GIS. Using EPSG codes in Qgis would take me months to find the proper one.

Any ideas how to solve it? or which GCS could fit better?


texts: How to store multi-valued attributes in PostGis using Postgresql

texts:
I have a with meterid,meterreading,reader and date read.I wish to store this data using Postgis database.

I used this code via postgresql to create the table

CREATE TABLE MeterRdg(
    meterid VARCHAR(5) NOT NULL PRIMARY KEY,
    reading integer,
    reader VARCHAR(15),
    DateRead date)

I then tried to insert data into the table using the following command

INSERT INTO MeterRdg(meterid, reading,reader,DateRead)
VALUES
('M1',871.31,'Kamau','26/02/2015'),
('M2',624.53,'Kamau','26/02/2015'),
('M3',531.47,'Kamau','27/02/2015'),
('M1',926.44,'Ochieng','25/03/2015'),
('M2',761.31,'Ochieng','26/03/2015'),
('M3',683.51,'Ochieng','26/03/2015')

I get the following error:

ERROR:  duplicate key value violates unique constraint "meterrdg_pkey"
DETAIL:  Key (meterid)=(M1) already exists.

How can I redesign the CREATE table command such that M1,M2,M3 can hold multi-values?


texts: Typecast from circularstring to polygon in postgis

texts: How can i type typecast a CircularString Polygon or Multipolygon in PostGIS? I am doing so because CircularString Datatype is not supported by QGIS and i have to create a circle or ellipse, and it should get display on QGIS map canvas.


texts: Export Google Earth Engine Landsat Image to Google Drive not working in Python API

texts:
I am trying to export a collection of Landsat images (but at this point I will settle for a single image) from Google Earth Engine to my Google Drive. I am using the Python API from my local terminal but I can not get the Export.image.toDrive (or ee.batch.Export.image.toDrive) to work. I even tried the code in the JavaScript code editor (in JavaScript, not Python) and it didn't work there either.

I have tried everything I can find on Google API Docs, StackOverflow, and GIS StackExchange - nothing has worked for me.

Eventually I need to iterate over an ImageCollection but to keep it simple for initial export here is my code for a single image:

#python
import datetime
import ee
import ee.mapclient

ee.Initialize()

#download a polygon to clip the collection of images down to
okla = (ee.FeatureCollection('TIGER/2018/States') #get oklahoma polygon to filter images by, this polygon is correct
    .filter(ee.Filter().eq('NAME','Oklahoma')))

#download image collection
collection = (ee.ImageCollection('LANDSAT/LE07/C01/T1_SR')
             .filterDate(datetime.datetime(2012, 1, 1),
                         datetime.datetime(2012, 1, 30)) #set dates to download (year,month,day)
            .filterBounds(okla)) #this is not a full clip

#condense collection to single image (do not want to do this in the future)
image1 = collection.mean() #takes the average of images in collection

image2 = image1.clipToCollection(okla) #this works and actually clips images to outline of Oklahoma

taskToexport = ee.batch.Export.image.toDrive(
        image = image2,
        description = 'test1',
        )

taskToexport.start()


texts:
I would like to create panoramic images such as the ones in the attatchment. My current software pallate is ESRI Advanced, SAFE FME,Adobe Illustrator and of course anything opensource.

I could fumble around with Illustrator to make similar results, but I thought someone might have made something similar.


texts: FME 2016 - FeatureMerger, row data to columns

texts:
I'm not able to get it work to "dissolve" data from rows to columns based on a join field.

My source is connected twice to the FeatureMerger in FME 2016. It's connected to the Requester port and to the Supllier port.
The join is made on column id and Process Duplicates is set to Yes.

Below is an image of the source and I want to achieve (ESTIMATED RESULT). See image.

Any suggestions?


texts: How to create contour plot with grided shapefile in QGIS

texts:
I'm dealing with the gridded shpefile with different color in each pixel. The gridded figure looks like this:

I want to transform the pcolormesh plot into contour plot. I have tried the contour plugin which can generate contours of set of data points.

But the shapefile which I have uploaded here can not be imported into the contour plugin as a vector layer.

It seems that the original shapefile need to be pre-processed.


texts: Simple way to detect/select border polygons of a shapefile

texts:
I am looking for a simple way to detect/select border polygons of a shapefile. Border polygons are here polygons that are not completely surrounded by other polygons i.e. polygons located at the periphery of the shapefile (the extent of the shapefile is entirely cover by polygons). In the example below, the desired polygons are shaded:

Solution using Arcgis, QGIS, R, Python are most welcome.


texts: WMS tile overlay displays only after map pan

texts:
I am new to Leaflet and OSM. I am trying to overlay a radar layer which is WMS tile layer. The map will load, but the WMS tile layer does not show unless I pan the map and then it displays. It also does not display on mobile devices regardless if I pan the map. I have this same issue with my icons on mobile too. How can I get this tile layer to load when the base map loads?

    var map = L.map('chaserMap', {
    fullscreenControl: true,
})

var gl = L.mapboxGL({
    accessToken: token,
    attribution: '&copy; OpenStreetMap contributors',
    style: 'mapbox://styles/mapbox/streets-v11',
    maxZoom: 14,
}).addTo(map);

var pulsingIcon1 = L.icon.pulse({iconSize:[18,18],color:'black'});
    L.marker([33.1712, -96.7039],{icon: pulsingIcon1,title: 'TEST ICON 1'}).addTo(map);

var pulsingIcon2 = L.icon.pulse({iconSize:[18,18],color:'black'});
    L.marker([33.0172, -96.5510],{icon: pulsingIcon2,title: 'TEST ICON 2'}).addTo(map);

var radar_current = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0q.cgi", {
          layers: 'nexrad-n0q-900913',
          format: 'image/png',
          transparent: true,
          opacity: 0.3,
          attribution: "Weather data © 2016 IEM Nexrad"
}).addTo(map)

map.setView([32.8998, -97.0403], 8);

I have even tried this and still acts with the same behavior.

var map = L.map('chaserMap', {
    fullscreenControl: true,
})

var gl = L.mapboxGL({
    accessToken: token,
    attribution: '&copy; OpenStreetMap contributors',
    style: 'mapbox://styles/mapbox/streets-v11',
    maxZoom: 14,
}).addTo(map);

var pulsingIcon1 = L.icon.pulse({iconSize:[18,18],color:'black'});
    L.marker([33.1712, -96.7039],{icon: pulsingIcon1,title: 'TEST ICON 1'}).addTo(map);

var pulsingIcon2 = L.icon.pulse({iconSize:[18,18],color:'black'});
    L.marker([33.0172, -96.5510],{icon: pulsingIcon2,title: 'TEST ICON 2'}).addTo(map);

var radar_current = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0q.cgi", {
          layers: 'nexrad-n0q-900913',
          format: 'image/png',
          transparent: true,
          opacity: 0.3,
          attribution: "Weather data © 2016 IEM Nexrad"
});

map.addLayer(radar_current);

map.setView([32.8998, -97.0403], 8);

Here is a test link with just the map:

http://media.dfwstormforce.com/test/test.html

If you click the zoom out or zoom out via wheel, you will see it try to load, but never does. Now if you pan the map the layer will load and stay. Once I have had it load after like 30 seconds of not doing anything, but I have sense been able to replicate it. I think it might be something with MapBox maybe? I feel like it might be a z-index issue with the WMS layer being below the MapBox tile layer. Anyway to set the layer order so that WMS layer is above the MapBox tile layer?


texts: Performing histogram streching using gdal_translate?

texts:
I have some rasters I want to perform histogram stretching on, and I want to use only open source tools, preferably using shell/bash command line.

I was thinking of using gdal_translate with setting -scale for minimum and maximum, but maybe there is something else that can automatically set min and max, do you know about something like that, please?

Is there in gdal_translate possibility to scale with bigger color depth than 2^8?


texts: Using GDAL GetProjection information to make coordinate conversion in pyproj

texts:
I'm opening a geoTIFF file in Python using gdal. Upon reading with the GetProjection() method, I find the following information

PROJCS["NAD83_HARN_UTM_zone_15N",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",500000.0],PARAMETER["false_northing",0.0],PARAMETER["central_meridian",-93.0],PARAMETER["scale_factor",0.9996],PARAMETER["latitude_of_origin",0.0],UNIT["Meter",1.0],VERTCS["NAVD_1988",VDATUM["North_American_Vertical_Datum_1988"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]]

Using this information, and my x,y information for my points, I'd like to convert them to WGS84 to compare with Google maps. So I tried doing the following:

wgs84=pyproj.Proj(init='epsg:4326')
p2=pyproj.Proj(init='epsg:3745')
print pyproj.transform(p2,wgs84,*upper_left)
print pyproj.transform(p2,wgs84,*bottom_right)

where I manually looked up the code for NAD83_HARN_UTM_zone_15N.

Surely me looking up the code for the p2 projection is not the best way to do this, as different files can have different projections listed, and I can't process things automatically if I have to do this step manually.

How do I do this without manual lookup?


texts: what is the minimum to install of QGIS for it to work?

texts:
This may sound like a daft question, but I'm looking to understand what the minimum parts of the install procedure I need to install to get QGIS to work (i.e. can it be installed without GRASS etc?) as I'm looking for the easiest way to roll this product out to a number of users preferably via a packaged installer, so any suggestions/hints would be greatly appreciated.

Thanks


texts: Move QGIS3 bookmark panel to be in the menu bar without creating a plugin

texts:
Is it possible to move the Bookmarks from a panel to be in the top menu bar - so you would get ...Edit--View--Bookmarks--Layer...

and clicking on Bookmarks have a dropdown that has Sydney, Melbourne etc as the point to zoom to?

I understand that we can create a plugin for this but is there a simple customization change that can be done to achieve this?

In Interface Customization all I see it Widgets--QgsBookmarksBase--buttonBox and nothing to make this a menu item.


texts:
I'm a programmer, and I'll probably have to write code for some kind of a Geoserver based platform. (probably will have to maintain the server too).
My knowledge in geography is (shamefully) quite minimal and my background in GIS  is 0.

I seek a programmer-oriented list of things I better add to my to-do list, in order to turn from someone new to an expert in the least painful way possible.

What I've done so far:

Skimmed through the Geoserver manual (including the REST API manual)
Got a book called "GeoServer Beginner’s Guide" and read a little.


texts: Is there any other option to display DMS grid and graticule in QGIS Print Composer?

texts: Is there any other option to display DMS grid and graticule in QGIS Print Composer, since there is no plugins available yet?


texts: How to add a MSSQL spatial layer using Python?

texts:
I'm having difficulty adding a MSSQL spatial data layer using Python. The database is password protected, and I can add the layer without any problems using the built in feature, but I can't make it work with a Python script.

I have been trying to follow the advice on this website without any success.

Using the following script (except with the actual variables obviously) gives me a 'Invalid layer' error every time and I have tried with various different syntax:

uri = "MSSQL:server=xx.xx.xx.xx,database='MYDBNAME',user='MYUSERNAME',PWD='MYPASSWORD',tables=dbo.MYTABLENAME"
qgis.utils.iface.addVectorLayer(uri,'newlayer','ogr')

Any help would be greatly appreciated. I'd also like to be able to run SQL queries on this as well so if anyone has some advice that would be great.

The advice on the qgis website explains how to load just about every other type of layer except MMSQL (http://www.qgis.org/en/docs/pyqgis_developer_cookbook/loadlayer.html)


texts:
I have a problem: I need to create a raster with all pixels values = 0, but one of these pixels must have the value =  1. This pixel has especific XY coordinates related to an in situ station.

I need this raster to use as input in a hydrological model. I'm using ArcGis to do this task.


texts:
I have several KMZ files that i want to import into QGIS, when i import any one it contains many features with different geometries and i only need the points one

the problem is when i try to merge them using mmqgis it says that i cant merge those layers saying that (points != 2.5d points) ,so:

1) is there a way to merge all those points without losing the data?

2) is there a way to detect the (2.5d points) and separate them so i can normally merge all the other points and i would manually add those points myself?


texts:
So I have a KML file (it contains a point):
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Folder>
    <Placemark id="linestring1">
        <name>My path</name>
        <ExtendedData>
            <Data name="curp">
                <value>GOCE850925HQRNND05</value>
            </Data>
        </ExtendedData>
        <description/>
        <Point>
            <coordinates>19.38695565339294,-99.2836972</coordinates>
        </Point>
    </Placemark>
</Folder>

what I need is to save in my PostGIS database, I use the following command line with ogr2ogr :
ogr2ogr  -f PostgreSQL PG:"host=127.0.0.1 dbname=postgis_24_sample port=5432 user=postgres password=123456" 1597780353.kml  -nln  ppb_curp_webmerc 2>&1

But I get the following error
local.DEBUG: Warning 1: Geometry to be inserted is of type Point, whereas the layer geometry type is
Multi Polygon.
Insertion is likely to fail
ERROR 1: ERROR:  Geometry type (Point) does not match column type (MultiPolygon)
ERROR 1: INSERT command for new feature failed.
ERROR:  Geometry type (Point) does not match column type (MultiPolygon)
Command: INSERT INTO "ppb_curp_webmerc" ("geom" , "curp", "name", "description", "tessellate", "extrude", "visibility") VALUES ('0101000000D7BD04C4E3633340E0FD4C1828D258C0'::GEOMETRY, 'GOCE850925HQRNND05', 'My path', '', -1, 0, -1) RETURNING "gid"
ERROR 1: Unable to write feature 1 from layer 1597780353.
ERROR 1: Terminating translation prematurely after failed
translation of layer 1597780353 (use -skipfailures to skip errors)

Any comment?


texts: Python/shapely: unary_union raises AttributeError: 'map' object has no attribute '_geom'

texts:
I am updating from Python 2.7 to Python 3.6. I have code that worked before and now raises an error where it uses shapely.ops.unary_union(). The argument used with that call is a GeoJSON object

{'type': 'FeatureCollection',
 'features': [
     {'geometry':
         {'type': 'Polygon',
          'coordinates': (((389331.5078411353, 5521519.426939811), (389331.9797582473, 5521513.321540129), (389330.07324640994, 5521514.852591204), (389331.5078411353, 5521519.426939811)),)},
          'type': 'Feature',
          'properties':
              {'ZoneMean': 0.35,
               'FERTILITY_': 'VR',
               'PolyArea': 0.0,
               'ZoneID': 6,
               'ZoneMin': 0.26,
               'id_1': 0.0,
               'PolyMean': 0.35,
               'ZoneArea': 39.0,
               'FieldOpID': 142925.0,
               'FieldID': 632891.0,
               'Id': 0.0,
               'ZoneMax': 0.41}},
       {'geometry':
           {'type': 'Polygon',
            'coordinates': (((389233.9246038566, 5521227.342725102), (389220.1242731925, 5521226.14937102), (389192.8088917327, 5521233.278642576), (389186.0853303991, 5521234.682576215), (389186.82531866303, 5521236.313554208),

etc.

The above GeoJSON object is put into a map before being passed to the unary_union function:

def to_shape(feature):
    geom = shape(feature['geometry'])
    if geom.is_valid:
        return geom
    return geom.buffer(0)

def get_shapes(zone_map_utm):
    return map(to_shape, zone_map_utm['features'])

...
x = unary_union(get_shapes(geojson_dict))

The error being raised is this:

File "/home/james/miniconda3/envs/py3/lib/python3.6/site-packages/shapely/ops.py", line 147, in unary_union
  subs[i] = g._geom
AttributeError: 'map' object has no attribute '_geom'

The shapely version is 1.6.4

Can anyone comment as to what may be amiss?


texts: How to select a specific tab at opening in the QGIS options dialog?

texts:
I want to open QGIS options dialog (menu Settings > Options) programmatically and focus a specific tab.
I saw the QgisInterface.showOptionsDialog class method description :

virtual void QgisInterface::showOptionsDialog     (   QWidget *   parent =
nullptr,      const QString &     currentPage = QString()     )
Opens the options dialog.
The currentPage argument can be used to force the dialog to open at a
specific page.

but I don't know which value enter for currentPage.


texts:
I'm trying to use the 'Hex grid from layer bounds" script to reproduce the simple "Mapping density with hexagonal grids" from the Learning GIS book.  When I run the script "as is" I get the error:  Data Source() invalid.

I did stumble upon a pretty good Q&A where there were multiple examples of how to rewrite the script but all of them gave different types of errors:
For example this script:

import processing
layer = canvas.layer(0)
cellsize = 1000
input = processing.getobject(layer.name())
centerx = (input.extent().xMinimum() + input.extent().xMaximum()) / 2
centery = (input.extent().yMinimum() + input.extent().yMaximum()) / 2
width = (input.extent().xMaximum() - input.extent().xMinimum())
height = (input.extent().yMaximum() - input.extent().yMinimum())
grid="grid.shp"
processing.runandload("qgis:creategrid", cellsize, cellsize, width, height, centerx, centery, 1, input.crs().authid(), grid)*

generates an error:

  name 'canvas' is not defined See log for more details

I'm pretty much a newbie with QGIS.

I'm using QGIS version 2.8 on a Macbook Pro.


texts: Developing application with Qt + QGIS or with PyQGIS + QGIS

texts:
I'm a n00b developer in the GIS arena, developing a desktop application that will have a window to display map data, along with other windows to perform operations over the data. I also would like to display a layer with Google Maps tiles, were overlay data will be displayed.

I understand that there are two major options to build this application if one is to use QGIS for the cartography part:

Qt + QGIS
PyQGIS + QGIS

Can anybody give guidance for the reasons to choose one options over the other one? Some topics I'm interested to consider are:

Differences in performance;
Code maintainability and extendability.


texts: "Data-defined size is not enabled!" - error when trying to create legend

texts: I would like to make a legend to a map in qGIS 3.18 using proportional symbology based on an integer field. When I go to Layer Properties -> Symbology -> Advanced -> Data-defined Size Legend, I get an error message saying "Data-defined size is not enabled!". Would anyone have any ideas what could be the reason?


texts: How do I stop QGIS from crashing when trying to create a DEM from a contour line file?

texts:
I am trying to use the same methodology I have used in the past to create a DEM from a line shapefile containing contours. However, it keeps crashing when I follow this methodology. (Using QGIS 3.10.9 with GRASS 7.8.3.)
I load the Mapset and then use v.in.ogr.qgis to create the output vector file. It seems to finish successfully although it gives warnings that say "file not found for location." I'm not quite sure what file it is talking about. This is the dialog it generates:
file not found for location
Over-riding projection check
Check if OGR layer "contours" contains polygons...
file not found for location
Creating attribute table for layer "contours" ...
Default driver / database set to:
driver: sqlite
database: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
Importing 31 features (OGR layer "contours")...
Building topology for vector map "contours_vector@POCC"...
Registering primitives...
Successfully finished
Then I use v.to.rast.attr and use the output vector file as the name of the input vector map. That filename shows up in the dropdown box, but when I select it, the program hangs up and a minute later it says "QGIS unexpectedly crashed."  I did look at the attribute table for the output vector file and noticed that it did not contain the contour values, just a column labeled "cat". I don't know if this is normal or not.
There may be something I'm not setting correctly, but I don't know what it might be. Any ideas?
I don't know if the stack trace is of any help, and I'm not quite sure how to keep all of the text from running together but here is the stack trace.
RtlRaiseStatus :
?? ::FNODOBFM::string' : longjmp : G_fatal_error : G_getenv : db_read_dbmscap : db_start_driver : db_start_driver_open_database : QgsGrassVectorLayer::fields qgsgrassvector.cpp:124 QgsGrassModuleInput::currentFields qgsgrassmoduleinput.cpp:1076 QgsGrassModuleVectorField::updateFields qgsgrassmoduleparam.cpp:1120 QMetaObject::activate : QgsGrassModuleInput::onLayerChanged qgsgrassmoduleinput.cpp:1242 QMetaObject::activate : QWidgetLineControl::default constructor closure' :
QComboBox::setCurrentIndex :
QComboBox::setCurrentIndex :
QWidgetLineControl::`default constructor closure' :
QMetaObject::activate :
QAbstractItemModel::endInsertRows :
QStandardItemModel::insertRows :
QStandardItem::insertRow :
QStandardItemModel::insertRow :
QComboBox::insertItem :
QgsGrassModuleInput::onChanged qgsgrassmoduleinput.cpp:1180
QMetaObject::activate :
QComboBox::qt_static_metacall :
QMetaObject::activate :
QLineEdit::qt_static_metacall :
QMetaObject::activate :
QWidgetLineControl::finishChange :
QWidgetLineControl::internalSetText :
QComboBox::setCurrentIndex :
QComboBox::setCurrentIndex :
QgsGrassModuleInputComboBox::hidePopup qgsgrassmoduleinput.cpp:606
QComboBoxPrivateContainer::eventFilter :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:418
QCoreApplication::notifyInternal2 :
QApplicationPrivate::sendMouseEvent :
QSizePolicy::QSizePolicy :
QSizePolicy::QSizePolicy :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:418
QCoreApplication::notifyInternal2 :
QGuiApplicationPrivate::processMouseEvent :
QWindowSystemInterface::sendWindowSystemEvents :
QEventDispatcherWin32::processEvents :
UserCallWinProcCheckWow :
DispatchMessageWorker :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main main.cpp:1606
BaseThreadInitThunk :
RtlUserThreadStart :
QGIS Info
QGIS Version: 3.10.9-A Coru�a
QGIS code revision: bf47e9d3e1
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 3.0.4
Running against GDAL: 3.0.4
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 6.1.7601


texts:
I am using ubuntu 16.04.2 server, I recently upgraded my Geoserver 2.10.5 to 2.12.0. When I was using 2.10.5 everything was working... including the init script. My original update plan was to download the newest geoserver and create a symbolic link to the new version and change all references of 2.10.5 to "cur". example:

  GEOSERVER_DATA_DIR=/usr/share/geoserver/geoserver-2.10.5/data_dir

to

  GEOSERVER_DATA_DIR=/usr/share/geoserver/cur/data_dir

This way I could switch between versions easier. Later after having trouble getting the update working I changed all references directly to 2.12.0 example:

  GEOSERVER_DATA_DIR=/usr/share/geoserver/geoserver-2.12.0/data_dir

I am using the init script from the geoserver website here, but for 2.10.5 I had changed the following variables to match my system:

USER=geoserver
GEOSERVER_DATA_DIR=/usr/share/geoserver/geoserver-2.12.0/data_dir
GEOSERVER_HOME=/usr/share/geoserver/geoserver-2.12.0/geoserver
JAVA_HOME=/usr/lib/jvm/java-8-oracle
JAVA_OPTS="-Xms128m -Xmx512m"

while in the init.d directory I have run the following commands:

sudo update-rc.d -f geoserver remove
sudo update-rc.d geoserver defaults

On starting up my server geoserver seems to be running but the website is not up. But if I run startup.sh the website works normally.

I am able to start stop and restart the service.

How do I get my updated geoserver to start when my server starts up?

****** Edit 12/11/2017 ******

If I get the status of the geoserver service I get the following:

● geoserver.service - LSB: GeoServer OGC server
   Loaded: loaded (/etc/init.d/geoserver; bad; vendor preset: enabled)
   Active: active (exited) since Mon 2017-12-11 16:01:24 UTC; 3min 24s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1289 ExecStart=/etc/init.d/geoserver start (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0

Dec 11 16:01:23 ubuntu-xenial systemd[1]: Starting LSB: GeoServer OGC server...
Dec 11 16:01:24 ubuntu-xenial geoserver[1289]:  * Starting GeoServer daemon geoserver
Dec 11 16:01:24 ubuntu-xenial geoserver[1289]: start-stop-daemon: user 'geoserver' not found
Dec 11 16:01:24 ubuntu-xenial geoserver[1289]:    ...done.
Dec 11 16:01:24 ubuntu-xenial systemd[1]: Started LSB: GeoServer OGC server.

I then changed the USER in the init script to the following:

USER=ubuntu

I ran the following commands:

sudo update-rc.d -f geoserver remove
sudo update-rc.d geoserver defaults

When I restart the server I get the same error. Somehow the user geoserver is still being used.

I have also deleted /etc/init.d/geoserver and recreated it with the ubuntu as the user, and I still get the same error.


texts:
I used shields in CartoCss to show the subway stations on my map. When I started to develop the map for mobile devices, I noticed that svg images in shields were destorted hugely and I decided to use markers instead of shields.
But then I found that I can`t set min-distance between markers rather than for shields. Before I could draw just one sign of subway entrance with label by setting min-distance between shields. But now markers draw each entrance with label and I have several similar images with labels for one station.

Is it possible to set min-distance for markers somehow? Or maybe there are other ways how to show just one station?


texts:
I can successfully get raster information when the raster file is located on my local file system:

import gdal
from gdalconst import *
filename= "MOD11A1.A2012193.h11v11.005.2012196013534.hdf"
dataset = gdal.Open( filename, GA_ReadOnly )
print ( dataset.GetDriver().ShortName,dataset.GetDriver().LongName)

Output:

('HDF4', 'Hierarchical Data Format Release 4')

But, when I try this with the same raster file, which this time is located on a ftp server, I get an error:

import gdal
from gdalconst import *
filename="ftp://ladsweb.nascom.nasa.gov/allData/5/MOD11A1/2012/193/MOD11A1.A2012193.h11v11.005.2012196013534.hdf"
dataset = gdal.Open( filename, GA_ReadOnly )
print ( dataset.GetDriver().ShortName,dataset.GetDriver().LongName)

Output with error:

ERROR 4: `/vsimem/http_1/MOD11A1.A2012193.h11v11.005.2012196013534.hdf' not recognised as a supported file format.

('HDF4', 'Hierarchical Data Format Release 4')

Why is this?


texts: Fixing polygon self-intersection in QGIS?

texts:
I am attempting to mask a raster to US Forest Service boundaries in QGIS. It fails due to self - intersections of polygons.

Warning 1: Ring Self-intersection at or near point -109.90112962000001 43.649977879999994
ERROR 1: Cutline polygon is invalid.

I have run the check validity tool and a new shapefile is created but it too finds the same error when attempting to mask the raster to the "valid" shapefile.

I have also attempted to dive into the v.clean tool with unsuccessful results using both bpol and snap separately. I don't fully understand what this tool is doing, but it outputs a number of polygons that match some Forest Service land but excludes the majority of their land.

I also ran v.build.check to find topological errors and it created an output that is seemingly empty. Nothing in the attribute table, nothing visible on the map.

There have been similar questions on here but I haven't been able to make their solutions work.

I downloaded and used GRASS to attempt to fix the self-intersecting polygons. GRASS upon v.in.ogr recommended I snap at 1e-6. I did this and the output said I had 1 area overlapping left when previously I had thousands. So I saved the shapefile and imported to QGIS to being my analysis over there. The check validity tool found 185 self-intersecting polygons.

Still unable to use the clipper to create a Mask, I decided to look at the error output on the Map. The snapping tool isn't fixing these nodes.

Here's a larger picture of the area.

I wonder if it would be easiest just to dissolve these shapes in some way.


texts: Automated QGIS print composer does not show layers with rule based style

texts:
I am using QGIS 2.18.13 and inside my plugin, I call a templet which the should create a new map as a PDF. The code I use for that is as follows:

from PyQt4.QtXml import *
templet = "C:\\my_templet\\templet.qpt"
template_file = file(templet, 'rt')
template_content = template_file.read()
template_file.close()

maprender = iface.mapCanvas().mapRenderer()
composition = QgsComposition(maprender)

docu = QDomDocument()
docu.setContent(template_content)
composition.loadFromTemplate(docu)

map_report = composition.getComposerMapById(0)
map_report.zoomToExtent(maprender.extent())
#map_report.updateCachedImage() # added for testing did not change anyting

composition.refreshItems()
composition.exportAsPDF("C:\\my_folder\mypdf.pdf")

The map is created with the correct layout, but all layers, which have a rule-based styling are not shown. Neither are labels which have rule-based labeling. When changing the style to a categorized styling. The layers are shown correctly, which means the coordinatesystem is not to blame.

Reading the documentation of the QgsComposition class didn't yield any insights for me.

Question:

How to make the rule-based layers appear in my final PDF without changing them into categorized styling?

Additional Info:

When I use the same templet to create a map manually, all layers are shown correctly and as expected.

As requested:

Or I simply style according to the scale. Both cases dont show in the map.

Update:

The error with rule-based styling seems to arise from the setting of the scale. When I dont set a scale, the layer style and labels will be displayed correctly. So I assume that I miss to the composer which zoom it has.


texts: ArcMap 10.3 Display different extents in Layout view (same dataframe)

texts:
I have a Layer with around 100 rather small polygons that are quite far apart spatially. If i want to make a single map with them you can barely see the fill colour of the polygons.
The solution i'm familiar with is to create multiple dataframes with each single dataframe showing a set of polygons that are close to each other.
However with this solution I would end up with about 8 Dataframes the problem with that being on one hand slowed performance but more importantly, whenever I want to change the symbology of my layer i have to do so in every dataframe?!

Desired Solution:

Either a way to show different extents of the same dataframe in the Layout view
Or a way to link dataframes so that a change of symbology in the original dataframe is simultaneously done in every copy of said dataframe.


texts: Add attribute value from a Point layer to a Line layer in QGIS

texts:
I have extracted nodes from a line shapefile.
On these nodes, I have extracted altitude values from a raster DEM using SAGA 'Add raster value to point'.

I want now to make the inverse of the first operation, i.e. getting the original lines again, but with the new altitude on each of their points (so stored in the geom).
I obviously can't make a join on attributes. And a union doesn't keep the fields of the points.

How would you do that, if it's possible?


texts: Failed connection with .sqlite file in QGIS converted from osm by spatialite

texts:
I have converted a *.osm file to a *.sqlite file using the spatialite_tool i.e sspatialite_osm_map..

Now I want to view the map using QGIS.  However, at the time of using the add spatialite table option I am getting an error:

  Failure while connecting .sqlite file - seems to be a valid SQLite DB,
  but not a SpatiaLite one ...


texts: Certain points cause Trace Geometric Network tool to crash

texts:
Using ArcGIS Desktop 10.2.1.  I have a set of about 600 points that I’m using as the flag input on the trace geometric network tool.  Every time I ran the tool with these points, it crashes, along with ArcMap or ArcCatalog, whichever its being run from.  I began isolating the points/flags and found that it was crashing only on certain points.  Since the crash doesn’t provide any information on the cause, I have no way of knowing what’s causing it or whats different about these points that's causing it to crash.  Has anyone experienced an issue like this?  The crash occurs on any trace task type.

The points are in NAD83 State Plane and stored in a file gdb.  I have been able to isolate a few points that cause the crash and yes, when I run it on one of those points, it crashes.  It works fine on the rest of the points.  I have not been able to figure out the difference between the points that cause the crash and the ones that don't.  The issue occurs on the trace tool in modelbuilder.  When I run the trace tool outside of modelbuilder, I experience similar results where the good point(s) run fine, however, the bad point(s) generate error 999999 "Invalid network element id".  I have not found any google information on this.  All the "invalid network element id" search results refer to reconciling data, which I'm not doing.


texts: How to sort features in a layer using OGR/Python?

texts:
How can I sort the features of an ogr layer by the values of a field?
I tried naive variations of

def sortlayer(ds, layer, field):
    lname = layer.GetName()
    lsort = ds.ExecuteSQL(b'select * from "{}" order by {}'.format(lname, field))
    ds.DeleteLayer(lname)
    ds.CopyLayer(lsort, lname)

but this either crashed or freezed.

Bonus points for a solution that doesn't change the order of layers in the datasource and/or that doesn't rely on unique layer names.

Actually the datasources are in-memory (memory-driver), and I may have up to 10 layers with up to 10.000 features over all.

Maybe it would be better not to use SQL but create an index as list, and then swap features around in the layer with Layer.GetFeature()/.SetFeature()?

Thanks, Redoute


texts: UBUNTU 16.04, QGIS 3.4 above Installation problem

texts:
I want to install QGIS 3.4 above and did exactly the same as this page:
QGIS Installers

and tried the codes below having no error at all:

(1) add the following lines to /etc/apt/sources.list

deb https://qgis.org/ubuntu xenial main

deb-src https://qgis.org/ubuntu xenial main

(2) wget -O - https://qgis.org/downloads/qgis-2017.gpg.key | gpg --import

gpg --fingerprint CAEB3DC3BDF7FB45 which gives the results below:

pub   2048R/BDF7FB45 2017-08-16 [expires: 2019-08-16]
      Key fingerprint = 61E0 A086 749E 463E DE50  2255 CAEB 3DC3 BDF7 FB45
uid                  QGIS Archive Automatic Signing Key (2017)
sub   2048R/E959BBCF 2017-08-16 [expires: 2019-08-16]

then:

gpg --export --armor CAEB3DC3BDF7FB45 | sudo apt-key add -

at last:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key CAEB3DC3BDF7FB45

(3) sudo apt-get update

(4) sudo apt-get install qgis python-qgis qgis-plugin-grass

every thing goes fine except that these codes installs only QGIS 2.18 but not 3.4 above?

I have tried other repositories as well and it still goes the same and installs QGIS 2.18

I need a solution and I need this software on my Ubuntu.

Regards.


texts: Extract coordinates of corner cells of a shapefile in Python script (QGIS)?

texts:
I have a grid in a Lambert Conformal Conic projection (with columns: ID, value) and I want to extract the corners of each cell in the native projection of the grid with QGIS. In particular, I want the coordinates of each cell of the following corners:

x1,y1 = lower left corners
x2,y2 = upper left corners
x3,y3 = upper right corners

So, I need to create a txt file containing the following columns

ID, x1, x2, y1, y2, x3, y3, value

where x1,x2 etc are the coordinates in meters.


texts: Multi-temporal classification in Google Earth Engine - clustering and grouping based on time sero

texts:
I am working on my master thesis on multi temporal classification of LULC using S2 imagery in Google Earth Engine.

The goal: to distinguish urban area from the landscape in the Inner Niger Delta. This cannot be done using supervised classification as the houses are build of the same material as the surroundings, so the profile spectra are very similar. So my plan is to do this based on time series, where I assume that urban areas are very stable in terms of the NDVI profile and the surroundings fluctuate more.  I would have to be able to have NDVI time serie info of every pixel and them cluster the similar ones together.

The problem:
I know how to extract the time series with NDVI information (script:https://code.earthengine.google.com/9069f8232d61a5a51546d28a92b27110), and I know how to apply clustering for one (LS8) image (script:https://code.earthengine.google.com/915d919c2adef5a15a140c1a0d5d328d). But I have not managed to combine these two. So to do a clustering based on the NDVI time series PER PIXEL.

Is it possible to extract the (mean) time-serie chart, of e.g. NDVI, per cluster so I can determine the class?


texts: Calculating slope cell-by-cell in ArcPy?

texts:
I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have.

import arcpy, numpy, math
from numpy import *
from arcpy import env

arcpy.env.workspace = ("D:/input")
inRas = arcpy.RasterToNumPyArray('t1')
[rows,cols]=inRas.shape
slope=zeros((rows,cols), float)

desc = arcpy.Describe('t1')
cellSize = desc.meanCellHeight
extent = desc.Extent
pnt = arcpy.Point(extent.XMin,extent.YMin)

for j in range(0,rows-1):
    for i in range(0,cols-1):
        slope[i,j]= inRas[math.sqrt(((cols+1)-(cols-1)) ** 2 + ((rows+1)-(rows-1)) ** 2)]
        print slope
        myArray=arcpy.NumPyArrayToRaster('slope',pnt,cellSize,cellSize)

        myArray.save("D:/output/t1")


texts: Creating 3D terrain/model from contour lines, preferably using Open Source GIS?

texts:
I am looking to create 3D terrain from a contour map that I have (originally inside a PDF). The contour lines are able to be viewed as paths in Adobe Illustrator. There are two types of lines: 7m and 2m intervals, which are the same color, but have different weights (the 7m contour lines are twice the weight of the 2m contour lines). If it might be useful to know: according to its metadata, the PDF appears to have been exported from AutoCAD. The contour lines (as paths in Illustrator) can be exported as .DXF, .DWG, and several other formats.

What is the simplest/easiest way to create a 3D model with the available data? Can it be done with free/open source software?

I can't seem to find anything that matches my situation.

--

Edit:

Update/Clarification:

I'm looking to create a 3D representation from the contour lines in order to render it in a 3D modelling program - something like a .DAE format (or similar).

The (near to) end result will look like:

http://flanzendorfer.com/images/3d_terrain/terrain_002.png


texts: Problem with reading data from PostGIS as KML file using PHP

texts:
I am using the following PHP code in order to read data from PostGIS and save it in KML format as a file. When I load the page a document with ".PHP" extension is returned (not .kml) which inside has the data in KML format. The page returns no error, but the console of the developer tools gives the following note:

  Resource interpreted as Document but transferred with MIME type
  application/vnd.google-earth.kml+xml: http://mydomain.com/....

Does anyone have any idea what the problem could be?

The PHP code:

<?php

$dbconn = pg_connect("dbname='nyc' user='postgres' password='****' host='localhost'");
if (!$dbconn) {
    echo "Not connected : " . pg_error();
    exit;
}

$sql = 'SELECT *, ST_AsKML(ST_Transform(geom,26918)) AS kmlgm FROM nyc_census_blocks LIMIT 5';

 # Try query or error
$query_result = pg_query($dbconn, $sql);
if (!$query_result) {
    echo "An SQL error occured.\n";
    exit;
}

$kml ="<kml><Document>";

for ($i = 0; $i < pg_numrows($query_result); $i++) {

    $townname = pg_result($query_result, $i, 0);
    $townkml =  pg_result($query_result, $i, 1);

    $kml .= "<Placemark><name>Town: ".$townname."</name><description>".$townname."</description>".$townkml."</Placemark>\n";
}

$kml .= "</Document></kml>";

header('Content-Type: application/vnd.google-earth.kml+xml');

echo $kml;

pg_close($dbconn);
?>

and the kml data returned inside a file with ".php" suffix!!:

<kml><Document><Placemark><name>Town: 1</name><description>1</description>360850009001000</Placemark>
<Placemark><name>Town: 2</name><description>2</description>360850020011000</Placemark>
<Placemark><name>Town: 3</name><description>3</description>360850040001000</Placemark>
<Placemark><name>Town: 4</name><description>4</description>360850074001000</Placemark>
<Placemark><name>Town: 5</name><description>5</description>360850096011000</Placemark>
</Document></kml>


texts:
I am interested in tools to correct topology errors in PostGIS, focussing on road networks. Is there a tool that corrects topology errors automatically, so that I can use the network for routing?

I am aware that there is something like osm2pgrouting. But I am trying to analyse the network in ArcGIS. Hence, I want to repair the topology in PostGIS and then import the network into ArcGIS.


texts: Using Con in Raster Calculator of ArcGIS for Desktop?

texts:
I have two images, "dvel.img" and "evi.img", and i want to extract water related pixels.

The condition is:

(("dvel.img" <= 0.05) & ("evi.img" <= 0.3))

I want to get an output by putting condition on both.

How do I write this conditional statement in the Raster Calculator of ArcGIS for Desktop?


texts: Finding distance within which set percentage of features fall using ArcGIS Desktop?

texts:
https://gis.stackexchange.com/questions/7455/how-many-features-within-a-set-distance-arcview/ asked about finding the number of features within a certain distance of another feature in ArcView.

I have the opposite question: is there any way, in ArcGIS 10, to find the distance within which a set percentage of other features fall?

I guess I could create a distance raster and then extract the values to points (the other features) and consult the attribute table. However, I will later need to export the distance to another tool somehow, so the distance would need to be part of the tool's output.

Is there any way to find such a distance? In other words, is there a tool that works like the density tools in reverse?


texts:
I am building a function which creates the CQL filter on the fly based on selections from dropdown menus.
Then I append the filter in the corresponding KML URL and download the KML file. It works fine but I have noticed that when the data (appended to the CQL) contain quotes then I get a runtime error:

Could not parse CQL filter list. Encountered "ar" at line 1, column 18. Was expecting one of: "and" ... "or" ... ")" ... "/" ... "*" ... "+" ... "-" ... Parsing : (DistrictNa='Man'ar').

Is there a way to escape these characters? What is the best strategy to follow?

EDITED
I read here that I can escape it with another single quote. But in my case I need something more automated than this!


texts: Google Earth plug-in: how to get name/description of a model, from lat/long or click

texts:
In Google Earth, if you move the mouse over a 3D model (building), it
turns light blue. If you click on it, you get a description (or
sometimes just an approximate address).

Google Earth plug-in web apps like Monster Milktruck or First Person Cam
are wonderful educational tools for
exploring an area, and learning about it spatially. For example you
are walking or driving around Rome, and you see buildings like the
Coliseum or the Forum, but you don't know what they are; so it would
be very useful to be able to click on them as you can in Google Earth,
and get a description.

Is there any way to do this in the G Earth Plug-in API? I see that a
hitTest can tell you whether you clicked on a model, and if so, what
the lat/lon of your hit is. But surprisingly, it doesn't tell us
which model was hit. Nor can I find any way to look up the model in
Google 3D Warehouse using the lat/lon.

Can someone tell me a way to do this?
Or is it for sure not allowed?


texts: PyQGIS Reproject Raster - not reprojecting

texts:
I'm writing a QGIS plugin that will reproject a raster.

I have all the pieces and it's writing a new raster with the new projection, but isn't reprojecting the underlying data.

The QGIS documentation says 'CRS to reproject to' but I'm concerned that no reprojection is being done. I'd prefer not to use GDAL, but I'm now at the point where I've exhausted my options in the PyQGIS API, I think...

My code is below:

layer.setCrs(orig_crs)
tr = QgsCoordinateTransform(orig_crs, dest_crs)

file_writer = QgsRasterFileWriter(out_file)
pipe = QgsRasterPipe()
provider = layer.dataProvider()
pipe.set(provider.clone())
result = file_writer.writeRaster(pipe,
                                 provider.xSize(),
                                 provider.ySize(),
                                 tr.transform(provider.extent()),
                                 dest_crs)

Edit: I'm editing now and will add a bounty.

The question really is this: How can you use the built-in QGIS Python API functionality to transform a raster. Answers accepted for QGIS 2.0 or 3.0.


texts: Converting Sentinel 2 data from the AWS archive to SciHub's structure

texts:
I've been using the Sentinel Level 1C data archive hosted on AWS, maintained by Sinergise.

However, I also need atmospherically corrected data. For that purpose, I use sen2cor, but it relies on the directory structure and metadata of the Sentinel scenes as stored on SciHub. The AWS archive uses a different (albeit simpler and more clear) directory structure.

Is there any utility that either converts the data from the AWS archive to SciHub's original directory structure, or adapts sen2cor for the data that can be downloaded from the AWS archive? As far as I understand, the Sinergise's archive is quite a common source for the Sentinel data, so I believe some work has already been done for that.


texts: Project's custom variable using plugin in PyQGIS

texts:
I'm building my first plugin and I meet an issue with some variables. I've made some custom fields to store some variables 'project_actitle' dedicated to a project. The plugin uses these variables. The error appears when either I launch Qgis and there is not any project, or when I use a project that doesn't have these customs fields. That logical, because the plugin doesn't find the field 'project_actitle'

project = QgsProject.instance()
title_file = QgsExpressionContextUtils.projectScope(project).variable('project_actitle')

the error:

Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python/plugins\xdr_import_photo\xdr_import_photo.py", line 296, in run
    self.dlg.lineEdit_2.setText(path + folder +  title_file + ".shp")
TypeError: can only concatenate str (not "NoneType") to str

How can I avoid this error? I would like to check if the project own this fields and pass the "variable called"  to avoid the error or something like that..


texts: How to extract shortest path from floydwarshall algorithm pgrouting

texts:
I've tried Floyd-Warshall algorithm using pgrouting with the following code;

SELECT * FROM pgr_floydwarshall(
'SELECT gid AS id,
      source,
      target,
      meters AS cost
      FROM jalan')

and the result is:

The question is How to extract path to new table from the result above if the source node = 9 and target node = 24?


texts: How to assign values to field using if/then logic involving multiple fields?

texts:
I want to run a field calculation on a string field named [territory] that first looks at a string field [majr_src] to see if there is a value other than "NONE", if so [territory] = [majr_src]. If not, it looks at field [top_pct] to see if it is >30, if so [territory] is assigned the value of another string field called [Top_src]. Finally, if neither of these conditions are met it assigns [Territory] the value from a final string field called [Close_src]

I have:
Pre-Logic Script Code:

def selectter(n):
 if [Majr_src] != "NONE":
  n = "[Majr_src]"
 else:
  if [Top_pct] > 30:
   n = "[Top_src]"
  else:
   n = "[Close_src]"

and

Territory =
 selectter([Territory])

any help would be greatly appreciated.
*Note I am on Arc 10.1


texts: Workflow for updating raster using polygons of different attributes

texts:
I require a specific output but it is proving difficult for me to work out a workflow.

I have:

1) polygons of new housing developments (356, non overlapping)

2) a 25m raster of land cover

I want to update my land cover raster (in areas where polygons overlay) to a new mix of land cover classes (predominantly built-up but with some improved grassland etc).

This mix is different for each polygon.

I have added to the polygon attribute table the number of cells of each land cover class that I want the polygon to represent when converted to raster (e.g. 18 built-up, 1 arable, 1 improved grassland, as the the polygon will be represented by 20 cells).

Furthermore, the cell values (land cover classes) need to be randomly allocated within the area covered by each polygon!

Any suggestions! Python or R code solutions welcome. I am more familiar with R but can run Python code if it doesn't need much adapting by me!

I am using ArcGIS 10.1 license type advanced. Windows 7 64-bit i7 processor


texts: Limits to processing files from a list of rasters

texts:
I have written a script which selects all files that are within or subset by an area of interest polygon. This works fine but when the file list it's working has more than 150 records it stops comparing the extents after the 150th file. Does anyone know why?

the log files and script are here in googledocs as they are very long.

FileList = is a log of all 450 files which the program uses to iterate through. This is generated by FileList = arcpy.ListRasters()

NoSubset – is a log of files which aren’t subset by the AOI. Note it finishes at 150

Success-Subset – is a log of all files that subset –note nothing beyond file

Success-Within – is a log of all the files within the AOI. 20 files are logged when there should be 54.

The ESRI log clearly shows that it stops processing beyond a certain point. I have included the tbx in the zip.

Any suggestions for improving the coding would be appreciated as well. Note that I have turned the copy file and subset file functions off and am just using the generated csv's (link to files) rather than creating gigs of new files.


texts: How to embed images in KML balloons using FME?

texts:
I am using FME to produce a kml file with multiple placemarks. Each placemarks corresponds to a specific feature on the ground. I am creating balloons to provide some descriptive information of the feature and I want to add a couple of images within the ballon of the feature itself.

Is this possible using FME?


texts: I am solving the way of writing data to KML file using OpenLayers in map application. I want to ask if OpenLayers can insert new coordinates into a layer after 2 seconds, for example. So far I have done it by loading KML every two seconds with all the data, which is very data intensive. As soon as I just added new ones, it wouldn't be as data intensive. Possible?


texts: Alternative to "Export Training Data For Deep Learning" ArcGIS's tool

texts:
My current research involves training a Mask R-CNN model with tensorflow to detect and segment buildings. I have a vector shape containing "M" features, each feature being a polygon delimitating a building, and high resolution images of the area of interest.
The problem: export sample data in the format the model needs, that is something like this: [N, img, masks], where "N" is the number of samples, "img" the sample image with shape (height, widht, channels) and masks an array with shape (m, height, width), where "m" is the number of features(instances) in that sample (having the mask the bbox should be no problem).
What I have tried using QGis:

Create a grid vector to delimitate every sample (image and features vector);
Clip the image and feature vector in respect to each cell grid;
(Problem) Build masks for each instance in each sample and associate them with the sample in question.

All my ideias are extremely time consuming.
Is there any simpler way or tool that would automatize this process? "Export Training Data For Deep Learning" ArcGIS's tool seems to be exactly what I need, but I do not have the resource.


texts: How to create a directory in Scripter Automation

texts:
Is it possible to create a directory in Scripter Automation?

I need to call ActiveX plugin. In VB you can call it with

My.Computer.FileSystem.CreateDirectory("C:\Documents and Settings\AllUsers
\Documents\NewDirectory")


texts: The submit button for styles in Geoserver

texts:
Say I have a layer L in Geoserver to which i attach a style S (in the GS backend i published L using S). Of course, If I use the style editor in the GS backend and change the SLD for S and then 'submit' the new style, my layer looks different next time I load it in a browser.

Now, I am planning to re-generate the SLD for S regularly directly into the Geoserver styles folder using php : each time the database has a new entry, it is queried, the appropriate style/legend is calculated and my php is parsed and prints the SLD code for S in the styles folder, overwriting the previous version of S in the process.
It does not work, i.e. if I modify or overwrite S directly in the styles folder and then reload my layer in a browser the style is not updated.

Hence my question: what does the 'submit' button in the GS backend style editor do and how can it be simulated using code instead of manually.

Hope this makes sense. Thanks for your help.
B


texts: How can I expand the 'extent' of a raster?

texts:
I'm adding two rasters that have different extent. The result is a raster with the extent of the smaller one, which is not what I want. What do I need to do to have the output raster as big as the biggest of the input rasters?
I have tried to increase the extent of the smaller one with "Copy Raster" and in 'Environments' I have selected the biggest raster as 'Extent' and 'Snap Raster'. This has not worked unfortunately.

Am I doing anything wrong? Is there any other way to do what I'm trying to do?

NOTE: I need to extend the smaller raster and set all those new cells to 0.


texts: Users can't save styles on the db PostGIS

texts:
I have a PostgreSQL database, and only with the PostgreSQL user (who's the owner of that table), I'm able to save styles to the database. I checked the user's permissions for the other group roles and all have SELECT, INSERT, UPDATE, and DELETE privileges over the layer styles table. So I really don't understand why they can't save the styles.
The group that I have is called r_readwrite and has USAGE in all schemas on the database and only SELECT, INSERT, UPDATE and DELETE privileges in a couple of tables (one of them the layer_styles). The other group that I have is called r_readonly and only has SELECT privileges over all tables in the database.

Does the group need to be set as the owner of the table to add styles? Maybe I'm missing something because once I changed the owner of the table from postgres to the group role it worked.


texts: Labeling a layer with the values of stand-alone table (that is associated to the layer with 1-Many relationship)

texts:
I wondering how could we labeling a layer with the values of stand-alone table (that is associated to the layer with 1-Many relationship)

For example, I wanted to label the parcels with their owners knowing that the parcel layer is associated with owners table with 1-Many relationship.

What might be the best practice to perform this task?


texts: cartodb.js without jqyery, backbone, mustache code merged?

texts: I found that cartodb.js has also the code of library like jquery, backbone, mustache etc. As on my project I am already adding jquery and I dont need backbone/mustache etc, so is there any cartodb.js without these libraries already included?


texts:
I have used Points to line to create a polyline from a series of points. I want the points to have attributes with m values corresponding to the distance from the start of the line.

There is also a second series of points that I have created with Generate points along line. These points are positioned differently along the line and I want them to have m values as well.

I wonder, what is a good workflow to add m values to both the old points and the new ones in relation to the polyline?

Do I need to create new features (perhaps retrace some of my steps) or can I work with my existing features?

What tool(s) should I use?


texts: Count points in a polygon that changes form ("on the fly calculation")

texts:
I have tried to find a plugin for this, with no luck.
Perhaps someone knows of a plugin that can do the following:

In this project I create a lot of polygons that contain points, and the size of the polygons is dependent of how many points there are inside the polygon. Therefore I need to manually change the size of the polygons to get a certain number of points inside it.

It is tedious work to run a new "Points in polygon" command as soon as I have changed a polygon and want to know the number of points. Is there any way to get this calculations directly on screen some how (a sort of "on the fly" point calculation)?


texts: QGIS has an automatic way of finding the LS factor?

texts:
I wonder if is possible to calculate LS (soil erosion) factor automatically in QGIS?
Or at least a way to calculate the length slope?


texts: How to apply a color to a geotiff image based on the elevation data?

texts: I want to apply a color to an geotiff image (which contains only elevation and coordinates info) based on the elevation data . How to do that using GDAL in c++.? Is there any example related to this?


texts: Arcgis 10.1 server, arcgis manager shows page cannot be displayed

texts:
I am facing this issue only in one machine.

I installed ArcGIS 10.1 SP1 in Windows 2008 R2 machine, installation went fine. But the select Arcgis manager, localhost:6080/arcgis/manager, it shows only page cannot be displayed.

I tried these items,

a) uninstall arcgis 10.1 sp1, installed arcgis server 10.1, still the same problem

b) uninstall arcgis server products, cleaned the registry, renamed the c:/program files/arcgis/server,... keycodes ... ..commonfile/arcgis... rebooted the server installed arcgis 10.1 sp1, still the same problem

c) i verified with windows support team, they confirmed no ports are blocked

d) when i compared with good arcgis server in other windows 2008R2, there is a javaw.exe in the process, but this is not in this current machine.

Any one have any idea/suggestions/work around to resolve this ?

thanks,
vadivelan. p


texts:
I am trying to create a web map using the QGIS2WEB plug-in from an existing map. I am new to QGIS and I don't know if this is possible?

When I try to export the map as a web map either in Openlayers3 or Leaflet format the diagram circles that I've used for the map disappear or don't display correctly (only the text labels are visible).

I've attached pictures of the problem and I'm using QGIS 2.8.4 Wien on a Mac if that is helpful.


texts: Shrinking the co-ordinates into a unique number

texts: I have a bunch of data's in my gpx files. I would like to shrink those bulk data's(co-ordinates) into a single ID or sort of something. any suggestions?


texts: Downloading raster data into python from postgis using psycopg2

texts:
I have raster data in a postgres table that I want to get into python as a numpy array. I am using psycopg2 to connect to the db. I am able to download the data but it comes back as a string (probably a serialized binary).

Does any one know how to take this string and convert to a numpy array?

I explored other options to download the raster such as use st_astiff and encode to download the hex file and use xxd but that did not work. I keep on getting the error
'rt_raster_to_gdal: Could not load the output GDAL driver' and I don't have permissions to set the environment variables to be able to turn on the drivers.

TL, DR: want to import raster data into a numpy array (using python).


texts: Batch shapefile merge, with adding and calculating field, in ArcPy?

texts: I have over 60 shapefiles, all in their own folders. I'm looking to add a field titled "Name" and then populate it with the name of the shapefile.  I want to be able to do this so that I can then merge the files together while retaining a unique identifier for each. I can do this by hand of course, but would like to script it. I don't know Python and I'm familiar though not very experienced with ModelBuilder. I'm using ArcGIS 10.


texts:
Does anyone know how to extract subfiles from a HDF5 file? The GIS remote sensing data I am getting is aggregated into a single .h5 file, but I need it separated into the component files. My aim is NOT to produce TIFFs, but to separate out the component files so that they can be processed one by one.

CONTEXT:

I am running Ubuntu 18.04. I have installed the CSPP VIIRS Flood Detection Software, here:

https://cimss.ssec.wisc.edu/cspp/viirs_flood_v1.1.shtml

I am working with VIIRS SDR data, downloaded from the NOAA CLASS website, here:

https://www.avl.class.noaa.gov/saa/products/search?sub_id=0&datatype_family=VIIRS_SDR&submit.x=24&submit.y=7

The software requires 4 files in a format like this:
SVI01_j01_d20181030_t0626485_e0629370_b04908_c20181101224627873308_cspp_dev.h5
SVI02_j01_d20181030_t0626485_e0629370_b04908_c20181101224627873308_cspp_dev.h5
SVI03_j01_d20181030_t0626485_e0629370_b04908_c20181101224627873308_cspp_dev.h5
SVI05_j01_d20181030_t0626485_e0629370_b04908_c20181101224627873308_cspp_dev.h5

However, the NOAA data is delivered in an aggregated file like this:

GIMGO-SVI01-SVI02-SVI03-SVI05_j01_d20181030_t0626485_e0629370_b04908_c20181101224627873308_noac_ops.h5

If I copy the GIMGO file four times and rename it with the four names above (SVI01, etc), the Flood Detection program works perfectly and the results can be read in QGIS 3.8. However that's a miserable lot of manual work if you have a large number of files to process.

Ideally I would like to install software allowing me to disaggregate the GIMGO files with terminal commands. Batch processing of a folder would be best. I am a completely self-taught GIS user with no other coding background, so a literal sequence of commands would be of the most help.


texts:
I working to invert values of a one-band tif files (download sample).

If i use 254 it works:

$ gdal_calc.py -A ./shadedrelief.tmp.tif  --outfile=whited.tmp.tif  --calc="254*(A>180)"
0 .. 10 .. 20 .. 30 .. 40 .. 50 .. 60 .. 70 .. 80 .. 90 .. 100 - Done
$ gdallocationinfo -valonly ./whited.tmp.tif 1 1   # we expect 254
254
$ gdal_calc.py -A whited.tmp.tif --outfile=inverted.tif --calc="255-A"
0 .. 10 .. 20 .. 30 .. 40 .. 50 .. 60 .. 70 .. 80 .. 90 .. 100 - Done
$ gdallocationinfo -valonly ./inverted.tif 1 1   # we expect 1 (because 255-A = 255-254)
1

But the value 255 is troublesome:

$ gdal_calc.py -A ./shadedrelief.tmp.tif  --outfile=whited.tmp.tif  --calc="255*(A>180)"
0 .. 10 .. 20 .. 30 .. 40 .. 50 .. 60 .. 70 .. 80 .. 90 .. 100 - Done
$ gdallocationinfo -valonly ./whited.tmp.tif 1 1   # we expect 255
255
$ gdal_calc.py -A whited.tmp.tif --outfile=inverted.tif --calc="255-A"
0 .. 10 .. 20 .. 30 .. 40 .. 50 .. 60 .. 70 .. 80 .. 90 .. 100 - Done
$ gdallocationinfo -valonly ./inverted.tif 1 1   # we expect 0 (because 255-A = 255-255)
255    # <============================ THIS OUTPUT IS NOT EXPECTED.

As far as I know, RGBA range is [0-255]. So...

Why does gdal_calc fails with value 0?

Edit: and for some reason, the 254-based whited.tmp.tif only has 2 type of pixels, so end final.tif also only has transparent [255,0] or black [0,255]. I expected a continuous gradation between the both.


texts:
I am trying to replicate an ArcGIS select by location type query in PosGIS.
In ArcGIS I am using the "are within a distance of the source layer feaure" where the target layer is municipalities and the source layer is a 'zone'. I am applying a negative distance to only select the municipalities that are 50 feet deep in the 'zone'. I am doing this query as opposed to the boolean intersect method because I do not want any municipalites that simply touch a boundary of the 'zone'. It works good in ArcGIS. In PostGIS I am trying to use this expression

where ST_DWithin('zone'.geom,mun.geom,-50)

but it gives me this error

ERROR:  Tolerance cannot be less than zero

********** Error **********

ERROR: Tolerance cannot be less than zero
SQL state: XX000

in ArcGIS


texts: Eclipse and PyDev using python from OSGeo4W

texts:
I'm trying to setup a PyDev Python Interpreter from OSGeo4W in Eclipse (neon 3 and java 8 on Windows 7 x64). I have installed the latest python 2.7.5 and python 3.6.? from OSGeo4W. I would like to avoid polluting the system environment variables in order to run different versions of python.

I click New under "Pydev/Interpreters/Python Interpreter".
I select C:\OSGeo4W64\bin\python.exe.
I click OK and pydev tries to check if the selected python executable is okay.

Of course this doesn't work, since I haven't set up any environment variables. The error message is:

  ImportError: No module named site

But how can I avoid setting up environment variables outside Eclipse and just point at the OSGeo4W setup within Eclipse?

Using the current state of python 3 from OSGeo4W doesn't seem to work, since it tries to use python 2.7 files.


texts: Converting 8-bit RGB tif to single gray-scale image

texts:
I have a tif image of soil thorium content (ppm) measured by gamma aerial spectroscopy. The original file is a 8 bit RGB image set in a rainbow-similiar pallet (blue>green>yellow>red>magenta). I have a jpg file about the legend, which was attached with the original file. The  thorium content ranges from 2 (blue) to 36 ppm (Fig. 1).

For modelling purposes, I want to convert this RGB file to a single raster of thorium content. I have already tested the a processing module of QGIS:

Raster > Conversion > RGB to PCT

The module transformed to a single band, but it produced a palleted band containing a unsorted color ramp (Fig. 2)

Could I sort the color ramp and reclassify the raster values to match with the original values from the jpg legend? If it is possible, how could I sort the colors?

Is there another way to transform the RGB image to a gray-scale single band?


texts: QGIS GdalUtils runGdal function throws error for second argument

texts:
I am trying to use a script provided in the QGIS Python Cookbook by Joel Lawhead -
its a simple script that georeferences images based on control points via the gdalwarp function. (p.124 in the book)
After the command list is filled with control point data and image paths, the following line should be executed:

GdalUtils.runGdal(command, None)

So, command is a list, all cool, but the second argument throws an error:

File "C:/Users/aaaa/.qgis2/python/plugins\processing\algs\gdal\GdalUtils.py", line 72, in runGdal
    progress.setInfo('GDAL command:')
AttributeError: 'NoneType' object has no attribute 'setInfo'

Now, GdalUtils.py came with my QGIS package (version 2.6.1-Brighton), so runGdal taking two arguments (Named: "command" and "progress") should be correct, the question is what should I give as a second argument to make progress.setInfo not throw error? This is there only, so that a indication of the progress is printed out right?
Passing 'None' as in the book, obviously does not work, any help on this?


texts: Can Line Data be an Input into Network Analyst Service Areas?

texts:
I am establishing an absent sidewalk prioritization for bond dollar expenditures. Each missing sidewalk segment will be scored according to various criteria including proximity to businesses, parks, jobs, etc.

I could perform a simple Euclidean buffer, but I believe the analysis would be more sophisticated using a network analysis. In other words, to find a way to score the sidewalks according to the destinations captured within x-distance walk-shed along the street network.

In what I have seen done, and in all of the research and tutorials I've found, network analysis is done using point data as the input rather than lines. So, for a service area, a business (point) is used as the input and analyzed according to the network (streets).

Because absent sidewalks are line segments - not points - I am not sure if what I would like to do is even possible.


texts: Layer is refreshed after an ajax request with openlayers

texts:
I can't understand why my vector is empy after this ajax request :

function loadKMLTMINT(terminalcode) {
    MapPanel.el.mask();
    Ext.Ajax.request({
        url: 'php/GetKMLTM.php',
        method: 'POST',
        params: {
            terminalcode: terminalcode
        },
        success: function (r) {
             if (r.responseText.length > 0) {
                var data_tmp = JSON.parse(JSON.stringify(r.responseText));
                vector_term.parseFeatures(data_tmp, new ol.parser.GeoJSON(), ol.proj.get("EPSG:3857"));
                var first = true, precExtent = [];
                for (var vec in vector_term.featureCache_.idLookup_) {
                    if (vector_term.featureCache_.idLookup_[vec].values_.Intermodal == 'Y' && vector_term.featureCache_.idLookup_[vec].values_.NAME.substring(0, 5) === terminalcode.substring(3, 8)){
                        if (first) {
                            first = false;
                            precExtent = vector_term.featureCache_.idLookup_[vec].values_.geometry.rings_[0].bounds_;
                        } else {
                            ol.extent.extend(precExtent, vector_term.featureCache_.idLookup_[vec].values_.geometry.rings_[0].bounds_);
                        }
                    }
                }
                olmap.getView().fitExtent(precExtent, olmap.getSize());
            }
            MapPanel.el.unmask();
        }
    });
}

I'm calling this function many time, in order to add some values to the layer vector_term. With the debugging I can see that my vector_term is full when I call the function, but when it reaches the success: function(r) it becomes empty !

Do you know if I'm doing something wrong?

Should I use addFeatures instead of parseFeatures?

vector_term definition

var vector_term = new ol.layer.Vector({
    source: new ol.source.Vector({
        parser: new ol.parser.GeoJSON()
    }),
    style: new ol.style.Style({
        rules: [
            new ol.style.Rule({
                filter : 'geometryType("polygon")',
                symbolizers: [
                    new ol.style.Fill({
                        color: ol.expr.parse('color'),
                        opacity: 0.4
                    }),
                    new ol.style.Stroke({
                        color: ol.expr.parse('color'),
                        opacity: 0.8
                    }),
                    new ol.style.Text({
                        color: '#0A3ABF', //'#165EF0',
                        text: ol.expr.parse('NAME'),
                        fontFamily: 'Arial',
                        fontSize: 14,
                        zIndex: 7
                    })
                ]
            })
        ]
    })
});


texts: Is there a QGIS equivalent to ArcGIS' Convex Hull and Circle under the Minimum Bounding Geometry tool?

texts:
I have the opportunity to run ArcGIS and QGIS side by side for a few months and was looking to see what comparisons there are.
So I'm interested to know if there is a similar tool on QGIS?


texts: Projecting vs. export using data frame projection?

texts:
I have two shapefiles with different projections. When I load both into ArcMap I get the 'Geographic Coordinate Systems Warning' when the second is loaded into table of contents but they both align properly with one another. If I export the second one using 'export data' than choose to export it using the coordinate system of the data frame, this exported feature has the same projection as the first shapefile and aligns with it properly. But if I project the second shapefile using the toolbox I have to choose a 'Geographic Transformation' and this output doesn't properly align with the first shapefile.

Can anyone explain the difference between these to methods to change the coordinate system of a shapefile?

Why would I used the projection toolbox if it has to preform a Geographic Transformation and shift it retaliative to other features as opposed to changing the data frame projection and exporting it?


texts:
I have a problem adding new features to a Postgis database.
My table has a primary key defined as

gid integer NOT NULL DEFAULT nextval('bo_gid_seq'::regclass)

When I try to add a new polygon in QGis to this layer, i can draw it, but I'm unable to save it to the database. I allways get an error:

null value in column "gid" violates not-null constraint ...

Before saving, the form shows me the nextval('bo_gid_seq'::regclass), but finally it seems to be ignored by the database.
The errors stays exactly the same, even when I enter a valid gid-number.

I used this feature with the same database before QGis 2.8, but with all the actual releases (2.14) I can't get it to work.

After all I wonder that there are so few threads about that problem in the net?


texts: Arcpy.Delete_management() not deleting folder?

texts:
I've written a script in Python that takes in two ascii files that represent surfaces, then convert them to Rasters, and finally Negate their values (i.e. multiply all cells by -1).  In the script, I create a temporary folder to store intermediate data and I'd like to delete it after the script has ran, however arcpy.Delete_management does not work.  My code is as follows:

import os, arcpy
from arcpy.sa import *

inputInterp = arcpy.GetParameterAsText(0)
inputDiff = arcpy.GetParameterAsText(1)
outputDir = arcpy.GetParameterAsText(2)

#Ascii to Raster Conversion, store output in temp location
arcpy.env.overwriteOutput = True
arcpy.env.workspace = outputDir
tempFolder = outputDir + os.path.sep + "pyOut"
arcpy.CreateFolder_management(arcpy.env.workspace, "pyOut")

outInterp = tempFolder + os.path.sep + "Interp_Rast"
outDiff = tempFolder + os.path.sep + "Diff_Rast"
dtype = "FLOAT"

arcpy.ASCIIToRaster_conversion(inputInterp, outInterp, dtype)
arcpy.ASCIIToRaster_conversion(inputDiff, outDiff, dtype)

#Reversing the rasters to their original values

outIntNegate = Negate(outInterp)
outDiffNegate = Negate(outDiff)

#Cleanup
arcpy.Delete_management(tempFolder)

Now here's the part I do not understand.  If I add:

arcpy.Delete_management(outIntNegate)
arcpy.Delete_management(outDiffNegate)

Right before:

arcpy.Delete_management(tempFolder)

Then tempFolder gets deleted as expected.  I plan on expanding this script after I get this part working and I really do not want to delete every individual temporary variable I create.  I suspect this has something to do with the workspace but I couldn't find any solutions after browsing similar posts.  Any ideas?


texts: What kind of different results or what is the difference between two URL based WMS requests

texts: I am trying to retrieve some WMS layers from geoserver so that I can display them in leaflet and I need to populate a URL field and I noticed that many of the layers that I opened up in openlayers had "GetMap&layers" vs examples that were successful with "GetFeatureInfo&Layers" when being served via URL.


texts: What are the background/geography and foreground/data parts of a map called?

texts:
Consider a geographical map, e.g. a street map or satellite map, overlaid with some data, e.g. crime density or distance to closest voting booth.

The former part is only used to orient the reader, so that he knows which part of the map corresponds to which geographical location. The latter part contains the actual data that the author wishes to visualize.

What are these two parts called?


texts: run r.stats as a quiet module in GRASS-Python script

texts:
Has anyone else used r.stats as a quiet module in a GRASS-python script?

As part of my program I'm using:

grass.run_command("r.stats", flags='l', input=<file>, output=<*.csv file>, fs=',')

I'm using the 'l' flag here to print out category labels.  If I change the flags to 'lq' r.stats does not produce the specified *.csv file.  If I use the flags as '-q', r.stats runs as a quiet module, but it only creates a *.csv file with one row that describes the category values.  For my output, I need both category values and their respective labels.

Any ideas?


texts: How do I download and install r.denoise for GRASS GIS?

texts: I have tries multiple ways to get it as a 'add in' in Grass 7


texts:
I've been working on a script that corrects some links in a few feature classes in an enterprise database I have. The script works fine for the most part. When it gets to a certain feature class my script throws RuntimeError: Invalid column value [FIELDNAME]. When I open the feature class's attribute table and manually search for the link I get There was an error with the expression. Attribute column not found[42s22:[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid colun name'Link I searched for'.][feature class I searched for it in] Keep in mind that this query was constructed using query builder.

This is the business end of my script:

def correct_link_head(compiled_regex, link):
    r"""This function changes the links that start with " A:\\",
"B:\\", "C:\\", and "D:\\" with "other path" so that they actually work."""

    corrected_link = compiled_regex.sub(
        repl = r"\\\\other path\\", string = link)

    return corrected_link

def hyper_link_update_query(feature_class, compiled_regex):
    """This script runs an update cursor on all the feature classes with a hyper link"""
    with arcpy.da.UpdateCursor(
        in_table = feature_class, field_names = ["hyperlink_field", ],
        where_clause = "hyperlink_field IS NOT NULL") as cursor:
        for row in cursor:

            row[0] = correct_link_head(
                compiled_regex = compiled_regex, link = str(row[0]))

            cursor.updateRow(row)

I've googled this issue every way I can think of. How do I fix this?


texts:
I'm using QGIS 3.4.5. I'm trying to make a new polygon layer that traces the border of a polygon on another layer. The tracing tool works fine except for the last vertices. I´ll attach an image to show an example.

I've tried changing the snapping tool option to only select the layer that I would like to trace, but it doesn't seem to make a difference.

Is there a way to fix this? Or is there another tool that's better for what I'm trying to do?


texts: How can I deploy a custom GeoTools datastore to GeoServer?

texts:
I'm using GeoTools v8.0 and GeoServer v2.1.3. I've currently built a working datastore connecting to a PostGIS database based off of the GeotTools' abstract datastore tutorial. After days of on and off research, I cannot seem to find a way to deploy a datastore jar file to GeoServer.

I've expected that dropping a jar file in GeoServer 2.1.3\webapps\geoserver\WEB-INF\lib and cycling the server will allow it to discover and publish the availability of the datastore. I cannot find evidence of this happening in the logs and I definitely don't see evidence of it in the UI.

Ultimately, I would like to have a datastore that I can use complex SQL queries with (as opposed to just CQL) and write back geometry objects to my database via WFS-T as an option for selection in the GeoServer UI. Right now I'm interfacing with my database using views which doesn't allow me to save to the tables the views are referencing.

Has anyone done this before or is anyone aware of an example out there of how to do this? This is largely unfamiliar territory for me and any bit of help or direction is immensely appreciated.


texts: Error getting while creating new field to a shapefile table

texts:
I am getting the error for following code to add a new field to a shapefile table.

from osgeo import ogr

# Open a Shapefile, and get field names
source = ogr.Open('my.shp', 1)
layer = source.GetLayer()
layer_defn = layer.GetLayerDefn()
field_names = [layer_defn.GetFieldDefn(i).GetName() for i in range(layer_defn.GetFieldCount())]
print len(field_names), 'MYFLD' in field_names

# Add a new field
new_field = ogr.FieldDefn('MYFLD', ogr.OFTInteger)
layer.CreateField(new_field)

# Close the Shapefile
source = None

Error is as following:

layer = source.GetLayer()

  AttributeError: 'NoneType' object has no attribute 'GetLayer'


texts: FindTask does not work - 304 not modified

texts:
I use 3.16 and I have got some problem.

When I try to execute FindTask

        require(["esri/tasks/FindTask", "esri/tasks/FindParameters"], function (FindTask, FindParameters) {
            console.log("Hello from FindTask");
            var findtask = new FindTask({
                url: "someWorkingURL"
            });
            var findparams = new FindParameters();
            findparams.returnGeometry = true;
            findparams.layerIds = layersIDs;
            findparams.searchFields = ["MYVALUE"];

            findparams.searchText = data["myValue"];
            findtask.execute(findparams, drawObject, drawError);
        });

I do not see writing "Hello from FindTask". In ArcGIS Manager I see that querying is allowed.

Where may problem be?

P.S. In network page in Firefox i see "304 not modified"

Answer: I changed hosts of my app http-requests to localhost and everything is good now. Also, I downloaded JS API and set localhost as host there.
I think, the problem was in mismatched hosts: I've deployed my app on my computer with corporate IP address as host but HTTP-requests have gone to localhost.


texts: ''More than one row returned by a subquery used as an expression'' postgres error

texts:
I am trying to realize a postgres request :

select distinct nom_reg_12
from region_15,repartition
where st_intersects(region_15.geom,
                   (select geom
                   from repartition
                   where id_espece='Tetrarti'))=true;

but i get the following error :

  More than one row returned by a subquery used as an expression

in the first time I tried this and it work fine :

select distinct nom_reg_12
from region_15,repartition
where st_intersects(region_15.geom,repartition.geom)=true;

and then I tried this a part to get the geometry I want :

select geom from repartition where id_espece='Tetrarti'


texts: Is it possible to use Google Maps as basemap in ArcGIS for Deskrop?

texts:
I remember using an AddIn Earlier that enabled the use of Google Maps within ArcGIS as basemap but I don’t have it now.

I am out of date here, but is it possible (in ArcGIS 10.3) to do that as a built-in functionality and if not, can someone please point me to any tool that would provide this functionality.

Note:
Older answers suggested using  ArcBruTile , but its not realy showing Google Maps, it is however very good in using Bing Maps, OpenStreet ...etc.

Its now ArcGIS 10.3 and I was hoping that someone out there may have developed something new or a workaround to get google maps into ArcGIS for free.


texts: Stitching MapProxy tiles to receive one georeferenced image?

texts:
In my struggle to get a decent aerial image for playing around with as a layer in Biosphere3D (and for other purposes as well), I managed to install Mapproxy and then cached the area in my desired zoom level from a 2m-Orthophoto WMS through the proxy within QGIS..

Well, now I am in possession of tiles worth 60MB, but i see no way how to stitch them together to one image.

The tiles are stored in a folder-structure like this:

The following sets of tiles are in 32/000/781/000/25, 32/000/781/000/25 etc. containing 408.png to 431.png

I have no clue how to interpret this structure.

I wonder if there is any way (script) to stitch those tiles to receive one georeferenced image.

The tiles were captured in WGS84.

Grateful for any hint on how to proceed.


texts: cannot submit address to Google geocoder on iPad: ArcGIS JS webmap app

texts:
I am working on a web map app for desktop and iPads.  The app uses a Google geocoder to locate addresses or intersections, added with the standard code in 'init':

geocoder = new google.maps.Geocoder();

Everything about the geocoder works fine on my desktop using IE9, Chrome, or Firefox 20.0.  But on an iPad (I am testing with one using v 5.1), I cannot submit the address I type in the text box...The 'Go(enter)' button does nothing, and no clicks or presses on the screen do anything.  Oddly, I can enter and successfully search for addresses using the same app on an iPad mini, by pressing 'Go' (v 6.1.3) ...

Has anyone encountered this problem, or does anyone have any suggestions? I am brand new at testing for iOS! I can add the geocoder code, but there is kind of a lot of it..I don't think the error is in the geocoder setup, but I am not sure... // J


texts: Go to XY tool in an ArcGIS online web map and/or application

texts: Has anybody created any language to attach to an ArcGIS online web map and/or application for a "Go to XY" tool?


texts: OpenLayers: How do I make a TileLayer start from origin?

texts:
I'm using OpenLayers to display a large image using a TileLayer with an XYZ source and a pixel projection. On top of that image I'm supposed to show some bounding boxes that have coordinates depending on an origin that's on the upper left side.
For starters I wanted to make the image show on screen starting from the origin (which in OL's case is lower left). However, it does show the image, but the lower part of it is still under the view. Using the MousePositionControl I can clearly see that the image does not start from [0,0].
Here's the code I'm using:
const mapExtent: Extent = [0, 0, ...map.getSize()];
const projection = new Projection({
  code: "pixels",
  units: "pixels",
  extent: mapExtent,
});
const center = getCenter(mapExtent);
const view = new View({
  projection,
  center,
  resolution: 1,
});
map.setView(view);

And here's the TileLayer I'm using:
const layer = new TileLayer({
  source: new XYZ({
  url: "<MY_ENDPOINT>",
  tileLoadFunction: (tile, url) => {
    getTile(url, (base64) => {
      ((tile as ImageTile).getImage() as HTMLImageElement).src = base64;
    });
  },
  wrapX: false,
  projection: map.getView().getProjection(),
}),

I have tried adding an extent to the layer of the size of the map itself, but it didn't work. Other than that I really am stuck here. I have checked the documentation and not found any clues that would be relevant to my situation.
I should note that I don't really know the size of the image beforehand. I just want it to start rendering it (tile - [0,0]) from the origin [0,0].
I'm new to this so if you could explain my mistake to me I would be very appreciative.
Edit:
Added screenshots of an example image. The lower left side of the first image has coordinates [0,0]. But when I go down, you can see the the lower left edge of the image is not at [0,0].


texts: How to create a transparent box in the map layout?

texts: Is there a way to create a transparent box in the ArcGIS layout view similar to the one in the screenshot?  I have tried without success adding a transparent box by inserting a neatline, adding a new dataframe and adding a polygon with the draw tools.  The only way I can envision doing this is by adding a shapefile to the layout and specifying transparency, although this approach seems awfully convoluted.


texts: How do I set extent in a geopandas plot (as in cartopy)?

texts:
The usual. My shapefile is from a much bigger place than my data, and I want to zoom in. The dark dot below is Melbourne, and it has some very interesting data plotted on it.

base.plot(linewidth=0
     ,color='gray'
     ,alpha=.1
     ,ax=ax)


texts: How can I use Convex Hull to select an area with a space from the points?

texts:
This refer to this post : Read Here

My goal is to select an area covering some points, but maintaining some space from points of border, like in the follow picture :

I think ST_Convexhull will do the job, but the border will touch the points in the edge.
I need some "tolerance" increasing the area in some way.


texts: if-then statement using VBscript not working

texts:
I'm trying to reclass from the value of field using if then statement.
the statement is like this..

In the figure above, what is making the result not work on my ArcGIS?