texts: QGIS Layers not projecting although Coordinate Reference Systems are the same

texts: I recently clipped a raster layer to a smaller extent. When I import this layer and assign it the same CRS as other layers (EPSG:4326, WGS 84) it does not project with them. The original pre-clipped raster layer projects correctly as do CSV data points that I have imported. I checked the Project properties and it also has EPSG:4326, WGS 84 assigned. Is it possible that the clipped layer is in meters instead of degrees? How would I determine if each layer is using either meters or degrees?


texts: Merge two maps with OR operation in GRASS

texts:
I have two vector maps. The two maps cover the same area but are split up into polygons differently (i.e. if you were to imagine one map placed above the other, the lines defining the polygons would not line up).

Map1 has its polygons colored red where crime is greater than some threshold, else white.

Map2 has its polygons colored red where poverty level is greater than some threshold, else white.

I wish to create a single map with polygons coloured red where either crime or poverty are above their thresholds. As the polygons from each map are different, new polygons would have to be created. I'm using GRASS.

Each file has an attribute table with several columns describing the polygons.

v.overlay with an 'OR' operation looks like a good candidate, but I can't figure out how to specify the correct attribute column to use for the OR merge.


texts: How to find Dropbox layer through CartoDB navigator?

texts:
this may well be just UI feedback for the CartoDB people (in which case I apologise for posting here).

I would like to make sure I'm not missing something obvious in the way CartoDB expects a user to locate a new layer for upload via Dropbox.

On an existing visualisation the user is given a [+] symbol which launches a "New Layer" selector widget. The widget presents a range of possible sources, including Dropbox.

Choosing Dropbox prompts an authentication process. When complete, CartoDB immediately scans the entire Dropbox: there is no opportunity to subselect a folder of interest.

After the scan is complete, CartoDB presents the user with a list of file titles with the path printed below each filename.

There is no clear way to sort, filter, or navigate this list...or is there?  This is my question. Please see attached screenshot.

In our case there are thousands of files in hundreds of folders, only a small percentage are spatial files.

What is the CartoDB concept on navigating Dropbox properly?


texts: Replacing NaN pixel values in GeoTIFF using GDAL?

texts:
I was wondering if there is a easy way (GDAL) to replace GeoTIFF pixels that are -nan with a different value (e.g. 100)?

I tried

gdal_calc.py -A my.tif --outfile=result.tif --calc="A-(A==-nan)*(-nan - 100))"

following some examples, but this doesn't work because NaN messes with arithmetic operations and turns everything it touches into a NaN.

Any pointers to alternatives?

Ideally a command line as with gdal_calc.py.


texts: Create Color Ramp for polygon outline in QGIS 2

texts: I was wondering if it was possible to create and save a colour ramp that colours the outlines of polygons rather than the fill in QGIS rather than editing each symbol manually.


texts: Workaround Near (analysis) tool in ArcGIS 10.2.2 for Desktop with a Basic License type

texts:
I have a point shapefile (with a lot of points) and a line shapefile (which contains just 1 line). I need to calculate the shortest distance from each point to the line as well as the coordinates of each point on the line to which the distances are calculated. I figured out that this can be done with ArcToolbox/Analysis Tools/Proximity/Near. But you need an advanced license for that, I only have Basic.

Is there another way to have the same outcome?


texts: Translate GeoTIFF to mbtiles success but failed to load on QGIS

texts:
I try to convert GeoTIFF data to mbtiles format using gdal_translate on Python console. The process was succeed but when the mbtiles was loaded on the canvas it's just blank. Any idea?
Here is the original GeoTIFF on canvas

Here is the mbtiles on the canvas

And here is my code:
import gdal

gdal.UseExceptions()
raslayer = "C:/PROJECT/2020/DERAWAN.tif"
rasterout ="C:/PROJECT/2020/derawan8.mbtiles"

ds = gdal.Open(raslayer)
ds = gdal.Translate(rasterout, ds, format="MBTILES")
ds = None

And I also try this using commandline on ubuntu, here my script :
gdal_translate Derawan.tif Derawan.mbtiles -of MBTILES
gdaladdo -r nearest Derawan.mbtiles 2 4 8 16

But it's still return blank when loaded on QGIS Cannvas.
Any ideas why the mbtiles couldn't load successfully?


texts: Why does Kernel Density fail in model with ERROR 000865?

texts:
I am attempting to build a model using variables for automation. (see below)

The problem I am having is when the model attempts to run the Kernel Density. It seems as if the Kernel Density will not recognize %FilePreFix%_ts_cd even though a shapefile is created. Below is the error I get.


texts:
I'm having difficulty adding land survey information to QGIS. What I need to do is add the survey boundaries of oil and gas leases, so that I can overlay additional data associated with land reclamation activities. There are legal land surveys available for all oil and gas leases in Saskatchewan, Canada. I've attached an example for reference. What I want to know is how to draw this lease and access road accurately. There are no absolute coordinates available, just a statement such as: Co-ordinates from NW corner NW1/4 Sec. 22-2-31-1. East = 1100' - South = 535'. Is there a cadastre source available so you can measure from the corner of the quarter section east and south and find the well centre? If that works, how do you ensure the orientation of the lease is accurate, i.e. If I'm Working in NAD83 UTM zone 13N, all of the roads aren't running 100% north / south or east/west, they are at about 3% tilt. Basically I need to be able to reproduce this survey in QGIS, i'm wondering the proper way to do it. Is there a public data set, or drafting procedure that would help me?

.


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

texts: I have two shapefiles and two rasters. I need to develop a map in Geoserver (ver. 2.0.2) with those 4 elements. They should be like layers which I can turn on or off. I added them on Geoserver like .shp files and WorldImage file. I edited styles of shp files in uDig. When I click on Layer Preview I see those 4 elements, but I can see every element separately. I want to develop map which will have all 4 elements like layers. What is the next step to develop that kind of a map? Also, I would be thankful if you give me some links on tutorials about Geoserver, except those on official site. Sorry for my bad english. Thank you.


texts: Using 'For each' type loop in PostgreSQL?

texts:
I'm really struggling with optimizing one of my sources. Instead of doing all the request and foreach loops in my server side application. I am thinking about shifting it fully to the database side. But I am struggling!

SELECT ST_asText( ST_ConcaveHull(ST_Collect(the_geom), 0.95)) FROM ways
JOIN
(SELECT seq, id1 AS node, cost
        FROM pgr_drivingDistance(
                'SELECT gid as id, source, target, reverse_cost as cost FROM ways',
                pgr_pointtoid(ST_setSRID(ST_MakePoint(7.26, 46.57),4326), 0.01)::Integer
, 10, false, false)) as dd_route
 ON
 ways.gid = dd_route.node;

But now I would like to replace the static point with a list or an array, and I just can't figure out how. I know there are a few cracks in PostgreSQL on this site.

We could use the following query to gather the data:

SELECT ST_SetSRID(ST_MakePoint(tmp[1]::double precision, tmp[2]::double precision), 4326) FROM (
    SELECT string_to_array(unnest(content), ',') as tmp FROM (
        SELECT string_to_array('7.26,46.57/8.26,46.25', '/') as content
    ) as data_array
) as data_row

The idea is now to the static set ST_MakePoint statement with a 'kind of foreach' statement.


texts:
I'm using, at work, ArcGIS geodatabases and using coded value domains a lot.

Now I'm working with PostgreSQL and I'm trying to create the same sort of data model I would in, for example, a file gdb. And that includes domains.

Coded value domains do not have equivalent to PostgreSQL domains.

For Both I can set up value constraints but the first also prevent repeating long strings by the use of codes without visually losing that information (you see the string, not the code).

That's exactly what I want to accomplish and can't find the way to do it. Maybe it has no sense and it's just a problem of concept as maybe PostgreSQL data modelling simply has a way to approach or deal with this situation that I ignore.

So is this usually done in PostgreSQL? Can it be done without too much extra code? Does it even has sense? Please enlighten me on this.

An illustrative example,

I have a  table with all the trees in a city:

city_trees

tree_id | t_location    | t_species      | t_health
--------+---------------+----------------+--------------
234     | Arc Cie Av.   | Populus nigra  | Healthy
235     | Arc Cie Av.   | Populus nigra  | Deceased
236     | 27th May Str. | Salix alba L.  | Healthy
237     | Monolith Sqr. | Quercus alba   | Healthy

For species names and health status I use coded value domains. The use of domains is transparent to the user: in the city_trees table I see the domain descriptions despite they are actually populated with coded values.

domSpecies

code  | description
------+-----------------
PN    | Populus nigra
SAL   | Salix alba L.
QA    | Quercus alba

domHealthStatus

code | description
-----+-----------------
H    | Healthy
D    | Declining
L    | Deceased
C    | Cut


texts: How can I get the ellipsoidal values for length and area using spatialite?

texts:
I have spatialite geometry data stored in a spatialite database in WGS 84 (EPSG 4328) format:

SELECT Srid(geometry) FROM shape_layer;
> 4326

When geometry is being returned as text, it is returned in meters (when the data is being worked on, the projection is more commonly EPSG 3857 to make use of Google Maps/OpenStreetMap). By example:

SELECT AsText(geometry) FROM shape_layer;
> LINESTRING(-381578.202 6574042, -378511.828 6574794.956)

All data works will display correctly (e.g. if using QGIS), but this is giving me issues when using spatial queries. GLength returns a non-projected length (3.16km) rather than the actual (Ellipsoidal) length (2km). I'm assuming I'm going to have similar issues with area.

QGIS can do this simply by checking the Ellipsoid option for measuring length/area so I know its possible with the data I have. But how can I get the actual values for length and area from this data using spatialite?

I'm hoping this is a pretty simple thing to resolve. Thanks in advance for any help you can provide!


texts: Adding Not Null constraint on field using PyQGIS

texts:
I have a vector layer to which I want to apply some constraints using a script with PyQGIS (a NOT NULL constraint on some fields).

I checked the docs of PyQGIS and found setConstraintExpression (int index, const QString &expression, const QString &description=QString()) which as I understand it from the docs it applies to a QgsVectorLayer I used it in my code like this:

my_layer = QgsVectorLayer('./path/to/my_layer.shp', 'my_layer', 'ogr')
field_index = my_layer.fieldNameIndex('ID')
my_layer.setConstraintExpression(field_index, 'NOT NULL')

I get an error that the function does not exist :

> AttributeError: 'QgsVectorLayer' object has no attribute
> 'setConstraintExpression'

I also tried setFieldConstraint and I get the same error. How can I add a constraint on a field using PyQGIS? (QGIS 2.18 Las Palmas)

I've just noticed that these 2 methods I tried are in the QGIS API 2.99.0-Master which is still not released.


texts: Unable to get python-qgis-common on Kubuntu 14.04

texts:
just upgraded my Kubuntu from 13.10 to 14.04 LTS and lost all plugins. Found out that "python-qgis-common" is not installed.

Tried to install it but was told that it depends on "sip-api-10.1" which cannot be installed. Searched the web and according to almost all ubuntu sites the "sip-api-10.1" is virtual package provided by "python-sip" which is installed (sip4 (4.15.5-1build1) trusty).

BTW, I also had problem with libspatialite3 - had to find libspatialite3_3.1.0~rc2-2_i386 on launchpad and manually install it.

Have 32bit Kubuntu, use standard QGIS repos:

deb     http://qgis.org/debian trusty main
deb-src http://qgis.org/debian trusty main

and have absolutely no idea what is wrong. I also performed autoclean after distro upgrade.

Do you know any solution of this situation?


texts: How do I make an attribute that will show the size of my polygon

texts:
Im trying to Create a feature layer for the scaring (Area burned) for hazard reduction burns on Arcdesktop and would like to have an attribute that shows the size of the polygon used.

Eg: I finish mapping the scarred area on collector that is 10 hectares and another area neighbouring it that is 5 hectares then when i click the layer I'd like it to generate the size without having to enter it in manually.


texts: ArcGIS Server Image Service Problem, Dark Imagery

texts:
I have been experiencing an issue when creating image services that contain multiple imagery sets. The method I have been using to create the image services is to create a mosaic dataset, add the images, publish the image service, create a tile cache and manually copy it over to the server. When I use a single set of imagery (from one location) the image services display fine. When I combine more than one set of imagery, the image service displays black.

Both sets of imagery are the same pixel type and depth, and have the same number of bands.

Here is a screen shot of what the cached tiles look like.

If you look at this close up of the same image, you can see that the black images are not completely black, but so dark that you cannot see the features in the image. I have also tried recreating the statistics for the mosaic dataset before creating the image service.

I have not been able to figure this out, does anyone have any suggestions?


texts: Plot many rasters on the same graph, one on top of the other, using a certain angle in R

texts:
I wish to create a plot with multiple raster layers in R, but plot them in a certain angle so that all layers can be properly seen. What I have in mind is a plot like the following, taken from here: https://pubs.usgs.gov/ds/691/ds691.pdf

How can I do this in R?


texts: Importing data from online my sql data base to the attribute table in arcgis 10.2

texts:
I have point features in ArcGIS which have sewer manholes plotted on them along with latitude and longitude. The attributes of these manholes are stored in an online server using MySQL database.

Can I import the attribute data into ArcGIS and merge it with the point data (spatial data)?

Data is in .gdf fomat

The join option does not help my purpose.

Does ArcGIS have an built in feature or will I have to write a script to do so?


texts: How to match symbology between two layers

texts:
I have two point layers: one shows the number of people in a county, the other shows the number of people who receive a particular service in that county.

I am symbolizing them both as "proportional symbols", that is, as dots of varying sizes.

However, the scale is different between them, so I can't compare the dot sizes in a meaningful way. 1000 people in one layer is a dot that looks five times bigger than 1000 people in the other. I'd like them both to be symbolized with the same scale so I can see how many people receive services relative to the whole population. Below is a snapshot so you can see what I mean.


texts: Getting FeatureTemplate dialog form ArcObjects?

texts: Is it possible to access the "Select Feature Template" dialog as shown in the below screenshot through ArcObjects? We can access this dialog when using the Editor -> Copy Parallel tool.


texts: Insert image in QGIS Plugin using qt creator

texts:
I'm building qgis plugin and i use Qt creator to creat a form. I want insert a image and i use a label to do this. In the field pixmap i choose a file image.png.
I save and in QGIS i reload a plugin and the image don't appear. I edit the file xxxx.ui and i see this

   <property name="pixmap">
    <pixmap>image.png</pixmap>
   </property>

but if i do that

   <property name="pixmap">
    <pixmap>C:\Users\...\.qgis2\python\plugins\...\image.png</pixmap>
   </property>

the image appear.But if i use in another PC the image disappear again because the Path is different.
Someone can help me ?


texts: Best way to get a bounding polygon of all features in a file .gdb

texts:
I have an arcpy script that dynamically creates a filegeodatabase and its featureclasses from uploaded spatial data, currently point and line features and possibly polygons in the future. I am interested in what is the best way to go about creating a polygon around the entire contents of the gdb.

Ideally, it would be perfect if I there was a way to do minimum boudning geometry on a set of feature classes, or an entire geodatabase, and maybe that is a thing somewhere that I am not seeing.

I have had success just calling that and creating polygons for each feature class, and then take the union of all the polygons for the geodatabase, however as the datasets get large that seems like it wouldn't be a very efficient way of handling it.

Another way I'm looking at right now is getting a list of all the points and doing a bounding geometry algorithm on them, furthermore just getting the min/max xy of each polygon and run it against a list of those.
It just seems like there is a tool or something that I'm not aware of that does this and would be a better way of solving the problem.


texts: Undomanager did not remove graphics when undo()

texts:
My attempted on using the UndoManager has been unsuccessful for a couple days and I'm stuck.

I did not setup a proxy.

I create a FeatureLayer object in memory with

var drawingPointLayer = new esri.layers.FeatureLayer(featureCollection, {
    id: "drawPointLayer",
    mode: esri.layers.FeatureLayer.MODE_ONDEMAND
});
mapApp.map.addLayer(drawingPointLayer);

created UndoManager and button to perfom undo redo actions

undoManager = new esri.UndoManager({maxOperations:50});

var undoButton = new dijit.form.ToggleButton({
    id: "undoButton",
    showLabel: false,
    iconClass: "dijitEditorIcon dijitEditorIconUndo",
    onClick: function(){
        undoManager.undo();
        checkUndoRedoState();

        mapApp.map.graphics.graphics.splice(mapApp.map.graphics.graphics.length-1, 1);
        mapApp.map.graphics.redraw();
        alert(undoManager.length + " | " + mapApp.map.graphics.graphics.length);
    }
}, "undoButton");
var redoButton = new dijit.form.Button({
    id: "redoButton",
    showLabel: false,
    iconClass: "dijitEditorIcon dijitEditorIconRedo",
    onClick: function(){
        undoManager.redo();
        checkUndoRedoState();
    }
}, "redoButton");

and add operation to UndoManager

function addToUndoManager(graphic, task){
    var operation;
    var featureLayer = mapApp.map.getLayer("drawPointLayer");
    //var featureLayer = mapApp.map.getLayer("landuseLayer");

    if(task=="add"){
        featureLayer.applyEdits([graphic], null, null, function() {
            operation = new esri.dijit.editing.Add({
                featureLayer: featureLayer,
                addedGraphic: graphic
            });
        });

    }

    if(operation)
        undoManager.add(operation);

    checkUndoRedoState();

    alert(undoManager.canUndo + " | " + undoManager.canRedo + " | " + operation.label + " | " + operation.type + " | " + undoManager.length + " | " + mapApp.map.graphics.graphics.length);
}

New point markers would be added to the map via mouse click. Undomananger would register. But when I press the undo button, the graphics on the map would not disappear.

I'm clueless on what to do next to solve this problem.

Please Help


texts: ogr2ogr conversion failed when converting the varchar value to data type int

texts:
I keep getting this Error 1 when I run the following on some tables

ogr2ogr -skipfailures -f "MapInfo File" -lco overwrite=yes -lco launder=no -lco relaxedFieldNameMatch "D:\QG\CREFNO.tab" "MSSQL:Server=zzzz;Database=GIS_Test;Trusted_Connection=True" -sql "SELECT * FROM dbo.vw_AUTH_CREFNO" -a_srs EPSG:28354 -t_srs EPSG:28354 -s_srs EPSG:28354

Is there some switch to include that fixes this?

I see that in the DB you can add a convert switch but is it possible to do this in OGR2OGR? https://stackoverflow.com/questions/21984110/conversion-failed-when-converting-the-varchar-value-simple-to-data-type-int

I need to keep the output format as .tab


texts: PyQGIS-Code in Plugin doesn't store features completely in memory layer

texts:
Within a QGIS plugin I download data which is then converted into a list of QgsFeatures. My way of storing for a long time was to use addFeatures on the provider object, but now in QGIS 3.16 LTR, not all features of the list are stored into the memory layer and I can't find the error.
# the main part of the function body:
        # load data
        features = postats.getFeatures()
        print(len(features)) # 654
        # create layer
        crs = QgsCoordinateReferenceSystem(4326)
        vlout = QgsVectorLayer("Point?crs=%s"%crs.authid(), layername, "memory")
        ### AMR: missing features
        ### vlout.startEditing()
        ###
        pr = vlout.dataProvider()
        pr.addAttributes(postats.fields)
        vlout.updateFields()

        pr.addFeatures(features)
        vlout.updateExtents()

        ### AMR
        ### vlout.commitChanges()
        print(vlout.featureCount()) # 47
        ###

        # add layer to QGIS canvas
        QgsProject.instance().addMapLayer(vlout)
        # add a styele
        vlout.loadNamedStyle(os.path.join(self.local_dir, style))
        # turn on labeling
        vlout.setLabelsEnabled(True)
        self.layerRefresh(vlout)

        return vlout

As you can see, I commented out my first take to fix it: using startEditing()/commitChanges() I got no changes in my result: Only 47 of 654 features are stored in the layer.

Postat, by the way, is another module to fill the feature list and create the QgsFields


texts: Combine latitude, longitude and value ascii files

texts: I have three ascii files of latitude, longitude and value. How to combine these three ascii files into a single raster of GTiff format?


texts:
I want to create add-in tool to show x y coordinate on status bar live.

      protected override void OnMouseMove(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
    {

        //this.Enabled = !this.Enabled;
        ArcMap.Application.CurrentTool = null;

        if (ArcMap.Document == null || ArcMap.Document.CurrentLocation == null)
            return;

        var point = ArcMap.Document.CurrentLocation;
        ArcMap.Application.StatusBar.set_Message(0, point.X.ToString() + point.Y.ToString());
    }

but xy are not live. What should i do?


texts: Using a Local Datum Plane (LDP) scale factor within ArcMap?

texts:
I have a CADD drawing that uses a Local Datum Plane (LDP) scale factor of 0.99991199. When I add the drawing to ArcMap without taking into account the scale factor, the drawing appears to the east of where it should. Is there a way for me to enter this LDP scale factor within ArcMap?

I'm using ArcGIS 10.2.1, and the NAD 1983 HARN StatePlane Oregon North FIPS 3601 Feet Intl projection.


texts:
I have derived Topographic Wetness Index (TWI)/CTI with ArcGIS 10.3 using 30m DEM resolution. Earlier, it was propagating negative values which were mainly confined to ridges. I have restructured the 'Raster Calculator' expression as below and got rid of negative values.

Ln(("Flow_acc"+ 1 ) * 900/"Tan_SlopeRad")

The below process diagram would acquaint you about steps I have taken to arrive at the positive integer values.

and the resultant image clearly indicates values having 'No Data'. These values are mainly confined to Zero Degree Slope within River.

Now, How would I deal with values having ''No Data'???


texts:
i have lots of data which was coordinated with gdal some programatic way at below:

gdal_translate -of GTiff  -a_ullr %s %s %s %s -a_srs EPSG:3857 %s/%s  %s/%s.tif

then for tiling them all i am building virtual dataset with this:

gdalbuilvrt some.vrt *.tif

for getting its geographic info with gdalinfo i am getting this result:

Coordinate System is:
PROJCS["unnamed",
    GEOGCS[,
        DATUM["unknown",
            SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","3857"]]
Origin = (.......,.......)
Pixel Size = (4.777314268465985,-4.777314267784062)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( .....

Band 1 Block=2816x1 Type=Byte, ColorInterp=Red
Band 2 Block=2816x1 Type=Byte, ColorInterp=Green
Band 3 Block=2816x1 Type=Byte, ColorInterp=Blue

then with this virtual dataset for gettin geodeitc tile i am calling gdal2tiles.py with profil geodetic but i am getting this result:

ERROR 1: No PROJ.4 translation for source SRS, coordinate
transformation initialization has failed.
Generating Base Tiles:
Generating Overview Tiles:

where i am wrong i havent found yet. but when running gdal2tiles.py for only one tif file it is working and in global mapper it returns true result...

how can i tile my image pls i need your helps?

thank you


texts: Arcmap digitize map display on android offline

texts:
Im quite new in arcmap map and i have been spending more than 2 week stuck in how to show map offline. I have tried the code is attached but when i run the application.It crashes nothing to show. You can see my code and i also attached geodatabase file.

i follow this tutorial: http://www.activeg.com/agBlog/android-running-an-arcgis-map-offline

And my geodatabase file is here https://files.fm/u/q5xuznvy

Code is here

MapView mMapView;

Geodatabase geodatabase;
private GeodatabaseFeatureTable geodatabaseFeatureTable;
private FeatureLayer featureLayer;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

mMapView = (MapView) findViewById(R.id.map); //Instantiates the MapView object
LoadMap mLoadMap = new LoadMap(); //Runs the LoadMap class on another thread
mLoadMap.execute(); //Calls the background thread

}

private class LoadMap extends AsyncTask {

@Override
protected Void doInBackground(Void... params) {

    try { //Opens up the basemap.geodatabase file from it's location on the physical device
        Log.d("_EXC", "Loading File");
        geodatabase = new Geodatabase("/mnt/shared/Database/mygeodata.gdb");
        Log.d("_EXC", "File Loaded");
    } catch (FileNotFoundException e) {
        Log.d("_EXC", e.getMessage());
    } finally { //Takes each layer one by one from the Geodatabase and adds it to the MapView
        if (geodatabase == null){
            Log.d("_EXC", "File not Loaded");
        }
        for (int i = (geodatabase.getGeodatabaseTables().size()) - 1; i >= 0; i--) {
            geodatabaseFeatureTable = geodatabase.getGeodatabaseFeatureTableByLayerId(i);
            featureLayer = new FeatureLayer(geodatabaseFeatureTable);
            mMapView.addLayer(featureLayer);
        }
    }
    return null;
}

}


texts: Merging tesselating regions depending on size?

texts:
I have the following regions marked up over map

Each region has assicated statistical data.

The problem is that sizes of these regions are very different. Some regions are very big and another ones are very small.

Obvious idea is to hierarchically merge regions so that at each zoom we will approximately same size of aggregated regions.

Are there any algorithms for this task?

The problem is that regions are not adjacing ideally, they can slightly overlap or have gaps between them.

I tried the followng approach:

I considered a grid (the same grid as web merkator use for tiles) at given zoom and assigned each region to closest grid point (closest to each centroid). Then I grouped region by grid points and joined them at some zoom.

Unfortunately, this produced bad results. A lot of regions of strange shapes and with holes appeared.

What can be suggested as better approach?


texts:
I'm creating a web service that will be passed a list of objects that include the Lat/Long coordinates and some other data such as Speed.  When I use the ArcGISRuntime library to add the features to my map service that is running, the Geometry will appear but none of the attributes ever will.  Here is my code:

            foreach (GPSLocation loc in aLocationsToStore)
            {
                var theLatLongPoint = new MapPoint(loc.Longitude, loc.Latitude, SpatialReferences.Wgs84);
                var theProjectedPoint = GeometryEngine.Project(theLatLongPoint, theSpatialReference);
                var theDateTime = Convert.ToDateTime(loc.DateTime);

                //Feature gpsFeature = new GeodatabaseFeature(gpsLocFeatureTable.Schema);
                var gpsFeature = gpsLocFeatureTable.CreateNew();
                gpsFeature.Geometry = theProjectedPoint;
                var attributes = gpsFeature.Attributes;
                attributes["SPEED"] = loc.Speed;

                await gpsLocFeatureTable.AddAsync(gpsFeature);
            }
            var result = await gpsLocFeatureTable.ApplyEditsAsync(true);

After running this, in the map service I can see the MapPoints in the feature layer, but all of the attribute values of the point are 'null'  Any idea what I'm doing wrong or how I can get the attributes to sync?

EDIT:
I tried sniffing the network data using WireShark and this is what I get for the adds value:

[
   {
      "geometry":{
         "x":883822.86125507951,
         "y":491566.5768424049,
         "spatialReference":{
            "wkid":102649
         }
      },
      "attributes":{
         "OBJECTID":-10
      }    } ]

It seems as though it is overriding all of the attributes that I explicitly define when I call AddAsync.  Any ideas on how to get attributes in the attributes object?


texts: How to package an image with an Addin so it can be added to page layout?

texts:
This post shows the code I'm using to insert an image into the page layout. It works fine, but it's using a hard coded path.
Adding picture to ArcMap PageLayout using ArcObjects in .NET?

Currently my code looks for the image in the user's ArcGIS folder, or if not there at a shared network folder, or else it doesn't insert it.

    strPath1 = Environ("USERPROFILE") + "\Documents\ArcGIS\logo.bmp"
    strPath2 = "Z:\networkfolder\logo.bmp"
    If Exists(strPath1) Then
        picElement5.ImportPictureFromFile(strPath1)
    ElseIf Exists(strpath2) Then
        picElement5.ImportPictureFromFile(strPath2)
    Else
        Dim Result As DialogResult
        Dim Buttons As MessageBoxButtons = MessageBoxButtons.YesNo
        Result = MessageBox.Show("image not found, not inserted", "title", Buttons)
        Exit Sub
    End If

What I would like to do is include the image in the Images folder of the AddIn. In the Config.esriaddinx file it allows images to be used from a subfolder, but picElement5.ImportPictureFromFile doesn't support relative paths.

Is there a different method to import an image into the page layout or a way to install them image into a standard folder that would work for all users. I need to distribute this addin to other users in the office.

I'm using ArcGIS 10.6, VB in Visual Studio 2017.


texts: Map scale factor when converting from Mercator to Equirectangular

texts:
Lets say I have a map in Mercator projection, and I know top and bottom latitudes:

topLatitude = 80;
bottomLatitude = -55;

I also know width and height of a map:

width = 800;
height = 500;

I want to rescale the map to Equirectangular projection, keeping the same width.

How can I calculate new height of a map?


texts:
I am trying to create my own XYZ tiles to use them with OpenLayers 3 as my local tiles. On this example you can see the objective/idea.

I want to use the NASA Blue Marble Earth Visible maps, as an example this one from July 2004

On the readme PDF it says that the image is on projection datum WGS84. So the as we know this projection bounds are on EPSG:4326.

I georeference the image on this way.

gdal_translate -of GTiff -a_srs EPSG:4326 -a_ullr -180 90 180 -90 world.topo.bathy.200407.3x5400x2700.jpg world.topo.bathy.200407.3x5400x2700.tif

The information of the new generated GeoTIFF can be checked with:

$ gdalinfo world.topo.bathy.200407.3x5400x2700.tif
Driver: GTiff/GeoTIFF
Files: world.topo.bathy.200407.3x5400x2700.tif
Size is 5400, 2700
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.066666666666667,-0.066666666666667)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
Lower Left  (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)
Band 1 Block=5400x1 Type=Byte, ColorInterp=Red
Band 2 Block=5400x1 Type=Byte, ColorInterp=Green
Band 3 Block=5400x1 Type=Byte, ColorInterp=Blue

As I want to create XYZ tiles with OpenLayers 3, checking the documentation, I see I need to warp the projection from EPSG:4326 to EPSG:3857, which I do with:

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 world.topo.bathy.200407.3x5400x2700.tif Marble_3857.tif

The problem is that the shape of this final image is (4009 x 4514) so it is not square which should be for XYZ tiles.

I have seen from MapTiler this example that uses that map which is already tiled in 256px tiles, something similar to what I want.

First of all, I have no square shape image projection so I cannot make tiles. And secondly, how can I make different zoom level tiles (zoom till 8 level)? Is there any tool on GDAL for that? I tried gdal2tiles but does not work with following command:

gdal2tiles.py --s_srs EPSG:3857 --zoom 0-3 -p 'raster' Marble_3857.tif

EDIT

Following the answer of AndreJ it mostly seems to work.
First I used gdal_translate as mentioned:

gdal_translate -of GTiff -a_srs EPSG:4326 -a_ullr -180 90 180 -90 world.topo.bathy.200407.3x5400x2700.jpg world.topo.bathy.200407.3x5400x2700.tif

Then, before gdal2tiles, as I am using Ubuntu I had to change something on the python code as mentioned here to avoid errors on projection.

After that, I could run the command of AndreJ:

gdal2tiles.py --s_srs EPSG:4326 --zoom 0-5 world.topo.bathy.200407.3x5400x2700.tif ./tiles

But the result is quite strange because it leaves a transparency column on the right on all the zoom levels... (can be checked downloading the below picture)

Which can be the reason? The modified code? Any option I should define?


texts: Find the Position of a Layer in the TOC PyQGIS3

texts:
I need to find a layer in the TOC and get its position (which can vary) so that I can add a group after that layer.
I can get the layer I want to reference easily enough:
root = QgsProject.instance().layerTreeRoot()
last_layer = QgsProject.instance().mapLayersByName('next_ids')[0]

What I want to do is add group after that layer:
lyr_pos = [index in TOC of last_layer]  # This is what I need to get
self.err_group = root.insertGroup(lyr_pos + 1, GROUP_NAME)


texts: Set the redirect_uri on ArcGIS JS application for ArcGIS Online WebApp

texts:
I am trying to create a javascript application using the ArcGIS JS API. I want to use a webmap created on the ArcGIS online. So, I have set the ArcGIS Online WebApp and register it in order to have the appID.

I downloaded the identity-oauth-basic.html from AGOL Link

I altered the appID to match the one of my WebApp and I get Invalid redirect_uri Error as shown bellow.

I checked the details and the redirect_uri is linking back to my html file...
How can I set/use the correct redirect_uri on the ArcGIS JS application?

I tried to set the redirect_uri on the OAuthInfo directly without luck

var info = new OAuthInfo({
    // Swap this ID out with registered application ID
    appId: "<appID in here>",
    redirect_uri: "<redirect_uri in here>",
    // Uncomment the next line and update if using your own portal
    // portalUrl: “https://<host>:<port>/arcgis”

    // Uncomment the next line to prevent the user's signed in state from being shared with other apps on the same domain with the same authNamespace value.
    // authNamespace: "portal_oauth_inline",
    popup: false
  });


texts: Setting up ArcMap to debug scripts in PyCharm?

texts: I'm wondering whether anyone succeeded at setting up ArcMap to debug python scripts in PyCharm. I've tried several times to configure both, but failed.


texts: How do I find OSM way-id from latitude/longitude?

texts:
How do I find the way-id (in an OpenStreetMap), from the latitude-longitude combination? To give some context:

I have loads of sensors that report pollution data (roughly) in the form:
lat, long, timestamp, value

Given that I'll have many sensors, I want to tag each 'way' with the amount of pollution recorded, so that my routing algorithm (GraphHopper) can assign different weights to each way.

Any ideas?


texts: GRASS - Will r.to.vect work on this scanned map?

texts: Total GRASS noob here. I have several very large hand contoured maps to digitize, and this thread intrigues me. In the past I have spent hours upon hours digitizing these maps and revisions in ArcMap. If I can save myself and my client time and money by using r.to.vect in GRASS, that would be great. The question is, to those with a trained GRASS eye, would r.to.vect even work on a scan like the sample below? I need to get the curved lines out to vectors. I'm wanting some educated eyes on this before I invest the time in learning enough GRASS to get this done. Thanks.


texts: Source code of DXF export functionality in QGIS 2.18

texts: I want to make some adjustments to the DXF Export functionality in QGIS 2.18.25. How can I get the source code of this functionality? Is it in Python?


texts: How to fix corrupted QGIS project file that causes Windows to freeze?

texts:
I'm running QGIS 2.14.9 on Windows 7 SP1. I have a project that contains PostGIS layers from a remote server, as well as some (local) shapefiles that I've been doing some development on in the Python Console. I have reached a point, however, where when I try to open this project the entire computer freezes, requiring a hard reboot. My colleague tried opening the project on their computer and suffered a BSOD.

I can open other projects OK. So would like to try removing layers from this project to see if that fixes loading issues, but how can I do that without opening it in QGIS?


texts: Filtering layers displayed on map only for point layers, lineString layers or polygon layers using mapbox

texts:
I tried to use setFilter method in mapbox but this method is used to filter existing layer's features depending on specific property but not filtering all layers according to geometry
In other words, I need to filter the layers depending on geometry type (Point, LineString, Polygons)


texts: Loading feature linked annotation to existing sde Database

texts: I have feature linked annotation (composite) in sde Databese and i need to add / load annotation from another Database FGDB, is there a way to do this? or i need to make all the prosses again (Lable and than convert to annotation and create new Anno layer)?


texts: ArcREST updateDefinition changes some fields but not others

texts:
I am updating the Layer Definition's of a number of feature layers hosted by ArcGIS online via the arcrest module in python(2.7). For certain fields we want "visible" to be false, and for some we want "editable" to be false. I am finding that when updating it, the changes to "visible" are happening for the relevant fields, but no fields are allowing "editable" to be changed to false. Is this a known bug? Any suggestions? these are views, do we need to change the source data first?

See my code:

import arcpy, arcrest
from arcresthelper import securityhandlerhelper
from arcresthelper import common

config = {'username': <user>, 'password': ,<pword>}
token = securityhandlerhelper.securityhandlerhelper(config)
admin =
arcrest.manageorg.Administration(securityHandler=token.securityhandler)
content = admin.content
userInfo = content.users.user()
userInfo.folders
#views
mpID = "<id>"
inID = "<id>"
rwID = "<id>"
nwID = "<id>"
npID = "<id>"

idList =[inID,mpID,rwID,nwID,npID]

for featid in idList:
    item = admin.content.getItem(itemId=featid)
    service = arcrest.hostedservice.service.AdminFeatureService(item.url,token.securityhandler,initialize=False, proxy_url=None, proxy_port=None)
    layer = service.layers[0]
    fieldscopy = layer.fields

    for field in fieldscopy:
        if field["name"] in (<fields to turn of editing>):
            field["editable"] = False

    for field in fieldscopy:
        if field["name"] in (<fields to make non-visible>):
            field["visible"] = False

    updateDict = {"fields":fieldscopy}
    layer.updateDefinition(updateDict)


texts: I have 2 fields in the same table which represent the same thing but they were unioned from 2 different data sets, lets call them A and B. Lets say there are 50 records in total, of which A has 25 and B has 25, all of which are distinct (ie. no overlap). How do I go about combining these 2 fields into one field. I'm using ArcMap 10.5.


texts: QGIS for Mac: How to restore menu bar and tool bar in print composer

texts:
I managed to hide both the tool bar and the menu bar in my print composer (Mac version 1.8.0). To get the tool bar back I saw you need to click on the menu bar. What then when you also miss the menu bar?

Here what I see. I right-clicked everywhere. I can't get the the check-box has described here.


texts: Creating contiguous dispersal surface between two climate-change scenarios in ArcGIS for Desktop?

texts:
I'm modelling the distributions of Australian parrots in response to climate change. I have two climate scenarios (present and future), and have used Maximum Entropy modelling to generate maps of future distributions. These distribution maps are binary maps consisting only of 'presence pixels' or 'absence pixels'.

I want to use three different dispersal scenarios in the future projections to limit how far each parrot species can disperse; for example 'no dispersal' and 'unlimited dispersal'. The third scenario is what I am needing help with: contiguous dispersal. I want to create a raster layer that limits the future distribution of a species only to pixels that directly or indirectly touch presence pixels from the current distribution, i.e. limiting the distribution to presence pixels (under the future scenario) that are indirectly contiguous with presence pixels of the current climate scenario.

For example I've included a diagram of one of the species. I have a species that has a relatively small distribution under current conditions (purple pixels), and a much larger projected range under future conditions (yellow pixels), the area of presence overlap between the two scenarios is shown by brown pixel, areas of absence in both scenarios are grey. I want to create a presence-absence raster layer that excludes all yellow pixels that do not form a contiguous surface with a brown or purple pixel - i.e. exclude yellow pixels that are separated from purple/brown pixels (and the yellow pixels that are contiguous with them) by areas of absence.

I'm hoping there is a tool that will allow me to exclude these 'discontinuous' yellow pixels so that the extent of the presence pixels in the presence-absence raster layer is restricted.


texts:
I'm trying to modify the following sample to only show the latest feature added to the map.

The sample is located here: https://developers.arcgis.com/javascript/jssamples/ed_attributeInspectorValidate.html

I've tried to change

//Add the editable feature layer to the map
        var pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Notes/FeatureServer/0",{
          mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
          outFields: ['*']
        });

from MODE_ONDEMAND to MODE_SELECTION

//Add the editable feature layer to the map
        var pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Notes/FeatureServer/0",{
          mode: esri.layers.FeatureLayer.MODE_SELECTION,
          outFields: ['*']
        });

Which works when adding a new feature but as soon as the user clicks anywhere else on the map the newly added feature disappears. Is there anyway to modify the code so that the newly added feature remains displayed until another feature is added? Effectively making it so only the latest feature is shown on the map.


texts:
I use the following code to filter my osm file
.\Files\osmfilter phili.o5m  --keep="highway=" -o=ways.osm

I get the error:

.\Files\osmfilter : osmfilter Error: too many input files.
At line:1 char:1
+ .\Files\osmfilter phili.o5m  --keep="highway=" -o=ways.osm
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (osmfilter Error: too many input files.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

I created the phili.o5m file by using this command:
'Files\\osmconvert64 "philippines.osm.pbf" -o=phili.o5m'


texts: How should I filter the data that I got from overpass-api-interpretor to look like data from overpass turbo?

texts:
I just started using Overpass Api yesterday. I am querying data from overpass-api with this method.
  var OVERPASS_API_ENDPOINT = 'https://overpass-api.de/api/interpreter',
      OVERPASS_API_REQUEST =
      '[out:json];(' + 'node["highway"](BOUNDS););' + 'out center;>;',
    OVERPASS_BOUNDS_REGEX = /BOUNDS/g;

 let res = await axios({
    url: OVERPASS_API_ENDPOINT,
    data: OVERPASS_API_REQUEST.replace(OVERPASS_BOUNDS_REGEX, bboxstr),
    method: 'get',
    timeout: 25000,
  })

currently, this returns
  {
    type: 'node',
    id: 66250246,
    lat: 34.2146702,
    lon: -84.8261852,
    tags: { highway: 'turning_circle' }
  },
  ... 4379 more items

On Overpass Turbo, with about the same bbox it shows fewer data points. So I am wondering what is the best way to filter the data I received to be similar to the one I found on Overpass Turbo? Also, why is there so many nodes with the same tags, I know I filtered it by the highway tag, but can the same node belong to more than one specific lat and long?


texts: QGIS 2.81. Why can i only see my whole polygon and nothing if i zoom in

texts: I have a polygon layer with one object. It is a flood inundation map. I could see my layer all the time in every scale factor. From one moment to the other it changed and know it is only visible if i zoom out and the whole polygon is visible. If i zoom in and only a part of the polygon should be visible, there is nothing. What can I do? I tried everything with layer properties -> general ->scale dependent visibility, but even if i uncheck it, the Layer is not visible.


texts: I'm doing a project for a city that has little database. I would like to know if it is possible to generate polygons of existing buildings and 3D of them from a Google Earth map in QGIS?


texts: Rearranging display of Date Field in ArcGIS Desktop?

texts:
Can you rearrange the text in date field type in ArcGIS?

Eg. Map_Date - 05/30/2014 (I want to reformat this to 2014-05-30)

I've been trying to use the field calculator on all my records, but cannot figure out the syntax for either Python or VB.


texts: Merging two vector layers with different granularity

texts:
I am a beginner at QGIS.

I have two vector layers. One represents country boundaries for the whole world. The other one represents region boundaries, but only for OECD countries.

I would like to create a unique layer that would use country boundaries for non-OECD members and region boundaries for OECD members.

How could I go about this?


texts: Securing REST endpoint using custom database and Basic Auth?

texts:
I need to provide Google Earth users access to my REST endpoints.  Currently there is a database that has the users and pwds as well as there roles.  Roles determine what data in the website they can see and could be used to tell me which endpoints they have access to.  I'm currently using Windows security for authentication, but this means I have to make changes to my users when ever changes in the database occur.  I want to use that database for authenticating the endpoints.  Google Earth only supports Basic Auth.

I've gotten as far as extending IIS to invoke Basic authentication but authenticate against a non-asp.net sql database, however, I don't know how to apply what I have now to securing the endpoints.


texts: I'm using GeoServer version of 2.7.1.1 and installed plugin for MB tiles, now I want to know how to generate MBtiles after installing the plugins.


texts: Apply a cloud mask to a Landsat8 collection in Google Earth Engine - time series

texts:
I have tried to apply a cloud mask for a landsat 8 collection using code1, code2, and code3 but none will work.

code1 encounters the error of not working even after changing

var mask = img.select(['cfmask']).neq(4)
to

var mask = img.select(['pizel_qa_bands']).neq(3)

code2 encounters the problem of not being a time series dataset. I want to be able to extract pixel values for each image over a period of time but this code only gives one output of pixel values.

and I can't adapt my script to code3.

Here is my script and all i want to do is remove the clouds and cloud cover from a Landsat8 image collection

var l8_mayo = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
  .filterDate('2000-01-01', '2018-12-31')
  .filter(ee.Filter.eq('WRS_PATH', 208))
  .filter(ee.Filter.eq('WRS_ROW', 23));

var visParams = {bands: ['B4', 'B3', 'B2'], max: 0.3};
Map.setCenter(-9, 53, 8);
Map.addLayer(l8_mayo, visParams, 'l8_mayo collection');`


texts: Maximum number of Tiled Layers in OpenLayers

texts:
I'm developing an OpenLayers site where the client wants a dozen layers that can be individually turned on and off, which is a bit of a bummer in terms of performance. The data is PostGIS and static enough to cache tiles. The area is quite small geographically but requires 9 zoom levels to allow detailed views. I'm using a cached tiled base map which is fast and efficient.

I've been using Single Tile WMS layers for the other dozen layers, but am wondering if I should used Tiled, cached versions of these.  There are other efficiency gains to be made by limiting the buffer, and adding sub-domains such that images can come from tiles.example.com, tiles2.example.com, etc,  however all other efficiency strategies aside, I'm wondering at what point the OpenLayers performance difference is for 12 untiled layers, verses 12 tiled layers?

Said another way, at what number of tiled layers in OpenLayers will the performance degrade such that Single Tile layers are preferable? If I have 12 tiles per view, and 12 layers, can OpenLayers handle 144 tiles without bogging down?


texts: ArcPy Intersect without self-intersection

texts:
I'm doing an intersection between buffers around street centerlines and census block group geoms.
The extent and density of features is fairly large so I'm running into memory limitations consistent with Getting topology or out of memory errors with large dataset intersects and spatial joins in ArcMap.
I was able to avoid the memory error by reducing the buffer size but may need to find an actual solution.
Looking at the output of the successful intersection, the problem with my code is that the intersection is calculating not just the intersection of buffers with census geoms but also the intersection of the buffers with themselves, which raises the complexity enormously.
The self-intersection is pretty evident in the screen grab below. That's a selection of all the intersection output features for a single buffer. While my goal is to have a few peices where it intersects the census geoms, it clearly is being cut up by the other buffers from the same layer.
Has anyone found a way to avoid the self-intersection?
Obviously I could dissolve after calculating the intersection but that doesn't improve the efficiency of the calculation.
I don't see a better option here but maybe I'm not thinking creatively enough.
As a note, the dice tool isn't helpful I don't think because the problem is the number of features not the complexity.


texts: Determining homogenous blocks of individual tree species in woodland and creating new shapefile without blocks/polygons of < minimum area

texts:
I am working on a project attempting to identify suitable woodland habitat for red squirrel translocation wherein conservation efforts could be focused. Below is a small section of the map showing where individual tree species polygons have been dissolved, using a 100m buffer dissolve, to appear as larger "wooded area" polygons.

For the purpose of my project, I want to identify suitable forest areas over 200ha in size, with a suitable make up of tree species. To do this I need to determine homogenous blocks as seperate from those they are not in contact with, and then determine the size and make up of these blocks. There are ~150,000 polygons in the shapefile, so manually selecting each is not a possibility.

I think some form of spatial dissolve would be most suitable, Identifying one homogenous block as "Block 1" for example, and then using Select by Attributes to create a new shapefile with only polygons ("Blocks") with an area greater than 200ha.

How do I do this?

I am very limited in my knowledge of GIS, and had the help of a phd student as well as some on here in getting this far.

I aming ArcGIS Desktop (ArcMap) 9.3, with ArcInfo licence type.


texts: Creating New Layer After Sorting Attribute Table using QGIS?

texts:
I have been self-teaching myself some open source GIS.

I downloaded QGIS and have been following this four part tutorial - http://www.youtube.com/watch?v=XUD6zcNGl4A&list=UUZkLX9x-HiA4B0sGPPvZMcQ. That's part 3, where at 5:21 he filters attribute table for NULL under the OPERATOR column. I don't have his search bar, but I can filter columns. I can choose OPERATOR and type in NULL (or null, case sensitive doesn't matter). It'll filter out to ~5000 results from ~12000 oil wells. However, I cannot save this as a new layer. If I have editing toggled "Save for selected layer(s)" is grayed out. When I click on "save as" the "Save only for selected features box" is also grayed out, and cannot be selected. Any help with this?

Also sometimes, if I do just save as a new layer it will save every well (all ~12000) as the new layer.

I'm using QGIS 2.4.0 on Windows 7.


texts:
I am trying to create a function in Google Earth Engine which would iterate through an ImageCollection consisting of DEMs and return a message saying when a big elevation difference occurs. I believe I am not far from the answer, but I can't manage to make it work.
To what I understand, when you subtract one image from another it does so on pixel-by-pixel basis and returns an image. If you want elevation changes at a specific point, a geometic point can be defined. But what if you want the elevation difference to be calculated on the whole DEM and if at any location a big elevation change occurs, the function detects it? Do you need to explicitly define the region of interests, even though the DEMs themselves act as roi?
Script:
function anomaly(image) {
  // Converting the ImageCollection ''newdems'' to list
  var Imagelist = newdems.toList(newdems.size());
  // Defining the previous image
  var previous = ee.Image(Imagelist.get(-1));
  // Equation to calculate the elevation difference
  var difference = image.subtract(previous);
  // Conditional statement to return the name of the image after which the big elevation change occurs
  return ee.Algorithms.If(difference.gt(150),print('Anomaly occurs after: ', previous),ee.Image(0));
};


texts:
I'm having some doubts concerning the layer mechanism.

Creating a new layer (ie a new connection between a vector and a DB table),
I've imported a vector (rivers) through v.in.ogr, then I've cloned the original table:

db.copy from_table=rivers to_table=rivers_clone

I've created a new connection:

v.db.connect map=rivers table=rivers_clone layer=2

At this point I supposed that the last command had created all the needed structures and fields for the new layer (2), but if I print the categories:

v.category input=rivers layer=2 option=print

no categories are displayed (while they are listed if I choose layer 1).

Question: I thought that a new connection used the same vector categories, but it seems I was wrong. How to make the layer 2 use the same vector categories from layer 1?


texts: Why did my network dataset disconnect on its own?

texts:
I'm running an OD Cost Matrix in ArcGIS Desktop 10.4, using the network dataset made by ESRI's Streetmap Premium. Currently I am testing the network dataset, and wanted to keep a closer watch on how long a run was taking.

I loaded my origins (~ 120,000) and destinations (~ 4,000) successfully. The analysis settings are set to find the 1 closest destination per origin in miles. Once the OD Cost Matrix layer's settings were as I wanted them, the network dataset added to the OD Cost Matrix layer, and all my origins and destinations loaded, I wanted more information about the solve so I ran it through the Solve tool in ArcToolBox instead of the button on the network analyst toolbar. This way it ran in the background and gave me information in the Results window (it won't do that if you run it through the Network Analyst toolbar).

It solved successfully, failed to locate a few of the 120,000 locations (not a big deal), and it output the lines with the attribute table full of distances that I needed. I exported the table for further study.

After the export of the Lines' attribute table, the OD Cost Matrix layer's settings and the Network Analyst window has a message saying 'Disconnected Network Dataset' even thought the network dataset didn't go anywhere. All the layers associated with the network dataset also had the same missing source red ! thing even though I didn't touch it. All my OD Cost Matrix layer's settings are gone, no trace of it. See below for a smattering of problems I'm having.

Does anyone have an idea of what happened here, or what I'd need to do to fix this? I know I can re-do my network analysis from scratch but the fact that everything vanished out of nowhere is something I've never seen before. All of the tabular information for the Origins, Destinations, and Lines are still there if I right-click and open the attribute table, but that's it.


texts: Dynamic connection between PostgreSql and Ms Access

texts:
I'm trying to set a dynamic connection between QGIS and Microsoft Access database. Knowing that MS Access can't handle spatial data, I put PostgreSQL/Postgis in the chain. So that Access could connect to PostGIS and PostGIS to QGIS.

Is there any module that can allow MS Access to connect dynamic with PostgreSQL/PostGIS?


texts: Getting Geometry error: One or more input features have invalid geometry from QGIS

texts:
I am trying to use the "Split With Lines" tool to split a polygon layer that consists 1000+ separate objects.

  Geometry error: One or more input features have invalid geometry.

The tool keeps finding invalid geometry.  I have used all of the general solutions like the "Buffer", "Fix Geometries", "V.Clean", and "Reproject Layer" tools.  None of them have worked.  Is there any other way to fix the invalid geometry?

I have manually gone through and fixed all of the invalid geometry.

Then ran the "Split With Lines" and it will not complete.  It crashes out QGIS for some reason.

Why does the tool keep crashing and not completing the operation?

This is what I am trying to do for the entire data set:


texts: Does Ruby on Rails enable PostGIS for you?

texts:
When using PostGIS with Ruby on Rails and the rgeo - activerecord PostGIS adapter

Do I need to create a database first in PostgreSQL and enable the PostGIS extension?


texts:
I have collected some GPGGA data in *.GPS file. Now how to import these GPGGA into Google Earth Pro.I want to see the result(lat, longt and height) in map.
The file is opened like that:
$GPGGA,023302.00,3957.7942,N,11618.2941,E,1,09,1.1,78.52,M,-9.80,M,,*40
$GPGGA,023305.00,3957.7942,N,11618.2941,E,1,09,1.1,78.53,M,-9.80,M,,*46


texts: Importing elevation data into prexisting KML in Google Earth Pro?

texts:
I am working on a project where I need the z value (elevation) of a set of data points.

Is there a way to assign elevation data to a KML in Google Earth without doing it manually for each point?

I have tried using TCX converter and http://www.nearby.org.uk/elevation-kml.php with no luck.


texts: Filling polygon with png pattern in OpenLayers?

texts:
I want to fill a set of polygons with png pattern.

Here is an extract of my code :

 var canvas = document.createElement('canvas');
 var context = canvas.getContext('2d');
 var pattern;
 var imageObj = new Image();

 imageObj.src = data["fichier_hachures"];

 imageObj.onload = function() {
     pattern = context.createPattern(imageObj, 'repeat');
 };

  zonageItems.push(new ol.layer.Vector({
        source: vectorSource,
        style: new ol.style.Style({
            fill: new ol.style.Fill({
                color: pattern
            })
        })
  })
);

When I do this I get my polygons filled with black color.

data["fichier_hachures"] : is an object property containing the Base64 string of my png image.


texts: Does the clipping function in QGIS clip the data relevent to each polygon?

texts: I am looking to clip geographical areas with population data already inputted. My question is: Assume I clip a polygon containing 100 people in half, will the newly clipped polygon report there to be 100 people or 50 people in it? If not, is there a plug-in I could use to do this?


texts: PostGIS: Calculating the shortest distance between one point and MULTILINESTRING objects

texts:
I have a table with MULTILINESTRING objects and I want to build a query that outputs the shortest distances between every MULTILINESTRING object and a specific point (the same for all records) using PostGIS.
The coordinate system is WGS84.

I'd like a result like the following:

MULTILINESTRING(....) distance1
MULTILINESTRING(....) distance2
MULTILINESTRING(....) distance3

I have tried commands like the following:

SELECT ST_AsText(ST_Distance(geom, st_GeomFromText('POINT(25.3622 35.3621)'), 4326))
FROM my_table;

But it raises the following error:

ERROR:  function st_distance(geometry, geometry, integer) does not exist
LINE 1: SELECT ST_AsText(ST_Distance(geom, st_GeomFromText('POINT(25...
                     ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
********** Error ********** **********

I feel that the answer is easy but I have no much experience in SQL.

UPDATE

After more searching I think that I'm closer to the solution. I run the following SQL code in order to calculate the shortest distance between a Point and Multilinestring records from "my_table" table:

SELECT geom FROM my_table
ORDER BY ST_Distance(geom, ST_SetSRID(ST_GeogFromText('POINT(25.3622 35.3621)'), 4326),
true
)
ASC
LIMIT 1;

This code works and gives me the geometry with the shortest distance:

geom
geometry(MultiLineString,4326)
<geometry object>

But how can I take the corresponding number (distance) ?


texts: How to work with overpass ways in Python?

texts:
I would like to calculate the distance of some points to the nearest motorway, for that i would obviously need a series of vectors/lines etc. to represent the motorway.
On Overpass Turbo, the query

way["highway"~"motorway"]
(33.60615,-84.51173,33.92940,-84.22099);
out;

returns various objects like this:

{
  "type": "way",
  "id": 41047668,
  "nodes": [
    68146293,
    68146294
  ],
  "tags": {
    "bridge": "yes",
    "destination": "Peachtree Industrial Boulevard",
    "destination:ref": "GA 141 North",
    "highway": "motorway_link",
    "lanes": "1",
    "layer": "1",
    "oneway": "yes",
    "surface": "concrete"
  }
}

How can I use this information to come to my final destination?
Does each node have its own coordinates and is there a straight vector between these nodes which is the motoway? Or should I somehow modify my query?
Does anyone have experience with such a problem and can share some knowledge?


texts:
What is the level of support for BigTIFF in image processing libraries?

GDAL supports this functionality so long as you're building against libtiff4(beta), and I would assume most open source C libraries would as well, since I assume most of them build against either libtiff or GDAL directly.

Does ESRI software support bigtiff?

Does Java software support bigtiff (presumably through Java Advanced Imaging)?


texts: QGis 2.18 (and other tests on QGis 2.14) hangs with GRASS 7 editing session (OS Windows 8and 10)

texts:
I installed QGis 2.18 (64bit and 32bit versions) and i started a session with GRASS 7 in Windows 8 environment (the same thing I did on another workstation with Windows 10).
I loaded a test layer with a shpfile with a few elementary polygons.
Some polygons overlap for small areas.
I imported the layers in one location and created a Mapset. The topology appears created correctly after my cleaning work.
All goes well apparently.
At one point QGis starts producing in the directory "PERMANENT \ .TMP\UNKNOWN \" an infinity of 512Kb files that paralyzes the harddisk (100% use) and freezes the session.
In particular, if i try to populate the Mapset with new centroids or breaking lines.
When I stop the session and i reopen the project in a new session, the Mapset is corrupted.
I tried the same actions with other polygonal files or different linear files, always the same thing happens.
I wonder if it has already been seen this QGis behavior.


texts:
I am trying to add popup to markers from database. Markers are showing unable to add title to popup.
        function add_markers(coordinates) {

            var geojson = (saved_markers == coordinates ? saved_markers : '');

            console.log(geojson);
            // add markers to map
            geojson.forEach(function (marker) {
                console.log(marker);
                // make a marker for each feature and add to the map
                new mapboxgl.Marker()
                    .setLngLat(marker)
                    .addTo(map);
            });

        }

Fetching from database
    $sqldata = mysqli_query($con, "SELECT proj_title, proj_location, start_fyear, complete_fyear, lng,
       lat FROM t_capital_projects ");

    $rows = array();
    while($r = mysqli_fetch_assoc($sqldata)) {
        $rows[] = $r;
        $title[] = $r['proj_title'];
        $proj_location[] = ['proj_location'];
        $start_year[] = ['start_fyear'];
        $complete_year[] = ['complete_fyear'];

    }
    echo json_encode($rows);

     }


texts:
I want to polygonize .tiff raster file for specific values. For example, using one method I firstly reclassified the raster by gdal_calc.py --calc="A*logical_and(A>0,A<1)" then used gdal.polygonize function. But I know I can achieve this by providing a mask to the gdal.polygonize function. How do I do that?

Update: I managed to do this sort of. I check the output GeoJSON with QGIS (raster to polygons -> Filter by value). The output has some issues: 1) it doesn't always compute, i.e. it gives GeoJSON of size 73 bytes, and 2) and it has more polygons than QGIS's result, which is odd.

from osgeo import gdal, ogr
import math
import os

sourceRaster = gdal.Open('ndvi.tiff')

band = sourceRaster.GetRasterBand(1) # Access the only band

outShapefile = "polygonized"

driver = ogr.GetDriverByName("GeoJSON")
if os.path.exists(outShapefile+".geojson"):
    driver.DeleteDataSource(outShapefile+".geojson")

# We first create a new vector dataset and layer in it
outDatasource = driver.CreateDataSource(outShapefile+ ".geojson")
outLayer = outDatasource.CreateLayer("polygonized", srs=None)

# We add a new field ‘DN’ to the layer for storing the raster values for each of the polygons created
newField = ogr.FieldDefn('MYFLD', ogr.OFTInteger)
outLayer.CreateField(newField)

# Creating a copy datasource
driver2 = gdal.GetDriverByName( 'MEM' )
ds = driver2.CreateCopy('', sourceRaster)
band2 = ds.GetRasterBand(1)

needed_values = band2.ReadAsArray()

for row in needed_values:
    for i, item in enumerate(row):
        if (math.isnan(item) or not (0.0947260633111 < item < 0.09498295187950134)):
            row[i] = -99

band2.WriteArray(needed_values)
band2.SetNoDataValue(-99)

for row in band2.ReadAsArray():
    for item in row:
        print(item)

# The fourth parameter is the index of the field to which the raster values shall be written (the index of the newly added ‘DN’ field in this case) (line 21)
gdal.Polygonize( band2, band2, outLayer, 0, [], callback=None )

band2.FlushCache()
ds = None
outDatasource.Destroy()
sourceRaster = None


texts: Eclipse can't find Driver.class from postgresql-9.2-1002.jdbc4.jar file nor AbstractJdbc4Connection class

texts:
I am using the jar file in my configuration path after following the example from postgresql/jdbc tutorial. But after I added the jar file and configured it for my reference library when I run it I am getting an error that says it can't find the source attachment for that jar file despite my retrieving that jar file from the jdbc postgres website. I have tried a couple of different configuration methods, but it the jar file and its classes have mostly already been added with the exception of a couple classes like Driver.class. Should I use a different version or is it a configuration issue? I don't believe its something in my code yet because no code error other than not finding the driver class would cause that.

I am connecting to pgadminIII to update some rows.


texts:
I have download from openstreetmap data for my project in a workshop i use den coordinates from a roads network ,but i have problem with visualization the cord in google maps same roads is not drawn on the roadσ but elsewhere map but is not for all roads , why i have this problem , i use in road table the pgrouting dikjstra algorithm same ways visualization corect others is not.
Is problem from data set of osm ?


texts:
I am trying to run QGIS 2.18.13 on Mac OS Sierra (10.12.4), but I'm having problems with SAGA and GRASS, at least from processing.

Here's what I did:

Installed QGIS from brew, but ended up having problems with the psycopg2 module. I tried to install it in various ways, but QGIS did not recognize it (perhaps I was doing something wrong, I don't know).

So I gave up homebrew and installed QGIS from the binary. Everything works, except SAGA and GRASS.

For SAGA, I get the following error:

  2017-10-06T10:09:47   2   Problem with SAGA installation: installed SAGA
  version (2.2.3) is not supported

As for GRASS, when I try to run any algorithm from processing, I get the following:

  Missing dependency. This algorithm cannot be run :-(  This algorithm
  requires GRASS GIS 7 to be run. Unfortunately, it seems that GRASS GIS
  7 is not installed in your system, or it is not correctly configured
  to be used from QGIS Click here to know more about how to install and
  configure GRASS GIS 7 to be used with QGIS

Note that I have already changed the GRASS path to /Applications/QGIS.app/Contents/MacOS/grass7 in Plugins/GRASS/GRASS options/general

In Processing/options/providers/GRASS GIS 7 I have:

GRASS7 folder : /Applications/QGIS.app/Contents/MacOS/
Msys folder : /Applications/QGIS.app/Contents/msys

After installing GRASS-7.0.app (which works fine) I tried:

GRASS7 folder : /Applications/GRASS-7.0.app/Contents/MacOS
Msys folder : /Applications/GRASS-7.0.app/Contents/msys

This didn't help. I've tried more or less everything I've found online, but nothing seems to work.

What am I doing wrong?


texts: Geoserver WPS Request for jts:buffer (or something else) with Multipolygon

texts:
I want to create a WPS Request using the JTS:Buffer (or any other process). I'm using the built in WPS Request Builder from GeoServer.

My Multipolygon looks like this:

52.52735668,12.71762844 52.52633816,12.71518035
52.52467495,12.71354766 52.52293926,12.7136373
[..] 52.52154308,12.71439548

I'm building the request with TEXT and text/gml subtype gml:3.1.1.
My input is:

MULTIPOLYGON(((52.52735668,12.71762844 52.52633816,12.71518035
    52.52467495,12.71354766 52.52293926,12.7136373 52.52154308,12.71439548)))

Unfortunately the

  Process failed during execution Could not convert
  MULTIPOLYGON(((52.52735668,12.71762844 52.52633816,12.71518035
  52.52467495,12.71354766 52.52293926,12.7136373 52.52154308,12.71439548))) to target type com.vividsolutions.jts.geom.Geometry

But when I insert an other Multipolygon as from this Answer

 MULTIPOLYGON(((743238 2967416,743238 2967450,743265 2967450,743265.625 2967416,
        743238 2967416)))

Everything runs fine and I get the buffered Multipolygon returned.
Can someone explain me what I am doing wrong?


texts: Interpolate line and locate point on line with Leaflet

texts:
I want to make a location tool in a leaflet web map.

In fact, I create a wep map application with Leaflet in which we can find those layers:

Bing aerial layer
POI = Points layer which contains geographical coordinates and kilometer point of a line
Lines = Polylines layer

My lines were built and calibrated with ArcGIS in ESRI shapes format but for the web application in Leaflet, I transformed this data in a GEOJSON Format.
I don't have a server and GeoJSON is better for the vizualisation in Leaflet.

With those layers, I have to locate some kilometers point on the lines but those points are not in the POI layer.
For that, I have to make a HTML Form where we put the kilometer point that we are looking for.
And after, I want the tool gives us the position of this kilometer point on the line and zoom on it on the map.

For that, I found the Leaflet.GeometryUtil functions on Github (Interpolate on line and Locate On line by makina corpus) but I don't know how to use it and how can I make the link between the HTML Form and those javascript functions.

Here's an schematic picture of want I want to do :

Please, can you give me a little help ?


texts: switching the layers on/off in leaflet map layer tree based on styling

texts:
I am developing web application which has leaflet maps. I need the layer control which is similar to QGIS

I am using Geoserver to get the layer as wms format and I added that layer using tilelayer.wms function. I am using jstree plugin for tree like structure of layers. So when user checks any layer I added that layer using map.addLayer() function. When user unchecks the layer I used map.removeLayer() function.
So now question is I want to add or remove the layer based on it's style like this

How to achieve this functionality using leaflet and geoserver and jstree.


texts: Cluster points in each polygon into n parts

texts:
I am working on adding 2000 random points to each of 2 polygons and then clustering the points in those polygons into 4 clusters for each polygon. When I apply ST_ClusterKMeans() in PostGIS, it divides the entirety of points (2000 points in each of 2 polygons) into 4 clusters spread across 2 polygons (Figure 1). However, I would expect there to be 2000 points divided into 4 clusters for each polygon.
How can I apply ST_ClusterKMeans() to each polygon so that each polygon has 4 clusters of points?

CREATE TABLE sample_pnts AS
  SELECT (ST_Dump(ST_GeneratePoints(geom, 2000))).geom AS geom
  FROM sample_polys;

CREATE TABLE sample_pnts_clustered AS
  SELECT geom, ST_ClusterKMeans(geom, 4) over () AS cluster
  FROM sample_pnts;

Figure 1


texts: Using field attribute in file name of PDF export of Data Driven Pages

texts:
I have made a script that iterates through a set of Data Driven Pages. Right now I have it that just the ID number of the data driven page is used in the file name to distinguish between each export. What I'm looking to do is instead of using the page ID number, I want to use an attribute from a specific field in the data driven page shapefile.
How do I accomplish this?
I've included my script below.
import arcpy

inputList = arcpy.GetParameterAsText(0)
bckGrndLyrs = arcpy.GetParameterAsText(1)
outputLocation = arcpy.GetParameterAsText(2)
exportDPI = arcpy.GetParameterAsText(3)

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]

for lyrs in arcpy.mapping.ListLayers(mxd, "", df):
    if lyrs.name in inputList:
        lyrs.visible = False
    elif lyrs.name in bckGrndLyrs:
        lyrs.visible = True
    else:
        lyrs.visible = False

for inFC in arcpy.mapping.ListLayers(inputList, "", df):
    if inFC.name in inputList:
        arcpy.AddMessage("Activating " + inFC.name + " Layer")
        inFC.visible = True

        for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
          mxd.dataDrivenPages.currentPageID = pageNum
          for titleItem in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
              if titleItem.name == 'EditedTitle':
                arcpy.AddMessage("...Changing title to " + inFC.name + " " + str(pageNum))
                titleItem.text = inFC.name
          arcpy.AddMessage("......Refreshing Dataframe")
          arcpy.RefreshTOC()
          arcpy.RefreshActiveView()
          arcpy.AddMessage(".........Exporting " + inFC.name + " Page " + str(pageNum) + " as PDF")
          arcpy.mapping.ExportToPDF(mxd, outputLocation + " " + inFC.name + " " + str(pageNum) + ".pdf", resolution=exportDPI)
        inFC.visible = False

del mxd


texts: How to convert ASTER HDF file to Geotiff

texts: I just downloaded the ASTER LT1 HDF file. How do I convert it to Geotiff using ENVI. Or do you know any conversion tools that are accessible to use for free. Previously, when I downloaded ASTER data from GloVis there was an option that allowed me to choose either HDF or Geotiff format, but apparently the system has changed and it automatically downloads ASTER data as HDF file.


texts: I have a map in Adobe Illustrator with several vector layers. ( Therefore the vector data have no spatial reference and no attributes. What is the best way to turn these vector data into a GIS and therefore get spatial data? (for example in QGIS)


texts: Generating ArcGIS Report with images based on field?

texts: I'm currently trying to generate a report through ArcGIS 10.2.2 based on my attribute table in which one of the field is a photo links field. I would like to have them show up as pictures rather than links in my report, but so far I have not had any success with it.


texts: How to double re-project data on the fly in QGIS!

texts:
I have some raster and vector data in one coordinate system and a WMTS services on another coordinate system. To go from on coordinate system to another i need to use custom transformation parameter and to go through 3 different coordinate systems and 2 custom transformation parameter because there is no transformation parameter for going from coordinate system 1 to coordinate system 3.

I can re-project data so they can fit together but i want to use it on the fly because i don't want to re-project data everytime.

For maps to fit together the workflow of projecting data is:

Coordinate system 1 (EPSG:28404) (vector or raster data) -> custom transformation parameters(EPSG:28404 to EPSG:32634) -> Coordinate system 2 (EPSG:32634)-> custom transformation parameters (EPSG:32634 to EPSG:3127 )-> Coordinate system 3 (WMTS service) (EPSG:3127)

So the input coordinate system is EPSG:28404 and the destination is EPSG:3127 but you should go through EPSG:32634 so that the maps can fit together.

Is there any way to do this in QGIS on the fly projecting?


texts: How fill length and feature count in PostGIS table for each polygons

texts:
I'am new to PostGIS/PostgreSql. I have a database which containts two shape-files :

polygonal layer towns and

linear layer of roads
To calculate the length and feature count of 'Streets' inside each 'Town' use the following query in pgAdmin:

     SELECT
         m."townname",
         sum(ST_Length_Spheroid(r.the_geom,'SPHEROID["WGS 84",6378137,298.257223563]'))/1000 AS Roads_Km,
         count(*) AS Roads_Count
     FROM
         "Streets" AS r,
         "Towns" AS m
     WHERE
         ST_Intersects(m.the_geom, r.the_geom)
     GROUP BY
         m."townname"
     ORDER BY
         m."townname";

and then I save the results in csv table with the fields 'Town name', 'length', 'count'.
I want to add in the 'Town table' the following columns :   'length', 'count' and 'time updates'.
I need some help to create :

A query which calculates 'length', 'count' (of linear geometries inside the Towns layer) and 'record resuls' as an attribute column within the 'Towns' Table

A new column called 'time updates' within the 'Towns' table which will hold the running time of the query.
Thanks!

Updated 10.12.2012
I've added the following extra informations to help clarify my problem :

Polygonal (town) and linear (street) geometry
Attribute table for polygonal geometry
Result my query in pgAdmin result window

Updated 12.12.2012
This is corrected query:
UPDATE town t SET
    length = calc.roadskm, -- column length in towns table
    count = calc.roadscount, -- column count in towns table
    updatetime = calc.time -- column updatetime in towns table
FROM (
    SELECT
        m.townname,
        sum(ST_Length_Spheroid(r.the_geom,'SPHEROID["WGS 84",6378137,298.257223563]'))/1000 AS roadskm,
        count(*) AS roadscount,
        now() as time
    FROM
        streets AS r, --linear layer of roads
        town AS m --polygonal layer of towns
        WHERE ST_Intersects(m.the_geom, r.the_geom)
    GROUP BY
        m.townname
        ) calc
WHERE t.townname = calc.townname;


texts: What is the scale and does it depend on the print out size?

texts:
I am new to ArcGIS and I would like to know what is the scale in ArcGIS and does it depend on the print out size or display?

Can any one explain all about topic scale in the ArcGIS?


texts:
I am trying to write .sh script command to clip raster by polygonal shapefile. Shapefile have name field with unique name of polygon feature. On the output must be rasters with name of polygons in shapefile. I'm use Linux, GDAL.
Now I use command

gdalwarp -dstnodata -9999 -cutline data/shapefile.shp data/input.tiff data/output.tiff

but in output I receive one raster.

Example on the picture:


texts: Software for image orientation (aerial triangulation)

texts:
I'm trying find a software which can orient an UAV Imagery using GCPs (Ground control points in UTM Coordinates system) and Camera calibration (only camera focal length, p1,p2, k0, k1, k2, k3 and without fiducial marks).

I want this because I would like to use them into StereoTools software or any other in Manual Photogrammetry or Stereoscopy.

Can you refer some software for stereoscopy pair view?

I have UAV Imagery with 60-80% of overlap.

Camera calibration

fx, fy - focal length.
cx, cy - principal point coordinates.
K1, K2, K3, P1, P2 - radial distortion coefficients, using Brown's distortion model.

AgiSoft Lens software, camera calibration parameters
http://downloads.agisoft.ru/lens/doc/en/lens.pdf

Image orientation

Interior and exterior orientation.

At the end I wan to get images with Interior and Exterior Orientation.

Later I'll use the Images in a software which allows me to work in Stereo-visualization using 3D Anaglyph glasses. (The final product will be points of the ground surface with real coordinate system, I'll import them on AutoCAD).


texts: Spaghetti, meatballs, and the one-to-many problem

texts:
I am trying to use the Spaghetti and Meatballs overlay technique to create a fire history layer from Cal Fire FRAP's fire perimeter data. I am following the technique Dale Honeycutt describes in his ESRI blog post. However, at the spatial join part, instead of doing a one to one join, I am performing a one to many join. This then gives me multiple points with the same "Target FID" value, but different values for Name and Year of Fire. His next blog then goes into detail on how to combine the points with repeating "Target FID" values into one point with a string of values for both the Name and Year of Fire columns. However, that blog seems to no longer exist.

Essentially what I am trying to do is take data that looks like this:

Target_FID   Fire_Name       Fire_Year
2              Otay            1953
2              Wheeler         1989
2              Thomas          2017

To look like this:

Target_FID   Fire_Name                 Fire_Year
2            Otay_Wheeler_Thomas       1953_1989_2017


texts: Distance from one point to multiple points WITHIN a shapefile

texts:
I am looking to calculate the distance from a main point to multiple points WITHIN shapefile.
In other words: I have a main point at the mouth of a creek. I have about 1,200 points at various distances upstream from the mouth. I would like to calculate the distance from the mouth to each individual point. (aka, mouth to point 1, mouth to point 2, mouth to point 3, etc.) So, in the end, I would end up with 1,200 measurements, all starting at the mouth of the creek.
I can only find tools that measure Euclidean distance or measure distance BETWEEN two consecutive points along a line, which will not work. I am looking for something that measures distance ALONG the route of the creek from one main point to multiple other points.
Any tips?

Screenshot image: want to find individual measurements from mouth point (red) to each blue point.

I'm using ArcGIS 10.3.1. I have no experience with Python.


texts: How to implement multilevel classification in eCognition (segmenting imagery at different scales)

texts:
I am trying to perform a ground cover classification in eCognition using UAV RGB imagery of a forest ecosystem, with multiresolution segmentation algorithm and NN classification.
Since there are terrain objects that are better segmented on a scale parameter = 200, and others on a scale parameter = 70, how could I implement a classification that would integrate objects segmented at both levels (i.e. Level 1 = 200 and Level 2 = 70)?
This is exactly what they do in these papers:

https://doi.org/10.1016/j.rse.2011.11.020
https://doi.org/10.1016/j.rse.2010.12.017
https://doi.org/10.1016/j.jag.2011.06.008

I am classifying at one level, and then applying a mask to classify at another level so perhaps ignoring the masked areas could work.
I am not able to implement masks in classified objects.


texts:
I realize that ESRI is calling their implementation of Fisher-Jenks proprietary.  Given the performance with mid-sized datasets, either a significant optimization or a sampling method are being employed.  I have found this link that used to point to pseudo code describing the implementation specifics.

http://support.esri.com/en/knowledgebase/techarticles/detail/26442

Does anyone either 1) have published pseudocode information that they happened to archive for a rainy day, or b) have any information on the implementation details.  In the latter case, not need to describe Fisher-Jenks as that algorithm is well documented.  I am interested specifically in the ESRI implementation.

Thanks.


texts: IDE with Spyder to works with both ArcGIS Pro and ArcMap?

texts:
I am searching for an IDE with Spyder that works with both ArcGIS Pro and ArcMap.
I did found a suggested answer Using spyder as Python IDE with ArcGIS Pro?, but would like to know if any more possibility exists.
Ideally, something like PyCharm does where you can easily switch between the two Python interpreters but if not then a separate IDE with Spyder for ArcMap (64-bit geoprocessing, Python 2.7).
Are there any IDEs or configurations that can do this?


texts: Calculating uncertainty for coordinates data?

texts:
I have a dataset of species distribution in latitudes and longitudes extracted from geo-tagged photographs. I have plotted them on a map to see how distribution looks like. My attempt was to check whether this distribution falls within the previously documented species distribution range. For this, I have the data (lat. and long.) of the previously documented species range. I have overlayed these documented data over the map which I have created. To be more precise, I have read that I can buffer the documented points. My problem is how to determine the buffer distance for each point for documented latitude and longitude. I have read that I can use uncertainty range for this (e.g. let's say 20km from a point).

How do I calculate this uncertainty from the decimal coordinates that I have?

I'm new to GIS.


texts: Extracting values of raster to points of shapefile crashes ArcPy?

texts:
I'm running a rather simple script with ArcPy, which extracts values of raster to points of a shapefile:

def raster_overlay(input_files):
    for raster in input_files:
        in_shp = "temp/shapefiles/points.shp"
        in_raster = raster
        print in_raster
        ExtractMultiValuesToPoints(in_shp, in_raster, "BILINEAR")

raster_overlay(raster_files)

The variable raster_files is a list with strings pointing to a number of raster files on the local hard disk.

The shapefile contains around 50 points, and each raster is around 15MB.

If the list of raster is small (more or less <20), everything works as expected. However, I have around 50 raster images. Using the complete list, Python crashes ("python.exe has stopped working") after processing 21 images or so.

The values of the first 20 raster are correctly appended to the shapefile (one column for each raster).

I monitored python.exe in the Windows 7 Resource Monitor. Memory usage of Python starts around 15 MB and then gradually increases to around 700 MB (and then Python crashes). So, memory leakage might be the reason for the crashes (although the PC has 8 GB of RAM).

I tried to include gc.collect() and del in_shp and del in_raster inside the loop, but nothing changed. What else could I try?

I just tried changing BILINEAR to NONE, and the script didn't crash. However, memory usage still increased in the same way (up to around 1.1 GB). And I would like to use bilinear interpolation, so the question is still relevant.

Cross-posted here to the ESRI support. I'll update this question if they can give a solution.


texts: What's the role Qwidget and Qlayout in the QGIS interface?

texts:
I use miniconda3 to manage my software installations, including QGIS, so I can use packages like geopandas easily in the QGIS python console. Lately however, when I open qgis from the command line like so:
$ conda activate ENV NAME
$ qgis

I get the following warnings in my terminal window:
Warning: QWidget::insertAction: Attempt to insert null action
Warning: QWidget::insertAction: Attempt to insert null action
Warning: QWidget::insertAction: Attempt to insert null action
Warning: QLayout: Attempting to add QLayout "" to QmsSearchResultItemWidget "", which already has a layout

My QGIS interface is obviously messed up when it opens. The tool bars have no dividing lines between them, the python console script editor window has this weird vertical line through the middle of the window, and sometimes the 'Select Color' window pops up behind my symbology window. I believe this is tied to the Qwidget and Qlayout warnings above, but I just dont know enough about the specifics of the Qt library to fully diagnose the problem for myself.
What I have tried:
I have tried removing the env where I have qgis installed completely and updating my base conda.
I have removed and reinstalled qgis several different times with different versions. The problem exists with 3.10 (LTR) 3.12 and 3.14.
My Set up:
I am running QGIS on a Mac (osx 10.15.5 Catalina).
I install QGIS in a specific conda env for easy access to Python modules in the QGIS console, and qgis functions in my stand-alone scripts. (conda version: 4.8.3)


texts: Selecting only CFSR images in Google Earth Engine with precipitation data

texts:
I am trying to create cumulative monthly composites of precipitation from CFSR data in Google Earth Engine (i.e. each image would be mm/month for each month)
However, I realised that images ending with 'F00' do not have the precipitation band I need - Total_precipitation_surface_3_Hour_Accumulation - whereas those with 'F03' has that band.
As such, when I try creating an image collection of images with that specific band only, it pulls up the error: 'Pattern 'Total_precipitation_surface_3_Hour_Accumulation' did not match any bands'
How can I go about choosing only the images ending with the name 'F03'?
var dataset = ee.ImageCollection('NOAA/CFSR')
                  .filter(ee.Filter.date('2019-04-01', '2019-05-31'))
                  .map(function (image) { return image.clip(roi)})
                  .select('Total_precipitation_surface_3_Hour_Accumulation');

print(dataset)


texts: Displaying images from imageCollection when changing the date on the Dateslider - Google Earth Engine

texts:
I've created an imageCollection of the outputs from the Sentinel1 floodmapping script that I used; however, I'm having issues with the images displaying as I change the date on the slider. The slider correctly reads the system:time_start and system:time_end, yet won't display the flood map when called.
[snapshot of code][1]
the code:
 // Assets
[var aoi = ee.FeatureCollection("users/acpierc5/gadm36_BGD_0");
    var empty = ee.Image().byte();][2]

// Bangladesh Boundary
var outline = empty.paint({
  featureCollection: aoi,
  color: 2,
  width: 0.5
});

var geometry = (aoi);
print('geometry:',geometry);
// Get the VV collection.
var collectionVV = ee.ImageCollection('COPERNICUS/S1_GRD')
    .filter(ee.Filter.eq('instrumentMode', 'IW'))
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
    .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
    .filterBounds(aoi)
    .select(['VV']);

// Create a 3 band stack by selecting from different periods (months)
var im1 = ee.Image(collectionVV.filterDate('2016-04-01', '2016-05-30').mean())
    .clip(aoi);
var im2 = ee.Image(collectionVV.filterDate('2016-06-01', '2016-08-31').mean())
    .clip(aoi);
var im3 = ee.Image(collectionVV.filterDate('2016-09-01', '2016-11-30').mean())
    .clip(aoi);

Map.centerObject(geometry,10);
Map.addLayer(im1.addBands(im2).addBands(im3), {min: -25, max: 0}, 'VV stack');

// Get the VH collection.
var collectionVH = ee.ImageCollection('COPERNICUS/S1_GRD')
    .filter(ee.Filter.eq('instrumentMode', 'IW'))
    .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
    .filterBounds(aoi)
    .select(['VH']);
// Collection max.
Map.addLayer(collectionVH.max(), {min: -25, max: 0}, 'max value', false);

// Flood Assets
var cyclone = ee.ImageCollection("users/acpierc5/cyclone10m")
  .filterBounds(aoi)
  .sort('system:time_start')
  .select(['VH'])

var Titli = ee.Image("users/acpierc5/CycloneTitli_10m"),
    Roanu = ee.Image("users/acpierc5/CyloneRoanu_10m"),
    Mora = ee.Image("users/acpierc5/CycloneMora_10m"),
    Komen = ee.Image("users/acpierc5/CycloneKomen_10m"),
    Fani = ee.Image("users/acpierc5/CycloneFani_10m"),
    Bulbul = ee.Image("users/acpierc5/CycloneBulbul10m"),
    Amphan = ee.Image("users/acpierc5/CycloneAmphan10m");
// Bound the slider
var start = ee.Image(cyclone.first()).date().get('year').format();
var now = Date.now();
var end = ee.Date(now).format();
print ('cyclone', cyclone)
var showImage = function(range) {
  var image = ({collection: cyclone.filterDate(range.start(), range.end())});
  var addTime = function(image) {
  return image.addBands(image.metadata('system:time_start'))
};
var conditional = function(image) {
  return ee.Algorithms.If(ee.Date(image.get('system:time_start')), image, ee.Image(0));
};
print('Expand this to see the result:', cyclone.map(conditional));
print('addTime',cyclone.map(addTime));
  // Asynchronously compute the name of the composite.  Display it.
  range.start().get('year').evaluate(function(name) {
    var visParams= {
      bands: ['system:time_start'], min: -25, max:0,
      palette: ['0000FF'],
};
    var layer = ui.Map.Layer(conditional, visParams, name + 'composite' );
    Map.layers().set(0, layer);
  });
};
// Asynchronously compute the date range and show the slider.
var dateRange = ee.DateRange(start, end).evaluate(function(range) {
  var dateSlider = ui.DateSlider({
    start: range['dates'][0],
    end: range['dates'][1],
    value: null,
    period: 1,
    onChange: showImage
  });

  Map.add(dateSlider.setValue(now));
});

var vizParams= {
  'palette': ['0000FF'],
  min: -25,
  max: 0
};
// Display Maps

Map.addLayer(outline, {palette: 'black'}, 'edges');

Code
[1]: https://code.earthengine.google.com/562c98493e63bf048bf9435fbcae6217
Boundary Shapefile
[2]: https://code.earthengine.google.com/?asset=users/acpierc5/gadm36_BGD_0
Image Collection
[3]: https://code.earthengine.google.com/?asset=users/acpierc5/cyclone10m