texts: Packaging Succeeded but Publishing Failed?

texts:
I am trying to publish a very large raster data set, ~330GB. I get the general error: "Packaging succeeded but publishing failed"

The geoprocessing results say to check the server logs.

The server logs provide general error messages:

Failed to construct instance of service
'TestBrandon/ImgTest_321.MapServer'. Service startup timeout.
Core server call to create service failed (/admin/createService).
Failed to create the service.: ERROR: Service failed to start,
Internal server error.
Error executing tool. PublishServiceDefinition Job ID:
j360531ad8cd940a490f8f7ee2085dc49 : ERROR 001369: Failed to create
the service. Failed to execute (Publish Service Definition).
The service 'TestBrandon/ImgTest_321.MapServer' was not found.
Verify the service exists and is started.

There is nothing wrong with my configuration settings; I am able to publish if I only do half of the tiles. It is also not corrupt data because I successfully published both halves of the data set.

It also has nothing to do with the cache, because I have it set to manually build cache afterwards (and I can publish with building cache when I only publish half of the tiles).

I do have a lot of .SOC processes running on the server machine, but I tried stopping all of them during after-hours with no luck.

It seems like it is stemming from the first error message:
"Service startup timeout"

I'm guessing it is just taking too long with the large data set. Is there anyway I can increase this time so it does not timeout?

Running ArcMap 10.4.1


texts: Set certain amount of pixels to 1 inside of a polygon (GRASS)

texts:
I have a rather coarse vector map with polygons and want to calculate a (sufficiently) finer raster map defined by spatial extension and resolution. Every polygon of the vector map has a value associated that describes the percentage of pixels of the finer map inside the polygon that should be randomly set to 1. The fraction of pixels set to 1 should be as exact as possible.

Example: Polygon 7 is associated with a value of 20%. 50 pixels of the finer map would be (mainly) situated inside Polygon 7. Thus, 50*0.2=10 out of the 50 should be set to 1.

As a possible approach in GRASS, I found v.to.rast with use=cat to create a raster map from the polygons where the value indicates in which polygon they lie. Now, I would need to select randomly a percentage of the pixels with the same value.


texts: How do I use DynamicCacheLayerManager in ArcEngine to connect to a previously created cache

texts:
I am trying to load a cacheDataset that was created using the MapCookerClass as shown in the Multithreaded MapCruncher example at the URL below. In arcMap it is possible to connect/add this cache using the Add Data dialog. The ArcEngine Add Data dialog does not seem to support this structure so I am trying to do it programmatically.

Does anyone have a working workflow/sample that I could go on?  I've started in many directions, all of which are wrong.  A similiar post mentions that this is possible, but not how.

Similiar post
How to connect to bundle files?

Mapcruncher sample:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Sample_Multithreaded_MapCruncher/000100000mmm000000/


texts:
I want to make color interpolation with SLD on Geoserver. Interpolation works fine. But i need to know min, middle and max property values to make it correct. So i want to know this values, i says:

  <LineSymbolizer>
         <Stroke>
           <CssParameter name="stroke">
             <ogc:Function name="Interpolate">
               <!-- Property to transform -->
               <ogc:PropertyName>AverageDailyIntensCar</ogc:PropertyName>

               <!-- Mapping curve definition pairs (input, output) -->
               <ogc:Literal>0</ogc:Literal>
               <ogc:Literal>#fefeee</ogc:Literal>

               <!--<ogc:Literal>15000</ogc:Literal>-->
               <ogc:Div>
                 <ogc:Function name="max">
                    <ogc:Literal>0</ogc:Literal>
                    <ogc:PropertyName>AverageDailyIntensCar</ogc:PropertyName>
                 </ogc:Function>
                 <ogc:Literal>2</ogc:Literal>
               </ogc:Div>
               <ogc:Literal>#00ff00</ogc:Literal>

               <!-- <ogc:Literal>-->
                  <ogc:Function name="max">
                    <ogc:Literal>0</ogc:Literal>
                    <ogc:PropertyName>AverageDailyIntensCar</ogc:PropertyName>
                 </ogc:Function>
              <!-- </ogc:Literal>-->
               <ogc:Literal>#ff0000</ogc:Literal>

               <!-- Interpolation method -->
               <ogc:Literal>color</ogc:Literal>
               <!-- Interpolation mode - defaults to linear -->
             </ogc:Function>
           </CssParameter>
         </Stroke>
      </LineSymbolizer>

Have no validation errors, but in layer preview i get all features with same colors.
My main problem is a middle value:

               <ogc:Div>
             <ogc:Function name="max">
                <ogc:Literal>0</ogc:Literal>
                <ogc:PropertyName>AverageDailyIntensCar</ogc:PropertyName>
             </ogc:Function>
             <ogc:Literal>2</ogc:Literal>
           </ogc:Div>
           <ogc:Literal>#00ff00</ogc:Literal>

Here something wrong becouse when i use Litteral for middle value interpolation works fine and i get features with differend colors.
 Whats wrong here?


texts: Median value for case within ArcGIS Desktop?

texts:
Similar to ArcGIS median value from layer?, I am looking for a toolbox to get the median value for a data field by a case. For example, say I have dataset with percent tree cover for each county for each state; I would like to summarize the data by calculating the median percent forest cover by state.

The only reason the answer to the previous post doesn't work for my needs is that I am using ArcGIS 10.1 and the toolbox/script (link below) doesn't work in 10.1  I have attempted to update the script associated with the previous tool for use in 10.1, but haven't been successful. Is there an easy way to do this?

The tool created by Ryan Dalton is available here:

http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=A0CD1751-1422-2418-882E-001EE0DC0D35


texts: Shading in different parts of the same shapefile

texts: I am creating a map of islands and I created a land shapefile using water shapefiles and therefore the land shapefile doesn't have any of the original attributes of the water shapefiles. I'm wondering if I can still shade in islands somehow?


texts:
I develop HTML pages by using OpenLayers, which points to a local GeoServer WMS service. On displaying a layer, it stops at its available max zoom level, but it is still too small to manipulate (a polygon of 10 meter square). Is there a way to increase the zoom level? Where should I do the workaround -- on the OpenLayers or the layer setting in GeoServer?
This is my OpenLayers code:

    var xwms = new OpenLayers.Layer.WMS( "Central Java",
    "http://localhost:8080/geoserver/myneighborhood/wms/",
    {
        layers: 'basemap',
        styles: 'tlx_map_land',
        bgcolor: '0xBED0DE'
    } );
    var map = new OpenLayers.Map({
       div: "map",
       layers: [xwms],
       controls: [
           new OpenLayers.Control.Navigation({
               dragPanOptions: {
                   enableKinetic: true
               }
           }),
           new OpenLayers.Control.PanZoom(),
           new OpenLayers.Control.Attribution()
       ],
       center: [110.248191,-7.477177],
       zoom: 13
    });

         ============================ solved ===============================

Finally, I decided to utilise Klokantech's tool to generate custom bounding box(es), set it into both layer publishing in GeoServer and OpenLayers map options. To everyone who participate, thanks for your time and attention.


texts: How to publish the layer from MongoDB store in GeoServer?

texts:
I am using GeoServer 2.5, MongoDB 2.4 Windows 7 64 bit

I am imported JSON data file into MongoDB using the below query.

mongoimport --db GeoMongodb --collection states  --file E:/states.json --jsonArray

This query successfully created states table into MongoDB database.

I am created MongoDB store in GeoServer. The store also created but inserted MongoDB spatial table not showing in MongoDB store as layer in GeoServer.
(Getting MongoDB working with GeoServer 2)
I referred to this link for creating MongoDB store, so I checked GeoServer log, and it is showing like this error:

  2014-04-17 14:22:32,723 ERROR [data.mongodb] - getLayers error;
  command failed [mapreduce]: { "serverUsed" :
  "localhost/127.0.0.1:27017" , "errmsg" : "exception: ReferenceError:
  mapfields_recursive is not defined near 'ction() { mapfields_recursive
  (\"\", this);' " , "code" : 16722 , "ok" : 0.0}

Can you please give me the steps for publishing layer from MongoDB store like postgres database?


texts: GPS Altitude uncertainty and postional uncertainty in Lat/Long

texts:
I'm working on flight sensors for a project and I'm supposed to model GPS device noise. I looked a lot for it online and could not get a convincing answer.

I need the uncertainties of altitude and Lat/Long measurements from an aviation grade GPS device such as a GARMIN GTN 750. By uncertainty I mean + or - certain metres for altitude and + or - certain degrees for Lat/Long.

I found just one web page mentioning the vertical uncertainty as 10m but again there was no reference attached to it and nothing for Lat/Long.


texts:
I’m creating an application using OpenGeo Suite SDK and I need to create a two level layer manager. I can create the first layer tree with the "gxp_layermanager" using the following code in the suite-sdk:

{
    ptype: "gxp_layermanager",
    groups: {
        "default": "Capas",
        "MGN":{
            title:"Marco Geoestadístico Nacional"
            },
        "TelCom":{
            title:"Vías de comunicación"
            },
        "background": {
            title: "Mapa base",
            exclusive: true
        }
    },
    outputConfig: {
        id: "tree",
        border: true,
        tbar: []
        },
    outputTarget: "westpanel"
},

That will put the layers in groups but what I need is to create subgroups or children nodes, pretty much like the left panel here.


texts: How to call correctly QgsMapRendererJob in pyqgis3

texts:
I'm trying to modify ma pyQgis2 code to run in pyqgis3.
That is custom application, that shows canvas with appropriate layers and settings and I can't refresh canvas with pyqgis3.

pyqgis2 code that did the work:

ms=canvas.mapSettings()
render = QgsMapRenderer()
canvas.refresh()
canvas.zoomScale(10000)
canvas.refresh()
canvas.show()

pyqgis3 I tried:

ms=canvas.mapSettings()
render = canvas.refreshAllLayers()
canvas.refresh()
canvas.zoomScale(10000)
canvas.refresh()
canvas.show()

I get empty canvas window instead of rendered map window. And python freezes.


texts: Points that fall outside a polygon in QGIS

texts: I need to figure out how many points, and which ones (with labels) fall outside the boundary of a particular polygon in QGIS.


texts:
Recently, I developed a feature to save and fetch points(lat and lon) from DB. It is working fine on my local, but on production database it is giving error:

PG::UndefinedFunction: ERROR:  operator does not exist: point = unknown
LINE 1: ...s"."name" = '九龍灣' AND "region_points"."lonlat" = 'POINT(1...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT COUNT(*) FROM "region_points"  WHERE "region_points"."name" = '九龍灣' AND "region_points"."lonlat" = 'POINT(114.20910358428955 22.321574434895677)'

I digged into psql and found that there is difference in type for the columns.
On production:

production=> \d region_points
                                     Table "public.region_points"
   Column   |            Type             |                         Modifiers
------------+-----------------------------+------------------------------------------------------------
 id         | integer                     | not null default nextval('region_points_id_seq'::regclass)
 name       | character varying(255)      |
 created_at | timestamp without time zone |
 updated_at | timestamp without time zone |
 lonlat     | point                       |
Indexes:
    "region_points_pkey" PRIMARY KEY, btree (id)
    "index_region_points_on_lonlat" gist (lonlat)

Whereas, type of lonlat on my local machine is: geography(Point,4326)

development=# \d region_points;
                                     Table "public.region_points"
   Column   |            Type             |                         Modifiers
------------+-----------------------------+------------------------------------------------------------
 id         | integer                     | not null default nextval('region_points_id_seq'::regclass)
 name       | character varying(255)      |
 created_at | timestamp without time zone |
 updated_at | timestamp without time zone |
 lonlat     | geography(Point,4326)       |
Indexes:
    "region_points_pkey" PRIMARY KEY, btree (id)
    "index_region_points_on_lonlat" gist (lonlat)

My questions are:

Is type wrong on my local or on production DB?
How can I fix this?
What is the difference between point and geography(Point,4326)?

I checked postgis_full_version on local and production DB's. Here are the outputs:

Production:

POSTGIS="2.1.4 r12966" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" LIBJSON="UNKNOWN" (core procs from "2.1.5 r13152" need upgrade) RASTER (raster procs from "2.1.5 r13152" need upgrade)

Development(local):

POSTGIS="2.1.5 r13152" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER

Is the error because of different versions?


texts: Overwriting Data for CADRG raster using ArcMap

texts:
I read this ArcGIS Resources about Overwriting Data for CADRG raster and try to understand, http://resources.arcgis.com/en/help/main/10.2/index.html#//000n0000005q000000#:~:text=When%20you%20add%20military%20products%20such%20as%20CADRG%2FECRG%2C,it%20has%20been%20added%20to%20a%20mosaic%20dataset.
It is mentioned that:

For CADRG/ECRG and CIB data, the NITF file date/time value is used for
the comparison

Could you confirm which field of data NITF file date/time refers to when it is comparing which data is newer?
Is it ImageDateTime or FileDateTime or something else?


texts: How to get a report of the unjoinable records from a table when joining attributes by field value in QGIS?

texts:
I am working on a "Join attributes by field value" processing, but I would like to get the "unjoined" records from the table, not those from the vector layer, and if it's possible, to get a report in html as we can get from the vector layer using Grass tools. Is there any expression that we can set or a python code to do so?. Notice that my Python and SQL knowledge is basic.
Thank you.


texts: Issue converting CSV files to point shapefiles using pyqgis - QGIS 3

texts:
I have hit a snag using pyqgis in QGIS 3. I want to convert a set of CSVs (20 total) into point shapefiles but I am struggling with just the single CSV case. My code is based on this blogpost (https://www.geodose.com/2018/07/python-qgis-tutorial-adding-csv-data.html). I keep getting the same error but the "reason" section of the error message is always empty.

My code:

This is the full code, I have not imported any additional packages.

path = "C:/Users/.../Weather/CSVs/precip_1992.csv"
uri = path + "?encoding=%s&delimiter=%s&xField=%s&yField=%s&crs=%s" % ("UTF-8",",", "longitude", "latitude","epsg:4326")
vlayer = QgsVectorLayer(uri,'Points', 'delimitedtext')
print(vlayer.isValid())

iface.addVectorLayer(uri,'Points','delimitedtext')

The error message in the "messages" log:

    2019-03-13T15:23:27     CRITICAL    Layer is not valid : The layer
    C:/Users/.../CSVs/precip_1992.csv?encoding=UTF-8&delimiter=,&xField=longitude&yField=latitude&crs=epsg:4326 is not a valid
 layer and can not be added to the map. Reason:

The error message in the "delimited" log:

    2019-03-13T15:27:59     WARNING
File cannot be opened or delimiter parameters are not valid

Sample of my csv file:

longitude,latitude,year,sum_precip,avg_precip
-179.75,71.25,1992,150.3,12.525001
-179.75,68.75,1992,189.5,15.791667
-179.75,68.25,1992,226.7,18.891666
-179.75,67.75,1992,287.10001,23.925001


texts: Limiting number of decimal digits in ArcGIS to have exported file in CAD with same format?

texts: I am supposed to have some numeric values in ArcGIS 10.2 for Desktop with 3 decimals Digits and then convert them to Microstation or AutoCAD. I did this Setting using field calculator and 'round' function in ArcGIS but when I convert it to CAD again it would come with more than 10 decimals which is not desired.


texts: Using QField with Multi-User Access also Offline?

texts:
I got 10-20 QGIS-Users which edit all one Project online and offline. Sometimes they do it at the same time. Until now we only used QGisDesktop with a PostGis Database stored in QGIS Cloud(50MB Version).

Now we want to introduce QFieldApp. I already tried collecting data and it was great. We could see the added data within seconds on our laptop and Smartphones.
But it worked only online!

So my Question is: Is it anyhow possible to collect data offline with a postgis database in QField? (Also with manaually synchronization)

I know the QField Team is working on this.
"Connection based on-/offline synchronization"
http://www.qfield.org/docs/development/index.html

Does someone know how long it will take till this service is published ?

The second Part of my Question is:
Is it possible to move a Database from QGisCloud to an other cloudservice like for example OneDrive?
How do you do that?

I have read this post: Can the QField Android App integrate with Dropbox (in order to open & edit/view a desktop Project)?

But it is not clear to me how to move or how to create a database on this Server.


texts:
I have about one million small geotiff files of a same region at different time. This should be a small amount of data, comparing to many other GIS applications. However, storing them as separate files makes accessing the directory extremely slow.

What is the good practice to manage this kind of raster images?

Is it a good choice to import them into database, or convert them into another format?

The file name contains the time when the image is captured.


texts:
I created domain range and added into my field.
The range was 0-100, nevertheless I could fill 359 into the field.

Do you have any idea where is a problem?  I am working with ArcGIS 10.4 for Desktop.


texts: Remove 'switch selection' pop-up from Select Features tool?

texts:
I'm using the 'select features' (clicking with the select features by rectangle option) tool in ArcGIS 10, and when multiple features are present, instead of selecting them all, one feature is selected, and this little toolbar/icon/drop-down menu thing shows up (looks like a 'switch selection' icon) and lists the other items that should have been selected. I'm sure there are plenty of instances where this would be useful, but almost exclusively, I find it unhelpful at best.

Is there a way to turn this off? (Or a name for the menu/tool object to better search for a solution? I looked at the selection options and general options and found nothing. The ArcGIS help on the select tool doesn't make any reference to it, and I don't know what it's called to find any reference to it.


texts: Why is local hosting of ArcGIS Online webmap giving error?

texts:
I have been trying to locally host this webmap I created using AGOL (to modify it):

http://dpwh.maps.arcgis.com/apps/MapTour/index.html?appid=7bd06d8330254b2688577d82f81bb92e

It uses the Map Tour template. I did step 1 of the readme file, and since I already had built the application inAGOL, skipped to step 5 and configured  configOptions to use the appid, such as it now looks like this

configOptions = {
                // Enter either a web map ID or a web application ID
                // - Using a Map Tour application ID created through the interactive builder in ArcGIS.com allow to reuse
                //   the settings like the header configuration without having to edit any configuration here
                // - Web map and application can be dynamically specified through url parameters (webmap and appid)
                //   if the authorizedOwners property is specified (see below)
                // - If an application id is specified, the webmap configuration isn't used
                webmap: "",
                appid: "7bd06d8330254b2688577d82f81bb92e",
                // Optional list of authorized application or web map owners
                // Has to be specified when using appid or webmap url parameters (e.g. ["user1"], ["user1", "user2"])
                authorizedOwners: [""],
                // Select the application layout between "three-panel" and "integrated"
                layout: "three-panel",
                // The application header title, if no title is specified, the webmap's title is used
                title: "",
                // The application header subtitle, if not specified the ArcGIS.com web map's summary is used
                subtitle: "",
                // Optionally force a web map layer to be used as the tour points data source (can be overridden through URL)
                // Otherwise the upper visible point layer is used (excluding map notes)
                sourceLayerTitle: "",
                // Use the first data record as an introduction instead of a point (can be overridden through URL)
                firstRecordAsIntro: true,
                // Optional zoom level to be applied for the story points following introduction (can be overridden through URL) (e.g: 0 to 16 for Gray Canvas, 0 to 19 for Street Map, -1 to disable)
                zoomLevel: -1
            };

Loading the local version however only produces a "Fatal error: Failed to get portal configuration" error. This is the case even if I only use the webmap id, or just load the page unmodified.

Help please to make this work?


texts: Save/ import style of chart symbology in ArcMap?

texts:
I am trying to save a style for a chart symbology. I can save it as .lyr file but I can't import the .lyr file into the chart symbology after: it says "this symbology option is not supported for importing". I can't import the symbology from another layer also, the list of layers shows up empty. Another option is the import dialogue via an ArcView 3 legend file (avl), I can't try this option since I don't have avl files.

I don't have tons of shapefiles so I will not try with scripting, just wondered if there is any simple solution I am missing out on? Next problem is I can't change labeling of the symbology, I was going to solve this in the end by converting the legend to graphics.


texts: QGIS simplify geometries shifts polygons north

texts:
I'm trying to simplify polygons in a shapefile using the "Simplify Geometries" tool in QGIS 2.10 (Pisa). This works as expected, except for one strange effect: the resulting features (shown in green) are slightly shifted to the north:

How can I avoid this?


texts: Nested Conditional Staement with QGIS Raster Calculator

texts:
I like to evaluate the following expression in the QGIS Raster Calculator:
IF
ELSEIF(A = 1, 1, ELSEIF((B = 1 OR B = 2), 3, ELSEIF((C = 1 OR C = 2), 4, ELSEIF(D = 1, 5, DEM))))

I tried the following expression in the Raster Calculator Console:
("A"=1)*1 + ("B" = 1)*3 +("B" = 2)*3 + ("C" = 1)*4 + ("C" = 2)*4 + ("D" = 1)*5 + "DEM"

The idea is to get values from 1 - 5 if some of the first conditional statements are fullfilled when evaluating for the rasters that are not the Digital Elevation Model, if any of those conditions are not fullfilled then it should get the value of the Digital Elevation Model. However when I run the calculation I get weird results that seems to be the sum of values in the Digital Elevation Model and some of the rasters.
What is the logic when using the raster calculator in QGIS to perform nested conditional map algebra?


texts: I'm working on my first web application using the JS API and am looking to add a simple tabbed pop-up window that can be called on the load of the page that can display map instructions and a general data disclaimer.  For the life of me I can't figure this out.  Any help would be greatly appreciated.


texts: Uncaught TypeError during proj4 transformation

texts:
I get:
Uncaught TypeError: Cannot read property 'x' of undefined at proj4js-combined.js:2720

While executing this code (transforming polygon from one system to another):

Proj4js.defs['EPSG:3765'] = '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';

var source = new Proj4js.Proj('EPSG:3765');
var wgs84 = new Proj4js.Proj('EPSG:4326');

var polygon = Proj4js.transform(source, wgs84, features[0].geometry.Polygon);

gmlLayer.addFeatures(polygon);
map.addLayer(gmlLayer);


texts: WorldClim bioclimatic data extraction in R: NAs obtained

texts:
I've been trying to extract bioclimatic variables from WorldClim based on a lat-long data frame. I've successfully obtained the RasterStack but when trying to extract the variables from a subset of coordinates ('coords' object in the code), I obtained a lot (but not all) of NAs. Does anyone know what could be the problem?

Here is my code:

library(raster)
library(sp)
r <- getData("worldclim",var="bio",res=2.5)
r <- r[[c(1,4, 10, 11, 12, 15, 16, 17)]]
names(r) <- c("Temp", "Temp_seasonality", "Temp_warmest_q","Temp_coldest_q","Prec", "Prec_seasonality", "Prec_wettest_q", "Prec_driest_q")

coords looks like:

          [,1]     [,2]
  [1,]  14.650   40.350
  [2,]  13.600   39.350
  [3,]   0.033  -78.717
  [4,]  37.017   -2.383
  [5,]  46.837 -113.966

dim(coords)
[1] 421   2

points <- SpatialPoints(coords, proj4string = r@crs)
values <- extract(r,points)

values df has a lot of rows with NAs, although some of them do have the bioclimatic variables.


texts: Error exporting attribute table in ArcMap to Excel

texts:
I try to export an attribute (and dbf) table from ArcMap10 to txt file, but the program gives "An error occurred exporting the table"

I checked all others types of exporting - all give the same, except only dbf (so I can export attribute table only in dbf format).
What I did wrong?

My main goal now – find how to export the attribute table to Excel. Now I can’t do it. Also I can’t copy my table from ArcMap and put it to Excel (I read this way as an advice), I don’t know the reason, but it doesn’t work. Maybe this problem relates with this error that gives ArcMap? Could you help me, why ArcMap doesn't export attribute and dbf table to others format, except dbf format?


texts:
I have two vector layers.

Roads Line  layer
Roads Point layer

I want somehow to get the average value of the distance between each  roads and get average value for my region. Each road has its own ID. Is it possible to get it automatically, vector or raster results?
I use QGIS and ArcGIS, any solution will be OK.

This is manually connected.


texts: Do I always have to project my layers for print maps?

texts:
Is it recommended to always project layers before printing a map?

I use QGIS and if I create a Print Layout often the map appears to be visually fine even if the Project Projection System is a Geographic one (e.g. WGS84).

Is this data automatically projected in GIS software before print or do I have a distorted map in the end?


texts: Where can I find daily minimum / maximum temperature for Africa, possibly in a raster format?


texts: Finding routes from set of points using PostGIS?

texts:
I have lines table (postgis enabled database) representing the streets.

I have collected few gps points along a route and I would like to match it with the streets in order.

Scenario - I am jogging along street A followed by street B, street C. Let's say I have 3 gps points collected when I am in running along each of those streets - total 9 points.
My desired output is a list - [street A,street B,street C]
What I have done so far

  Get street name given a gps point. This is
  based on closest distance from the point to any street in the
  vicinity. As expected when there are overlapping streets, the results
  gets skewed.

What I think can work

  Take pair of points and find the street(line)
  making smallest angle with line connecting the pair of points. If this is a good approach, what should I expect when I make transition from one street to another (like points (3,4) or (6,7) in the scenario)? They might make a smaller angle with another street close by.

Is there a better way to achieve this or can you make my approach more robust?


texts: SVG symbols for alphabet characters e.g. A, B, C, ... etc

texts:
Can anyone tell me whether there is a SVG plugin or source (or how to do) of letters of the alphabet e.g. A, B, C, D etc.

I want to create a symbology with colour e.g. gray but also with letters in the fill pattern e.g. SI to denote "Semi-improved" grassland. Ideally trying to create JNCC phase 1 habitat symbols.

Thanks
Will


texts: Impeding PyQGIS saving changes to file on disk immediately

texts:
I am using QGIS 3.10.2-A Coruña and its Python Console. Currently I am modifying features and attributes of a shape file, e.g. dropping features:

caps = layer.dataProvider().capabilities()
if caps & QgsVectorDataProvider.DeleteFeatures:
    res = layer.dataProvider().deleteFeatures(selId)

where selId are the features to be dropped.

I noticed that when I do such operations changes are immediately saved to the file that is stored on my hard disk, which sort of eliminates the advantage of using a script in the first place.

What do I need to do to get around changes being saved automatically? I read about "editing buffers" in the QGIS Developer Cookbook but I am unsure whether that's what I need.

EDIT:

Just noticed that the layer is only saved on the hard disk (overwrites the current file) if executing the code results in actual changes in the layer. Running the code below for a second time doesn't delete any additional features bc selId doesn't change and the layer is NOT saved again. The same applies to the code proposed in the answer below. It seems like the automatic saving isn't triggered by the code itself but maybe rather by some general preference setting according which any changes to a layer are automatically saved to the hard disk? Does sth like that exist?


texts:
This question is similar to the "points in polygon" analysis, but I want to keep the attribute data for multiple lines within a single polygon. The data source is multiple line segments representing weather data, and I want to add the attributes of each line inside a geographic region (country shapefile). For example, the resulting polygon might have 10 rows for "India" and each row represents a unique set of weather data. Each row is the actual data from a line shapefile that falls within the "India" geography.

I've tried spatial join (and several other options), but this summarizes the datasets by polygon and does not preserve original attributes (unless I am missing something).


texts: Any possibility to have local tiles of OSM an display them with Sharpmap

texts:
I'm using Sharpmap to develop my Windows application. I am able to show OSM using Brutile provider of OSM default server.

This is a Tile Layer of Sharpmap.

new SharpMap.Layers.TileAsyncLayer(new BruTile.Web.OsmTileSource(), "OSM")

But what I want is to use something similar with local OSM Tiles. I know I can create Tiles with gdal2tiles for example, or maybe there is some online resources where I can download OSM tiles for offline use.

Any tips of how I can achieve this?
Anyone knows if Brutile has any implementation to this? I mean to obtain the Tiles from a filepath.


texts: How to work with 16 GB orthophoto raster

texts:
I would like to use one GeoTIFF raster in a custom ArcGIS-Engine Application, but my provider gave me 4 orthophotos GeoTIFF 4 GB each, because GeoTIFF is limited to 4 GB.

Is there any other way to mosaic these images in a format (lossless and well supported), for example, as in file geodatabase or Postgres SDE database (using Arcgis tools or open source tools both are welcomed) ?


texts:
I'm writing a program that needs to generate GEOID values from 2000 and 2010 Census data, to link the census data to TIGER/Line records. I'm starting with the state, county, region block, etc, values in the census GEO files, and need to create GEOIDs.

I need to work with all of the summary levels, and since the structure of the GEOID value seems to vary depending on the type of geography, it would be really nice to have a spec for constructing it.

I found this document, but it only specifies the GEOID structure for the redistricting files:

http://www.census.gov/rdo/pdf/0GEOID_Construction_for_Matching.pdf

I'd like to get the same thing, but for all summary levels.

I've considered downloading all of the tiger files and extracting the GEOID10 values and reverse engineering them from the records attached to the shape files, but the programming would cost more than just paying someone to do it manually by inspecting the files or the documentation ( http://www.census.gov/geo/www/tiger/tgrshp2010/TGRSHP10SF1.pdf )

Any other ideas how to most easily generate GEOID from census GEO files, for all records and summary levels?

Alternately, can the 0GEOID_Construction_for_Matching.pdf file, which is written for the redistricting files, be used as a spec for the 2010 SF1 summary levels and the GEOIDs of the corresponding TIGER files?

Thanks!


texts: decimals and commas in QGIS - how to display in Qt designer form

texts:
I use Qt designer, create a new form, add several line edit (qLineEdit) widgets, rename them the same as the fields in a QGIS attribute table, and save. In QGIS I associate the new .ui file in Layer Properties -> Fields, Under the Attribute editor layout dropdown I select, "Provide ui-file" and point to the file just created. Everything works fine, the .ui form displays correctly when a feature is selected.

I need better control over number formatting in the Qt .ui form display. For example:

One field is a double, Real length 18, precision 11 that I need rounded to two decimals with a decimal point.
Other fields are qlonglong, Integer64, length 10, precision 0 that I need displayed with commas (only if needed) as 1000 separators.
One field I'd like to divide by 1000, round to the nearest integer and display with a "k" trailing in the output. (O.K. that may be pressing it...)

Are these "Number formatting operations" done only by adding new columns to the attribute table and then sending the data over to Qt in the exact desired format or does Qt have the capability of formatting numbers, prior to display?

Sorry, no C or C++ background but plenty of Excel & VBA. Strikes me that Qt is somewhat like a form generator/report writer (and if so it should have all the formatting capability you would need? Documentation on Qt designer is pretty harsh on the "uninitiated".

With a report writer you would never tamper with the underlying database structure. So, it seems pretty non intuitive creating new columns... However if that's the best way to do it (using the expression builder functions) I can go that route and get the job done.

Ideas? qLineEdit inputMask may be a way to go but it seems to force the output of commas even when the number is small.


texts: Exporting 16 bit single-band to 8 bit in SAGA/QGIS

texts:
Everytime with every function (e.g convert data storage type or gdal-translat -ot Byte) the output is a completely white map with a black border. only  the "save as" export works, but the TIFF also has 3 bands and the data is much bigger..this isnt my intention

Has anybody an idea?


texts: More pythonic approach to resolution increase of point locations

texts:
Excuse my first question being slightly more Numpy and less actual GIS, but it relates to latitude / longitude so I thought I'd give it a shot.

Problem: I have a flat file with latitude and longitude and I'm asked to increase the resolution of these individual points.

Currently I'm given a flat file with latitude/longitude and I'm asked to change the 0.001 resolution (~100m resolution) point grid and create 8 more points turning it into .00025 res (~30m resolution) grid. Example of the XX.XXX reoslution points below:

HUC4,Longitude,Latitude
1204,-95.956,30.05
1204,-95.955,30.048

Now I believe this is the basis of pretty much all interpolation on rasters and such, as well as slope and other cell calculations. I have created the very un-pythonic solution for myself:

#Input
csvinput = open(file, 'r')
reader = csv.DictReader(csvinput, delimiter=',')
#Output
dst_file = open("out.csv",'wt')
dst_file.write( "longitude,latitude,huc4\n" )
lformat = '%.5f,%.5f,%5s'

for row in reader:
    huc4 = row['HUC4']
    # Longitude Value
    x = float(row["Longitude"])
    xup = x + newres
    xdwn = x - newres
    # Latitude values
    y = float(row["Latitude"])
    yup = y + newres
    ydwn = y - newres
'''
###################################################
# Make sure we create the new matrix properly
###################################################
###################################################
xup  ,ydwn | xup, y  | xup , yup
x    ,ydwn |  x,  y  | x   , yup
xdwn ,ydwn | xdwn,y  | xdwn, yup
###################################################
###################################################
'''
    line = (lformat % (float(x),float(y), str(huc4))) + '\n'
    dst_file.write( line )
    # X Upper Axis
    line = (lformat % (float(xup),float(y), str(huc4))) + '\n'
    dst_file.write( line )
    line = (lformat % (float(xup),float(ydwn), str(huc4))) + '\n'
    dst_file.write( line )
    line = (lformat % (float(xup),float(yup), str(huc4))) + '\n'
    dst_file.write( line )
    # X Middle Axis
    line = (lformat % (float(x),float(yup), str(huc4))) + '\n'
    dst_file.write( line )
    line = (lformat % (float(x),float(ydwn), str(huc4))) + '\n'
    dst_file.write( line )
    # X Lower Axis
    line = (lformat % (float(xdwn),float(ydwn), str(huc4))) + '\n'
    dst_file.write( line )
    line = (lformat % (float(xdwn),float(y), str(huc4))) + '\n'
    dst_file.write( line )
    line = (lformat % (float(xdwn),float(yup), str(huc4))) + '\n'
    dst_file.write( line )

Now I am very new to python and I know that there are many ways to enhance this as well as storage, but for my purpose, my colleagues see flat files as easiest right now (though I have been messing with Postgres). Any tips on that end would not fall on deaf ears, but my main concern is the creation of the new points.

Can anyone expand on the type of numpy array algorithm you would use?

Can I just create a master array for x and a master array for y and then combine the two together (sorta like a pandas dataframe?):

longarray = [xup, x, xdwn, xup, x, xdwn, xup, x, xdwn]
latarray = [ydwn, ydwn, ydwn, y, y, y, yup, yup, yup]


texts: OGR SetAttributeFilter does not let datasource to update

texts:
I am trying to update an attribute value for a certain feature in a shapefile. To filter out that feature, I use SetAttributeFilter. This returns the feature I want, and SetFeature also works as expected, but after running the code below shapefile is not updated.

My question is: how does SetAttributeFilter prevent shapefile from being updated with regular SetField -> SetFeature method.

After commenting out a line with SetAttributeFilter, shapefile gets updated (although the value is updated just for a first (layer[0]) feature).

from osgeo import ogr
shapefile = r"target_file.shp"
dataSource = ogr.Open(shapefile, 1)
layer = dataSource[0]

# This line is the source of the problem
layer.SetAttributeFilter("attr_a = 'a_value'")

feature = layer[0]
feature.SetField("attr_b", 999999)
layer.SetFeature(feature)
del dataSource


texts: How to add a Google map layer in a pyqgis script

texts:
I'm creating a python plugin for different users that has the layers that each person need to use and work with in QGIS.

I have no trouble adding rasters from Geoserver using the following code:

        wmsTicketDSM= QgsRasterLayer('contextualWMSLegend=0&crs=EPSG:27700&dpiMode=7&featureCount=10&format=image/png&layers=Ticket_DSM&password=XXXXXXXXXXXX&styles=&url=http://62.12.41.211:8080/geoserver/exchange_maps/wms&username=admin', 'Ticket_DSM', 'wms')
        if not wmsTicketDSM.isValid():
            print "Layer wmsTicketDSM failed to load!"
        else:
            print "Raster Layer wmsTicketDSM loaded!"
        QgsMapLayerRegistry.instance().addMapLayer(wmsTicketDSM,False)

Now I need to add basemaps. How to add a Google Satellite map on python?


texts:
How to download GPM rainfall data automatically?

I tried to use DownloadGPM.R Function, but I think I had problem with Axel download accelerator. I guess I need to declare Axel as environment variable (using Windows 7), is that right? Does somebody used this or something similar?


texts: Rpy2: how do I use the function 'as' (r library methods) in python?

texts:
I want to coerce an object of class Raster Layer to class SpatialPixelsDataFrame since that is required as input for the function autoKrige from the r library automap.
However, when I try to use as from the r library methods, I get the following error:

Encountered "as" at line 307, column 25. Was expecting one of ...

Where line 307 is:

layerGrid = methods.as(layerRaster, "SpatialPixels")

I'm assuming that the word as has already has a meaning in python. The question is, however, how do I use the function as. Is it possibly replaced by rpy2 with a different name?


texts:
In ArcGIS modelbuilder I want to check if a shapefiles exists, if not I want to create the shapefile in that folder. I guess the calculate value tool within ArcGIS modelbuilder can be used, but I need some python scripting to do the work.

Any idea or python script examples?


texts: Creating index layer for multiple maps in ArcGIS Desktop?

texts:
I am trying to create an index layer of just the area within the Orange lines. I am having difficulty creating this layer due to it not being a simple box area.

The goal is to create a index layer, with grids, so that the Data Driven Pages would be used to generate it as a mapbook for the response area for my firehouse.

Below is an image of what I am speaking about.

Any ideas?

I am using ArcGIS Desktop.


texts:
I would like to get suggestions/autocomplete as I am typing methods and functions in VS Code for arcpy. Currently, IntelliSense would suggest only functions or methods that I have been using within the file, but would not some that I haven't.

I am using Python and Kite extensions. I have also cloned the Python environment in Pro and I am using that as a Python environment in VS Code.

I have tried to play a little bit with editor.quickSuggestions but haven't really done much.


texts: jquery range slider to filter geoserver layer attribute

texts:
i would like to apply with jquery range slider a filter to an attribute of a geoserver layer.
I prepared the code for the shape topp:state, attribute PERSONS.
How is it possible filter the PERSONS attribute and visualize only the state selected in the range of the jquery range slider?

here the code for the slider, it needs to add the filter to geoserver:

  $(function() {
    $( "#slider-range" ).slider({
      range: true,
      min: 0,
      max: 1000000.0,
      values: [ 0, 1000000.0 ],
      slide: function( event, ui ) {
        $( "#amount" ).val( "PERSONS" + ui.values[ 0 ] + " - PERSONS" + ui.values[ 1 ] );
      }
    });
    $( "#amount" ).val( "PERSONS" + $( "#slider-range" ).slider( "values", 0 ) +
      " - PERSONS" + $( "#slider-range" ).slider( "values", 1 ) );
  });

NEEDS add


texts:
In QGIS, Can we render a layer's label as HTML to be able to style label partially?
For example, a feature's label including two attribute, an attribute will render bold while the other one will render italic.

Maybe something like;
bold("an_attr") || italic("another_attr")


texts: Python - Find the largest extent in a list of extents (tuple format)

texts:
I am trying to find a way (simplest is the best) to retrieve the largest extent in a list of  tuple extents in python.

The list is looking like that:

extents = [(-180.0, -90.0, 180.0, 83.624), (-124.731, 24.956, -66.97, 49.372), (-122.42, -
37.818, 151.207, 52.516)]

Could it be a good idea to sum the absolute value of each coordinates and retrieve the highest?

Or does a geographic library such OGR could be used?

Edit:

I have created Envelope objects with GDAL library:

envelopes = [Envelope(extent) for extent in extents]

Now I have to compare the area of each? Any suggestion?

Can anybody give explanation on this?
Thanks a lot.


texts: How to reuse a layout in the QGIS print composer layout on different pages?

texts:
I've got a map template that I've created in the QGIS print composer on page 1. It includes various objects like text boxes, images (north arrow), scalebar and legend. I want to use the same template on page 2, 3 and so on.  I've tried to select all the map objects, then copy and past them on to another page.  However all objects paste at the position of the cursor, meaning I then have to place them in their proper locations manually, so that is no good.

How can I easily replicate the map design on subsequent pages?


texts:
Having looked at many duplicates I still can't seem to get a concensus especially with regards to using QGIS.
I've read Creating duplicate features - many to one - in qgis and several others.

My data format is:

A) Point Shapefile Layer
 B) Polygon Shapefile Layer

I want to:

Grab all the "non-geometry" attributes of the point data, and merge them with the "geometry" of the polygon parcels it falls within.

Using MMQGIS, Layer->Join Attributes by Location, Spatial Query, etc all yield the same results. I can only get the "first matched" feature.

What I want is for the polygon to have an array where the addresses are shown within it. I have somewhat achieved this using POSTGIS but am suprised that there is no solution in QGIS.

Am I correct?


texts: Hatching on filtered region of raster layer

texts:
I've created RasterSymbolizer-based styles (colour ramps )for a bunch of trend maps layers (from NetCDFs) in GeoServer, and I serve them over WMS. I also have matching p-value raster layers, and I'd like to fill the parts of those layers with a hatching pattern, rather than a solid fill (because I want to overlay the statistical significance on the trend layer as a layer group).

I understand that hatching fill is not available with the
RasterSymbolizer, but it is doable with a PolygonSymbolizer. According to
the YSLD reference
http://docs.geoserver.org/stable/en/user/styling/ysld/reference/symbolizers/index.html;,
the latter can actually be applied to a raster. Sure enough, when I create
a PolygonSymbolizer style and preview the p-value, I get a big, green
square the size of the map.

But if I try to add a Filter, things stop working. The style validates, btu the Layer Preview no longer works properly. Here's what I'm trying:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd";
  xmlns="http://www.opengis.net/sld"; xmlns:ogc="http://www.opengis.net/ogc";
  xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">;

  <NamedLayer>
    <Name>Statistically significant trend (p lt 0.05)</Name>
    <UserStyle>
      <Title>Statistically significant trend (p lt 0.05)</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>Stat. sig. (p &lt; 0.05)</Name>
          <ogc:Filter>
            <ogc:PropertyIsLessThanOrEqualTo>
              <ogc:PropertyName>quantity</ogc:PropertyName>
              <ogc:Literal>0.05</ogc:Literal>
            </ogc:PropertyIsLessThanOrEqualTo>
          </ogc:Filter>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#D3FFD3</CssParameter>
              <CssParameter name="fill-opacity">0.5</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#6DB26D</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

One problem could be the PropertyName value: I'm not sure whether to just
use 'quantity', or the band name (which is 'pvalue' for all of the layers I
want to use this style with) or the layer name (which varies). None of these work. Or maybe the Filter is incompatible with raster layers (even when they're using PolygonSymbolizer)? I'm not sure.

If someone can help me with this (or an alternate way to get hatch fills over parts of a raster layer), that'd be fantastic :)


texts: Visualise in a map featured from a related table in ArcGIS

texts:
I have an attribute table of a shapefile with some related attributes tables linked to the original table. I would like to show in the map through Symbology > Categories > Unique values one of the column from one of the related tables.

The column isn't visible in the Symbology "value field". I can only see the ones from the original table.

How can I make the related column appear ?


texts:
I have vector data:

And would like to iterate over the attribute table returning only two field values. Isn't there a way to limit the values returned by getFeatures so all attributes does not have to be read? This work but seems convoluted:

layer = iface.activeLayer()
fields_to_return = ['KKOD','KATEGORI']
for feat in layer.getFeatures():
    print([feat[f] for f in fields_to_return])

[414, 'Kommun']
[414, 'Kommun']
[414, 'Kommun']
...

In ArcGIS I would do:

with arcpy.da_SearchCursor(r'C:\data.gdb\ak_riks',fields_to_return) as cursor:
    for row in cursor:
        print(row)


texts: Reprojecting netcdf file using gdalwarp?

texts:
My netcdf file coonsists of radar rainfall data in aeqd projection (azimuthal equidistant projection). Each file consists of 5952 timestamps(7.5 minutes resolution) of rainfall values for 1kmx1km grids.

I want to reproject from aeqd to UTM33 using gdalwarp in commandline as follows.

gdalwarp -t_srs "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" -of netCDF C:/Radar/precip_aeqd-1000.201408.nc C:/Radar/RadarPrecip_UTM33proj.nc

I get error message that

  Input file C:/Radar/precip_aeqd-1000.201408.nc has no raster bands.

Why do I get this error message?

I want to get output as reprojected netcdf file with utm33 1kmx1km grids.


texts: Specifying Minimum and Maximum Word Wrap length in QGIS

texts:
I want my labels to fit nicely within polygons.

Based on this answer to Creating multiline labels in QGIS, I discovered the power of the wordwrap function in QGIS to make labels. However, I'm confused as to how I could specify a minimum AND a maximum length for wrapping: I'd like no line to be longer than say 13 characters, but I also don't want any line to only have 3 characters. Merely nesting the functions didn't work out for me

wordwrap( wordwrap( title(SITE_NAME) , -3), 13)

So I would like this label to fit someone nicely within its polygon

But if I only use the simple wordwrap it looks ridiculous.

And if I try to build an expression for wordwrap, e.g. wordwrap( title("SITE_NAME") , -3), the "output preview" shows

  'Anthony
  A. Loconte
  Memorial
  Skating
  Rink'

But the result is still the first image above.

But if I instead put wordwrap( title("SITE_NAME") , -3) in the Label With box (and make sure to disable all wordwrap functions. I get:


texts: Merging in ModelBuilder after Running Script?

texts:
I have multiple inputs running through various processes throughout my model. At the end of these processes they are all merged together and output into one final feature class. This was working fine until I decided to put a script tool at an earlier point in the model on one of my functions, essentially stopping the process if a certain value was false. The script tool works well, but now my final merged output is not performing correctly. I took the model apart in pieces and ran through to isolate the problem, and it would appear that when the script tool stops the process, even though the merge function has multiple correct inputs, it will not merge anything together.

Any ideas on how to resolve this issue or a workaround?

I'm using ArcGIS 10.


texts:
Is it possible to set center and zoom/fit bounds to country by name with ArcGIS Javascript API? I mean, with Google Maps you can do something like this: https://stackoverflow.com/a/6086437/1745228
How can we get data from ArcGIS and set extent on country?


texts: Rotate SVG marker angle based on each feature's value

texts:
I'm importing data, and creating a layer, which has a number of features, each with an f_angle attribute.

I'd like to create a data defined override to rotate the SVG marker by the angle defined by f_angle but am unsure how to do this using pyqgis in QGIS 3.

This question/answer seems to show how to do it is QGIS 2, but QgsDataDefined has been removed in QGIS 3 with the suggestion to use the QgsProperty framework instead.  However I'm struggling to find examples/documentation using that.

Can anyone tell me how to create a data defined override to rotate SVG markers based on a feature attribute in QGIS3, using pyqgis?


texts: How to go with...somewhat complex geological maps in QGIS?

texts:
Just a follow-up to this question QGIS: Line to polygon conversion. Not sure do i have to continue there itself...

We are currently digitizing a geological map...which has 36 features in total. Some of them will be polygons & some of them will be polylines. What we normally do is, we will capture all the features as polylines in Mapinfo and later we will enclose some of the features as polygons and will keep the others as polylines itself, so that we don't have to digitize the same features again and again.

I am arguing with some of colleaques...that most of the work can be done in QGIS itself.I knew very well the limitations of a OSS. But still, i find it very difficult to understand..why a basic conversion like "Line to Polygon" is not running properly..which is very much needed for our work.

I've almost tried everything. Polygonize, Line to Polygons (even thru SAGA), Convex Hull. But still, the result is not satisfactory (Pls refer the image).

Is it one of the limitations of qgis ? If so, then we have to drop the idea of using qgis for our project (which i don't want to happen). Is there any other alternative in QGIS itself ?

What we'll do in Mapinfo is...

1) Will capture all the linear features as polylines (Obvious, isn't :) )

2) Then we'll capture some other geological features as polylines as well (with different attributes). Most of the time, the linear features will overlap with the geological features. So we will make use of the previously digitized Linear features layer & merge them with this - Geology layer.  Of course, with the change in attributes.

3) Now, using the "Enclose" command in Mapinfo...all the properly snapped polylines will be converted to Polygons.

QGIS doesn't work like Mapinfo layer thing..i.e..Point + Lines + Polygons..all in one layer. So we have two options Either capture the features as polygons first & then convert it to polylines. But, it's so cumbersome & will create lot of confusion. B'coz so many linear features will be overlapping on this polygon/geology features. It'll be very difficult to delete the unwanted polylines late...once we have converted it to polylines.

Or otherwise, we have to go with mapinfo's procedure. Polyline -> Polygons..That's what we are trying to do & so far the results are unsatisfactory (as in the image)

Update:
As answered by nhopton, i tried the same "Polygonize" in 2.2 Valmiera (which was installed with all the components thru OSGEO installer) and it worked fine. I think the problem might be with python components or something.. The outcome was shown in the image.

Note: The second map in the image was done in a system wherein which QGIS 2.2 was installed as standalone sw.


texts: Why are the coordinates transformed with proj.4 off compared to http://valdemar.kms.dk/trf/?

texts:
I am trying to transform from epsg:4326 (wgs84) to epsg:25832 (utm ETRS89) using Proj.4. I am comparing the results with results from http://valdemar.kms.dk/trf/ .

it seems like the results calculated by proj.4 is off by 2m northing and 4m in easting in Copenhagen. The results farther west are more correct.

Am i missing some sort of correction attributes in my calculation?


texts: Why are start and end segment not partially skipped?

texts:
Im using TRSP routing algo. I want to skip partially start and end segment part for point to point routing. Percent along start edge 0.6, percent along end edge 0.4. Route generated but start and end segment is not partially skipped.

Please help me. My query is as below.

select * from turn_restrict_shortest_path(
    'select gid as id, source::integer, target::integer,cost_fastest as cost, reverse_cost
    from centre_line',
    17271,     -- edge_id for start
    0.6,   -- midpoint of edge
    14345,     -- edge_id of route end
    0.4,   -- midpoint of edge
    false,  -- directed graph?
    true,  -- has_reverse_cost?
    null)  -- no turn restrictions


texts:
Is it possible to use a MapBox style as a tileset? I would like to add the style as a tile layer in QGIS.

I can access tiles from my tilesets in a browser.

http://api.tiles.mapbox.com/v4/dbauszus.9ezmpldi/14/8187/5443.png?access_token={}

When I substitute the tileset map id dbauszus.9ezmpldi with my style map id dbauszus.cilusj60s00scc3lwa30nys2b I get {"message":"Tileset does not exist"}.

Is there any way to request tiles directly from a style?


texts: Speeding up pan-sharpening with OTB plugin for QGIS (orfeo-toolbox)

texts:
I use QGIS 3.6.1 with the plugin orfeo-toolbox to create a pan-sharped Landsat 8 image. I use the BundleToPerfectSensor function because calling the Pansharpening function results to the error: Inputs are not occupy the same physical space!

The problem is that execution with default parameters is extremely slow - more than 2 hours and 30 minutes (even after adding memory to the OTB plugin - 1024 mb).

How long does it take to you to create a pan-sharp Landsat 8 image using the QGIS OTB plugin?

Do you use the default settings?

My logs:

Processing algorithm…
Algorithm 'BundleToPerfectSensor' starting…
Input parameters:
{ 'inp' : 'G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/LC08_L1TP_160017_20180716_20180730_01_T1_B8.TIF',
'inxs' : 'G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/RGB.tif',
'out' : 'G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/PAN_full.tif',
'elev.dem' : '',
'elev.geoid' : '',
'elev.default' : 0,
'mode' : 'default',
'method' : 'bayes',
'method.bayes.lambda' : 0.9999,
'method.bayes.s' : 1,
'lms' : 4,
'interpolator' : 'nn',
'fv' : 0,
'outputpixeltype' : 1
}
2019-10-17 17:20:57 (INFO): No kwl metadata found in file G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/RGB.tif
2019-10-17 17:20:57 (INFO): No kwl metadata found in file G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/LC08_L1TP_160017_20180716_20180730_01_T1_B8.TIF
2019-10-17 17:20:57 (INFO): Default RAM limit for OTB is 1024 MB
2019-10-17 17:20:57 (INFO): GDAL maximum cache size is 812 MB
2019-10-17 17:20:57 (INFO): OTB will use at most 8 threads
2019-10-17 17:20:57 (INFO): Reproject XS onto Pan...
2019-10-17 17:20:57 (INFO): Elevation management: setting default height above ellipsoid to 0 meters
2019-10-17 17:20:57 (INFO): Fusion of XS and Pan...
2019-10-17 17:20:57 (INFO): Bayesian fusion algorithm
2019-10-17 17:20:57 (INFO): Estimated memory for full processing: 12196.3MB (avail.: 1024 MB), optimal image partitioning: 12 blocks
2019-10-17 17:20:57 (INFO): File G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/PAN_full.tif will be written in 13 blocks of 16361x1270 pixels

2019-10-17 17:32:17 (INFO): Estimation will be performed in 11 blocks of 16361x1501 pixels
2019-10-17 20:04:20 (INFO): Estimated memory for full processing: 10136.5MB (avail.: 1024 MB), optimal image partitioning: 10 blocks
2019-10-17 20:04:20 (INFO): Estimation will be performed in 11 blocks of 16361x1501 pixels
2019-10-17 22:37:53 (INFO): Estimated memory for full processing: 13226.1MB (avail.: 1024 MB), optimal image partitioning: 13 blocks
2019-10-17 22:37:53 (INFO): Estimation will be performed in 14 blocks of 16361x1179 pixels```
2019-10-18 01:14:02 (INFO): Estimated memory for full processing: 5149.29MB (avail.: 1024 MB), optimal image partitioning: 6 blocks
2019-10-18 01:14:02 (INFO): Estimation will be performed in 7 blocks of 16361x2358 pixels
Execution completed in 37821.38 seconds
Results:
{'out': 'G:/!DELETE/testing_pansharp/LC08_L1TP_160017_20180716_20180730_01_T1/PAN_full.tif'}
Loading resulting layers
Algorithm 'BundleToPerfectSensor' finished


texts: How do I find the slope of road segments with point elevation data of the same linear path

texts:
I'm currently working on a project to calculate road grade along roughly 30 miles of highway. I need to isolate and portray all sections of road with more than a 5 percent grade; in hopes of finding that there are at least 15 miles of road that fall into this category.

I currently have my line segment (road), which I generated random points along, and extracted elevation data from DEM to these points. Now I have a points shapefile and a line shapefile but cannot find a way to merge the two.

I expect that I will have to calculate the slope for each segment of the line, but in order to do that I need my line to have elevation data for each segment (which I was expecting could be taken from the point data)

I need to find a way to break my line up into segments between the points I generated in order to attach the proper elevation data (from the points). Maybe I am going about this the wrong way? I am running Arc 10.3 with unlimited license for the ArcToolbox, so I know I have the tools available to do this.


texts:
I'm working on a simple Python code to make a raster from a shapefile using the Natural Neighbors tool, and then use the resulting raster to generate a contour using the Contour tool. I keep getting an Attribute Error saying the module has no attribute.

The following is my code:

import arcpy

arcpy.env.overwriteOutput = True

# Variable Definitions

in_point_features = "C:\\GIS\\PythonProgramming\\Lesson3\\Lesson3_Data\\WellsSubset.shp"
z_field = "TD"
out_polyline_features = "C:\\GIS\\PythonProgramming\\Lesson3\\Lesson3_Data\\ContourOut.shp"

# Generate raster from WellsSubset shapefile using Natural Neighbor interpolation

raster = arcpy.NaturalNeighbor (in_point_features, z_field)

# Use Contour tool with 1500 as contour interval on the raster

arcpy.Contour (raster, out_polyline_features, 1500)

The following is the error message I get when I run it:
Traceback (most recent call last):
File "C:/GIS/PythonProgramming/Lesson3/Crotty_Homework3.py", line 15, in

<module>
raster = arcpy.NaturalNeighbor (in_point_features, z_field)
AttributeError: 'module' object has no attribute 'NaturalNeighbor'

Can anyone steer me in the right direction here?


texts:
I have a raster in GRASS GIS and want to export it as a ASCII file following the ESRI format. This is my code

r.out.ascii --overwrite input=XX@PERMANENT output="...\XX.asc" null_value=-9999

The file generated has the following header

north: 3458710
south: 3454500
east: 353030
west: 348740
rows: 421
cols: 429

while the ESRI one is

NCOLS xxx
NROWS xxx
XLLCORNER xxx
YLLCORNER xxx
CELLSIZE xxx
NODATA_VALUE xxx

My only solution has been to manually edit the header, but i want to export multiple files thus the manual process becomes cumbersome. Does anyone know how to automatically export a raster from GRASS as an ESRI ASCII?

Am using this grass

GRASS version: 7.6.0
GRASS SVN revision: r73958
Build date: 2019-01-17
Build platform: x86_64-w64-mingw32
GDAL: 2.4.0
PROJ.4: 5.2.0
GEOS: 3.7.0
SQLite: 3.26.0
Python: 2.7.14
wxPython: 2.8.12.1
Platform: Windows-10-10.0.16299


texts: Export Layout problem in QGIS 3.4 and Windows 10

texts:
I try to export the layout into A0 size- but all size options bigger than A3 are blocked. I working with QGIS 3.4, windows 10. In QGIS 2.18 there no problem export layout to any size. But when i work with other PC with windows 7- there no any size export problems in QGIS 3.4 & QGIS 2.18

i red this, but didn't found solution to my problem:

https://issues.qgis.org/issues/18557
QGIS window size problem
Where is the composition tab in QGIS 3.0 Composer, so I can change page size?


texts: Compute elevation and azimuth from lat, lon, and altitude

texts:
Given the latitude, longitude and altitude of two points (in my case satellite and ground antenna) I would like to compute the azimuth and elevation angle between the two points from the ground station.

My idea would be the following (doing it in matlab):

% convert the lat, lon, and altitude data into ENU

[E,N,U] = geodetic2enu(lat,lon,h,lat0,lon0,h0,wgs84);

% and then compute elevation and azimuth the following:
Az = atan2(E,N);
El = atan(U / sqrt(E^2 + N^2));

Could that be right?


texts: Exploding polygons and adding consistent space/buffer between groups using QGIS?

texts:
I have a set of shapefiles grouped by regional area in Western Australia. What I want to do for visual purposes is add a consistent amount of space between each region. What's the best way to do this?

I can add everything into one shapefile, with attributes for regions, or split each shape further down into the lowest level, if either of those helps in getting this working.

Examples below should make what I mean clearer, obviously still needs work on borders, labels, etc.

My current map:
These are current state gov region groupings. I'm not sure if they're the groupings I'll finish with, so would one shapefile and an attribute table/filter work better for on the fly changes?

Style Required:
Regions grouped and split to highlight that artificial grouping


texts:
I try to identify overlapping lines in the same layer with QGIS.
My problem is that the lines are the same shape but not the same length. Maybe you can understand it with the picture below.
These are two lines and I want something that shows me that the blue line overlaps the orange one. I have a huge network of lines and a visible solution doesn't work.
I tried topology rules with QGIS but there is no suitable rule for them. The blue line is not a duplicate of the orange one. Then I tried the Check Geometries Plugin but it doesn't work either, because the lines don't intersect.
Unfortunately, I couldn't find a similar question. So, does anyone have an idea? Maybe with a python script? I'm not good enough to write a script by myself.


texts: Getting list of shapes on border of map using ArcMap

texts:
I have the following map of a state with its precincts inside of it:

Is there any way that I can get a list of the precincts that are on the border of the state? I have been looking through the different tools that ArcMap has but I cant find anything useful.


texts: Clipping a section from google map as geotiff

texts:
I am trying to export regions of interest in google map as geotiff. I know google earth has option to save image as jpeg.

Are there any tools to obtain a part of image from google maps with its world file or as geotiff?

Is there any way to do that with python?


texts: Pre-rendering tiles fail, only once in a while

texts:
I've customized the https://github.com/Overv/openstreetmap-tile-server and broken it down into two images, a Tile-Server and a Postgis-Server. Both Tile Server and PostGIS Server are up and running in my kubernetes cluster.
Tile-Server is deployed with following config:
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
spec:
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  replicas: 1
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}
    spec:
      containers:
      - name: {{ .Release.Name }}
        image: {{ .Values.Pod.Image }}:{{ .Values.Pod.ImageTag }}
        args: ["run"]
        ports:
          - containerPort: 80
            name: "osm"
        volumeMounts:
        - mountPath: /var/lib/mod_tile
          name: osm-storage
        - mountPath: /dev/shm
          name: dshm
        resources:
          requests:
            cpu: 4
            memory: 64Gi
          limits:
            cpu: 4
            memory: 64Gi

        env:
          - name: ALLOW_CORS
            value: enabled
          - name: PGHOST
            value: "{{ .Values.Pod.ServiceNamePostgis}}"
          - name: PGUSER
            value: password
          - name: PGPASS
            value: password

      volumes:
        - name: osm-storage
          persistentVolumeClaim:
            claimName: {{ .Release.Name }}-pvc
        - name: dshm
          emptyDir:
            medium: Memory

Now I have two questions:

When I do df -h in Tile-Server pod, I can see that 99GB is allocated to /dev/shm (see screenshot below). But still when rendering tiles, once in a while I get this error renderd[112]:    reason: Postgis Plugin: ERROR:  could not resize shared memory segment "/PostgreSQL.446172090" to 50438144 bytes: No space left on device. Someone please help me understand where the problem is because I can see plenty of free disk space and ram on the Tile-Server
Even after rendering zoom levels 0-6, /var/lib/mod_tile used only 61MB disk space. Shouldn't this be in GBs? I'm using this command to render tiles - render_list -n 1 -s /var/run/renderd/renderd.sock -z 0 -Z 6 -m ajt -a -f


texts: Convert grey,green,blue to red,green,blue tiff

texts:
==== Edit =====

Issue tracked to strange behaviour of gdal_warp when -dstalpha is specified and source is RGBA.

I had assumed that the grey,green,blue tiffs (see example below) were genuine and people would be familiar with them - meaning something like luminence, green, blue (i.e. kind of similar to analogue TV).

However, it turns out that this was in fact a standard RGB file, where gdal_warp had 'lost' the TIFF colourinterp value for the 1st band.

This seems to happen if you run gdalwarp on an RGBA image (i.e. with an existing alpha band), and also include the -dstalpha parameter.  The result is a 5-band file with the colorinterp value for red replaced by 'grey'.  If you later ask a gdal program to remove the alpha band, you are left with an apparent 'grey, green, blue' image.  As most of my source maps were RGB but some were RGBA, passing them all through the same script was producing a mix of RGB and GGB results.

Command causing the problems:
gdalwarp -overwrite -s_srs EPSG:27291 -tr 10 10 -t_srs EPSG:2193 -r bilinear -dstalpha -of GTiff NZMS001_N128_1965_geo_crop.tif NZMS001_N128_1965_geo_warp.tif

e.g. of erroneous file:

mbriggs@maps:~/tmp$ gdalinfo NZMS001_N128_1965_geo_warp.tif

Driver: GTiff/GeoTIFF
...
Band 1 Block=4187x1 Type=Byte, ColorInterp=Gray
Band 2 Block=4187x1 Type=Byte, ColorInterp=Green
Band 3 Block=4187x1 Type=Byte, ColorInterp=Blue
Band 4 Block=4187x1 Type=Byte, ColorInterp=Undefined
Band 5 Block=4187x1 Type=Byte, ColorInterp=Alpha

After conversion to 3-band:

mbriggs@maps:~/tmp$ gdalinfo NZMS001_N128_1965_geo_nztm.tif

Driver: GTiff/GeoTIFF
....
Band 1 Block=4187x1 Type=Byte, ColorInterp=Gray
Band 2 Block=4187x1 Type=Byte, ColorInterp=Green
Band 3 Block=4187x1 Type=Byte, ColorInterp=Blue
mbriggs@maps:~/tmp$

Fix:

run:

gdal_translate   -b 1 -b 2 -b 3

on all files to ensure all are RGB (and not RGBA) before running gdal_warp -dstalpha.

=====

How do I convert a geotiff from grey, green, blue colour map to red, green, blue?

gdalbuildvrt won't let me use my collection of sheets as some are in grey, green, blue and some are red, green, blue.


texts: Selecting Polygon Features in QGIS Lisboa

texts:
I want to select and save as a separate shape file, a smaller section (polygon) from a whole island country which includes both land and shallow habitat coastal features (like coral reefs) and when I draw and select a polygon, the indicated yellow selected area includes areas outside of the polygon I have drawn.

What am I doing wrong so that I can select polygons that are subsections of larger maps without including these 'outside' areas?


texts: Creating shapefile from current dataframe extents in layout view of ArcMap?

texts:
Where is the ArcGIS 10 tool for creating a shapefile from current dataframe extents in layout view?

Have looked around and the closet thing i can find is Toolbox's Grid/Strip Map Index tools under Data Drive Pages.

I just want to be able to create a single polygon rectangle shp file based on the data frame (in layout view) for any given scale / page setup.


texts: Which scale value to use with Landsat 8 Band 10 when calculating Top of atmosphere Radiance

texts:
I'm trying to calculate LST over a large area using Landsat 8 Band 10 and the attached method.
I've determined that the DN value for band 10 isn't right and is the cause of incorrect (nonsense) values calculated for LST.
I've looked on here, and at several sources including the Landsat documentation but have just become more confused.
Per the attached formula (peer reviewed, and known to work), the Top of Atmosphere Radiance is: the band-specific multiplicative rescaling factor from the image metadata x DN value for Band 10 + band specific additive rescaling factor from the image metadata.
For example, this gives: 3.342x10^-4 x 3271 + 0.1 for a Band 10 DN value of 3271.
On this page - https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C01_T1_SR - the scale factor for Band 10 is given as 0.1.  If I multiply the Band 10 value by 10 I get a sensible result, but I don't understand the process, or the meaning of the two scale factors.
Why is one specific to each image, and the other consistent across all data?
Referring to the example above, should my actual calculation be 3.342x10^-4 x (3271 * 10) + 0.1 for a Band 10 DN value of 3271?  Why?
I'm working in Earth Engine as the process will need to be automated and scaled in due course.
In the meantime I shall continue reading.


texts:
I'm open a lot of widgets programmatically. So I need focus a widget when it's opened. The first time that widget it's open, automatically set focus, but the second time it doesn't.

updated

Code to open a widget:

openWidget: function (aWidgetId, searchIn) {
    var def = new Deferred();
    var wm = WidgetManager.getInstance();
    var myWidget = wm.getWidgetById(aWidgetId);
    if (myWidget == null) {

      if (searchIn === 'widgetPool') {
        wm.appConfig.widgetPool.widgets.some(function (aWidget) {
          if (aWidget.id == aWidgetId) {
            myWidget = aWidget;
            return true;
          }
          return false;
        });
      } else {
        wm.appConfig.widgetOnScreen.widgets.some(function (aWidget) {
          if (aWidget.id == aWidgetId) {
            myWidget = aWidget;
            return true;
          }
          return false;
        });
      }

      //para mostrar widgets ocultos en la pantalla
      myWidget.visible = true;
      wm.loadWidget(myWidget).then(lang.hitch(this, function (args) {
        PanelManager.getInstance().showPanel(myWidget).then(function () {
          // wm.openWidget(myWidget);
          def.resolve(myWidget);
        })
      }));
    } // end if
    else {
      myWidget.visible = true;
      PanelManager.getInstance().showPanel(myWidget).then(function () {
        //  wm.openWidget(myWidget);
        def.resolve(myWidget);
      });
    } // end else
    return def;
  }


texts:
Correct me if I am wrong but did we not used to be able to see the background grid and customize the color of it etc. with DATAPLOTLY?
I cannot see where to edit/show that now!


texts: how to connect points to create a polygon boundary in QGIS

texts: I have 31 points in a shapefile, which delimit a field (it's an irregular shape). I want to connect those points so they create the boundary of a polygon. Does anybody know a kind of "connect the dots" tool?


texts: Specify the NoData pixel from 255 to a lower value pixel value

texts:
I have a series of raster files (tif) that extracted using a particular shapefile.
However, the output files became much larger (from 2 MB to 200MB). The NoData is now equivalent to pixel value of 255 instead of 0 (maybe this is the reason).

Is there a way to specify it through this code?

 import arcpy
 from arcpy import env
 from arcpy.sa import *
 arcpy.CheckOutExtension("Spatial")
 env.overwriteOutput = True

 #Set the current workspace
 env.workspace = ("C:\Users\Brent\Documents\JO_GIS_Analyst and PA")

 #This is for extracting the forest areas of hansen percent treecover
 for raster in arcpy.ListRasters("lossyear*", "TIF"):
     print raster #checking the presence of raster
     outputRasterExtractbyMask = ExtractByMask(raster, "NAMRIA.shp")
     outputRasterExtractbyMask_Name = "forest_only"+raster
     outputRasterExtractbyMask.save(outputRasterExtractbyMask_Name)


texts: SAGA: could not initialize data objects (QGIS 3.6, Mac 10.14)

texts:
I was trying to generate a catchment area from a DEM and got the error message:

The following layers were not correctly generated.

/var/folders/ft/rbsnpzy96r76t8rkj5fdtzc40000gn/T/processing_9c115a04040346468f5f515f34c18060/56eb9d666ec44bd5a5ffeb946d486006/FLOW.sdat

/var/folders/ft/rbsnpzy96r76t8rkj5fdtzc40000gn/T/processing_9c115a04040346468f5f515f34c18060/7d782906ca3b428899252f6f368f308f/FLOW.sdat

You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

When I checked the Log Messages it indicated this:

             SAGA Version: 2.3.1

             ____________________________
             library path: /Applications/QGIS3.app/Contents/MacOS/lib/saga/
             library name: libta_hydrology
             library : Hydrology
             tool : Flow Accumulation (Top-Down)
             author : O.Conrad (c) 2001-2016, T.Grabs portions (c) 2010
             ____________________________

             Load grid: /var/folders/ft/rbsnpzy96r76t8rkj5fdtzc40000gn/T/processing_9c115a04040346468f5f515f34c18060/8340cdad8325410f9cb94c4a526ab5a8/hillshadeandyam3x3.sgrd...

             Flow Accumulation (Top-Down): could not initialize data objects

Any idea why it cannot initialize data objects, or how I could find out?


texts: Using search cursor with ArcPy and Spyder?

texts:
I recently installed ArcGIS 10.3.1 (previously had 10.1 installed) and I am trying to run a script in Spyder 2.7 that has always worked and getting the below error:

"Traceback (most recent call last):

  File "<ipython-input-4-95832f8a9f6d>", line 1, in <module>
    perimCur = arcpy.SearchCursor(subwatSubPath + subwatPerimsSub[i])

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\__init__.py", line 1179, in SearchCursor
    return gp.searchCursor(dataset, where_clause, spatial_reference, fields, sort_fields)

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 359, in searchCursor
    self._gp.SearchCursor(*gp_fixargs(args, True)))

RuntimeError: ERROR 999999: Error executing function."

I've tried reinstalling both ArcGIS and Spyder xy, but am still getting the same errors. After looking extensively online, I can't find a solution, although I suspect it may be a path issue. Can anyone help me identify the problem?

I don't know if this is related, but when I import from the spatial analyst module by calling from arcpy.sa import * I get a warning that states unable to detect undefined names.


texts: shp2postgis changed field type and length

texts:
I'm using shp2postgis GUI tool load ESRI shapefile to PostGIS.
In the shapefile, there is a field of type text which length is 2000, or even more. However after loaded in PostGIS, its type changed to be varchar and length was 254. So the records content was not complete.
How to use shp2postgis to load shapefile with complete attributes. Or use other ways? Thanks in advance


texts: How to delete one polygon from a multi polygon record in a spatialite database using QGIS

texts:
I have a spatialite database with multi polygon records within the database. When i try to edit these records i cannot delete just one of the polgons for a specific record. It only allows me to delete the entire record which may have up to 5 or 6 polygons associated with the record and i only want to delete one of these polygons from within the multi polygon record.

I can get around it by exporting the record as a Shapefile, exploding to a multi part then deleting the polygon i need to delete, then taking the multi part back to a single part and then inserting it back into the spatialite database. A long and annoying process !!!!

Is there a quicker way of doing this?? I really hope so !!

Regards,

Paul


texts: How to set PYTHONPATH in OS X to use PyQGIS?

texts:
I am trying to use PyQGIS in custom applications.

I am on Mac OS X 10.9 with QGIS 2.0.1-Dufour.

I know I have to set the the PYTHONPATH environment variable.

This is the path to QGIS on OS X: /Applications/QGIS.app/Contents/Resources/python/

My current PYTHONPATH is the following:

$ echo PYTHONPATH
PYTHONPATH

Next I tried to export the QGIS Python path:

$ export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python
-bash: $: command not found

Then I tried it with sudo:

$ sudo -s export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python

This worked. But when I check my PYTHONPATH again it is the same as before:

$ echo PYTHONPATH
PYTHONPATH

What steps am I missing in order to set the PYTHONPATH?


texts: Error 000628: Cannot set input into parameter out_layer when executing MakeFeatureLayer

texts:
I have a script that runs fine in ArcMap and when published to ArcGIS Server:

it runs fine when using folder workspace i.e GDB database.
fails when using ArcSDE workspace to connect to a RDBMS.

This is my script. The problematic line is indicated by a comment.

    arcpy.env.overwriteOutput=True
    arcpy.env.workspace= params[3].valueAsText
    coverageDirName="tempCoverage"
    coverageOutDir=tempfile.gettempdir()+"\\"+coverageDirName

    arcpy.CreateFeatureclass_management(params[3].valueAsText, "points", "POINT")
    arcpy.AddField_management("points","featureClassName","TEXT")
    arcpy.AddField_management("points","OriginalOBJECTID","Integer")

    linesObjIdFldMap = arcpy.FieldMap()
    for fc in params[0].values:
        linesObjIdFldMap.addInputField(fc,"OBJECTID")
    linesObjectId=linesObjIdFldMap.outputField
    linesObjectId.name="OriginalOBJECTID"
    linesObjectId.type="Integer"
    linesObjIdFldMap.outputField =linesObjectId

    linesFeatureClassFldMap = arcpy.FieldMap()
    linesFeatureClassFldMap.addInputField(params[0].values[0],"featureClassName")
    linesFeatureClassName=linesFeatureClassFldMap.outputField
    linesFeatureClassName.name="featureClassName"
    linesFeatureClassFldMap.outputField =linesFeatureClassName

    lineFieldMappings = arcpy.FieldMappings()
    lineFieldMappings.addFieldMap(linesObjIdFldMap)
    lineFieldMappings.addFieldMap(linesFeatureClassFldMap)

    pointsObjIdFldMap = arcpy.FieldMap()
    for fc in params[1].values:
        pointsObjIdFldMap.addInputField((fc),"OBJECTID")
    pointsObjectId=pointsObjIdFldMap.outputField
    pointsObjectId.name="OriginalOBJECTID"
    pointsObjectId.type="Integer"
    pointsObjIdFldMap.outputField =pointsObjectId

    pointsFeatureClassFldMap = arcpy.FieldMap()
    pointsFeatureClassFldMap.addInputField(params[0].values[0],"featureClassName")
    pointsFeatureClassName=pointsFeatureClassFldMap.outputField
    pointsFeatureClassName.name="featureClassName"
    pointsFeatureClassFldMap.outputField =pointsFeatureClassName

    pointFieldMappings = arcpy.FieldMappings()
    pointFieldMappings.addFieldMap(pointsFeatureClassFldMap)
    pointFieldMappings.addFieldMap(pointsObjIdFldMap)

    arcpy.Merge_management(params[0].values,"lines",lineFieldMappings)
    arcpy.Append_management(params[1].values,"points","NO_TEST",pointFieldMappings)

    inputFeatures="'{0}\\lines' ARC; '{0}\\points' POINT;".format(arcpy.env.workspace)
    arcpy.FeatureclassToCoverage_conversion(in_features=inputFeatures,out_cover=coverageOutDir)
    #arcpy.env.workspace=params[3].valueAsText
    arcpy.FeatureClassToGeodatabase_conversion([coverageOutDir+"\\arc",coverageOutDir+"\\node"],params[3].valueAsText)

# this line throws error
    result=arcpy.MakeFeatureLayer_management(in_features="tempCoverage_node",   out_layer="nodes_lyr")
    arcpy.SetParameter(4,result.getOutput(0))
    result=arcpy.MakeFeatureLayer_management(in_features="tempCoverage_arc", out_layer="arcs_lyr")
    arcpy.SetParameter(2,result.getOutput(0))

The environment is ArcGis Server 10.2.2 connecting to remote sde database.

The input workspace is set to the sde connection file located in the root drive (c:\data) with its permissions set to allow full control by ArcGis Server account.

I have tried forward slashes, double backslashes and concatenating the path for the in_features parameter instead of relying on the workspace variable, to no avail


texts: Manage Map Cache using ArcGIS Server 10.4 REST API using C#.net

texts:
I am trying to use the ArcGIS Server 10.4 REST API to manage map caches via C#.NET, System.Net.Http. I am able to access and utilize the REST API with this technology, so I know it can work. But this specific attempt fails every time with the following error:

Error executing tool. Manage Map Cache Tiles Job ID: j89eeb39daaba427891dcc5cefe90a0d0 : ERROR 001428: Failed to retrieve configuration for service http://arcgistest.domain.net:6080/arcgis/rest/services/TestServices/TestPoints/MapServer/. Failed to execute (Manage Map Cache Tiles).

As you can see by the error message I am able to submit a job to the proper service (that is after generating a token, which is required for the System geoprocessing services). Furthermore, if I remove one of the required parameters I get a message telling me so. This helps me to know I'm on the right track.

My best guess is the "service_url" parameter is not correct but the documentation on what to supply here is not helpful and mainly for python applications which will be running on a local machine. My goal is to create a service wrapper for a non-gis developer...

private static void TryMapCache(string[] args, string token)
    {
        args = new string[7];
        string url = "http://arcgistest.domain.net:6080/arcgis/rest/services/System/CachingTools/GPServer/";

        args[0] = "Manage%20Map%20Cache%20Tiles/SubmitJob?";
        args[1] = "service_url=http://arcgistest.domain.net:6080/arcgis/rest/services/TestServices/TestPoints/MapServer;
        args[2] = "&levels=1155581.108577;577790.554289";
        args[3] = "&thread_count=6";
        args[4] = "&update_mode=RECREATE_ALL_TILES";
        args[5] = "&f=pjson";
        args[6] = "&token=" + token;

        StringBuilder urlParameters = new StringBuilder();
        urlParameters.Append(args[0].ToString());
        urlParameters.Append(args[1].ToString());
        urlParameters.Append(args[2].ToString());
        urlParameters.Append(args[3].ToString());
        urlParameters.Append(args[4].ToString());
        urlParameters.Append(args[5].ToString());
        urlParameters.Append(args[6].ToString());

        Console.WriteLine(url + urlParameters.ToString());

        HttpClient theClient = new HttpClient();
        theClient.BaseAddress = new Uri(url);

        //data response
        HttpResponseMessage theResponse = theClient.GetAsync(urlParameters.ToString()).Result;
        if (theResponse.IsSuccessStatusCode)
        {
            string responseData = theResponse.Content.ReadAsStringAsync().Result;
            Console.WriteLine(responseData);
            Console.ReadKey();
        }
    }

This is the output:

{
 "jobId": "j8f9f5f6412ac4d688540bad252cfee3e",
 "jobStatus": "esriJobSubmitted"
}


texts:
"Rec" & " " & [RECEPTION] & VbNewLine & "Bk" &[BOOK] & " " & "Pg" &[PAGE]

This is what I have so far. I want to make it so that if the Rec number is blank OR null to label Book and Page. Thoughts?


texts: How to display features only if labels are displayed?

texts:
In my maps there are several point layers, and each layer has a different labelling rule and priority. Sometime the point density is too high and the labelling engine is not displaying some labels, following the priority rules I have defined.

Is there a way to display only the points that are labeled? Basically, if there is not space for displaying a label, also the feature should not be displayed.


texts: Setting transparency of feature class in ModelBuilder in ArcMap?

texts:
I've made a model which yields an output feature class using ModelBuilder in ArcMap 10.4

I can set the symbology for the output layer by specifying a layer file.

Is there any way I can set the transparency of this output layer to a specific value directly within ModelBuilder?


texts: Adding multiple spaces in messagebar text using PyQGIS

texts:
I create a messagebar using this
iface.messageBar().pushWidget(iface.messageBar().createMessage( 'Hello World' ), Qgis.Info)

How can I add, say, 5 spaces between Hello and World?
I could use '
Hello     World
' to output exactly what I type but this changes the font of the messagebar. I would like to retain the same default font.
Is there another way?


texts: Adding Metadata of image as band when band has different projection than image?

texts:
I am trying to add system:time_start as a band in my image, so that when I mosaic the image collection, I retain the time value of each pixel. I am doing this in Landsat data. However, when I add the metadata, it gets added as EPSG:4326 as opposed to EPSG:32644, which is the projection of a Landsat image.

I have attached the screenshot that shows time is added in a different projection. This is especially troublesome when I try to export the image--all I get is straight lines.

below is a reproducible code

https://code.earthengine.google.com/179ddb6096f79bd45c10930b0b6fbcca


texts: Unable to select ArcGIS layout boxes (created with Insert Picture) after path changed?

texts:
I inserted a few png images into my map layout (state road shields), but when I changed the path for the folder they were located in, they no longer appear. The problem is that a box has appeared that is not selectable, and I cannot delete it.

Attached is a picture showing two yellow boxes "481px-Florida_281.svg". Is there a way to remove these. I have re-added the images to the map, but the box still remains.


texts: What's the best way to represent a Year field in Enterprise Geodatabase & Web AppBuilder?

texts:
I have a Fiscal Year Start field in a Feature Class which is shared as a Feature Service in a Web Map > Web Mapping Application (built with Web AppBuilder) workflow. The field must only contain 4-digit years, therefore, I cannot set the field to data type 'Date'. Instead, the field uses a Short Int data type with precision 5 (I set the precision to 4 but ArcGIS automatically changes it back to 5). Here are the field properties:

Now, I can go into the config attribute settings in my Web Map and turn off the 1000 separator option. This works for displaying the years correctly in the Web Map. However, this does not carry over to the Web Mapping Application. When I use the Filter widget in the Web Mapping Application, the 1000 separator returns.

I initially tried to get around this problem by using a Text field for year input, but that option does not work for this workflow due to the presence of a GeoForm - the GeoForm is  where data is entered for the project. The reason a text field does not work is because the GeoForm Fiscal Year Start field must throw an error if a non-4-digit-integer is entered, i.e., FY17, or 17.

Essentially then, my question is this - is there a better solution for representing a year in a geodatabase? This ideal solution would do the following:

Have data entry limited to no more or less than 4-digits
Throw an error if a non-integer was used during the data entry process in a GeoForm
Would not use a 1000 separator to display a 4-digit integer in Web AppBuilder

(By the way, is there a way to change the Error Message of 'Please enter a valid integer between -32768 and 32767.'? I'd much rather it said what the help text says, e.g., 'Enter a fiscal year as the four-digit year...'.)


texts: Basic proj4 conversion UTM grid -> longlat and back

texts:
I'm a GIS novice, and am struggling to understand how to drive proj4 to accomplish what seems like a simple thing. I've googled for a couple of days, but everything I find seems to presuppose quite advanced knowledge, and leaves many things unsaid. Stack Overflow couldn't clear it up for me, either..

I have a conversion between UTM easting/northing and lat/long to do in both directions. Once I get this working, I'll add some different projections/datums.

I'm working on my recently acquired knowledge/assumptions:

This conversion will require a datum translation, because WGS84 (standard datum for UTM) has it's prime meridian approximately 100m east of Greenwich (where longitude is zero).
I don't need to worry about ellipsoids, because the lat/long are geographic coordinates, rather than projected ones.
I can either start the conversions using one string (as used in the command-line instantiation), or can pre-assemble a source and destination object, and call pj_fwd(data, ref) directly.

Another issue is that if I call the code directly, while I've found the projUV datatype - I can't find the corresponding UTM version.

Could someone please get me started with the format of the string(s) of either method required?

Perhaps using conversion from zone 56 499451mE 6960921mS to lat/long as an example.


texts: I can't define "enum QgsComposerItem::ItemPositionMode " to UpperRight

texts:
In order to create a new map layout with labels, I have to set in my code the position of the labels with ItemPositionMode, but it the parameter is not accepted:

from qgis.core import *
from qgis.utils import iface
from PyQt4.QtGui import QColor
from PyQt4 import Qt
from qgis.core import QgsComposerMap

municipios = QgsVectorLayer("C:\\ROUTE\\MUNICIPIOS.shp","Municipios","ogr")
reg = QgsMapLayerRegistry.instance()
reg.addMapLayer(municipios)

maprenderer = iface.mapCanvas().mapRenderer()
c = QgsComposition(maprenderer)
c.setPlotStyle(QgsComposition.Print)
layout = QgsComposerMap(c,1,1,1,1)#example
layout.label = QgsComposerLabel(c)
layout.label.setText("LAYOUT")
layout.label.adjustSizeToText()
layout.label.setFrameEnabled(True)
layout.label.setItemPosition(10, 20, 10, 10, UpperLeft)
layout.c.addItem(layout.label)
layout.output("ROUTE\\my_map.jpg", "jpg")

The error message is:

  QgsComposerItem.setItemPosition(float, float, float, float,
  QgsComposerItem.ItemPositionMode itemPoint=QgsComposerItem.UpperLeft,
  bool posIncludesFrame=False, int page=-1): argument 2 has unexpected
  type 'str'


texts: Error while performing actions in GRASS GIS in Python

texts:
While performing actions in python console as described in the module of GRASS GIS,am getting following error:

import grass.script as gs

r.in.gdal -e input="D:...\ASTGTMV003_N19E073_dem" output=DEM

File "", line 1
r.in.gdal -e input="D:\...\ASTGTMV003_N19E073_dem" output=DEM

   ^

SyntaxError: invalid syntax
Then I gave input from import raster and was able to view my DEM tile in GUI but the next actions gave me other errors.

gs.run_command('g.region', raster='elevation')

Traceback (most recent call last):
File "", line 1, in
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 441, in run_command
return handle_errors(returncode, returncode, args, kwargs)
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 343, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None g.region raster=elevation ended with error
Process ended with non-zero return code 1. See errors in the (error) output.

s.run_command('r.neighbors', input='elevation', output='elev_smoothed', method='average', flags='c')

Traceback (most recent call last):
File "", line 1, in
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 441, in run_command
return handle_errors(returncode, returncode, args, kwargs)
File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 343, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None r.neighbors -c input=elevation output=elev_smoothed method=average ended with error
Process ended with non-zero return code 1. See errors in the (error) output.


texts: Using Extract by Attibutes tool in ArcGIS ModelBuilder?

texts:
I have a model which at one point uses the Extract by Attributes tool to produce a new raster with just the areas containing the maximum values of the first.

I would think that the SQL expression would go something like:

"VALUE" = (SELECT MAX("VALUE") FROM in_raster)

No matter what combination I try of expression it always comes up invalid.

I always have to run the model up to the point of this tool, then GET UNIQUE VALUES by hand in the sql builder window to input something like

"VALUE" = some_number

Then it works fine. The rest of the model runs and I get the correct output.

I did try with Zonal stats but the output at the end of the model is not correct when I do.

Is there a way of automating this perhaps with some python or another set of tools?

I have a number of initial values I need to iterate through for this model and I want the whole thing to be able to run without me having to do that step manually.


texts: How to set fill style to no brush on QGIS using pyQgis

texts:
I need set fill style "No Brush" but still stuck how to, here is my current code:

mySymbol1=QgsFillSymbolV2.createSimple({'color':'#289e26',
                                                'color_border':'#289e26',
                                                'width_border':'1',
                                                'brushStyle':'No Brush'})
myRenderer = layer_base.rendererV2()
myRenderer.setSymbol(mySymbol1)
layer_base.triggerRepaint()

I am not sure and I think 'brushStyle:'No Brush' isn't the correct one, any ideas ?