texts: How do I make a more Bandwidth-friendly map overlay?

texts: I performed a map overlay in Google Earth then saved the overlay as a KMZ file. Then logged into my Google Maps account and uploaded that KMZ file so the map overlay would appear on Google Maps. The download speed for this map image overlay on my iphone was still much slower than I'd like it to be. Next I decided to forgo using GE and creating a KMZ file, and I just logged into Google Maps performed a map overlay there using a PNG of my map. Result is still a slow download time via my iphone. Any ideas for how to make this overlay so that it downloads quicker for me? More bandwdth-friendly?


texts: QGIS Automatically Converts UTC Date-Time to Local?

texts:
I imported a WFS layer from a geoserver  into QGIS and also into a web service that is based on Cesium.  The geoserver fetches the data from Elastic search and serves it out as WFS.  The date-time attribute of the data stored in Elastic Search is in UTC.  The web service (based on Cesium) displays the date-time attribute in UTC, but QGIS displays the same date-time attribute my local time zone.  My local time zone is GMT minus 5 hours.

Example:  A date-time attribute is stored in Elastic Search as ‘2017-12-29 01:10:37.000Z’. The web service displays the date-time as ‘2017-12-29T01:10:37Z’.  The QGIS Identify Results and the QGIS attribute table both display the date-time as ‘2017-12-28T20:10:37’

Including a ‘Z’ in the SQL filter doesn’t seem to make any difference and provides misleading results.  In QGIS, the layer filter date-time = ‘2017-12-28 20:10:37.000Z’ finds the feature, but date-time = ‘2017-12-29 01:10:37.000Z’ does not find the feature.

It seems QGIS is converting the date-time attribute to local time.  I can’t find a preference to override QGIS converting date-time values.  I want the results to be displayed in UTC, not local.  Is there a way to do that in QGIS?


texts:
I'm having trouble creating an OpenLayers Vector layer with GeoJSON data in an MVC 4 application.

The GET request for  my json file always comes back with a 404.3 error - page cannot be served because of the extension configuration.

I've followed every OpenLayers example creating the GeoJSON layer just as they have but I can't get mine to display.  I've followed the steps in this post
Trouble displaying GeoJSON file in OpenLayers and everything besides the GeoJSON layer works great.

So in my OpenLayers.aspx page I have the following code to initialize my vector layer.

var vector = new OpenLayers.Layer.Vector("GeoJSON", {
            projection: new OpenLayers.Projection("EPSG:900913"),
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "<%:this.Url.Content("~/Content/Delta_Parcels_2008.json") %>",
                format: new OpenLayers.Format.GeoJSON({
                    internalProjection: new OpenLayers.Projection("EPSG:900913"),
                    externalProjection: new OpenLayers.Projection("EPSG:4326")
                })
            }),
            styleMap: vector_style_map
        });

any suggestions would be much appreciated. thanks.


texts: Getting 000210 Error trying to wirte output to in_memory workspace in ModelBuilder?

texts:
My model gives this error message when it tries to do the Clip function

Here is the first half of the model showing the parameters used in the clip function

I have successfully run this model when the clip function output was writing to disk but when I changed it to in_memory it stopped working. Any suggestions? I really don't want to write all 3000 files to my hard drive.


texts: Trying to deal with pure whites, and transparency of orthomosaic in MapInfo

texts:
I'm hoping to deal with this using the raster calculator in QGIS. But, here's my issue (and I'm a pretty novice GIS user); when you bring a raster image into MI, it turns all the null ("no data") values to white. In MapInfo, to make those previously null values transparent, I have to select that white color as the target color for transparency.  But that makes any pure whites (typically over exposed images) also transparent.

Before

After

My thought was, prior to bringing the raster into MI, to use the raster calc in QGIS to alter the pixel values for these whites (255 in all four bands) to something like 254. Not sure how exactly to do that, though, or if it will work well, or if there is an easier way.  I searched endlessly before posting.


texts: High resolution and high detail vector GIS coastline product needed

texts:
What is the absolute best vector GIS coastline product available globally? I know of a great product for Africa (page 13 of this PDF http://rmgsc.cr.usgs.gov/ecosystems/docs/Africa_Ecosystems_Booklet_final.pdf). This is just what is needed but for the countries listed below. Does a global product of this detail exist? If not global feel free to send me links for continents or countries. I particularly need the coastlines of Asia (tropical countries) and Latin America. Feel free to give me continental links or even country links to the best vector digital GIS coastlines. High-detail and high-resolution matters (1:50,000 or better).

Countries required are:

Brazil
Ecuador
Mexico
India
Bangladesh
China
Thailand
Malaysia
Vietnam
Philippines
Indonesia
Myanmar

Thanks.


texts: Polygon to Polygon: new geometry, preserve attributes

texts:
I have two sets of polygon cadastre parcel data with different attributes and slightly varying geometry. What I need to do is to transfer the attributes of Feature A (older) to the geometry of Feature B (newer). This will allow me to compare old attribute data against the updated cadastre. At first glance, this does not seem too complicated. However, A and B do not share the same unique identifier, and the lookup table provided with the datasets is incredibly unreliable. Therefore, I need to complete the attribute transfer through a spatial relationship. The process needs to be as automated as possible due to the size of the datasets.

The problem is further complicated in that not every parcel in Feature A will have a 1:1 relationship with a parcel in Feature B. However, I will focus on reconciling those parcels which do have a 1:1 relationship for now.

My first attempt in ArcGIS included using the Attribute Transfer Tool in the Spatial Adjustment toolbar. The steps I took something like this:

Use Feature to Line to convert Feature A and B from polygons to lines. This step is necessary because the Attribute Transfer tool only accepts lines as input.
Run Attribute Transfer Tool with A as the 'Source' feature and B as the 'Target' to transfer attributes of Feature A to the geometry of Feature B. Result: lines in Feature B (within a specified tolerance of lines in A) A now have the attributes of A.
Run Feature To Polygon to convert these B’s newly attributed lines back to polygons. However, the Feature to Polygon tool has a known bug – so attributes do not transfer to the new polygons although the geometry is created successfully.

So basically I need to find a way to preserve attribution when creating a polygon from attributed lines.

Other strategies I have attempted:

Workaround using Spatial Join to join the lines of feature A to the polygons of B to the target geometry. However, the results were unreliable and did not produce the expected numbers of matched and unmatched features.
I have also been fiddling with the “Production Feature Builder” but I have not found a way to use this tool in an automated fashion yet. I have over 16 000 polygons to transfer in total from A to B so a manual update is out of the question!

I'm also open to suggestion in FME, and will post details on what I've already tried there if requested


texts:
I have a Heron/Geoext/ExtJS map. I found a site with this function and I would like to implement it.

So how can I use this function without their MapCentia.gc2 function? How can I rewrite it to use in my map?

     {
            type: "any",
            options: {
                text: '',
                tooltip: 'Search with Google Places',
                iconCls: 'icon-map-magnify',
                id: "googleSearch",
                handler: function (objRef) {
                    if (!searchWin) {
                        searchWin = new Ext.Window({
                            title: "Find",
                            layout: 'fit',
                            width: 300,
                            height: 70,
                            plain: true,
                            closeAction: 'hide',
                            html: '
<input style="width: 270px" type="text" id="gAddress" name="gAddress" value="" />
',
                            x: 300,
                            y: 70
                        });
                    }
                    if (typeof(objRef) === "object") {
                        searchWin.show(objRef);
                    } else {
                        searchWin.show();
                    }//end if object reference was passed
                    var input = document.getElementById('gAddress');
                    var options = {
                        //bounds: defaultBounds
                        //types: ['establishment']
                    };
                    var autocomplete = new google.maps.places.Autocomplete(input, options);
                    //console.log(autocomplete.getBounds());
                    google.maps.event.addListener(autocomplete, 'place_changed', function () {
                        var place = autocomplete.getPlace();
                        var transformPoint = function (lat, lon, s, d) {
                            var p = [];
                            if (typeof Proj4js === "object") {
                                var source = new Proj4js.Proj(s);    //source coordinates will be in Longitude/Latitude
                                var dest = new Proj4js.Proj(d);
                                p = new Proj4js.Point(lat, lon);
                                Proj4js.transform(source, dest, p);
                            }
                            else {
                                p.x = null;
                                p.y = null;
                            }
                            return p;
                        };
                        var p = transformPoint(place.geometry.location.lng(), place.geometry.location.lat(), "EPSG:4326", "EPSG:900913");
                        var point = new OpenLayers.LonLat(p.x, p.y);
                        MapCentia.gc2.map.setCenter(point, 17);
                        try {
                            placeMarkers.destroy();
                        } catch (e) {
                        }

                        try {
                            placePopup.destroy();
                        } catch (e) {
                        }
// which heron/geoext/extjs is equivalent of these?
                        placeMarkers = new OpenLayers.Layer.Markers("Markers");
                        MapCentia.gc2.map.addLayer(placeMarkers);
                        placeMarkers.addMarker(new OpenLayers.Marker(point));
                        placePopup = new OpenLayers.Popup.FramedCloud("place", point, null, "
" + place.formatted_address + "
", null, true, function(){
                            placePopup.destroy();
                            placeMarkers.destroy();
                        });
                        MapCentia.gc2.map.addPopup(placePopup);
                    });

                }
            }


texts: ArcMap 10.5 freezes saving edits to feature class in File Geodatabase

texts:
I'm encountering a very peculiar bug in ArcMap 10.5. I have an mxd I created as part of a large project, and when I attempt to save edits to a feature class from the project's file geodatabase (~38 GB) ArcMap freezes every time. Initially I suspected that either my mxd or geodatabase had been corrupted, but I can successfully save edits to shapefiles from different directories in the same mxd AND save edits to feature classes from the same geodatabase in different mxd's. Perhaps it's something about the particular combination of layers that are added to the dataframe? I really don't know. Everything is in the same projection and I haven't encountered errors running any other tools or processes. Without success, I've tried:

Clearing the geoprocessing history and image cache
Compacting the geodatabase in ArcCatalog
Running MXD Doctor on the map file
Copying the geodatabase and changing the data source to the backup
Copying the data frame from the original mxd to a new map and editing in that window
Whitelisting the directory the geodatabase is stored in in my antivirus (Windows Defender)

Edit: The File Geodatabase is local, not in a network location. No other programs are trying to access the files simultaneously. In reference to a few of the other questions, the number of features in the layers being updated varies-- the problem is not confined to any particular feature class or layer. It happens when trying to save edits to any layer in the geodatabase unless I edit them in a new map with only one or a small subset of feature classes added.

Edit 2: Yes, the geodatabase contains a number of large rasters and shapefiles that cover an entire state. But it's not even close to the storage limit by total file size or number or files, so I'm not sure that would be the issue. I haven't had any issues editing until a day ago. I tried compacting the geodatabase this morning with no success. I'll give compression a whirl and see if that helps.


texts:
I'm trying to build a process model which uses a series of raster operations - Rasterize, Proximity, Raster Calculator. However, I couldn't seem to add two consecutive raster calculator processes.

From the model, I have two raster calculators branching out from a gdal_proximity, and what I want to do is to add these two rasters. I used saga for the raster calculator because this is the only one I've tried which can take a numerical user input in the modeller.


texts: Meaning of grey and yellow/brown colors of buildings in Google Maps?

texts:
I'm wondering what the difference beween those yellowish and the grey buildings is in Google Maps.
I marked a few of the yellowish building as an example in the picture below.


texts: Retrieve road segment from Google or Bing Maps

texts:
Let me see if I would be able to explain this correctly... Both Bing and Google Map geocoders can return you and a point given an address. Is there any way to retrieve an 'address range' instead i.e. to get returned a LINE rather than a point?

Its not necessarily address ranges I am after- the key word here is 'line' (along a road). Another example would be to get a road line given 2 points so I would want to get returned the road segment between these 2 points. I assume for this I would need to use the routing functions only?

Another scenario (i guess even more difficult) is given 1 point (along a road) to ask for the road segments for x Km 'up or down' this same road

Hope I am making sense...


texts: Dissolving layer with two or more fields in QGIS 3

texts:
I want to dissolve the layer based on two or more fields through "Processing modeler".

How to set and where to set those fields? When I use "Dissolve" tool separately I can choose fields that I want, but not in this case.

I am using QGIS 3.10.

This is my table. I like to dissolve with fields: "SP" and "PJ"


texts: Which opensource alternative for users used to ArcGIS 10.x?

texts:
I'm a student and used ArcMap 10 for over 5 years now. Since I will finish university in 3-4 month I wouldn't be able to use ArcMap free of charge anymore. I already searched on google for opensource alternatives (found QGIS, Grass, SAGA and some more) but I'm unsure which one I should give a try. The software should be opensource and easy to use for someone who used ESRI products before.

Can anybody recommend a product?


texts: Doubts with Ripley's K function Interpretation

texts:
I'm a self-taught person, I'm studying the K Ripley's function and I would need some person who give me some advices.

First, I have written a little script of R in QGIS processor:

##Point pattern analysis=group
##Layer=vector
##Titulo=string
##showplots
library("maptools")
library("spatstat")
K <- Kest(as.ppp(Layer))
plot(K, main=Titulo)

Then, to test the different results I have  prepared 3 layers about the same extension. One regular, other random, and the last clustered, with 100 points each one. This is the random graphic ploted:

This is my question:

The random graph should be equal than the poisson line, Why the observed K is higher than poisson one? (I see the lines shapes are equal) Is this due to the little number of points?

Here are the files to reproduce it (included script for QGIS).

Zip file


texts: How to Properly load ENC charts on QGIS 3

texts:
I am trying to load ENC charts on QGIS but they are very odd when loaded. I read that one has to use ogr2ogr that converts these to shapefiles but that didn't work for me too. It shows up totally different. Can anyone guide. I downloaded sample charts from NOAA website.
I expect it to load it like this.This is opened on openCPN:


texts: 'erdas apollo how to enable this service'?

texts:
We have installed ERDAS Apollo, and when we open the welcome page it tells us

  "you've setup ERDAS APOLLO 2011, v11.0 successfully"

but test Sample HTTP requests give an error, for example when test a WFS request:

 .../vector/ATLANTA_VECTOR?version=1.0.0&service=WFS&request=GetCapabilities&'

We got the following error:

javax.servlet.ServletException: Cannot construct provider ATLANTA_VECTOR. The construction of the provider ATLANTA_VECTOR has already failed.Failure was due to The provider ATLANTA_VECTOR is unknown or more probably, the license is either invalid or does not enable this service!!

How can we enable this service?


texts: Troubleshooting downloading MODIS NDVI Data in R

texts:
I am trying to download MODIS Data from 2000-2018, however I am encountering some difficulties.

Here is my script

         MODISoptions(localArcPath = "/Volumes/myserver/MODIS/data",
         outDirPath = "/Volumes/myserver/MODIS/data/proc_data")
         runGdal("MOD13A2", collection = "006", # see getCollection("MOD13Q1", forceCheck = TRUE)
         tileH = 8, tileV = 7, # MODIS tile id
         begin = "2000.02.18", end = "2018.03.31", # time period
         SDSstring = "110000000000") # SDS layers to extract (here: NDVI, EVI)

I am trying to do multiple dates from H: 6-8, and V: 7-9. However, when I run it, the program downloads several tiles then encounters this error:

   "Username/Password Authentication Failed.
   Remote connection failed! Re-try: 1 Getting file from: LAADS
   trying URL 'ftp://ladsweb.nascom.nasa.gov/allData/6/MOD13A2/2000/353/MOD13A2.A2000353.h08v07.006.2017285143550.hdf'
   Content type 'unknown' length 7085835 bytes (6.8 MB)
   Downloaded after: 2 re-tries
   Error in load(fls_col) : empty (zero-byte) input file"

How do I get around this?

I believe it to be a missing tile, and the code terminating instead of skipping it, and going to the next one.


texts:
I have a graph representing a road network and I need to clean it before working on it. Problem is that the original shapefile is not clean so when I make the graph I have many useless nodes too close from each other like in this picture:

I have 3 or 4 blobs like that on the map. The edges in those blobs are too short so there are many intersections, thus many nodes. I'm trying to merge the edges for example but I don't know how to locate these parts when I'm coding.

Does anyone have an idea on how to solve this ? I tried osmnx's simplify graph but it did not work; and was considering networkx's contract functions but i dont know how to find the these nodes.


texts: How to set snapping specification in web map feature layer (arcgis)?

texts:
I need to set snapping to snap just to polygon vertex (by default it snaps to polygon vertex and edges).

In this example and according to this, the map.enableSnapping() function should return an SnappingManager and then I could set the layerInfo array of this object, setting for each item the snapToEdge property to false. But in my testing the map.enableSnapping() is returning undefined.

ArcGIS javascript API is 3.7 and ArcGIS Server is 10.2.


texts: Why are some SVGs not displayed properly in print composer?

texts:
I am having weird problem with adding .svg to qgis print composer. I have done some smaller symbols before in inkscape and they work - however the latest one displayed itself as huge black square.

I -did- find a very round about way of making it work, but I havent slightest idea why it works like this:   First I saved the .svg in Inkscape as pdf file, then used http://www.online-convert.com/ to convert the .pdf back to .svg ....and after this QGIS displays it fine in print composer.

Does anyone have any idea why this happens? I have added the working and original not working .svg's as uploads, if someone wants to try it out.

http://speedy.sh/XGMWs/Svg-example.zip


texts:
Is it possible to open a location in Google Street View and have it show ONLY the Street View image?

For example, if I open the following link:

http://maps.google.com/maps?q=&output=svembed&layer=c&cbll=34.9032895146312,-82.3337301891165&cbp=0,0,0,0,0

I want to set the attributes so that the navigation tools, the full screen button, and the overview map button are all gone from the screen.  If possible, I would also like to be able to remove the Google logo at the bottom left.

Can this be done?

Thanks,
Seth


texts: GRASS GIS installed add on does not show in Modules>addons

texts: I'm using GRASS GIS 7.2.1 64 bit in Windows 10 and however new add-ons can be installed most of the installed ones do not show in the "Module" window under the category "Addons":


texts: How to merge (append) ArcInfo coverages that are inside folder structure using ArcPy?

texts:
I'm having a bad time trying to create a script capable of merging a list of arcinfo coverages located inside a folder structure.
My goal is to merge the coverages named "car" that are inside each of 500 folders. The field definitions are the same for all the "car" coverages.

My unsuccessful approach has been first to create a list with the path of each folder and second apply the arcpy.ListDatasets function to each of the folders and append (or merge) each of the coverages to an initial empty shapefile.

I'm new in Python and a simple task like this has become hours of trial and error. I hope someone here can guide me through the best solution.

This is the code I have so far (with indentation error on line 21):

import arcpy
from arcpy import env
import os

outlocation = "W:/forestal/1_25k_carreteras"
folderspath = "W:/forestal/cartografia/hojas_1_25k"
emptyshp = "1_25k_car.shp"
folderslst = []

arcpy.CreateFeatureclass_management(outlocation, emptyshp, "POLYLINE")

for dirname, dirnames, filenames in os.walk(folderspath):
    for subdirname in dirnames:
        folderslst.append(os.path.join(folderspath,dirname))

for folder in folderslst:
        arcpy.env.workspace = folder
        coverageslst = arcpy.ListDatasets("car", "Coverage")
        arcpy.Append_management(coverageslst, outLocation + os.sep + emptyshp)

Thanks!


texts: Python function to get the co-ordinate pair of a point

texts:
I am trying to geocode a point shape. But first I want to determine the coordinate pair of the point shapefile before geocoding. The error I get is:
**ERROR** :ValueError: Must be a coordinate pair or Point

redshape = fiona.open("murt.shp")
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="my-ride")
location = geolocator.reverse(redshape)
print(location.address)

Any ideas?


texts: Converting DataFrame with geometry column into GeoDataFrame in Pandas

texts:
I have this DataFrame:
In [120]: a
Out[120]:
     a    b              c
0  111  333  [POINT (0 0)]
1  222  444  [POINT (0 0)]

I am trying to convert with the next line, but it fails:
In [125]: b = gpd.GeoDataFrame(a[['a', 'b']], geometry=list(a['c']))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-125-cce5399870e4> in <module>
----> 1 b = gpd.GeoDataFrame(a[['a', 'b']], geometry=list(a['c']))

/usr/local/lib/python3.8/dist-packages/geopandas/geodataframe.py in __init__(self, *args, **kwargs)
    149                 )
    150                 # TODO: raise error in 0.9 or 0.10.
--> 151             self.set_geometry(geometry, inplace=True)
    152         self._invalidate_sindex()
    153

/usr/local/lib/python3.8/dist-packages/geopandas/geodataframe.py in set_geometry(self, col, drop, inplace, crs)
    252
    253         # Check that we are using a listlike of geometries
--> 254         level = _ensure_geometry(level, crs=crs)
    255         index = frame.index
    256         frame[geo_column_name] = level

/usr/local/lib/python3.8/dist-packages/geopandas/geodataframe.py in _ensure_geometry(data, crs)
     40             return GeoSeries(out, index=data.index, name=data.name)
     41         else:
---> 42             out = from_shapely(data, crs=crs)
     43             return out
     44

/usr/local/lib/python3.8/dist-packages/geopandas/array.py in from_shapely(data, crs)
    164
    165     """
--> 166     return GeometryArray(vectorized.from_shapely(data), crs=crs)
    167
    168

/usr/local/lib/python3.8/dist-packages/geopandas/_vectorized.py in from_shapely(data)
    132             out.append(None)
    133         else:
--> 134             raise TypeError("Input must be valid geometry objects: {0}".format(geom))
    135
    136     if compat.USE_PYGEOS:

TypeError: Input must be valid geometry objects: <GeometryArray>
[<shapely.geometry.point.Point object at 0x7f80af64beb0>]
Length: 1, dtype: geometry

I don't know how I convert the list or series (dataframe) to GeometryArray.
I am trying with: gpd.array.GeometryArray(list(a['c'])) but it is not working.


texts:
I'm making a mobile game that uses GPS to interact with the real world.

The game should be able to "see" what terrain/land use/land cover the user is currently in.

Ideally, the game would send the user's current coordinates and receive something like "forest", "city", "lake", "beach", "meadow", etc. and have data available globally.


texts: QGIS's Select Features tools only work occasionally

texts:
I'm hoping someone can help me work out whether there's something I'm missing here or whether QGIS's Select Features tools are just really buggy.

I have a variety of polygon layers from shapefiles based on Australian geostatistical units. I've clipped these layers according to larger city-based polygons in order to create metropolitan cohorts. Now, I'm trying to copy and paste these cohort polygons into their own layers. So, I select the cohorts with a rectangular selection, then copy and paste into new layers.

Except it usually doesn't work. This isn't a case of the colours being similar; the copy option isn't available after I try to make a selection. And when it occasionally works, I can't work out what I've done to make it happen: sometimes I switch to another tool and back (eg. identify a feature, then switch back to the selection tools) and it works, sometimes it doesn't. Sometimes I switch to another application like my browser, and when I try again when I return it works fine. There doesn't seem to be any consistency to the behavior. I literally just made a successful selection, deselected, turned another layer on and back off, tried again and nothing happened.

Is there some sort of layer lock I'm not seeing that prevents interaction? Is it just a buggy tool? What am I missing? I'm using QGIS 2.12.1-Lyon of OS X.

EDIT: my workaround is to select features via the attribute table, which appears to work consistently. It's not ideal, though.

EDIT #2: nope, never mind—the attribute table doesn't work either. It highlights the features associated with the rows I select consistently, but Edit > Copy isn't enabled most of the time. Because they were highlighted and I was using the keyboard shortcut, I didn't realise this until I had a dozen incorrect layers pasted.


texts:
Is there another way to put raster into PostGIS?
I have tried with raster2pgsql.exe but it does not recognize raste2pgsql.


texts:
I am recently facing a strange issue with my code in earth-engine. The moment i save it, it stops working and gives me a simple error of blahblah is not a funtion. But the same code works just fine as long as it is not saved.
Has someone else encountered the same issue? and if yes, then how did you overcome it?


texts:
I have a problem when using WMS layers in QGIS.

I am loading a WMS layer containing some aerial images, and then on top of it another WMS layer that contains information of the city, boundaries etc with labels. When I load the WMS layer with the labels, the background goes blank and I can't visualise the aerial images.

I have tried the same thing in ArcMap and it works fine but I have to use QGIS.


texts: How to select lines closest to another set of lines?

texts: In the image shown above, I am trying to select lines marked in green color that are closest to the blue lines along the direction of the blue lines. I did a lot of Google searches, but I could not find the tool that will help me accomplish this task. How can I perform this selection?


texts: Python script runtime error - ImportToolbox and run a custom geoprocessing tool

texts:
I am very new to Python.  I created a simple tool using Model Builder that updates a few columns of data in a SDE feature class.  The model runs perfectly within ArcMap 10.5.  I need this script to run automatically each night, and so I need a Python script to use in Windows Task Scheduler. Rather than exporting the model to a Python script from Model Builder (which I am aware does not always do a good job translating), I want to simply ask the script to run the tool.  I researched and attempted the 'ImportToolbox' function, but continue to get runtime/syntax errors.  I am not experienced enough to resolve what is going wrong.  I have tried different aliases, removing the alias altogether...nothing has eliminated the errors.  I am hoping someone will be able to point out where I may have gone wrong...

>>> import arcpy
arcpy.ImportToolbox(r"G:\tools\SIBToolbox.tbx","LCU")
arcpy.LaneClosureUpdate_LCU()
Runtime error
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\__init__.py", line 125, in ImportToolbox
    return import_toolbox(input_file, module_name)
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\toolbox_code.py", line 457, in import_toolbox
    mymodule = generate_toolbox_module(toolbox, None, False, False, False, module_name, use_alt_alias)
  File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\toolbox_code.py", line 432, in generate_toolbox_module
    'exec')
  File "G:\tools\SIBToolbox.tbx", line 11
    def LaneClosureUpdate.tbx():
                         ^
SyntaxError: invalid syntax


texts: Reasons to NOT make my database into a PostGIS database?

texts:
So our team currently has two databases in two "independent" parts of the process. It's organizationally independent but for the actual work we do they depend on one another's output.
I wanted to make our Postgres databases into PostGIS databases. Currently the database holds some metadata and a reference to the corresponding file location on disk. To run an intersection, I'd go into the database for the file locations, run the intersection on the actual files which for our purpose isn't a big process, however, it would be more convenient if I didn't have to do that. If I could just run the intersection with a PostGIS query on a column.
From my understanding PostGIS just adds some optional things. It doesn't change any of the functionality of the database unless we use those options.
Is it a big deal then to just make a database into a PostGIS database?
Also, from my understanding, PostGIS depends on GDAL. If I currently have GDAL on my environment, could that potentially cascade down dependency conflicts with interrelated packages or is the PostGIS GDAL on the DB server and thus completely separate from my environment's GDAL?


texts: Google Earth tour LookAt not looking at same place as Placemark with same coordinates

texts:
I have tried to create a tour from a csv file. I want the tour to look at each Placemark in turn but the view is of a different set of locations when run in Google Earth. The Placemarks are plotting correctly (as far as I can tell) and the LookAt seems to be off. Please could someone tell me what I'm doing wrong?

<Document>
   <name>Test</name>
   <open>1</open>
   <gx:Tour>
   <name>Play me!</name>
   <gx:Playlist>
   <gx:FlyTo>
   <gx:duration>10</gx:duration>
   <LookAt>
       <longtitude>-0.0441561</longtitude>
       <latitude>51.4354051</latitude>
       <altitude>400</altitude>
       <heading>1</heading>
       <tilt>0</tilt>
       <range>1</range>
       <altitudeMode>relativeToGround</altitudeMode>
   </LookAt>
   </gx:FlyTo>
           <gx:wait>
               <gx:duration>10</gx:duration>
           </gx:wait>
   <gx:FlyTo>
   <gx:duration>10</gx:duration>
   <LookAt>
       <longtitude>-0.0382701</longtitude>
       <latitude>51.452901</latitude>
       <altitude>400</altitude>
       <heading>1</heading>
       <tilt>0</tilt>
       <range>1</range>
       <altitudeMode>relativeToGround</altitudeMode>
   </LookAt>
   </gx:FlyTo>
           <gx:wait>
               <gx:duration>10</gx:duration>
           </gx:wait>
   <gx:FlyTo>
   <gx:duration>10</gx:duration>
   <LookAt>
       <longtitude>-0.0242591</longtitude>
       <latitude>51.4303771</latitude>
       <altitude>400</altitude>
       <heading>1</heading>
       <tilt>0</tilt>
       <range>1</range>
       <altitudeMode>relativeToGround</altitudeMode>
   </LookAt>
   </gx:FlyTo>
           <gx:wait>
               <gx:duration>10</gx:duration>
           </gx:wait>

    <gx:TourControl>
    </gx:TourControl>
   </gx:Playlist>
   </gx:Tour>
 <Placemark>
       <name>T1</name>
       <description></description>
       <Point>
           <coordinates>-0.0441561,51.4354051</coordinates>
       </Point>
   </Placemark>
   <Placemark>
       <name>T2</name>
       <description></description>
       <Point>
           <coordinates>-0.0382701,51.452901</coordinates>
       </Point>
   </Placemark>
   <Placemark>
       <name>T3</name>
       <description></description>
       <Point>
           <coordinates>-0.0242591,51.4303771</coordinates>
       </Point>
   </Placemark>
</Document>


texts: UpdateCursor only takes last value of SearchCursor

texts:
I have this piece of code:

#written on python 2.7 for ArcGIS Desktop 10.2.2

import arcpy

#set to folder where features are located
arcpy.env.workspace = "c:\\Users\\python_ex" #on windows use \\ instead of /

#---------------------------
#define variables for cursor
#---------------------------

"""SEARCHCURSOR"""
"""SearchCursor (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause})"""
#field taken as "identifier". i.e. if column1 == a, take the value from the same row of column2
stable = "test2.shp"
sfield = ["column1", "column2"]
#where clause will be written in SQL and not assigned to variable
#more information can be found here http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000011000000

"""UPDATECURSOR"""
"""UpdateCursor (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause})"""
#field taken as "identifier". i.e. if column 1 == a, take the value of the SearchCursor and insert into same row, but column2
utable = "test.shp"
ufield = ["column1", "column2"]
#where clause will be written in SQL and not assigned to variable
#more information can be found here http://resources.arcgis.com/en/help/main/10.2/index.html#/UpdateCursor/018w00000014000000/

#--------------------------
#start the loop
#--------------------------

svalues = [] #create list to store the values from the searchcursor

with arcpy.da.SearchCursor(stable, sfield, """"column1" = 'aa'""") as scursor: #SQL queries in python are build that way http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001r000000
    for srow in scursor:
        svalues.append(srow) #append values to list
        print svalues
        with arcpy.da.UpdateCursor(utable, ufield, """"column1" = 'aa'""") as ucursor: #if used with statement, no need to close all the cursors
            for urow in ucursor:
                    ucursor.updateRow(svalues[-1]) #-1 always takes the last value of the list

I want to update every field in test.shp with each value found in test2.shp.

But, it takes only the last value found in the table of test2.shp and updates all the fields in test.shp with it.

Shouldnt the logic of the loop I created be:
"take the first value that matches the criteria, go on to the updatecursor, update the first row matching the criteria and then go back to search and update the next row. etc"

Or am I totally mistaken?


texts: Using Spatial join tool returning "Count" values in ArcGIS Model Builder?

texts:
I want to replicate the manual  Spatial join (R-click Join) using 'count' in ModelBuilder.

I have 2 datasets:

Historic Road Traffic Collisions (RTC) locations - Point feature
(gdb) - 3,398 rows
Road Network in segments - polyline (Shp)  - 149,775 rows

and I want to count the number of RTC per road segment so I can display only sections that have more than 1 historic RTC and show different thickness of line based on the value returned.

It works fine when I do it manually.
However the Spatial join in the ModelBuilder does not bring back a count.
I am also unsure of the results.

If I use 'Intersect' it does not bring back anything
If I choose 'Closest' it attributes a value to all my segments (which it should not).

Sometimes it also bugs and "null" all my table fields apart from the 1st row.
Anybody have any idea of what I am doing wrong?


texts: Referenced table not found in standalone Python script

texts:
I'm trying to run a Python script from OSGeo4W Shell. Im doing this by typing "python-qgis C:\path\test.py"

Everything seems to go fine until the script launches the processing module. After that console gives me a lot of invalid escape sequence warnings.

Then when the script hits the SQL- algorithm it fails to find the referenced table. It still manages to load it.

ERROR: Referenced table file in query not found

Here is my script:

import sys

from qgis.core import (
QgsApplication,
QgsProcessingFeedback,
QgsVectorLayer,
QgsCoordinateReferenceSystem,
QgsProcessingParameterFeatureSource,
QgsProcessingFeedback
)

QGIS = 'C:\\Program Files\\QGIS 3.6\\apps\\qgis'

# Prefix
QgsApplication.setPrefixPath(('QGIS'),True)
qgs = QgsApplication([], False)
qgs.initQgis()

# Processing path
sys.path.append('C:\\Program Files\\QGIS 3.6\\apps\\qgis\\python\\')
sys.path.append('C:\\Program Files\\QGIS 3.6\\apps\\qgis\\python\\plugins')

path = 'O:\\Desktop\\Qgis\\File\\file.shp'

IN = QgsVectorLayer(path,'file','ogr')

if IN.isValid():
    print ('Success!')
else:
    print ('Failed!')

OUT = 'O:\\Desktop\\Area\\Leik\\A_Area.shp'

from qgis.analysis import QgsNativeAlgorithms
import processing
from processing.core.Processing import Processing
Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())

AO = {
            'INPUT_DATASOURCES': IN,
            'INPUT_GEOMETRY_CRS': QgsCoordinateReferenceSystem('EPSG:3883'),
            'INPUT_GEOMETRY_FIELD': '',
            'INPUT_GEOMETRY_TYPE': None,
            'INPUT_QUERY': 'SELECT \"file\".* \nFROM \"file\"\nWHERE \"file\".\"type\" like \"a%\"',
            'INPUT_UID_FIELD': '',
            'OUTPUT': OUT,
        }

feedback = QgsProcessingFeedback()

result = processing.run('qgis:executesql', AO,feedback=feedback)

print(result)

sys.exit()


texts: Multi-line labels position and guideline

texts:
I'm trying to indicate a specific point to fixate 2 lines of a feature's labels. This points should by linked to the END of a guideline's position, who is rendered by the "Geometry Generator" in my shapefile.

I already have an example of what is expected as final result in QGIS. It's a dynamic block that I've elaborated several years ago to AutoCAD.

Currently what I´ve reached in QGIS, using a Multi-line label and a guideline:

So, the difference between the 2 examples above is on the 1st and the 4th line of QGIS's labels. As I've said, I want to put it always in the guideline's end point with the 4th line on the closest point and the 1st line after the 4th. The problem is: this place is exactly between the 2nd and 3rd line and if I use one more '\ n' (breakline) the final result is not that good.

I don't know if is that a way to "print" the labels in a specific coordinate using Geometry Generator's expression.

Anyone has another idea to do it with the final result similar to the AutoCAD's block ?

Here's the link with the shapefile and the ".qml" style that I'm using on the GIF's example: https://drive.google.com/open?id=12zYPu4aGMMCpXGpE3-mLIiT-q8WM4oae

Label's code:

  "Nodo_tipo"    ||   '\n'  ||
  'CT = '  || "CT_(N)"   ||  '\n'   ||
   'CF = '  ||"CF_nodo"   ||   '\n'  ||
   'h = '  ||"h_nodo_NT"   || 'm'

And guideline's generator code:

CASE
WHEN @map_scale < 6000
THEN

If ($x < "LABEL_X",

make_line (
make_point( "LABEL_X" + (0.015 * @map_scale), "LABEL_Y" + (0.0065 *
@map_scale)),
make_point( "LABEL_X" - (0.0020 * @map_scale), "LABEL_Y" + (0.0065 *
@map_scale)),
make_point( x(centroid( $geometry )), y(centroid( $geometry )))
 ),

make_line (
make_point( "LABEL_X" - (0.0020 * @map_scale), "LABEL_Y" + (0.0065 *
@map_scale)),
make_point( "LABEL_X" + (0.015 * @map_scale), "LABEL_Y" + (0.0065 *
@map_scale)),
make_point( x(centroid( $geometry )), y(centroid( $geometry )))

)

)
END


texts: I have a boundary polyline of an island that is broken into multiple short segments. The island is surround by many other islands. What I want to do is delete the mainland island and convert the satellite islands into polygons. I tried dissolve but that merged the entire file into one feature. I then tried the multipart to single part thinking it would separate the smaller islands from the large one but it broke the entire file back up into the short segments again. Effectively I want to merge/dissolve touching lines so that each individual island is its own, one line feature.


texts: Where to track the status of Processing in QGIS 2.99?

texts: I've understood that the processing algs are going to be implemented in the master version of qgis. What is the best way to track the status of which algs that are implemented and the plan for the rest?


texts: Adding curb/gutter and subsurface storm drain networks to watershed analysis in QGIS

texts:
I need to do a neighborhood scale drainage analysis.  The analysis needs to accurately show the drainage area to each storm drain inlet.  Using GRASS on QGIS 2.12.1 on OS X, I have been able to delineate basic watersheds.  However, the DEM file does not appear to be precise enough to pick up curb/gutters, which significantly impact drainage patterns (the flow direction just runs over the curbs in many cases), nor does the analysis account for subsurface drainage networks, which collect drainage from one location and deliver it to another.

Is there a way to 'fine tune' the DEM to add curbs and/or a way to model a storm drain network in QGIS (on Mac)?


texts: How to properly convert landmass NaturalEarth data into GeoJSON?

texts:
100% Newbie. I've been following Mike's d3 Map Tutorial and I've come up against a challenge.  I guess my question essentially boils down to: how does one generate the proper GeoJSON/TopoJSON files which allow one to combine the Natural Earth data from ne_110m_land along with Admin 0 – Boundary Lines and Admin 1 – States, Provinces?

I think there's some sort of trick I'm missing for thematic maps.  (I guess that's also why Mike may have not covered that in the intro article).?

Thanks!

Seemant


texts: Strange buffer shape when using planar buffer method

texts:
I'm doing a very simple operation involving clipping some streams from the National Hydrography Dataset in ArcGIS Desktop 10.3.1, reprojecting them from "GCS North American 1983" into "USA Contiguous Albers Equal Area", and buffering the streams by 30 meters, with the following settings:
Distance = Linear unit, 30 meters
Side type = Full
End type = Round
Method = Planar
Dissolve type = All

The result is completely bizarre, like the following (note the blue is the "buffer", and the buffer-shaped white space around the streamlines is just that -- white space):

The only way I can find to avoid this is to either change "Method" to "Geodesic" instead of "Planar", or to run the buffer operation on a stream file that is in a geographic rather than a projected coordinate system. But I don't see a need for using geodesic buffers when I'm working within a very small area and my stream file has a projected coordinate system. Moreover, this is the first time I've ever seen this kind of behavior. I've tested on many different clipped portions of the NHD and seen the same behavior, so it does not appear to be any kind of corruption of the polylines. Any ideas of what might be going on?


texts: Opening image files with Sentinel 2 toolbox

texts: Anyone worked with the Sentinel-2 toolbox/SNAP? It doesn't support sentine-2 data to be opened directly. I tried opening  .safe, .zip and .xml files.


texts: Save TIFF from WMS layer QGIS for bhuvan lulc

texts:
I am new to QGIS. I was trying to export .tiff from WMS layer.

WMS URL is :

https://bhuvan-ras2.nrsc.gov.in/cgi-bin/LULC250K.exe

This WMS layer is from bhuvan for lulc data India.

https://bhuvan-app1.nrsc.gov.in/thematic/thematic/index.php

I can successfully add layer to QGIS but fail to save it as .tiff . My settings while saving TIFF file:

Problem is it does not create any .tiff file, even though it reports it has created a tiff. Exporting the layer as another data type (GeoPackage) to the same location works.

How can I save it as .tiff and how to check what formats are supported by a WMS service ?


texts: Getting an "Internal Error" message for a Google Earth Engine task that has run successfully before

texts:
I am running a code that I have run successfully hundreds of times before without a problem.  Now I am getting an "Internal Error" message.  I suspect it is a system problem, but am not sure.  The only difference is the polygons that I am exporting  for.  The input polygons seem fine, so I'm not sure what the problem is.
import ee
import gdal
import ogr
import geojson
import os, sys
import uuid

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
drive = GoogleDrive(gauth)

ee.Initialize()
myImage = ee.Image("users/myname/myasset")
myImageA = myImage.select(['b1'])
myImage60 = myImageA.updateMask(myImageA).gt(59).toByte()
mask = ee.FeatureCollection("users/myname/maskasset")

myImage60Clipped = myImage60.clip(mask)

shpfile = 'Mapping_Regions/myshapefile.shp'

drv = ogr.GetDriverByName('ESRI Shapefile')
vecDS = drv.Open(shpfile, 0)
vecLyr = vecDS.GetLayer()
numQuads = vecLyr.GetFeatureCount()
print('Number of Quads: %d' % (numQuads))

for k,feat in enumerate(vecLyr):
    quadname = feat.GetField('QUADNAME')
    geom = feat.GetGeometryRef()
    gjson = geojson.loads(geom.ExportToJson())
    points = []
    for j in range(5):
        points.append([gjson['coordinates'][0][j][0], gjson['coordinates'][0][j][1]])
    myPoly = ee.Geometry.Polygon([points[0], points[1], points[2], points[3], points[0]])

    task_config = {
        'folder': 'MyFolder',
        'scale': 9.554628534319960,
        'region': myPoly,
        'crs': 'EPSG:3857',
        'maxPixels': 1e13,
        'skipEmptyTiles': True,
        'fileFormat': 'GeoTiff',
        'formatOptions': { 'cloudOptimized': True }
        }

    task = ee.batch.Export.image(myImage60Clipped, quadname+'_gcrmn_reef_extent', task_config)
    task.start()
    print('%5d : %s : %s' % (k, quadname, task.id))

vecDS.Destroy()


texts:
I am currently trying to load different shapefiles in ArcObjects programmatically.  Currently I can load lines, polylines, polygons and ellipses (even though that's just a fancy polygon as far as ArcObjects is concerned).

However, I'm having a problem loading texts. Basically it's a point on a map with some text above it.

This is how I'm trying to load the shapefile. Note this is basically the same thing I do for polygons, polylines and ellipses. The only notable difference is ITextSymbol as opposed to ISimpleFillSymbol for Polygons or ISimpleLineSymbol for lines:

IFeatureLayer featureLayer = new FeatureLayerrClass();
featureLayer.FeatureClass = myFeatureClass //Loaded from the featureWorkspace
featureLayer.Name = featureClass.AliasName;
featureLayer.Visibile = true;

IGeoFeatureLayer layer = featureLayer as IGeoFeatureLayer;

IRgbColor textColor = new RgbColorClass();
textColor.Red = 255;
textColor.Blue = 0;
textColor.Green =0;

ITextSymbol textSymbol = new TextSymbolClass();
textSymbol.Color = textColor;
textSymbol.Font = (stdole.IFontDisp)OLE.GetIFontDispFromFont(new Font("Arial", 12 , FontStyle.Bold);
textSymbol.Size = 12;
textSymbol.Text = myText;

ISimpleRenderer simpleRenderer = new SimpleRendererClass();
simpleRenderer.Symbol = textSymbol as ISymbol;
geoFeatureLayer.Renderer = simpleRenderer;

myAxMap.AddLayer(geoFeatureLayer as ILayer);
Invalidate();


texts:
I am using Leaflet draw for adding Draw toolbar to my leaflet map. I am using angular leaflet directive to add the map. I want certain elements of the draw toolbar to be removed, specifically (line and circle). I have tried using this statement in my code but does not works
polyline:false. How should i go about it? Here is my code

JS

angular.extend($scope, {
                center: {
                    lat: 51.505,
                    lng: 10.09,
                    zoom: 3
                },
                controls: {
                  scale:true,
                  draw: {}

                },

                layers: {
                    baselayers: {
                        mapbox_light: {
                            name: 'Mapbox Streets',
                            url: 'https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoicmVoYW5zNTE2IiwiYSI6ImNpeWxjcWNkODAwNGwzM3FxamR6a2gxOXkifQ.PuUfs90MyfmVGYVqx0AoUw',
                            type: 'xyz',
                            layerOptions: {
                                apikey: 'pk.eyJ1IjoicmVoYW5zNTE2IiwiYSI6ImNpeWxjcWNkODAwNGwzM3FxamR6a2gxOXkifQ.PuUfs90MyfmVGYVqx0AoUw',
                                mapid: 'mapbox.streets',
                                format: '@2x.png'
                            },
                            layerParams: {
                                showOnSelector: false
                            }
                        }
                    },
                    overlays: {
                        draw: {
                            name: 'draw',
                            type: 'group',
                            visible: true,

                            layerParams: {
                                showOnSelector: false
                            }
                        }

                    }
                }

           });

           leafletData.getMap().then(function(map) {

               leafletData.getLayers().then(function(baselayers) {
                 var drawnItems = baselayers.overlays.draw;

                  map.on('draw:created', function (e) {

                    var layer = e.layer;

                    drawnItems.addLayer(layer);

                    console.log(JSON.stringify(layer.toGeoJSON()));
                    coordinates_selected = layer.toGeoJSON();

                  });
               });
           });

HTML

        <leaflet lf-center="center" controls="controls" layers="layers" geojson="geojson" width="540" height="400"></leaflet>


texts:
Does anyone know how to get the affine transformation from a geopandas dataframe?
I need this for rasterising geospatial vector data with rasterio.
shapes = ((geom,value) for geom, value in zip(geodataframe.geometry, len(geodataframe)*[255]))

numpy_array = features.rasterize(
    shapes,
    out_shape=self.tile_size,
    transform=geodataframe.transform???,
    all_touched=True)

I am however still missing the transform part.


texts: ArcGIS feature class interprets Latitude/Longitude in meters instead of degress

texts:
I wanted to tie toegther some data from my database table to an ArcGis map. The table contained an Object_Id, GIS_LATITUDE and GIS_LONGITUDE column. I added the feature layer based on the table (x as GIS_LONGITUDE, y as GIS_LATITUDE) and was surprised when my points, instead of being based in California, ended up just off the African coast.

I looked at the details of each point and found that the decimal fields had been translated to be meters away from 0,0 instead of degrees away. So my point:

-119.789°  36.793°

becomes:

-119.789  36.793 Meters

I'm new to ArcGis for desktop and can't seem to find an option that will change the projection to use degrees. Most frustrating is that both the feature layer and the topographical layer is using the same Mercator projection.


texts: How can I keep labels in the same layer from overlapping in QGIS?

texts:
In QGIS (2.14.0) I have a polygon layer I need to show labels for, but often the polygons overlap.  I need to see the labels for each of the overlapping parts but when the two polygons are coincident, the label gets placed in the same location and overlaps one another.

For example, polygon A is 50m^2 and is labelled "A", polygon B is also 50m^2 and coincident with polygon A but is labelled "B".  Currently I get both "A" and "B" rendering on top of each other whereas i want "A" and "B" to render without colliding, so both are readable.

In the image below the three south western parcels each have "2-Ground Oriented Infill" and "17-Coach Houses" overlapping polygons, but labeling engine has drawn "17" first on one feature and "2" first on the other, so they look mismatched but should all be the same according to the polygon colour, ideally both "2" and "17" labels should show and not overlap.  The south eastern polygon doesn't overlap as "7-Riparian Areas" is a different polygon shape than the overlapped "17-Coach Houses" in that case".


texts: What is the most efficient way to get a table or attribute table of a float raster?

texts:
I'm starting with a stretch point raster.  Ultimately I want to get a mean value of values with larger zones and then rate the zonal mean stretching from 0-1 and output rank/zone to a table or layer with an attribute table.

After using zonal statistics to get the mean per zone.  I've been using the geomorphometry and gradient metrics>Transformations>Normalize Tool to rank which results in a 0-1 floating point raster with decimals (still no attribute table).  I realize I could convert this raster to a integer and then finally to polygon or table but there must be a more efficient way to do all of this??


texts: Using the advanced filter of an attribute table from python

texts:
I have created a script which opens the attribute table in QGIS and I would like to use the advanced filter (expression). I want to create the expression from python and then show the result in the attribute table.

Code:

request = QgsFeatureRequest().setFilterExpression( u'"STATUS" = \'OK\'' )
self.attDialog = self.iface.showAttributeTable(self.layer)
self.attDialog.findChild(QAction,'mActionAdvancedFilter').trigger()

Do you know how could I do that?

The expected result should be something like this:


texts: Opening links in same window with ArcGIS Online Popup?

texts:
I've noticed when embedding an ArcGIS Online webmap which has a popup with links on it, that there seems to be no way to have the popup link open in the current window. It will always open in a new window.

There are no configuration options for link @targets in the ArcGIS Online popup configuration tool and if you try manually setting the target attribute of a popup link to target="_top" or "_parent" that value will be overwritten as target='_blank' and thus links will open in a new window.

This means you can't really integrate the map with your page, because users are taken outside the original window and you have to figure out a way to get them back in.

I wondered if anyone has a workaround and why ArcGIS Online insists on this behaviour?


texts: Openlayers3 Marker/icon Clustering in WebGL

texts:
I try to create a webGL-based icon-Clustering with an array of self-hosted images. My approach was to combine the iconSprites-WebGL-Example with ol.clusterSource. The ClusterLayer shoes up, but it is only displayed as pointCoordinates without the images. If i only render the main vectorLayer, all images are there, but (of course) not clustered. Somehow i can´t access the features from the vectorLayer inside the clusterLayer. Does anybody have an idea, what i´m doing wrong (js is attached)

var i;
var iconCount = 1001;
var icons = new Array(iconCount);

for (i = 0; i < iconCount; ++i) {

icons[i] = new ol.style.Icon({
  opacity: 1,
  size: [100, 100],
  crossOrigin: 'anonymous',
  src: 'data/images_' + i + '.jpg'
});
}

var featureCount = 1000;

var features = new Array(featureCount);
var feature, geometry;
var e = 25000000;

for (i = 0; i < featureCount; ++i) {
  geometry = new ol.geom.Point(
  [2 * e * Math.random() - e, 2 * e * Math.random() - e]);

  feature = new ol.Feature(geometry);
  feature.setStyle(
  new ol.style.Style({
    image: icons[i % (iconCount - 1)]
  })
  );
  features[i] = feature;
}

var vectorSource = new ol.source.Vector({
  features: features
});
var vector = new ol.layer.Vector({
  source: vectorSource
});

// ********************** CLUSTERING ********************************

var clusterSource = new ol.source.Cluster({
    distance: 40,
    source: vectorSource
});

var clusterLayer = new ol.layer.Vector({
  source: clusterSource
});

var map = new ol.Map({
  layers: [clusterLayer],
  renderer: 'webgl',
  target: document.getElementById('map'),
  view: new ol.View({
    center: [0, 0],
    zoom: 5
  })
});


texts: artifacts in SRTM contour layers processed with GDAL tools and rendered with mapnik?

texts:
Here is my workflow for importing individual SRTM tiles into postgis using the GDAL utils and rendering a png using mapnik:

gdal_fillnodata.py -srcnodata -32768
gdal_contour -i 10 -a ele -snodata -32768
ogr2ogr -f PostgreSQL -nln srtm3 -append -t_srs 'EPSG:900913'
(some SQL to split the data into 10m, 50m and 250m tables)
nik2img.py [stylesheet] [file] --srs 900913 -d [width] [height] --no-open -f png -v --center [center] --zoom [zoom]"

Most of the time this works perfectly. However, large areas with mountainous terrain are often completely distorted:

Huge swaths of landscape are covered with strange (often linear) patterns that shouldn't be there. No way the SRTM data is that messed up.

What am I doing wrong and how can I avoid this?

Ideally there should be a command-line solution.


texts: Fast implementation of polygon overlay tools in osgeo suit

texts: I am currently using symmetrical difference, difference and intersect tools from standard QGis implementation in python (I use pyqgis). I do topological checks ie. if Fc1 is contained within Fc2. Algorithms give good results and pick up even on very slight difference between objects (offset of 0.0001 m etc.), however with massive shapefiles that include complex polygons processing speed is just unbearable. I have been looking at OGR implementation but it seems to have some sort built in tolerance that I can not remove. I do care for the most precise measurements between objects. I did give very quick look at v.overlay but importing shape to grass format put me a bit of. Althought I think that grass format is best for this kind of task it seems that Ill loose some details during conversion. I also had a quick look at SQL geometry tools (OGR +SQL on shapefiles) but I did not notice huge speed improvement. I tried to investigate, why python implementation is so slow, since I found some thread about C++ implementations for above tools that apparently are way faster (someone started C++ implementation but I did not find any finished tools). From what I understand current QGis tools use geos libraries, the same that are used for SQL spatial operations. Its really not possible that those for loops in  https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/SymmetricalDifference.py decrease performance so much. I have been working with arc and geomedia, both had much better performance for those operations. Is there a way in open source world to get at least decent processing speed with good accuracy? Can anyone recommend any tools or tell me what I am missing or doing wrong or point towards some geometry guru for advice?


texts: Why does the next() method fail after the last record, using arcpy.da.SearchCursor?

texts:
Using the older arcpy.SearchCursor, the next() method would return Nothing once the last record had been passed.
Using the newer arcpy.da.SearchCursor, I'm finding that the next() method crashes the script if there are no more records. To illustrate:
import arcpy
fc = "C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcGlobeData\continent.shp"
fields = ["CONTINENT"]
where = "CONTINENT = 'Asia'"
with arcpy.da.SearchCursor(fc, fields, where) as cursor:
    for i in range(0,5):
        row = cursor.next()
        print row

There is only one record in the cursor, so the first time it iterates the name is printed. But the second iteration throws a StopIteration error.
How should we use next() with arcpy.da.SearchCursor?


texts: How to import DWG file from CorelDraw to MapInfo project?

texts:
I have to make polygons of some protected areas in MapInfo. I have the WMS with the protected areas loaded into mapinfo but making polygons from the WMS will take me years.

So I took the following steps:
-saved the window (.jpg) with polygons from WMS that I was interested in,
-imported the .jpg in CorelDraw,
-traced the bitmap so I had only vectorized contour of the polygons
-exported it as .dwg file
-created .tab file from .dwg file in MapInfo Universal Translator

And at this point I have a problem. When I open the new .tab file based on CorelWork in MapInfo with georeferenced map or the WMS with protected areas, the new .tab and my polygons are in totally different place and much smaller (few meters comparing to kilometres) than original polygons in WMS. Corel works in cm/in/mm etc. and my project in mapinfo has hundreds of km.

Can you help me fit polygons from .tab based on Corel to .tab with proper scale and projection? Sorry if I'm chaotic. Corel and MapInfo are the only programs I can use. I have no access to AutoCad and so on.


texts: Load mbtiles by Mapbox iOS & Android SDK

texts:
Is it possible to read .mbtiles files through Mapbox iOS or Android SDK?

I'm trying to download .mbtiles from osm2vectortiles.org and setting up a full offline application running offline maps.


texts:
I am looking to place labels showing the exact number associated with a graduated symbol. I have the labels, and the symbols, but cannot seem to get them placed in the same location.

Can someone shed light on how to make this happen in ArcMap 10.x?


texts: How to edit "Self Intersecting" polyline in ArcGIS for Desktop?

texts:
Trying to figure out how to edit a self intersecting polyline (Interstate Ramp) such that I end up with a from node, self intersection loop, then end node.

I'm using ArcGIS Version 10.3 and the data is stored in a Feature Class of a File Geodatabase

Richard.  Great and insightful comments, but I think I found a solution from which we both might find useful.  I found that if, as you stated, I create two features, then retrace the features (ramp), then delete the underlying features I was left with one self-intersecting line that appears to work fine in network analyst (See Figure).  The only issue I have now is when I trace the new feature I lose all attribution so I suspect some sort of join to repopulate the attributes.

To copy attributes from one feature to another feather I used the following procedure ....

1.Click the Editor menu and click Start Editing.

2.Click the Edit tool Edit tool on the Editor toolbar.

3.Select the features whose attributes you want to edit.

4.Click the Attributes button Attributes button on the Editor toolbar.

5.In the Attributes dialog box, right-click the feature you want to copy from and click Copy.

6.Right-click the feature you want to paste into and click Paste.


texts: I am trying to create a hypsometric curve from polygon shapefile and a DEM, and for that I am creating this model. Now, when I reach the Add Geometry Attributes step, I can't see AREA under Geometry Properties. I have added some more screenshots for further reference under the comment section, as I don't know how to add more than one image in the question.


texts: Getting all possible routes in network analyst?

texts:
The network analyst (ArcGIS 10.3) gives you the best route regarding some impedance.

I want to know if there is the possibility that he gave us ALL the possible routes and not only the best one.

That would be important in order to do a better analysis.


texts: How rename each band of an Image Collection that I created in GEE?

texts:
I input each image and band and, created an Image Collection in GEE.
However, each band is as "b1" and I want to rename in order that I created the Image Collection
respectively as b1,b2,b3 and b4 .
I am trying as:
var mar_03 = ee.ImageCollection("users/nayaraestrabis/collection")
            .select(ee.Image("users/nayaraestrabis/collection/image_band2")).select('b1').rename('b2')

and it didn't work. I am trying to do a function, but I don't know how to do using an Image Collection.


texts: OpenLayers DrawFeature override double click

texts:
Can anyone explain how I can ovveride the dblclick event when I'm using an OpenLayers.Control.DrawFeature? I see there is parameter in the constructor for handlerOptions - Used to set non-default properties on the control’s handler. My handler is just an OpenLayers.Handler.Path.

I want to run some custom validation when a user double clicks so that they can continue the sketch should they fail.

Double click --> "you've drawn something stupid are you sure you want to finish?" --> No ---> carry on sketching

Thanks,
James


texts: Cropping TIFF images based on GeoJSON bounding boxes in Python

texts: I have a GeoJSON file that has bounding boxes (squares), and I also have many TIFF images. I want to crop the TIFF images exactly to bounding boxes provided by the GeoJSON file. While doing this, I want to preserve the coordinates of the TIFF images that is shown in QGIS. I searched a lot, but I could not find useful information about it.


texts: Determining unknown Coordinate Reference System based on ref points

texts:
How do I find a projection to a target CRS (Coordinate Reference System) based on a number of reference points?

Reference Points

Lat Lng                                -> Unknown CRS (X, Y)

29.999999999999456, 10.0               -> 0, 0
29.999942188937776, 10.099416075499747 -> 10000, 0
52.51051013417886, 13.430682115106462  -> 229459, 2511140
52.420591784398034, 12.98406698769891  -> 200000, 2500000
52.44802435357121, 11.492633733515229  -> 100000, 2500000

From the data above it seems, the unknown CRS has its origin at 30.0, 10.0 and the unit is in meters. My closest guess based on the tools recommended in related questions are:

Esri:102014 - Europe_Lambert_Conformal_Conic

Esri:102031 - Europe_Equidistant_Conic

However, trying to transform the coordinates using the CRS above does not yield the correct target reference points.

Disclaimer: I have read the related questions (Determining unknown Coordinate System using QGIS? and Find CRS (coordinate reference system) based on known location and coordinates?)

The EPSG-Registry and Projfinder tools recommended in those questions did not yield a result.


texts: how to beginning with GDAL, how can i use it for image format conversions

texts:
I like to work with GDAL. is it a software with or without graphical user interface?
or the commands are run in command prompt.


texts: OpenLayers + GeoServer problem with WFS projection

texts:
In GeoServer I have a layer in EPSG:26191. In OpenLayers I add it on map as WFS:

markerLayer = new OpenLayers.Layer.Vector('Markers',{
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.WFS({
             srsName:   "EPSG:900913",
             version:   "1.0.0",
             url:       "http://localhost:8080/geoserver/copro/wfs",
             featurePrefix: "copro",
             featureType:   "st",
             featureNS:     "http://localhost:8080/geoserver/copro",
             geometryName:  "geom",
        }),
        projection:new OpenLayers.Projection("EPSG:900913"),

    });
app.mapPanel.map.addLayers([markerLayer]);

  I used QGIS with OpenLayers plugins the overlay is perfect but with
  this code my WFS is sent to ocean


texts: Unable to load raster data from PostGIS database into GRASS GIS

texts: I have a PostGIS (PostgreSQL 10.8) database with vector and raster data that I have connected to GRASS (7.8). I have successfully loaded my vector data into GRASS from the PostGIS database but have not been able to figure out how to do the same for the raster data. Does anyone have experience with this or know the commands might be?


texts:
I've got a webpage which prints a web map via the ArcGIS Javascript API.
The DPI of the print is 72. To debug I added three different types of symbols
 1. The default (most of them are)
 2. One custom symbol created at large scale
 3. A red icon created by ArcGIS

As you can see on the image it looks really pixel imperfect. While the background is nice, you can almost count the pixels in the symbols.

Does anyone has some kind of idea what's causing the pixelastion of the symbols and how to avoid that?


texts: Applying savitzky golay filter to MODIS NDVI data

texts: I want to smooth the NDVI MODIS 16 bit integer data .tif for LULC classification. I have timesat 3.1 software on windows but I don't how to apply the SG filter. I am not that good in programming. I tried opening .tif(40mb) in timesat  but the data is not loaded. Should I have to convert the .tif images to some other format? Can I achieve my aim using ENVI?


texts: Ogr2ogr: Unable to open datasource problem

texts:
I downloaded the Precints shapefile from the City of Boston's data hub, and I'm trying import it into SQLServer (I'm running the Express verson). I've already created the database in the SQLServer (but not the tables), so now I'm using OGR to import the data. I keep getting this error:"FAILURE: Unable to open datasource 'precints.shp' with the following drivers."

Here's what I've written in the OSGeo4W command prompt:

ogr2ogr –f “MSSQLSpatial” “MSSQL:server=Comp1\SQLExpress;database=Precints-ogr2ogr; trusted_connection=yes” “Precincts.shp”

I've tried downloading the data again, but no luck. I tried getting rid of the XML file that has the same name as the .shp file, but it still didn't work.

Any idea on how to fix this?


texts: Kriging interpolation with blocks as barriers for street level visualization in ArcMap?

texts:
I'm trying to do Kriging interpolation with blocks as barriers for street level visualisation, but I can't realise how I can do this. I already have the barriers polygons, data and all.

But can I do Kriging interpolation with barriers in ArcMap?


texts: Overpass-API - Get landuse from latitude/longitude

texts:
Based on my question at StackOverflow https://stackoverflow.com/questions/44021365/openstreetmap-nominatim-and-landuse

Can you tell me if it is possible to get the landuse of a point with latitude/longitude? After my question at StackOverflow, my solution is so far:

http://overpass-api.de/api/interpreter?data=way(around:25,48.7749365,9.1827252)[landuse];(._;>;);out;

If it is not possible to get the landuse from a point, what is the minimum parameter (now 25 meters) that will work? With 20 meters there is a result, too. But is this suitable for most points on islands?

By the way, the query url is generated at runtime.


texts: Reverse geocoding in QGIS Graphical Modeller

texts:
I would like to add addresses to the attributes of a series of points using the Graphical Modeller.
I can use the GeoCoding Plugin to get the address by clicking manually but would like it to be automatic. Any ideas?


texts: Understanding difference between osgeo4mac libraries and basic libraries (PROJ, GDAL, etc)

texts:
Is there a meaningful difference between osgeo-gdal and gdal that would make me choose the osgeo version over the basic version?
The context here is that I'm trying to install grass on my mac (catalina) and am hitting issues:
brew install osgeo-grass
#> Warning: Calling depends_on :x11 is deprecated! Use depends_on specific X11 formula(e) #> instead.
#> Please report this issue to the osgeo/osgeo4mac tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
#>   /usr/local/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/Formula/osgeo-grass.rb:111

#> ==> Installing osgeo-grass from osgeo/osgeo4mac
#> osgeo-netcdf: You have other linked versions!

#> Unlink with brew unlink netcdf or remove with brew uninstall --ignore-dependencies netcdf

#> osgeo-proj: You have other linked versions!

#> Unlink with brew unlink proj or remove with brew uninstall --ignore-dependencies proj

#> osgeo-libspatialite: You have other linked versions!

#> Unlink with brew unlink libspatialite or remove with brew uninstall --ignore-dependencies libspatialite

#> osgeo-gdal: You have other linked versions!

#> Unlink with brew unlink gdal or remove with brew uninstall --ignore-dependencies gdal

#> osgeo-libgeotiff: You have other linked versions!

#> Unlink with brew unlink libgeotiff or remove with brew uninstall --ignore-dependencies libgeotiff

#> Error: Unsatisfied requirements failed this build.


texts:
I am playing around with a map of bike lanes (so, lines) and trying to calculate the total number of miles of lane in each of a couple of regions. But I'm not even sure how to use ST_Length to calculate miles. I'm getting values of .001 and I don't even know what that means.

The documentation: http://postgis.org/docs/ST_Length.html is confusing to me -- I think this is supposed to be giving me meters, but I'm not entirely sure, and the segments tend to be one or tow blocks long, so ... more than .001 meters.

How can I use ST_Length to calculate miles?


texts: Displaying XYZ as Height Map in ArcGIS Desktop?


texts: Error with conversion from shapefile to GeoJSON

texts:
Currently, I am trying to transform a shapefile to GeoJSON, I have the .shp, .shx, .dbf and .prj files.

In order to do this I have the following code:

import json
import geopandas as gpd
import shapefile

SHP_FILE = '00ent.shp'
DBF_FILE = '00ent.dbf'
JSON_FILE = "mexico.geojson"

geodf = gpd.read_file(DBF_FILE)
geodf.plot()

The problem is that these points in the geometry, are not a lat, long points, and I want to convert to lat, lang in order to convert the file in a geoJson with the lat long coordinates.

Data:

CVEGEO  CVE_ENT NOMGEO  geometry
0   01  01  Aguascalientes  POLYGON ((2470517.824 1155028.588, 2470552.248...
1   02  02  Baja California MULTIPOLYGON (((1493197.166 1849625.247, 14934...
2   03  03  Baja California Sur MULTIPOLYGON (((1694656.344 1227647.637, 16946...
3   04  04  Campeche    MULTIPOLYGON (((3544897.199 946994.621, 354491...
4   05  05  Coahuila de Zaragoza    POLYGON ((2469954.193 1978522.993, 2469982.807...
5   06  06  Colima  MULTIPOLYGON (((1157633.318 768573.525,

How can I translate this to lat long?

I can use another Python library if is necessary.


texts: Couldn't load PyQGIS in QGIS 2.2 on Ubuntu 14.04

texts:
This issue appears to be occurring with some frequency to folks in some shape or form. I upgraded from ubuntu 12.04 to 14.04, with loss of python functionality.

My QGIS version is 2.2 from the official repository (not ubuntugis).

I have anaconda installed as my main python release, and I also used anaconda to install sip, since I received that error message earlier on.

conda install sip

Which left me with version 4.15.5. After installing that, the sip dependency was no longer an issue, and now it is "just" the pyQGIS and qgis.core dependencies causing problems.

I tried switching to the nightly build, but to no avail--still no python support.

I am not sure where the qgis package should be located--it may be just a pythonpath issue, but it may be an API version issue with underlying dependencies, although sip does seem to be fine now.

Tips?


texts: What is the difference between ActiveView, FocusMap and PageLayout in ArcObjects?

texts:
I see that different starting points are used when interacting with ArcMap IMxDocument

  IMxDocument mxDocument = application.Document as IMxDocument;

  IActiveView activeView = mxDocument.ActiveView;
  //IActiveView activeView = mxDocument.FocusMap as IActiveView;
  //IActiveView activeView = mxDocument.PageLayout as IActiveView;

  // Get an envelope corresponding to the view extent.
  IEnvelope envelope = activeView.Extent;

What is the difference between mxDocument.ActiveView, mxDocument.FocusMap and mxDocument.PageLayout related their extent? Are they going to be different?

In what case each can be used?


texts:
I am looking to create a shadow mask based on a DEM, with the sun conditions (azimuth and altitude) known. I am using QGIS, and had hoped to use the r.sunmask.position tool for this. The DEM is in UInt16 format as required by this tool, and data has been reprojected to UTM, so all measurements should now be in metres I believe.

However, when I apply the r.sunmask.position command, the output is only seen around the edge of the original raster, rather than within as well. I am sure that the image would contain shadows under the conditions specified, as I am comparing this to a Sentinel-2 image of the same region on which the shadows are clearly visible.

Image attached shows the trial area (actual area needs to be much larger, but is broken up into tiles with different solar conditions), with the DEM shown in black to white (min value =0, max value = 1990). The output of the command is seen as the thin yellow area, mainly in the top left corner.

Any help much appreciated


texts:
I'm a new developer of QGIS using C++. I am working on a project which needs to display dynamic maps/layers(just like GPS, but it is not GPS, however it should display data alike GPS data - dynamic display of changing data).

I know that ArcGIS has the technique called dynamic display (or something like that), which supports the capacity to do such things.

Does QGIS have similar ability?

I'm using QGIS 2.4.0. I want to develop a desktop application using QGIS API, it is a Qt Widget, it should have these features: add layers\symbols, zoom in\out, pan. Suppose I already have this application, first I add a map as background layer, then I add a symbol as the target which is changing position by data, data is changing by time, and there should be a track to target. For example, a car drives from A to B, it should be displayed on the map, car's position is changing by time, therefore it displays real-time different on map,  and there should also be a track to the car on the map.

I think this application scenarios is quite common in GIS, so I think it should be a common function to do it.

The result is the display should be smooth, no splashing screen,no view shaking.I developed a simple demo that has these features: add layer, zoom in/out, pan. When I added a vector layer (.shp) and I zoom in or zoom out, the refresh is not smooth or continuous. In particular, when the map is beyond the Map View(canvas's extent),panning map cause serious screen splashing, but when the map is within the Map View, it is OK to pan map.

Are there any places I did not do right?


texts:
With QGIS 2.18, the "rasterize" command offered the possibility of defining a raster target. I used this option to "update" a existing raster with the value of a polygon layer.

I'm not able anymore to find this possibility in QGIS 3.2. Any idea?


texts: Embedding static Google Earth Engine JavaScript in web page?

texts:
I have made a couple informational views in Google Earth Engine code editor and would like to put the resulting static map in a webpage.

I am a novice at html, but have experience embedding mapbox and leaflet maps in pages.


texts:
Is there a way to search for only parts of text in QGIS.

Imagine I have a field in my attributetable called myField and I have several entries there, something like

This is awesome
Even more awesome
Hard Faster Stronger
Rolling down

Is there a way to search only for awesome and get all the rows returned, where myField has a cell where the word awesome occurs?


texts: Georeference in ArcGIS to a known scale?

texts: If I'm georefencing an engineer's drawing and the scale is 1:250 is there anyway I can input this into ArcGIS for accuracy once I've selected a few points to georeference?


texts:
I need to identify the closest line from a point. Elements are stored in a postgreSQL/postGIS database, in the same projection. From a point (geom multipoint to be specific), I need to identify the closest line (multilinestring)  element from an other table.

Theoretically it should look like this :

SELECT myColumnLine FROM myLineTable WHERE ST_Closest(geomPoint, geomLine) LIMIT 1

I think ST_ClosestPoint can do the trick but I want to return line attribute, not coordinates.


texts: Open an existing document (MXD) inside ArcMap

texts:
I try to open a specific MXD inside a running ArcMap-Application, but I always get "System.UnauthorizedAccessException" and ArcMap crashes.
I have an Add-In-toolbar with a button, which opens a form (modal). Inside the form I show a combobox with available MXDs. In the OK-Buttons Click event I want to open the chosen MXD (below the mxd is a constant for test):

    Dim mxd As String = "D:\temp4\mytest.mxd"
    Dim pApp As ESRI.ArcGIS.Framework.IApplication = My.ArcMap.Application

    Dim pMapDoc As ESRI.ArcGIS.Carto.IMapDocument = New ESRI.ArcGIS.Carto.MapDocumentClass
    If pMapDoc.IsMapDocument(mxd) Then
        pApp.OpenDocument(mxd)
        'pApp.OpenDocument()
    End If

Also if I try to open it without the optional argument (mxd), ArcMap crashes with the same error. But it should open the dialog to choose a MXD.
What's wrong, who can help ?


texts: "Hello World" introduction for ubuntuGIS?

texts:
Is the GIS equivalent of "Hello world!" = "You are here?"

I installed ubuntuGIS recently, but I'm a little overwhelmed navigating the network of many packages to begin accomplishing simple things.  I'd like to explore GIS more thoroughly (I have made maps using R and techniques like these).

Are there any resources minimally illustrating going from...

Point A: sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get install qgis to

Point B: Here is a simple world map with a marker for your location?

Or could someone propose this "hello world" to get newbies started?  I think a tiny, simple project like this---"print where you are in the world" analogous to "print words on a screen" would be a very good learning tool for providing some narrative, tutorial context---something like giving a newbie a "roadmap" to making maps.

(Not required, but my personal preference on a thing like this would be that the output be d3 or kartograph, something in-browser.)


texts: Generating tile index from LAS dataset in ArcGIS?

texts:
I need to generate a tile index in ArcGIS from an LAS Dataset.

When you create an LAS Dataset, the map displays a footprint-like feature. These polygons contain the LAS file reference and you can identify the file name. Is there a way to save this as a polygon feature?

I essentially need the spatial location of the LAS files with associated file name as a field in the attribute table.

There are 800+ tiles so manually creating this is not preferred.


texts: Is *.xls MS Excel default format in ArcMap?

texts: Is it always necessary that whenever we want to show our data kept in Excel spreadsheets in ArcMap, that it must be in .xls? Is .xls a default format for ArcMap?


texts: Extract the attribute names from a large number of Shapefiles

texts:
I happened to need the attribute names of a large number of .shp files.
Is it possible under Linux, without importing the files into a GIS?


texts: Moving layers in QGIS Table of Contents via PyQGIS?

texts:
I have loaded two layers in canvas and would like to move the layers using the following code in TOC, but it is not moving the layers to the position based on the index given.

from PyQt4.QtCore import *
from PyQt4.QtGui import *

from qgis.core import *
from qgis.gui import *
import qgis.utils

canvas = qgis.utils.iface.mapCanvas()
layers = canvas.layers()

for i in layers:
  if i.name() == "Layer2":
    alayer = i
  elif i.name() == "Layer1":
    blayer = i

qgis.utils.iface.legendInterface().moveLayer(alayer, 0)
qgis.utils.iface.legendInterface().moveLayer(blayer, 1)
canvas.refresh()

How can I do that?


texts:
I'm trying to extract the bathymetry values of my area of interest from a world bathymetry raster layer using the 'rasterize' function in the {sp} package.

*Edits: I found the 'extract' function which seems to be more what I'm looking for.

This is what I've done so far:

> class(subarea0) #This is my area of interest (Eastern Canadian Arctic Sea)
[1] "SpatialPolygons"
attr(,"package")
[1] "sp"

> extent(subarea0)
class       : Extent
xmin        : -82.21997
xmax        : -57.21667
ymin        : 60.2
ymax        : 78.16666

library(marelac)
data("Bathymetry")#World bathymetric data in library (marelac)
names(Bathymetry);class(Bathymetry);str(Bathymetry)
[1] "x" "y" "z"
[1] "list"
List of 3
 $ x: num [1:359] -180 -179 -178 -177 -176 ...
 $ y: num [1:180] -89.5 -88.5 -87.5 -86.5 -85.5 ...
 $ z: num [1:359, 1:180] 2853 2873 2873 2873 2873 ...

  raster_bath<-raster(Bathymetry)#Transformed into a raster layer
    extent(raster_bath) <- extent(subarea0)#Transform the extend of my raster to the extend of my SpatialPolygons

>ras_sub0<-rasterize(subarea0,raster_bath)#rasterize my SpatialPolygons (*Edits: not the function that I need here, but I am still interested to learn what results mean)
Found 2 region(s) and 10 polygon(s)
> plot(ras_sub0)
> plot(subarea0, add=TRUE)

> ras_sub0
class       : RasterLayer
dimensions  : 180, 359, 64620  (nrow, ncol, ncell)
resolution  : 0.06964709, 0.0998148  (x, y)
extent      : -82.21997, -57.21667, 60.2, 78.16666  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84
values      : in memory
min value   : 1
max value   : 2
layer name  : layer

I don't understand the result. Why am I getting 2 colors for each of my polygons? What do they mean?

How can I ultimately get bathymetry depth contour? Is this something to do with my resolution or changing the dimensions?

*Edits: ok, I've now done the following:

v <- extract(raster_bath, subarea0)#Extract data from my Raster Layer for the locations of my SpatialPolygons

v is a list and I am not quiet sure how/under what form to rebind this info with my spatial polygon...

Thank you!


texts:
I am working on a QGIS plugin and using a QPlainTextEdit (QGIS 2.18 -> QT4 / python 2.7) in python and try to list multiple files.
I add the files using the following lines:

def select_files(self):
        path = r"c:\temp"
        filt = "Text file(*.txt)"
        filenames = os.linesep.join(QFileDialog.getOpenFileNamesAndFilter(self.dlg,
                                    "Select text file ",path, filt)[0])
        if len(filenames[0])>0:
            self.dlg.txteFilenames.setPlainText(filenames)

i.e. joining the list of files to a string with line breaks for each file.
This works fine (as it seems) and the self.dlg.txteFilenames is populated with the selected filenames, one for each row.

But then when I later try to use these files, one by one, I cannot parse it back to a list of files

filenames = self.dlg.txteFilenames.toPlainText().split(os.linesep)

This does not however split into a list of filenames but remains as one string.
I have tried to look for how QPlainTextEdit handles row breaks but I cannot find out how.
Does anyone know?


texts: What is the difference between the astar_sp and shortest_path_astar  functions?

texts:
I want to ask about what different of function :
"astar_sp" and "shortest_path_astar"  ?

Do you think the query's result from both of them is same or different?


texts: QGIS Control layer under the group layer display shortcut keys

texts:
In the ArcMap, you can hold down the Alt key and select the layer to show only the selected layer, and hold down the Ctrl key to select the layer that can be displayed at all levels on the same level.

If you select the layer under the group layer, The above operation will only function in the layer under the group layer.

Does QGIS have a similar shortcut?


texts: Sinusoidal Projection and ArcInfo Sphere Datum Woes

texts: I am using published forest loss data (found here: http://glad.geog.umd.edu/indonesia/data2014/index.html) that uses the ArcInfo Sphere datum with a sinusoidal projection. I am seeking to transform a DEM (I've tried Aster and SRTM), or any raster in GCS_WGS_194, really, into this datum/projection. However, when I do so (using a geocentric transformation with parameters set to "0") the images don't align. I've completed the transformations in both Arc and in ERDAS, to no avail.


texts: Error restoring spatial database. ERROR : could not load library “/builds/postgresql-9.6.3/lib/rtpostgis-2.3.so”

texts:
I am trying to restore a backup of a database. I am running postgresql-9.6.3 with postgis-2.3.3

I run the following restore command
.../myw_db new_db restore /path/to/database.backup

I get the following error message:

  ERROR: could not load library
  “.../builds/postgresql-9.6.3/lib/rtpostgis-2.3.so”:
  .lib64/libresolv.so.2: symbol __h_errno, version GLIBC_PRIVATE not defined in > file libc.so.6 with link time reference

I am very new at working with postgreSQL and working in the linux environment in general. I did try looking for a solution in the forums before posting.


texts:
I have a multipatch feature class which comes from a conversion of a IFC model. Its coordinate system is very strange ("IFC_COORD_SYS_0") and I'd like to change it to EPSG:32632.

I am using ArcGIS Pro.

As the project tool fails (it shows an "extent error" message), my way to go was to:

use the Define Projection tool to set its coordinate system to EPS:32632.
Move everything with the Move To tool to my area of interest, having the Map Frame coordinate system set to 32632 as well.

Doing so, the layer looks in the right place, but it spans over regions while it is supposed to be just a single building. I suppose the problem is that its usints are millimeters rather than meters.

I think I need to make a custom PRJ with millimeters units. My idea was to save projection as EPSG:32632 as prj file, and modify it from METERS to MILLIMETERS units. But, I have some problems in doing so, as when I assign the new custom PRJ my layer shows up in the wrong place all the time.

Below are both the original (in meters) and the modified (in millimeters) PRJ files. What could I have done wrong?

EPSG:32632 (METERS)

PROJCS["WGS_1984_UTM_Zone_32N",
    GEOGCS["GCS_WGS_1984",
        DATUM["D_WGS_1984",
            SPHEROID["WGS_1984",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",9.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0],
    AUTHORITY["EPSG",32632]]

EPSG:32632 (MILLIMETERS)

PROJCS["WGS_1984_UTM_Zone_32N_MM",
    GEOGCS["GCS_WGS_1984",
        DATUM["D_WGS_1984",
            SPHEROID["WGS_1984",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",9000.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["MILLIMETER",1]]


texts: Understanding units in Kernel Density analysis using ArcMap

texts:
I'm having trouble understanding the units from a Kernel Density analysis in ArcMap.
The Context: I am analyzing how many structures will be damaged by sea-level rise in a coastal community. I have estimated flooding extent from a university data source, and I have structures in town as points features. I simply overlaid point features on flooding extent to identify which structures will be damaged by flooding. This part was intuitive and very straight forward.
Kernel Density Analysis: Next I wanted to know the areas of town that have the most affected structures. so I used a Kernel Density tool. The resulting raster makes sense (the low-lying area of town has the highest density of values) but I don't understand what the units mean.
Tool parameters:
Input point feature: Structures inside the flood zone,
Population Field: NONE,
Output cell size: 5,
Search Radius: [blank],
Area Units: SQUARE_MILES,
Output Values Are: Densities,
Method: Planar.

One example class of the VALUES in the resulting raster are 846.8815105 - 1,016.257813 (this class represents a moderate density of structures.)
But the heart of my question is: what does 846.8815105 - 1,016.257813 mean? Are these pixels within 5 SQ Miles of a point? or Something else?


texts: Data Driven Pages ExportToAI Resolution syntax?

texts:
I'm fairly novice with code.  I am trying to do a simple data driven pages export to .ai using arcpy.  I need the resolution down to 150 DPI. Line 4 brings up parsing errSyntax Error: Invalid Syntax.  I feel confident it takes place where I want to put in the resolution and the quality of image.

mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = pageNum
    arcpy.mapping.ExportToAI(mxd, r"M:\Projects\RAN_GIS_Project_ID\!2016\8852\RAN8851_Cricket_" + str(pageNum) + ".ai",,,,150,"NORMAL")
del mxd


texts: Which parameter values should I use with QGIS Heatmap plugin?

texts:
I've read all the posts and docs about the heatmap plugin but can't seem to get it to work.

The map is the size of the United States and has a little over 2000 points. I've tried small radi (1 meter) and large radi (5 million meters), but still get a red hot map.

I'm using QGIS 1.8 and WGS84. The data was initially in a spreadsheet, but I saved it as a .shp vector layer and deleted the old csv layer.

The goal is to convert that to contour lines to map density of these points like in this Mapbox blog post.


texts: Proportional aggregation of census data between layers in QGIS?

texts:
Not sure if anyone here remembers the little program called "AtlasGIS"? Well its been discontinued years ago which is a pity, but it had a function where one could proportionally aggregate for example population data from enumeration areas up to larger polygons (essentially giving you the sum of population of all the enumeration areas that falls into each larger polygon.

The neat thing was that if an enumeration area only partially fell into the larger polygon, AtlasGIS would calculate the % population that fell inside the larger target polygon.   But I can't find such a process elsewhere.

Can anyone help?


texts: Creating address locator for data with no ZIP codes?

texts:
I am trying to create an address locator using Tiger/line data (dual address locator). While initially successful, I can only geocode addresses that have ZIP codes in the dataset. Most of the data I work with,however, does not contain ZIP code information, only street address.

How can I this problem?


texts: How to call QGIS modules (qgis.core) from python idle as I can call arcpy

texts:
I was trying to set up path to be able to call  qgis  modules as it defined in their website Introduction and set PYTHONPATH=c:\qgispath\python .  I also try to follow suggestion in link below

How to import qgis.core to python IDLE?

However, I still get import error.
I also get error ImportError: DLL load failed: The specified module could not be found.

The other error I get is

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import qgis.core
  File "C:\Program Files\QGIS Wien\apps\qgis\python\qgis\__init__.py", line 26, in <module>
    import sip
ImportError: No module named sip

I want to be able to call this module from Spider or Python idle under arcgis. Does anyone know how to do that or have more detailed explained documentation? I can call the arcpy from spider but I could not achieve that for  qgis.core module.


texts: Save ocean shape layer using another CRS problem using QGIS

texts:
I downloaded Natural Earth Ocean Data http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-ocean/
and tried to reproject by saving the layer as different name and CRS using QGIS

Then, it gives me weird looking shapefile:

Also, America continent and South Asia's land areas are filled.

Using ArcMap, it's totally fine.
I am just curious why it happens.