texts: Stop button causes "R session aborted" screen when using arcgisbinding

texts:
I've been having a problem in R studio that when interrupting R studio, using the stop button, the R session would abort. I've finally narrowed this down to when I have loaded in data from ArcGIS using the R-ArcGIS bridge. I've tried uninstalling and reinstalling "arcgisbinding" from within ArcGIS (version 1.0.1.244), uninstalling and reinstalling Rstudio (v 1.4.1106), and switching from R version 4.0.4 to Microsoft R open v. 4.0.2 but none of these have resolved the issue. If I have loaded data using arc.open and arc.select, and later use the "stop" button, I get a popup saying "R Session Aborted" and have to start over.

The R session log then shows this exception:

30 Apr 2021 14:16:40 [rsession-Cheryl] ERROR CLIENT EXCEPTION
(rsession-Cheryl): (TypeError) : Cannot read property 'L' of null;
org/rstudio/studio/client/workbench/views/source/editors/text/AceEditor.java#4486::setScrollSpeed
org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#46::monitor
org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#70::execute
com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute
com/google/gwt/core/client/impl/Impl.java#306::apply
com/google/gwt/core/client/impl/Impl.java#345::entry0
rstudio-0.js#-1::eval
com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap
Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e User-Agent:
Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML,
like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

One strange thing is that if I remove the data loaded in using arc.open and arc.select, the error still occurs.
I can come up with a workaround to export the data I need to files and load these in a new instance of R using fread rather than the ArcGIS tools, but this is a bit clunky and likely misses out on some of the functionality of using the GIS data directly.


texts:
I cannot uninstall opengeo suite 3.0.2.    I tried uninstalling and it would timeout on me. So I deleted the directory and now it won't let me uninstall or reinstall.

My goal is to get OpenGeo 3.0.2 working with postgreSQL 9.1 and postGIS.   I had it working on Windows 8 (32 bit) and am now trying to move my data to Windows 8.1 (64 bit).


texts: Shopping Centers Database by Center Type

texts: I am trying to find a free database which would have the shopping centers in US by center type (i.e. outlet, mall, strip). Could you please advice? I checked BA Desktop but our version does not have Center_Class_ID which would at least narrow it down to Power Center, Lifestyle, Super Regional.


texts: Symbology in QGIS for plan drawing regulation in Germany

texts:
In Germany we have to use standardized symbols for maps of the land use planning ("Bauleitplanung", "Bebauungspläne", "Flächennutzungsplane").

These symbols are defined in an act called "Planzeichenverordnung".

Here are some examples of the defined symbols for polygons

and for points.

All symbols are listed here.

How can I use these symbols in QGIS? Are there any predefined symbol sets which I can use?

Original question was in German (Translated by @Jens):

Gibt es für QGIS eine Phytonerweiterung "Planzeichenverordnung"? Zur Bearbeitung von Flächennutzungsplänen und Bebauungsplänen kommt man an den Planzeichen nicht herum.


texts: Statistic validation for spectral trajectories/trend from ground truth dataset

texts:
I'm doing an extraction of spectral trajectories for disturbed forest pixels using multitemporal (single scene for 20 years) Landsat Surface Reflectance products.

Usually, forest disturbances are detected using automated algorithms (mainly Landtrend for Landsat data) and statistic validation of the results is done using confusion matrix (overall accuracy ecc.), Kappa, Pearson correlation and similar methods.

In my case, the disturbed pixels are identified by visual interpretation (so they can be classified as ground truth data) and no predicting algorithm is used. I'm only extracting the pixel values and plotting them along the temporal series.

My question is: after noise removal (outliers detection, data cleaning filters ecc.), how can I tell how accurate the trajectories obtained from the pixel values are?


texts:
I am responsible for preparing a GIS lab, and I was wondering if there is any license restriction for using the tutorial data in ArcGIS (ArcTutor) for classroom use like this? (attribution, modification etc.)

I searched around, and found ArcGIS tutorials being hosted on outside website like Duke library
http://library.duke.edu/data/collections/gis/esri/tutorials

Also googling ArcGIS tutorial license doesn't show much. Results are mostly about the license manager.


texts: Open a .osm.pbf file with fiona in python

texts:
I would like to open a .osm.pbf using fiona in Python. I can't find much documentation on this. How can I does one do this?

I have done it using ogr2ogr.


texts: Hiding selected features in ArcGIS for Desktop using ArcPy or ModelBuilder?

texts:
I'm using data driven pages to create a series of maps of point features.

Some of my features overlap spatially and I only want to show some of them on each map.

Once I select the features which I want to show, is there any way that I can hide the rest using ArcPy or ModelBuilder?

My whole setup is automatic, I don't want to do this manually!


texts: Calculating acreage as a percentage in ArcPy

texts:
I am struggling to calculate the acreage as a percentage in Calculate Field Management, but I am getting this error message:

  "ValueError: could not convert string to float! BufferAcreage!

arcpy.CalculateField_management(fc, "BuffAcreage", "!shape.area@acres!", "PYTHON", "")

arcpy.CalculateField_management(fc, "BuffPct", float("!BufferAcreage!")/float("!Acres_Whole!") * 100, "PYTHON", "")

The initial line of code works perfectly, but it is the second line of code when I am calculating the acreage percentage that I run into the error.

It will not calculate the field because for some reason it is telling me that I am treating the values in these attributes as strings and will not convert them to floats.

It must be done with the arcpy.CalculateField_management().  I can not use an alternative python scripting method because the assignment directions stipulated that I must use the Calculate Field tool in my script. Any suggestions?


texts: Error with graphical modeler QGIS "not all arguments converted during string formatting"

texts:
I'm new to QGIS Graphical Modeler. I've used ArcMap model builder before and now trying out the Graphical Modeler in QGIS2.18.15.

I tried creating a simple model where I create a buffer for a line feature (river) and then clip point data with the newly created buffer. I want to extract the points that are located within the buffer zone.

Everything seems fine but when I hit execute I get an error: "not all arguments converted during string formatting".

Can someone please explain what does this mean and how to fix this?

Traceback (most recent call last):
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute
                self.processAlgorithm(progress)
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\modeler\ModelerAlgorithm.py", line 504, in processAlgorithm
                self.tr('Running %s [%i/%i]', 'ModelerAlgorithm') % (alg.description, len(executed) + 1, len(toExecute)))
            TypeError: not all arguments converted during string formatting


texts:
I have troubles with python console in QGIS 2.18.23. When I type something like

Print ("test ")

and I press Enter, nothing happens and nothing is shown in the console.

EDIT:System configuration: Windows 8.1 64 bits


texts:
I have a raster of 36 classes of the land cover in South Africa. However, I only need 4 of these classes and create a polygon out of these 4 classes combined.
I have now used the raster calculator to generate a raster where 0 = the values/classes I don't need and 1 = the 4 classes I need.
How can I polygonize just the value 1 from this raster? Or, how can I polygonize the 4 classes out of the land cover layer directly?


texts:
I recently was looking for the long/lat data on several different U.S. zip codes (several thousand) and came across this website made a while ago called: "geonames.org". I went to the website and found the respective files for the U.S. and downloaded them.
I noticed shortly after that the website sometimes shows as "secure" (https) in the search bar and other times it is "Not Secure" (HTTP) with the exclamation point next to the website URL. I'm a little worried I either clicked on the wrong website or a replica website that might have viruses. Can anyone else confirm that geonames.org is legit?
specific link used: http://download.geonames.org/export/zip/

Shows as "Not Secure" for whatever reason.


texts: How to make nonoverlapping polygons using QNEAT 3

texts:
I am doing a project in which I am determining which areas of New York City can be accessed within a five- or ten-minute walk of a subway entrance. I have done this in the past in ArcGIS, and am trying it out in QGIS. The goal of the project is to determine which areas of the city would become accessible within a five- or ten-minute walk if closed subway entrances, of which I have accumulated a list here, were reopened. I used the QNEAT3 tool to first look at the service areas for open subway entrances, based on the city's street network.
In ArcGIS, I could create non-overlapping service area polygons to allocate areas to the closest subway entrance.
I have not seen any way of doing this in QGIS, so how do I do this using that software?
When using QNEAT3, all the areas within, for example, five minutes of an entrance, are in a single layer, which is not very helpful, as can be seen in this screenshot below.


texts:
I need to convert lat/lon to meters as the unit of measurement to do some calculations. I found this online tool to transform my data from GEO_WGS84_Lat-Lon to LAMGe (LCC). This works for me but I have to implement the calculations in Java. I found this formulas but I don't know what I have to use for λ0 (reference longitude), Φ0 (reference latitude) and Φ1, Φ2 (the standard parallels).

The online tool says that it uses 10.5 degrees east longitude and 51 degrees north latitude for the coordinate origin.

Would this be the λ0 and Φ0? And what do I have to use as Φ1 and Φ2?


texts:
outSetNull = SetNull(outRas2, outRas2, "VALUE < 0")

When I try to run the SetNull tool using the expression: "VALUE < 0"

the output returns a min = 9.53674e-007

Consecutive run with exact same input:
min = -3.40282e+038

If I change the SetNull expression to "VALUE < 1"
the output returns a min = 1, as expected...

Why does the SetNull tool output this extreme negative value when expression is written as "VALUE < 0"   ?

EDIT: Here is the full script if desired

`import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "c:\users\lmhall\desktop\workshop"
env.overwriteOutput = True
#env.pyrmaid = "PYRAMIDS -1 BILINEAR DEFAULT"
#env.rasterStatistics = "STATISTICS"

#   check out any necessary licenses
arcpy.CheckOutExtension("3D")
arcpy.CheckOutExtension("Spatial")

#   script arguments
DEM = arcpy.GetParameterAsText(0)
if DEM == "#" or not DEM:
    DEM = "PG_Test.tif"

Flood_Depth = int(arcpy.GetParameter(1))
if Flood_Depth == "#" or not Flood_Depth:
    Flood_Depth = "0" #Default if unspecified

Depth_Grid = arcpy.GetParameterAsText(2)
if Depth_Grid == "#" or not Depth_Grid:
    Depth_Grid = "Flood_Grid.tif" #Default if unspecified

#   Process: Map Algebra(DEM - Flood_Depth)
outRas = Raster(DEM) - Flood_Depth
#Delete comment if output for outRas is desired >
outRas.save("DEM2")

#   Process: taking the inverse of the previous output > Map Algebra (outRas * (-1))
outRas2 = -outRas
outRas2.save("DEMinv")
#   Process: Set Null for final flood depth grid output

outSetNull = SetNull(outRas2, outRas2, "VALUE < 0")
outSetNull.save(Depth_Grid)

#PyramidsIn = arcpy.GetParameterAsText(3)
#if str(PyramidsIn) == "true":
#   arcpy.BuildPyramids_management(outSetNull)
#else: PyramidsIn = "NONE"

#StatisticsIn = arcpy.GetParameterAsText(4)
#if str(StatisticsIn) == "true":
#   arcpy.CalculateStatistics_management(outSetNull)
#else: StatisticsIn = "NONE"
`


texts: Generate irregular 3d Buffer of polyline

texts:
I have a 3D polyline That i would like to 3D buffer 300 Feet XY and 100 Feet in the Z direction. I think it may be something similar to this but in 3 dimensions rather than 2 (Buffering point with different distance toward N, E, S, W using ArcGIS for Desktop?) This is buffering a point, whereas i am attempting to on a line. but the process could be similar, i suppose.
I would prefer a python approach, but ArcGIS would work as well, i suppose. I am going to have a couple hundred thousand of these lines to calculate similar to this one.
My end goal is to measure the amount of overlap that these irregular buffers
Here is an image I tried to make to maybe explain what i am dealing with a bit more. The lines do have bends and curves. Hopefully, someone may know of a way to accomplish this and some code to get me in the right direction.

I


texts: How do I get the lat-long coordinate of point 1 from a survey plan

texts:
Here are the data from the survey plan:

TIE LINES from BLLM No. 3, PLS 561, to corner "1" of:

LOT ----------Bearing--------------------Distance
Boundary ----S 36deg 41min W ------11,641.21 meters

BOUNDARY:

LINE ----- BEARING ------------- DISTANCE
1-2 ------ N 37deg 58min E ----- 251.18 meters
2-3 ------ S 50deg 42min E ----- 199.73 meters
3-4 ------ S 38deg 28min W ----- 248.00 meters
4-1 ------ N 51deg 37min W ----- 197.58 meters

Obviously the map has 4 points. If only I can get the lat-long reading of point 1 so that I can readily verify "on field" if it did not overlap to adjacent lots.
Additionally, if lat-long coordinates of point 1 is known, I can easily check on the other three points and determine its position thru Bearings describe in the title/map.

I only need the process on how to do this, but it there is an application or software to do this, much better.


texts: Given a known batch of mobile-obtained gps data with timestamps, what algorithms can be used to clean it?

texts:
I'm working on the backend for an iOS/Android app that collects locations every hour and syncs with the server every three hours. The mobile apps themselves are not under my control and so I can't tweak or even read the code (although I could ask the developers about specifics if need be). The server, given those "batches" of location data enhanced with timestamp and vertical/horizontal accuracy information, tries to determine visits to states/countries: if, for example, it gets some locations that can be placed in new jersey for a given day, it is said that the user visited new jersey once that day. It's based on reverse geocoded addresses to determine the places visited.

The problem is that some of those locations can be noise: bad accuracy, "jumps" or readings from the very boundaries of states can affect the algorithm (which is very naïve: every location it finds, if it's on a different place, is considered as the beginning of another visit, unless it's too unique or too inaccurate).

I was reading earlier about kalman filters, but, as I understand, they not only warrant a very good understanding of the mathematical model involved, they are more suited for real-time measurements. In my case, I already have enough inputs to not need so much prediction as I need smoothing. I'm starting to read about the Douglas–Peucker algorithm to maybe find a solution, but I don't know if I'm on the right track. What do you guys suggest?


texts: Adding Greek letters in existing columns in ArcPy?

texts:
Example table:

colA    colB  colC
173743    01  8974
173443    02  8934
173943    05  8924
173243    01  8994
173343    03  8964

I want to pass to the third column:

The 3 first numbers from the first column, then add '\delta\sigma', then the rest of the numbers from that column then add the second column.

I tried:

with arcpy.da.UpdateCursor('G82.shp', ['colA','colB','colC']) as cursor:
    for row in cursor:
       row[2] = row[0].str[:2].add('δσ').add(row[0].str[2:]).add(row[1])
       cursor.updateRow(row)

But it doesn't do anything.
It gives:

  AttributeError: 'unicode' object has no attribute 'str'


texts: QGIS - digitising polyline on Google maps base

texts:
I'm displaying a Google Street map via the Openlayers plugin and hand-digitising a route to find out its length. As I pan the map the digitized line keeps shifting slightly on the basemap. I'm using the project projection of British National Grid (EPSG27700) with on the fly projection turned on.

What is causing this problem? How do I know if my digitized line is actually in the right place?


texts: In QGIS, I use the intersect function provided by the saga algorithms. The resulting shapefile contains the original attributes but misses joined fields of the input layers. Is there an elegant workaround?


texts: How to get elevation raster data at custom scales for a specific region?

texts:
I'm new to GIS and trying to obtain elevation data for a specific region, transformed to raster data with a custom cell size of 10 meters.
My first attempt was to download a TBDEM dataset from USGS via the CoNED Viewer's download tool, which I think represents elevation data for both sea floor and land (integrated bathymetric–topographic DEM), for the region I selected in the CoNED Viewer.
Within the downloaded zip I found a file .tiff.xml file describing it as "a 2 meter cell size dataset" and "seamless land elevation and water depth information" which sounds great.
Then there is a .tiff file (800 MB) as well as a Spatial_Metadata_2m.gdb file (2 MB), which I guess go hand in hand representing that data.
How would you go about extracting the elevation data from the .tiff file and transform it to a custom grid (or cell?) size of 10 meters, on a Mac?
Are there easier to use tools or APIs to get elevation raster data at custom scales for a specific region?
Purpose: Terrain generation for a simulation game, so it doesn't need to be highly precise.


texts:
We are using Collector for ArcGIS Online on tablets to do some field inspections.

We have some fields on the form that we want to draw the inspector's eye to to expedite filling out the form.

I'm aware that there are more advanced ways to build custom pop-ups with HTML or Arcade, but that's not in line with my current knowledge or timeline to learn.

Is AGOL compatible with simple tags like <"bol">text<"/bol"> similar to in desktop and Pro? If not, I can stop investigating and messing about with it and just keep it as is.

I tried messing with the alias in the pop up setting dialog to no avail.

Results in


texts: How to export data from sql server into shapefile in the decimal format in QGIS 2.4?

texts:
The last couple of days, I have been working on exporting data from SQL to a shapefile in QGIS 2.4. While converting into a shapefile, the data type changes automatically from Float to Integer in the attribute table (if it is 47.656 it comes automatically as 47 in the attribute table).

Then I tried it in QGIS 1.8 and it works perfect as expected. The value remains unchanged and the data type remains a float (47.656 in database table and after exporting it, remains the same 47.656). I don't know what exactly is the matter. Maybe this one is my personal experience, but is it a version issue or updates issue for QGIS 2.4?


texts: Preserving attributes of linejoin through concatenation

texts:
I've run into a bit of a problem, I'm working on a layer of connected lines which represent geological faults and contacts. These lines were broken into many small segments so to get rid unnecessary line segments and thus reduce the size of the layer. I joined the lines in FME and I joined based on certain attributes that I wanted to preserve (I couldn't preserve them all or the linejoin would not reduce the number of lines enough).

However, now I want to bring back some of the lesser important attributes such as the name's of the geologist who mapped the lines. Each line had a source author name telling me the geologist's name. Now that I've line joined I want to find a way to place these authors name's back into the geolines and have the new single lines that were previously composed of two or more segments to have all the author names. So I want to end up with a concatenated column with the source authors names for each line listed.

For example,

If I had two connected line segments:
gid source_author

1 Pete Philips

2 Frank Urt

Now when I combine the two lines I lose this information. So I just have:

gid source_author

1   <-blank->

But what I want is to fill this new line with the previous source authors concatenated together

gid source_author

1   Pete Philips Frank Urt

My brain hurts thinking about it and I haven't really been able to come up with a solution or tried anything that even remotely worked. If anyone has any ideas how I could do this that would be great!

Thanks for the help!

PS. I'm working in Manifold, FME and pgAdmin.


texts: Editing Field using VBscript or Python in Attribute Table?

texts:
I add a field called Name in attribute table in arcgis 10.1 but I can't edit this field. From this site, I have learned that this can be done by field calculator using VBscript or Python. As I have very little knowledge in Visual Basic or Python, it becomes difficult for me to enter an expression using this programming language. In the picture shown, I created four category which I want to put in the Name section according to their GRIDCODE.

Can anyone tell me how can I do this ?


texts:
I'm in the process of learning to use python to automate some tasks in ArcGIS, and while I've done a couple of on line courses about python I'm still learning to use it within ArcGIS. I've had some success, but I have a question about the correct way of doing things sometimes. I can get it to work (which is important, of course), but don't always understand the purpose of doing something this way or that.

My question is pretty simple I think. Using the example of the Spatial Analyst operation 'Plus', why would you choose to use the syntax outlined in the ESRI help page for the command over the syntax used by building the command in model builder and then exporting as a python script. I understand how they are each working, but don't understand why one would be chosen over the other.

Example:
ESRI help
#Import modules, environment settings, set variables, get license
#Execute plus tool and save result to a file
outPlus = Plus(inRaster1, inRaster2)
outPlus.save("C:/sapyexamples/output/outplus")

Model Builder export
#Import modules, environment settings, set variables, get license
#Execute plus tool, and output to variable raster3
arcpy.gp.Plus_sa(raster1, raster2, raster3)

Is this just a style preference? I assume both of these would run outside of ArcGIS, so why would someone choose on over the other?


texts: Import related CSVs to geodatabase without losing foreign key relationships

texts:
For various reasons I understand it is poor practice to rely upon OBJECTID fields to relate different tables together using a relationship class.

Therefore, I have a series of several tables related through RelationshipClasses on a user-defined primary key field. I plan to implement code later that will auto-fill this field upon importing a new record.

When I import new records to these tables, I need to import from CSV files and maintain the integrity of the foreign key relationships already defined in these CSVs. How can I accomplish this and still assign the newly imported fields new primary key values in my custom defined field?

This database will be used to manage traffic counts. See part of the schema below. For example, I have two CSVs of records to be inserted into different tables: counts.csv and intervals.csv. Counts.csv contains general count information (ID of location where they were collected, Date, weather conditions comment). Intervals.csv contains the specifics of each count (one row for each five-minute interval of count data collected). In counts.csv, before import the Count ID column will be numbered 1-n, and the Count ID foreign key in intervals.csv will reference those same numbers, 1-n.

If I append counts.csv to the existing geodatabase table, they will receive new values in my user-defined custom primary key field. So, the intervals will no longer point to the correct count. How can I re-point each interval to its appropriate parent count?

Thanks

Database entities:

Locations (Point Feature Class):
--------------------------------
- Location ID
- Text description

Counts (Geodatabase Table):
---------------------------
- Count ID
- Date
- Comment
- Weather conditions
- Location ID (Foreign key to location)

Count Interval (Geodatabase Table):
-----------------------------------
- Interval ID
- Start Time
- End Time
- Volume of traffic
- Count ID (foreign key to counts)


texts: How to share a hosted feature service with an application on ArcGIS Online?

texts:
According to the ESRI REST API documentation on authentication, a registered application can log in to AGOL via an App ID and App Secret and will then have access to the data that has been shared with it.

Applications that target end users who are unknown to the ArcGIS platform use app logins to connect to the platform. In this case, the application must use both an APPID (OAuth 2 client_id) and an APPSECRET (OAuth 2 client_secret). You are responsible for building the application in a way that keeps the APPSECRET secret, including from malicious users who download and inspect the iOS or Android application or view the source of the JavaScript application using developer tools. A malicious application that has access to the application's credentials (APPID and APPSECRET) can access billable services on ArcGIS, which will be billed to the application. For most JavaScript, iOS, and Android applications, this implies that the app must have a server side application component that keeps the application credentials secure and performs work on behalf of the app.
The server side application component that has access to the application's credentials can obtain a token using a single request. The OAuth 2 grant type is set to client_credentials. The actual POST request is made to the portal's OAuth 2 token endpoint.
For arcgis.com:

https://www.arcgis.com/sharing/oauth2/token

Parameters:

client_id=APPID&
client_secret=APPSECRET&
grant_type=client_credentials

Successful authentication directly returns a JSON response containing the access token that allows the application to work with resources that are accessible to the application (that is, have been shared with the application). Use of the client_secret as previously described is mandatory.

In the section above they specifically mention "resources...that have been shared with the application".  I have not found anywhere in any documentation how to actually share resources with an application.  How do I share a hosted feature service with a registered app so that my app can access secured services without my users logging in?


texts: Get empty layer from QGIS Raster Calculator PYQGIS

texts:
I have a raster file containing different type of land use. For each type of land use I want to apply a coefficient to obtain a new map. Then I am Using QGIS Raster Calculator.

I did it manually with for example this formula :

  ("lu_4@1"=210)*200+("lu_4@1"=12)*20.897+("lu_4@1"=30)*27.812

Where lu_4 is my land use layer.

I obtain a black layer with nan values. When I apply my precreated style, my layer is displayed correctly.

I wanted to automatized it. When my layer is loaded in the project, I figured out that it is empty. Indeed it has only nan value and when I check with the Value Tool, all the data are no data and I can't see the layer.

Here is my code :

    rast = self.pathabs+'/_Inputs/LandUse/lu_'+ str(self.num_grid )+".tif"

    fileInfo = QFileInfo(rast)
    baseName = fileInfo.baseName()
    bohLayer = QgsRasterLayer(rast, baseName)

    entries = []
    # Define band
    boh1 = QgsRasterCalculatorEntry()
    boh1.ref = lu[:-4]+"@1"
    boh1.raster = bohLayer
    boh1.bandNumber = 1
    entries.append( boh1 )

    folder=self.pathabs+'/Maps/'+self.name_grid
    if not path.exists(folder): # create a folder for the grid if not existent
        os.makedirs(folder)
    path_map = folder+'/presence_'+name_sp+'_'+self.name_grid+'.tif'
    # Process calculation with input extent and resolution
    calc = QgsRasterCalculator( f,
                                path_map,
                                'GTiff',
                                bohLayer.extent(),
                                bohLayer.width(),
                                bohLayer.height(),
                                entries)

    calc.processCalculation()

So rast is my raster path, bohLayer is my raster layer, f is the formula, folder is the output path.

I checked that :

my formula is correct
my raster layer is correct too, I added it to the canvas
extent,width and height correspond to the raster layer, so no problem with these neither
the output path is correct as i get the layer, even though it is empty

So does anyone know where the problem can come from ?
I still wonder if it could come from the QgsRasterCalculator itself even if I don't get a error message. I got a problem with it by trying it directly from the python console. See this post if you want more information.

I am using QGIS 2.18.9


texts: Can a satellite go over the same area in different passes overtime

texts: Can a sun-synchronous satellite (let's consider Sentinel-1) go over the same place, one time in an ascending pass and the next time (or few times after) in a descending pass?


texts: How to get the maximum value of NDVI in GEE？for anther way but reduceRegion（）

texts:
sorry，I tried to use this method to get the maximum value of NDVI, but all years are -1 to 1, which is obviously wrong. Is there another way?
    var dict1 = cdl_image.reduceRegion({
        reducer: ee.Reducer.max(),
        geometry: poly,
        scale: 30,
        maxPixels: 1e13
    });


texts: Is there a QGIS mailing list that only announces new releases?

texts: Is there a mailing list for QGIS that announces only new releases / new binary packages?


texts: "Combo-box" for ArcGIS Java script API (ver. 3.1)

texts:
I am using combo-box in ArcGIS Java script API (ver.2.8). When I update the version to 3.1 it gives an error "TypeError: _2d.store.query is not a function"

Can anybody tell me that "Combo-box" effect is removed in 3.1 version ??

I am trying to make similar type example (Click here)

Any help will be great...


texts: ArcGIS Viewer for Flex widget moves inadvertently when placed in upper right

texts: Any widget moves inadvertently to the left whenever it is placed in the upper right area of the window?


texts: Accessing Zonal Statistics for QGIS on Mac?

texts: I've just updated to QGIS 3.4 for my MacOS (10.12). I'm trying to run some occupancy analyses and am looking to extract attribute data for a polygon grid from an underlaying raster file. ZonalStats sounds to be the ideal plugin for this, and is apparently built into this version of Q but I cannot find it anywhere and / or via any search within Q. Please any suggestions how I can access?


texts: How to read/write ENVI metadata using GDAL?

texts:
I am trying to use GDAL to read and write images in ENVI format (for example a .bsq file with an associated .hdr file). The GDAL Formats Info page states "Starting with GDAL 1.10, all ENVI header fields will be stored in the ENVI metadata domain.". If that is the case, how should I access them?

I am using the Python bindings with GDAL 1.9.2 (the latest at this time of writing), and have tried getting all of the metadata:

image.GetMetadata()

which gives me a list of the band 'names' as displayed in ENVI, but that's about it. I've also tried specifically asking for the ENVI metadata domain, as instructed on the GDAL information page linked above:

image.GetMetadata('ENVI')

but that doesn't return anything.

Is there a way to get other metadata from the ENVI file, or will I have to parse the header file myself?

Furthermore, even writing the band names (the ones that seem to be returned when I run GetMetadata()) using SetMetadata() doesn't seem to put them in the .hdr file.

Can anyone shed any light on this?


texts: I have a Sentinel-2 L2A image downloaded from the Scihub.copernicus website.This image has clouds that muddle the classification. Thus, I want to remove them using sen2cor and SNAP. Is there any suggestions?


texts: How can you prevent ogr2ogr from truncating trailing zeros when setting coordinate_precision=0 and saving to GeoJSON?

texts:
This weekend I started using ogr2ogr and discovered that it's a great tool for converting from one spatial reference system to another. I used it to convert a shapefile to GeoJSON, from WGS84 to a NAD83 stateplane, and wanted decimals truncated, but I discovered that its "smart truncation" feature then truncated the trailing zeros on the resulting integers (e.g., 1100000 was written as 11). I searched the web for a while, but wasn't able to find a command-line argument that would avoid this issue.

Below is the full command I was running. My short-term solution was to set the precision to 1 and then use a regex on the resulting file to truncate decimals.

ogr2ogr -f "GeoJSON" CTABusStops.json -s_srs EPSG:4326 -t_srs EPSG:102671 -select
OBJECTID,STOP_ID,STREET,CROSS_ST,DIR,POS,ROUTESSTPG,PUBLIC_NAM -where STATUS=1 -lco
coordinate_precision=0 CTA_BusStops.shp


texts: How to read/write a/from a file in javascript with prototype.js/jQuery.twFile support OR anyotherway

texts: I want to write my data into a file from OpenLayers, I have gone through Prototype.js and jQuery.twFile.js or anyother way to write into a file.


texts: Seeking documentation for qgis.utils module?

texts:
There is a PyQGIS module called utils that I can't find any documentation for. It seems to have some useful functions for loaded plugins.

Within the Python console in QGIS you can run qgis.utils.plugins and a dictionary for each loaded plugin is returned.

dir(qgis.utils.plugins)

returns this list of attributes

['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values', 'viewitems', 'viewkeys', 'viewvalues']

And this returns the attributes of an instance of a plugin:

dir(qgis.utils.plugins.get('<plugin-name>'))

Seems like this could be useful for building unit tests or creating interactions between plugins.

However I cannot find any documentation about the utils module in the QGIS API Documentation. This description has been provided: Difference between qgis.utils and qgis.core?, but is there further documentation that describes the purpose of this module?


texts: Updating basemap and layers at same time using ArcGIS Runtime SDK for .NET?

texts:
i'm working with ArcGIS Runtime SDK for .NET 10.2.5, my app has different graphiclayers with objects that are continuously moving around the map (new position data is provided fastly), the problem comes when i try to fix an object at the center of my screen and move the basemap around it's position using SetView(object.long, object.lat)

When the object is moving very fast or zoom is near the ground i'm getting some "vibrations" (don't keep in the center of the screen) in the object because they don't update at the same time.

I worked with OpenGL before ArcGIS and i'm looking for something like GL.Invalidate() - GL.SwapBuffers()where you make all your changes and then update all at once, but i couldn't find anything that do the trick


texts: Resetting a marker Style after another marker has been clicked

texts:
Is there a way to reset a markers colour after clicking off of it.
I am trying to make the markers colour change once clicked on and then update the infobox to the name of the train station and zoom into the marker.
Upon clicking on a new marker, I would like the old markers style to be reset. I used to have this through the if statement below
//if clicked the circle marker changes colour and gets bigger
     function SetMarkerStyle(target) {
     if (clicked) {
     clicked.setStyle(tMarker);
     }
     target.setStyle(clickStyle);
    clicked=target;
    }

However, this does not work in the current situation. Is there a way to update the marker after another has been selected?
Current Code to show implementation


texts: ODBC connection to Sybase SQL Anywhere database

texts:
I have my GIS data in ESRI personal geodatabase, and my attributes in a Sybase SQL Anywhere database.
I would like to make a join between my GIS data and my tabular data, but don't understand how to set up the correct ODBC connection. (I allready have the correct ODBC/OLE DB connection, Nordata, which works good in ArcMap), but how to use this connection in QGIS is my problem.

Which parameters should I use in this QGIS form for adding Vector layer

Or - maybe it is not possible to establish a ODBC connction to Sybase SQL Anywhere ver. 5.0?


texts: WFS service Server Error in '/ArcGIS/services' Application

texts:
I have a SSL secured ArcGIS Server 9.3.1 machine on W2k8. I set up a service with WFS. Every time I try to request the capabilities, I get the error:

Server Error in '/ArcGIS/services' Application
 Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a  tag within a "web.config" configuration file located in the root directory of the current web application. This  tag should then have its "mode" attribute set to "Off".

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's  configuration tag to point to a custom error page URL.

In the IIS log I see a 500 type error (Internal server error).


texts: Joining CSV to shapefile with same Name field results in NULL fields

texts:
I am having some issues with using the join feature between my shapefile polygons and my CSV data (originally a xlsx file), when I join the layers together using the common field between them (name) it results in NULL fields. The joining name fields are both text (string), I have tried converting them to dbf files instead of CSV and had some partial success (some files work, others do not) I have come to the conclusion there must be some sort of invisible characters in my data that is messing it up.

How can I check for this?

Other than that I have no ideas, and have combed through past questions to no avail.

I would upload files but it seems that is not an option here.


texts: ArcGIS 9.3.1 on Windows 7 (64 bit) identify tool won't display

texts:
I have installed the arcgis editor student version 9.3.1, but the identify tool does not display.

I tried the options described in the link:

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

I change my screen resolution first to a lower one since the settings were in the highest, restarted my computer, opened arcmap, changed to a higher resolution several times and nothing.  I also tried to follow the path but I do not have the Identifyresultsdialog option either. I can only get to HKey_Current_User\Software\ESRI\ArcMap\

Any other solutions?

Identify is sooo necessary!

I am using windows 7 professional version 6.1


texts: Dropping images coming from a certain file inside our map

texts:
I've been charged of this yesterday :

Finding a way for the user to drag a picture that he took before and dropping inside the map element
this picture is coming from an outside file like D:\images\image.png

I want to know (and I've been looking for this but I found nothing) if there's a way to do such a thing with leaflet (maybe the ImageOverlay and JavaScript)

Is there a way to make an image that came form your hardrive/USB an drop it inside the map ?


texts: Can the maximum and minimum values of raster display be changed automatically when changing the data frame extents?

texts:
I have a raster layer in arcgis which covers a large surface area. I would like to be able to zoom into specific areas of this raster and have it display only the range of values in the area I have zoomed to. Is this possible?

For example if the range of values for the entire raster is 0-255 but the range of values at the current extent is only 25-100 I would like the symbology to represent only those values between 25-100, until I zoom to a different scale.


texts:
We use shp.file in our VB6 to run tracking system. Now we want to convert it into the navigation system, which requires doing the route analysis on shp.file. The route is drawn in shp.file

Usually, we see the route analysis is on the grid when programmed it using Visual Studio 6. How to make it to run on shp.file?

Thanks.


texts: Exporting all attributes from a GPX file

texts:
I have a GPX file that i have imported into Google Earth, it looks like this.

When I try and use the GPX to features tool in ArcGIS, it does not export out all the attributes..

It seems that GE has access to more data. What do I need to do to export all the attributes shown in the Google Earth popup into my feature class.

Thanks


texts: Summing up over area based on distance related function?

texts:
Through a field study, we learned that the density of a bird species in the forest was related to the distance to forest edge: ln(density) = 1.89*(distance to edge) + 0.34

Now, for any forest polygon, how can we estimate the number of birds in it based on above equation?

I thought of using raster approach, dividing the forest into many grids, calculating, and summing up.

But as the forest polygons are highly irregular in shape, there are many "incomplete" polygons. The size of the grid cell and the origin of the grid system influence the output as well. I wonder if there is any approach to this problem using polygons directly?


texts: Failure to install QGIS 2 - held broken packages

texts:
I pasted the issue about not being able to install QGIS 2 on Ubuntu Raring on an ubuntu forum: launchpad.net apt questions and the answer seemed to indicate the problem is with QGIS?  Thread: https://answers.launchpad.net/ubuntu/+source/apt/+question/236907

A copy of the thread is attached via the preceding link hoping there's someone who knows what is going on with this program.  Unfortunately I can't use Linux or a version of it at the moment as I can't get QGIS to work on it so your help would be much appreciated.


texts: Null values in polygon intersection results

texts:
I am using 2.8.3-Wien to analyse two polygon layers, one with many more polygons (layer A) than the second. (layer B)

I need to know which of the polygons in A overlap with each of the polygons in B, as a new layer, with every overlap as a new polygon.

I've tried using Intersect, but I get a great big table with only half the data in it. It has all the polygons, labelled with data from B, but the fields which should say which polygon from A has overlapped is all null.

I had managed to get Intersect working with layers with less polygons, so is this just a processing power problem, or is there some other tool within QGIS that I can use?

I've not been using QGIS for long, so it's entirely possible I'm missing something really basic but vital.


texts: Labels are overlapping at scale 25 Mio. in QGIS?

texts:
when I zoom-out (at a scale 25 Mio.), the labels are overlapped and it shouldn't be overlapping like the image below (in red drawn 'circle'),

Is it because of the size of the labels or do I have to move the 'elevation' (= Kinabalu 4101 and Raya 2278') manually?


texts: How to get Memory layer dispalyed in Vector Panel List using Pyqgis?

texts:
I have two point layer in my Project Centroid.shp and Nodes.shp.I have used Distance Matrix to find nearest Nodes point from Centroid Point. I have saved the output in FinalDistance.csv. The FinalDistance.csv contain centroid point number, node point number and distance. No other X and Y coordinates of any of the point layer is stored in csv file. but later I realized I need to do some Sql processing in this final distance, so I tried to save as memory layer. But I couldn't get this memory layer in my Layers Panel. However when I execute manually I always get "FinalDistance" named memory layer in panel.
Or is there any way of importing csv file without having x and y cordiantes info in it.

   processing.run("qgis:distancematrix",{ 'INPUT' : 'C:/Final Demand Allocation/centroid.shp', 'INPUT_FIELD' : 'HMINNODE', 'TARGET' : 'C:/Final Demand Allocation/Test/Proposed_Nodes.shp', 'TARGET_FIELD' : 'id', 'MATRIX_TYPE' : 0, 'NEAREST_POINTS' : 1, 'OUTPUT' : 'memory:' })


texts: Conversion from Shapefile to TopoJSON format results in incorrect map when rendered using d3js

texts:
I am trying to build a map of Canada showing FSA boundaries using d3js. I got shape data from Statistics Canada [http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2011-eng.cfm].

To convert the SHP file to topojson, I am following the process from Mike Bostock's Tutorial 'Lets Build a Map' [http://bost.ocks.org/mike/map/].

First convert the map to GeoJSON using ogr2ogr, then using topojson in Node.js, convert the GeoJSON file to a TopoJSON file.

I am executing the commands:

> ogr2ogr -f "GeoJSON" -s_srs EPSG:21781 -t_srs EPSG:4326 output.geojson input.shp

Followed by the command:

 > topojson --id-property CFSAUID -p name=PRNAME -p name -o output.topojson output.geojson

The resulting map that is generated renders some provinces properly, however, the following provinces show up as jumbled lines.

Ontario
Newfoundland
Quebec
Manitoba
Saskatchewan
Alberta
British Columbia

Here is a basic version of my d3 call.

var g = svg.append("g").attr("id", "fsa");
d3.json("can/output.json", function (error, json) {
    var counter = 0;
    var subunits = topojson.object(json, data);
    g.selectAll("path")
    .data(subunits.output)
    .enter()
    .append("path")
    .attr("d", path)
});


texts: Creating a 10-mile radius buffer zone that averages a variable in my shapefile?

texts:
I´m trying to create a "buffer zone" for every polygon in my shapefile, which will identify a 10 mile radius around the centroid of each polygon, and calculate the AVERAGE "demand for services" (one variable in my shapefile attribute table) for all the surrounding polygons within this radius. All of the relevant polygons are in the same layer/shapefile.

Ideally, this average would be calculated in a new field in the attribute table, so that I can symbolize this variable and get a more even "heat map" of demand (which is not as tied to the municipality boundaries.)

Can anyone help me out with instructions on how to do this?


texts: Converting QGIS Labels to a Polygon Shapefile

texts:
I am trying to create an annotation feature from labels and then export this out as a polygon shapefile (the resulting shapefile can then be loaded into ArcGIS online to basically have labels without using feature services from ArcServer).

In ArcMap, you can label the features, turn the labels into annotation, and then use the "Feature Mask Outline" GP tool with a mask of "0" to essentially 'mask' the annotation labels into exact polygons of the label text (as a shapefile).

I am looking to do the same process described above, but do it in QGIS?
Any thoughts on what tools may accomplish this?


texts: Can I update features in an SDE database from python without using an ArcEditor License?

texts:
I have a non spatial data set that I would like to keep sync'ed in SDE as a spatial set. So I would like to be able to insert, update, and delete without using one of my two ArcEditor licenses since this will be running on a server. Can I do this?

Clarification: I meant data set in the most general term, just a raw table in a DBMS that holds spatial data, but is not a part of any ESRI product.

Full explanation: We use a very old MapObjects customization that was purchased from a 3rd party vendor. It stores binary shape information (conforming to ESRI shapefile standards thankfully) in a binary column in MSSQL server. Every time an edit is made to a record in that datbase a trigger records the edit. As of now, there is an application that runs on a server that checks out an ESRI ArcEditor license and processes the edits (with ArcObjects) that have been made and makes the appropriate change in an SDE database with feature datasets and feature collections. I would like to avoid this use of a license on an unattended server for what would seem to me to be a normal use of SDE and not something inherent that requires an ArcEditor instance.


texts:
I'm trying to split several lines into bits of a maximum given length using v.split.
First, I got this bug:

  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in
  position...

which was solved downloading the new QGIS version 3.4.2
But now, using QGIS 3.4.2 under WIN8-64 bits, I get several warnings and this new errors:

  Starting GRASS GIS...

  WARNING: Concurrent mapset locking is not supported on Windows.

  Creating attribute table for layer
  ...

  WARNING: Unable to open database ... by driver

  ERROR: Unable to open database ... by driver

  WARNING: Unable to open vector map
  on level 2. Try to rebuild vector topology with v.build.

  ERROR: Unable to open vector map

  ERROR: Vector map  not found

I tried to save the output as a shp file instead of a .gpkg but it doesn't work either.


texts: Using createLayer in CartoDB isn't working

texts:
So, the scenario is I have a situation where users can look up multiple tables worth of data, and want to view them in an aggregate fashion. Based on certain filters, I get a list of tables then want them displayed on a map.

For sake of everyone's sanity, I've put up a Fiddle with a working version:

https://jsfiddle.net/tigerhawkvok/q1nq89s1/5/

it uses real table names (with test data) and a real account, and you can see it not functional.

Here's the main function in question:

createRawCartoMap = (layers, callback, options, mapSelector = "#global-map-container") ->
  ###
  # Create a raw CartoDB map
  #
  # See
  # https://docs.cartodb.com/cartodb-platform/cartodb-js/getting-started/#creating-visualizations-at-runtime
  #
  # @param array layers -> an array of sublayer objs for CartoDB
  ###
  unless options?
    options = new Object()

  params =
    user_name: options.user_name ? cartoAccount
    type: options.type ? "cartodb"
    sublayers: layers

  # The CartoDB layer options
  mapOptions =
    cartodb_logo: false
    https: true
    mobile_layout: true
    gmaps_base_type: "hybrid"
    center_lat: window.locationData?.lat ? center[0]
    center_lon: window.locationData?.lng ? center[1]
    zoom: 5

  ## Leflet Map Setup
  leafletOptions =
    center: [window.locationData?.lat ? 0, window.locationData?.lng ? 0]
    zoom: zoom ? 5
  unless geo.lMap?
    lMap = new L.Map(mapSelector.slice(1), leafletOptions)
    geo.lMap = lMap
    lTopoOptions =
      attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
    L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', lTopoOptions).addTo lMap
  BASE_MAP = geo.lMap

  cartodb
  .createLayer(BASE_MAP, params)
  .addTo(BASE_MAP, 1)
  .on "done", (layer) ->
    # It really should already be up from the array of sublayers provided, but sure, we'll try again
    for dataLayer in layers
      layer.createSubLayer dataLayer
    if typeof callback is "function"
      callback()
    false
  .on "error", (errorString) ->
    # Error handling
  false

Both the fiddle and the code above may have some detritus from the full script it was pulled out of.

I'm seriously at a loss. Everything I've read and seen seems to indicate that it should work, but it doesn't.


texts: Data driven page in ArcGIS - export to PDF - page name

texts:
I am working with data driven pages. In data driven object attributes I have one attribute column with page order (index), another with page name.

Is there a way to get file name like: %Page order%_Some-text_%Page index%.pdf?


texts:
I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large,  in some cases up to 3GB per raster dataset.

I need to convert these to NumPy arrays so as to run an analytical program that I wrote on them, but I'm hitting a memory error when my script tries to convert the first raster dataset. The script creates a list of all of the rasters in the dataset (rasterList), then grabs the country codes at the end of each raster dataset name and populates a new list of all the country codes. I then delete rasterList, and iterate through the country codes, converting rasters to either 'GLUR_'+code or 'Pop00_'+code. I delete each raster from memory after it is converted, but the program doesn't even get that far...

The code is:

import arcpy, os
import numpy as np
from arcpy import env
env.workspace = "J:/Data/CISC.gdb"

filepath = "J:/LIVE/"
rasterList = arcpy.ListRasters("G*")
codeList = []

for raster in rasterList:
    codeList.append(raster[5:])

del rasterList

for code in codeList:
    print code
    inputGLUR = arcpy.Raster("J:/Data/CISC.gdb/GLUR_"+code)
    lowerLeft = arcpy.Point(inputGLUR.extent.XMin, inputGLUR.extent.YMin)
    cellSize = inputGLUR.meanCellWidth
    print "Converting GLUR_"+code, "to NumPy array"
    arr = arcpy.RasterToNumPyArray(inputGLUR, nodata_to_value=0)
    os.chdir("J:/LIVE/NumPy_GLUR")
    numpy.save("GLUR_"+code+".npy", arr)
    print "GLUR Converted"
    del inputGLUR
    del arr

    inputPop = arcpy.Raster("J:/Data/CISC.gdb/Pop00_"+code)
    lowerLeft = arcpy.Point(inputPop.extent.XMin, inputPop.extent.YMin)
    cellSize = inputPop.meanCellWidth
    print "Converting Pop00_"+code, "to NumPy array"
    arr = arcpy.RasterToNumPyArray(inputPop, nodata_to_value=0)
    os.chdir("J:/LIVE/NumPy_Pop")
    numpy.save("Pop00_"+code, arr)
    print "Population array converted"
    del inputPop
    del arr

and yields this error:

Traceback (most recent call last):
  File "J:\PYTHON\RasterToNumPy.py", line 21, in <module>
    arr = arcpy.RasterToNumPyArray(inputGLUR, nodata_to_value=0)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\__init__.py", line 2244, in RasterToNumPyArray
    return _RasterToNumPyArray(*args, **kwargs)
MemoryError

This is on a computer with an i7 processor and 16GB RAM. The data is stored on an external disk. Any ideas on how to handle rasters of this size?


texts: Strange QGIS plugin behaviour if it runs for the first time

texts:
I have made a plugin that works fine in itself. Shortly said it fills a combobox based on a MS Access table. Then features in the map are shown that meet the value I select in the combobox.
But I encounter a strange phenomenon. If I run the plugin for the first time after starting QGIS, or after reloading it, the combobox is not filled and I can't do anything but closing the plugin. Then, if I rerun the plugin it works fine.
What's happening here?
The relevant code:
conn = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ= [path and .accdb];')
cursor = conn.cursor()
cursor.execute( [query] )
mylist.clear()
for row in cursor.fetchall():
  mylist.append(row[0])
  self.dlg.mycombobox.addItem(row[1]+' ('+str(row[2])+')')


texts:
I´ve downloaded the C++ code for the qgis_hello_world plugin from GitHUB (https://github.com/thebigspoon/qgis_cpp_plugin_cookbook)

I compiled with Visual Studio 2012 express on a win7 machine (though I had to comment out the Q_OBJECT macro), but it is unclear to me where to put the dll afterwards. I´ve tried
c:\OSGeo4W\apps\qgis\plugins and c:\OSGeo4W\apps\qgis\qtplugins but it doesn´t seem to be loaded, and I don´t get any error messages.

This page (http://qgis.org/da/site/getinvolved/development/cppplugindevelopment.html#qgis-cpp-plugin-development) leaves me with the impression that in order to create c++ plugin I have to compile the entire QGIS source from scratch - is that correct?


texts: Creating lines from starting to arrival points?

texts:
Is it possible in QGIS to create lines from a table storing the X,Y-coordinates of starting and arrival points, so that a line.shp is automatically created?
Or does a plugin exist to achieve that?


texts: What is the best way of refreshing the view after drawing graphics?

texts:
I draw a polygon on button click to highlight a feature. Then I need to refresh the ActiveView to show the new polygon. This lines do work:

mapControl.ActiveView.ScreenDisplay.StartDrawing(StartDrawing(mapControl.ActiveView.ScreenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache);
mapControl.ActiveView.ScreenDisplay.DrawPolygon(feature.Shape);
mapControl.ActiveView.ScreenDisplay.FinishDrawing();
mapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, feature.Extent, null);

But it always reloads every layer. I tried nearly all ways of calling PartialRefresh with other esriViewDrawPhase but none of them did show the new polygon.

Is there a better solution than to redraw with esriViewDrawPhase.esriViewAll?

Update

I used an ILayerExtensionDraw.AfterDraw to test the draw phases and the AfterDraw only gets hit for PartialRefresh() with esriViewAll. The extension is added to all layers in MapControl.Layers. I expected that it gets hit everytime? On which layer does mapControl.ActiveView.ScreenDisplay.DrawPolygon(feature.Shape); draw so that the AfterDraw isn't even raised?

Answer

Thanks to Kirk here is the solution, which shows the new added graphic without reloading any layer.

IGraphicsContainer con = _mapControl.Map as IGraphicsContainer;
if (con != null)
{
  IFillShapeElement fillShapeElement = new PolygonElementClass();
  fillShapeElement.Symbol = fillSymbol;
  IElement element = (IElement)fillShapeElement;
  element.Geometry = feature.Shape;
  con.DeleteAllElements();
  con.AddElement(element, 0);
  _mapControl.ActiveView.ScreenDisplay.Invalidate(feature.Extent, true, _mapControl.ActiveView.get_ScreenCacheID(esriViewDrawPhase.esriViewGraphics, null));
}


texts: Projection issues whilst opening shapefile in ArcMap created in QGIS

texts:
I created a polygon shapefile in QGIS.  Projection was saved as EPSG: 3857, WGS 84 / Pseudo Mercator.

When I open this shapefile in ArcMap the projection sets itself as WGS_84_World_Mercator which I believe is also EPSG: 3857.

The issue is my polygons are several hundred metres to the north of where they should be when overlaid on the OpenStreetMap base map.

Does anyone know of this projection issue and the link this has to taking files created in QGIS and bringing them into ArcMap?


texts: Changing shapefile (.shp) format to Object File Format (.off) file?

texts: I got a map and its format is .shp. What tool can be used to change it to one of the following file formats .off, .ply, .wrl, .obj, .m, .gim. ？


texts:
I am very new to GIS and I've looked everywhere for a solution but to no avail.

I want to analyze Himawari 8 Gridded Data. I am following the steps to process gridded data, link below.

http://quicklooks.cr.chiba-u.ac.jp/~himawari_movie/rd_gridded.html

After converting count values to spectral reflectances (I am processing Band01, visible), I am left with a file with the extension '.dat'

The tutorial mentioned above further explains how to visualize this using Generic Mapping Tools (GMT) which I have no problem with. I want to explore and analyze the final raster after applying the processing steps in QGIS. But this software does not see '.dat' file extension as a valid input. I have come across tools which convert ASCII to raster.

The .dat file I have is close to 530MB. I opened it in wordpad and it was all gibberish.

How should I proceed? I've been stuck on this subject for couple of days now and am looking for guides or relevant sources.


texts: Generating a predictive map with standardized variables

texts:
I have a model from which I am attempting to create a predictive map (in GIS, but I'm aware of some options in R). The response values are constrained to [0,1] using an offset term in the model (see the full model below) and as such, raster values should also have the same constraints.

I believe the syntax in Raster Calculator is correct, but the output values aren't constrained to [0,1]. My guess at the moment is that this is because I scaled the variables around a mean of 0 and standard deviation of 1 prior to model building. Is my best bet of achieving the predictive map to also scale the rasters in GIS or R? If so, how?

Model syntax in Raster Calculator is as follows:

     Ln(57064) + (-0.10872 * "var1"^2)+ (0.02844* "var2"^2)+(-0.03848 * "var3"^2)+ (0.05726*"var4")
     +(0.06462*"var5"^2)+(- 0.42450*"var6"^2)

Edit to clarify the process I used: I created 6 raster layers (things like distance to roads, distance to streams, etc.) in GIS from which I sampled to generate my predictor values. I standardized these predictor values using the parameterization described above. I fit a negative binomial model with these predictors, where frequency of animal use was the response. An offset term (in the syntax above, depicted as ln(total counts)) transformed frequency of use to probability of use. After some model selection, my model generated beta estimates which are standardized and therefore are best interpreted in an odds-ratio context. I'd like to use the model, which I included above, to generate a predictive map of probability of use across my study area.


texts: Writing Python script for ArcGIS to square polygon corners?

texts:
I'm looking for a script that will square the corners of polygons that are near 90 degrees but not exactly. Near could be dealt with via a variable, for example within 5 degrees of 90 (85 - 95 degrees).

For a more detailed description and some rather formal pseudo code, please refer to the following ESRI thread (particularly William Huber's post).


texts: PostGIS connection in QGIS using Linux login-user?

texts:
I wanted to set up a generic QGIS project (with PostGIS data on localhost) that can be re-used by different users. I use trust authentication, so no need to worry about passwords.

The problem is that I still have to provide a user name when creating a local PostGIS connection in QGIS, which is stored in the QGIS project (.qgs) file. (I use the current login-user in Linux). The project file becomes unusable/invalid when a different user tries to use my project file on their machines.

Is there a way to set up the project (or system) so that it works for any Linux user name, assuming those users have default PostgreSQL databases/usernames, which are the same name as their OS user names?

Related:
Creating new PostGIS connection in QGIS?

(I'm using QGIS3, PostGIS 2.4).


texts:
I've created a polygon and closed my project, after opening the project again, i can't use the Reshape Feature tool in that specific polygon. But if I create a new polygon in the same shapefile I can use this tool.

Do you know what can be happening in my project? what can I do?


texts: Using Feature Dataset with ReplaceDataSource gives ValueError: Layer: Unexpected error?

texts:
I'm attempting to replace the data source of a unsourced layer with a mxd. The issue I'm having is that the Featureclass "APPL" is contained within a Feature Dataset. When the feature class is outside of the data set the code below works perfectly.

   workspace = output + "\\PlanningSession.gdb\\DIDs" ## Dataset

   lyr = arcpy.mapping.ListLayers(mxd,"DAB_APPL", df)[0]
   lyr.replaceDataSource(workspace, "FILEGDB_WORKSPACE", "APPL")

The error received can be found below:

    Traceback (most recent call last):
      File "Q:\Admin\Python_Scripts\Tools\PlanningSession\Script\PlanningSession.py", line 356, in <module>
        lyr.replaceDataSource(workspace, "FILEGDB_WORKSPACE", "APPL")
      File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\utils.py", line 182, in fn_
        return fn(*args, **kw)
      File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\_mapping.py", line 681, in replaceDataSource
        return convertArcObjectToPythonObject(self._arc_object.replaceDataSource(*gp_fixargs((workspace_path, workspace_type, dataset_name, validate),True)))
    ValueError: Layer: Unexpected error

    Failed to execute (PlanningSession).


texts: Export dataset of images for given points in the map for image classification

texts:
I am working on a project about image classification from GIS (working with GEE).
I have a .csv with Longitud, Latitude and some other features of sample points (like the class, and others).
Disclaimer alert: I am new to GIS and JavaScript, first time with both.
What I want to achieve is export for each point in the dataset:

Data from N different days of observation (Example, just for illustration, 4 images 1 every 3 months) for each ROI.

What I've done so far (some thing are not exactly what I need, but I want first to get things working and afterwards do the fine tuning, like cloud coverage, or exact dates):

Load the original dataset
var table = ee.FeatureCollection("users/user/folder/train");

Load the image collection from Landsat 2
var imgCollection = ee.ImageCollection('COPERNICUS/S2_SR');\

and filter it
var imgFiltered = imgCollection.filterDate('2020-01-01','2020-02-28')
                               .filterBounds(dataSquares) [dataSquares is defined as the table.map(getSquare)], function defined below
                               .filterMetadata("CLOUDY_PIXEL_PERCENTAGE", "less_than", 25)
                               .select(['B2','B3','B4','B8']);\

Get a Square of 2*radius side around the datapoints
function getSquare(feature,radius) {
var circle = feature.buffer(radius);
var square = circle.bounds();
 return square}
This function I use to build squares around all the points in the original dataset

Clip Image Collection to desired area: Work in progress here I am only working with ONE SAMPLE to make it work, then try to extend it to the entire dataset
function clipImageBounds(image,area,side){
 return image.clipToBoundsAndScale({geometry: area,
             width:side,
   height:side
  }).uint8();}

Finally, export
Export.image.toDrive({image: onlyInterest,
scale: 10,
 dimensions: "100x100",
 region: dataSquares});

So I've been trying to make this work for just 1 image before trying to it with the entire dataset.
When I do it, I can export an image that is not usable (it's a 2x2 with half of it being black).
My main problem now is getting an usable image from this. Because I am getting some output, but it is really far away from the dessired one.
Since probably there are much better ways to get the same thing done, modifications to my workflow are also welcomed.


texts:
I need to overwrite a table in CartoDB using the Import API, but the system instead of overwriting the table, it creates another one with the same name and attaches an id auto-generated.

For instance:

The table stored in CartoDB is named coordinates.

When I overwrite the table, it creates a table named coordinates_1 for instance.

Is it possible to overwrite the same table with different data?


texts: Changing symbol and legend of feature class in ArcMap using ArcObjects?

texts:
I want to change the symbol of features and legend programmatically.  When I use this code

Dim pSymbolSelector As ISymbolSelector
Set pSymbolSelector = New SymbolSelector
Dim pMarker As ISimpleMarkerSymbol
Set pMarker = New SimpleMarkerSymbol
If Not pSymbolSelector.AddSymbol(pMarker) Then
       MsgBox "Could not add symbol"
ElseIf pSymbolSelector.SelectSymbol(0) Then
       Dim pSymbol As ISymbol
       Set pSymbol = pSymbolSelector.GetSymbolAt(0)
End If

then Symbol Selector is open, but when I select a symbol it is not being applied at the current layer in Table of Contents.


texts: Imported polygon from Google Earth is not being merged

texts:
I'm new to QGIS. I need to merge two polygon that I have imported from Google Earth (.kml) but when I try to do so I am getting an error message

Not enough features selected: The merge tool requires at least two selected features

Is there any remedy?


texts: Why does Describe function fail on annotation layer with RuntimeError: Object: Describe input value is not valid type?

texts:
I am accessing layers in an mxd programatically and also accessing the layer properties using the Describe function

 lyr =arcpy.mapping.ListLayers(mxd) # gets me the list of layers in mxd

 desc= arcpy.Describe(lyr[8]) #returns the properties of the layers

This last step fails at one of the layer "Annotation Class 1" as the layer has white space characters or a probable keyword ( I suppose) in it showing me the following error:

  RuntimeError: Object: Describe input value is not valid type

How do I handle that?

It is impossible for me to go and manually change all mxd layer names with whitespace, please help, thanks


texts: Editing the shape_length field in a gdb file

texts: I spotted two mistakes in my file (see objectid = 395), as seen in the photo. I know what the values are meant to be, and I can edit the length(km) variable in ArcMap, but I am unable to edit the shape_length variable. How then can I fix the incorrect observation, and have the correct file?


texts: Oracle Spatial - How to calculate the point of intersection of 2 line geometries

texts: How to calculate the point of intersection of 2 line geometries.


texts: Create time series for multi-polygon Google Earth Engine

texts:
I have a imported a KML as fusion table to GEE. This fusion table is type of FeatureCollection and contains 6 elements. I would like to create a time series of a raster (in this example MODIS LST), based on the feature. Meaning, my final goal is to get a chart (which I can export as csv), where the x-axis is the date and the y-axis is LST (or other raster value), per each feature in the feature collection, or one that contains all, which I can differentiate between them. I saw the GEE example script - Image Time Series By Region, but when I changed the feature collection there to my fusion table, I got one chart for all of my features, I assume this is the average of all of them.

What I got so far is this:

// Get  temperature data for 1 year.
var modis = ee.ImageCollection('MODIS/006/MOD11A1');
var modisLST = modis.filterBounds(fc2)
                    .filterDate('2003-12-25', '2008-02-25')
                    .select('LST_Day_1km');

// Convert temperature to Celsius.
modisLST = modisLST.map(function(img){
  var date = img.get('system:time_start');
  return img.multiply(0.02).subtract(273.15).set('system_time_start', date);
});

// Create a function that takes an image, calculates the mean over a
// geometry and returns the value and the corresponding date as a
// feature.
var createTS = function(img){
  var date = img.get('system_time_start');
  var value = img.reduceRegion(ee.Reducer.mean(), fc2).get('LST_Day_1km');
  var ft = ee.Feature(null, {'system:time_start': date,
                            'date': ee.Date(date).format('Y/M/d'),
                            'value': value});
  return ft;
};

// Apply the function to each image in modisLST.
var TS = modisLST.map(createTS);

// Create a graph of the time-series.
var graph = ui.Chart.feature.byFeature(TS, 'system:time_start', 'value');

print(graph.setChartType("ColumnChart")
          .setOptions({vAxis: {title: 'LST [deg. C]'},
                        hAxis: {title: 'Date'}}));

where fc2 is my fusion table that contains 6 features.
How can I accomplished my goal?


texts: Updating OSM map from within PhoneGap/Cordova App

texts: I am trying to build a sat-nav application that allows the users to dynamically update the map that their application is using. So if the user updates the map with a new road then that road is considered in shortest path calculations.  I have become familiar with Postgres/PostGis databases, and importing osm data into them, but so far I have been unable to figure out a way that the user can update the map and the display the updates to the user. Could anyone offer me some advice on methods to achieve this ? ?


texts:
I'm having the following problem with IDW automation. I have a catchment and several gauging stations measuring daily precipitation amounts. I would like to interpolate the precipitation amounts from these stations (points) to the whole catchment. In the next step, I would like to calculate average precipitation value for the catchment. I can do it for one day (1 value for each station).
The problem is that I have 30 years of daily precipitation measurements in each station, and so I need to do this process thousands of times. I have created a simple model in model builder which could do this process once, but I am not able to force it to do it repeatedly.

How do I automate this process?

Here is the modelbuilder scheme:


texts:
I know there was ArcInfo Workstation, and its earlier name of ARC/INFO which was used prior to the release of ArcGIS 8.0, but how did "Arc" come into the name?

I suspect because of the arc which is a geometric element representing a vector feature.


texts:
I try to use postgis in rails and write my first request. I would like have :
- the nearest points of another point (but without this point)
- the name and the distance between the both

In my model I have write this scope :

 scope :close_to, -> (latitude, longitude, distance_in_m = 1) {
  where(%{
  ST_Distance(lonlat, 'POINT(%f %f)') < %d
 } % [longitude, latitude, distance_in_m * 1000])
}

How can I get the distance ?


texts: Starting Python Shell Window of IDLE for use with ArcGIS Pro?

texts:
Prior to installing ArcGIS Pro 1.3 (I am now at 1.3.1), on Windows 7 SP1, I have been starting IDLE in a Python Shell Window from the Windows Start Menu using IDLE (Python GUI) in the Python 3.4 folder.  I can still do that but it reports that I am using Python 3.4.3.

However, when I use Windows Explorer and right-click a *.py file and choose Edit with IDLE (ArcGIS Pro) the Python Script Window that opens reports that I am using Python 3.4.4.

In the help for Python in ArcGIS Pro 1.3 it says:

  In prior versions of ArcGIS Pro, Python was accessed outside of ArcGIS
  Pro through a separate installation of Python for ArcGIS Pro. Starting
  in ArcGIS Pro 1.3, Python for ArcGIS Pro is no longer required and
  should be uninstalled to avoid confusion.

which makes me suspect that I should no longer be using or have the Python 3.4 folder under All Programs on the Windows Start Menu.

If I were to delete it, then how would I start the Python Shell Window of IDLE with Python 3.4.4?


texts: Stop Agent Analyst model run in the code after a number of steps

texts: I was wondering if there was a way to stop a model run within the code. For example, I would like to end a model run after a prescribed number of steps. I have looked around but I can't find anything that helps me. Thanks.


texts: Making stars::st_rasterize equivalent to raster::raster using meuse.grid

texts:
I'm trying to learn my way around stars. Given the meuse.grid data, how can I make a stars object that has the same dimensions, extent, etc. as I can get from going from SpatialPointsDataFrame to SpatialPixelsDataFrame to raster? In the example below, how can I make mg1 and mg2 equivalent?
library(tidyverse)
library(sf)
library(stars)
library(sp)
library(raster)

data(meuse.grid)
mg1 <- meuse.grid
coordinates(mg1) = ~x+y
proj4string(mg1) <- CRS("+init=epsg:28992")
gridded(mg1) = TRUE
mg1 <- raster(mg1)

mg2 <- meuse.grid
mg2 <- mg2 %>% st_as_sf(coords = c("x", "y")) %>%
  st_set_crs(value = 28992) %>%
  st_rasterize(dx=40,dy=40)

mg1
mg2

dim(mg2)
dim(mg1)
bbox(mg1)
st_bbox(mg2)


texts: QGIS - Bad Allocation error message on zoom or atlas generation

texts: I've seen a few topics on the 'Bad Allocation' error message, but nothing that's help solve my problem yet.   I have a virtual layer returning records from multiple tables, but I can't identify any of the records in the canvas.  It appears to be tied to the geometry - if it's on 'Autodetect', simply nothing happens when I try to zoom to a selected a feature; if I've specified the geometry (in this case, LineString), I'll get the bad allocation error.  Same thing happens in composer if my atlas is based on the virtual layer - either nothing, or bad allocation.


texts: How can i figure out to convert this points to latlong?

texts:
I got below data in sql server, Learned that data is collected under zone IIIa considering Lambert Conformal conic projection in India. The data is generated from Spatial Cadastre Software. Also learned that XPos and YPos units are in meters.

Expectation: All the below data combined should draw a polygon in google maps.
Please guide us to convert this points to latlons or any suggestion on how to draw polygon in google maps. It should be plotted in India-AndhraPradesh(State)-Karimnagar(Dist)-Peddapur(Village)

PointName   Xpos    Ypos
_0  192         388.6016
_1  189.7742    409.8918
_10 299.5876    382.3074
_11 329.6552    355.2643
_13 334.9612    350.492
_14 373.8721    315.4951
_15 396.8649    294.8151
_16 403.9396    288.452
_17 467.6119    231.1844
_19 536.5903    169.1445
_21 375.0864    452.0209
_3  198.4302    327.0963
_4  202.1399    291.6124
_6  210.3013    213.548
_7  210.7959    208.8169


texts: CreateLayer function needs a basemap? How to create one in Cartodb.js?

texts:
I'm new to using CartoDB.js and I'm trying to use the CreateLayer function to create a new map on a webpage. (I don't want to link to a map already made on the CartoDB website.)

The online tutorials provide code samples, but don't explain how to create a basemap. Can I do that in Cartodb.js? Or do I have to use something like Leaflet?

Here's my code so far:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Online Mapping</title>
    <link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />
    <script src="http://libs.cartocdn.com/cartodb.js/v3/3.15/cartodb.js"></script>

</head>
<body>
<script>
    map = new google.maps.Map(document.getElementById('map'),  mapOptions);
    cartodb.createLayer(map, {
      user_name: 'samuelsmaggie',
      type: 'cartodb',
      sublayers: [{
        sql: "SELECT * FROM us_counties",
        cartocss:

            #us_counties{
              polygon-fill: #8A4E8A;
              polygon-opacity: 0.8;
              polygon-comp-op: darken;
              line-color: #FFF;
              line-width: 0.3;
              line-opacity: 1;
            }

            }
                  }]
                }).done(function(layer) {
                map.addLayer(layer);

                });
</script>
</body>
</html>


texts:
I would like to install the current QGIS LTR (2.14.15) under Linux Mint 18. I have followed the QGIS instructions for installing the LTR from the ubuntugis ppa without success. I get the following error about unmet dependencies:

The following packages have unmet dependencies:
 qgis : Depends: qgis-providers (= 1:2.14.15+24xenial) but 1:2.18.8+24xenial-ubuntugis is to be installed
 qgis-plugin-grass : Depends: qgis-plugin-grass-common (= 1:2.14.15+24xenial) but 1:2.18.8+24xenial-ubuntugis is to be installed
                     Depends: qgis-provider-grass (= 1:2.14.15+24xenial) but 1:2.18.8+24xenial-ubuntugis is to be installed
E: Unable to correct problems, you have held broken packages

I had previously used the LTR candide QGIS 2.18.x, but decided to replace with the LTR. I have removed and purged qgis and removed the related content from my sources.list file before attempting to install the LTR. I have also tried the steps listed in this answer. My errors still invoke 2.18.8. Can I install the LTR on Xenial, and if so, how do I do it?

Edit:  Here is the result of

apt-cache policy qgis-providers

below

qgis-providers:
  Installed: (none)
  Candidate: 1:2.14.15+24xenial
  Version table:
     1:2.14.15+24xenial 500
        500 http://qgis.org/debian-ltr xenial/main amd64 Packages
     2.8.6+dfsg-1build1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages


texts:
Background:
I have been tasked with porting a 9.3 .NET toolbar to ArcGIS 10 / 10.1.  I am a dyed in the wool Python programmer and, while digging through someone else's .Net is interesting, it isn't the most fun in the world!

Once ported I have a number of improvements that I want to implement.

The existing tool is a toolbar with 4 buttons.  Each button launches a menu that accepts parameters, performs some processing* and generates output files (shapefile in GDB and text logs).

Question
Is it possible to create this same style workflow,  toolbar > button > menu > run, using python add-ins?  This needs to be shippable to a wide range of users (10 & 10.1) so I do not want to generate windows using WxPython (for example).

*By in large the processing is not digging into ArcObjects geoprocessing functionality that is not accessible via Python.  Anything geoprocessing that is, is pretty easily recoded in pure Python.

Edit: Both posters so far have noted that the functionality I am really looking for is ArcGIS10.1.  I should have noted that I realize this, but still wanted to hear some options.  This should be targeted at 10.1+ (for when 10.2 rolls...)


texts: How to merge rasters with negative extents?

texts:
I'm trying to form a mosaic from two overlapping images of an old tithe map.  I've used the georeferencer plugin using one of the images as canvas to generate a modified version of the other.  I then used Raster>Miscellaneous>Merge.  This generates the following commandline:

gdal_merge.py "/home/ian/Maps/Stubbin/1801 map Stubbin prt 1.JPG" "/home/ian/Maps/Stubbin/1801 map Stubbin prt 2_modified.jpg"

This gives an error:

ERROR 1: Attempt to create 2768x-1659 dataset is illegal,sizes must be larger than zero.

This seems to be related to the fact that image metadata for the original images shows the layer extents as 0.0, -1651.0 : 2339.0, 0.0 and other digital camera images also have -ve extents.

How do I work round this?

Platform is QGIS 1.8.0 on Debian Squeeze 64-bit.


texts: Using SearchCursor - TypeError: Not a Spatial Reference

texts:
I am trying to use a search cursor to print three columns of data (out of the existing 10). I run a dissolve early in the code and use raw_input so I can specify which fields to use for the dissolve parameter. My endgame is so I can use this on various datasets. Anyway, when I get to the search cursor, it kicks back and error stating "not a spatial reference."

Here is my code after the dissolve. I use the many print field statements to make sure it is printing the text correctly. Ultimately, what I am trying to do is have it automatically use the fields I use for the dissolve as the search cursor. I am not sure how I do not have a spatial reference when codes_fc is the dissolved_lu layer. Dissolve_items contains the field names in the dissolve. They are typed in as LU12;LABEL12;TYPE12 - which explains the replace the in the first line.

textheaders = str(dissolve_items.replace(";",","))
print textheaders

codes_fc = dissolve_lu
fields = textheaders.split(',')
print fields
print fields[0]
print fields[1]
print fields[1]
print fields[2]

#Search fields for using Search Cursor
with arcpy.da.SearchCursor(codes_fc, fields[0], fields[1], fields[2]) as     cursor:
#log("LU12" + "," + "Label_12")
    for rows in cursor:
        print rows
        codes = str(fields[0])
        desc = str(fields[1])
        type1 = str(fields[2])
        print codes, desc, type1
        code_entry = str(codes, desc, type1)
        if code_entry not in lu_code_list:
            lu_code_list.append(code_entry)
print lu_code_list


texts:
I am trying to figure it out how can I take a preserved color from a raster I already set up before and then apply the colormap to a new raster file?

Here are the details of what occurred:
Before I export it to a Imagine file, the shade relief was in grid file and I change the color ramp and made the edits of the colors I want and save it the style in Arcmap 10.
When my ArcGIS 10 was installed last December 2012 and in about a month or so my ArcGIS 10 had problem, so I had to re-install my ARCGIS 10 to correct a problem.
Now that my style file I saved the color I want got lost/ or missing and could not find it. Is there a way that can I get the colors from the raster I have and to apply a new shade relief?

This is the picture I want the colors to transfer to another raster.

as of May 1, 2013 my ArcGIS has been upgraded to 10.1 .


texts: Joining with gSSURGO with field polygons

texts:
I am using field boundary polygons to get soil type information from gSSURGO (especially percent sand and clay).

Here are my steps:

I used zonal statistical as table tool to find what unique ID (MUKEY) is assigned into each field bounday. I was thinking to join with soil data at the end.
Using Soil raster provided by gSSURGO, I first joined with Chorizon table (where information for percent sand and clay are located) since raster layer only include (value, count, MUKEY). Once I joined table to raster I found there are many (Null) values since original information for percent sand and clay have Null values
Finally, I joined between field bounday with field in raster based on MUKEY.
However, I also found there are many (Null) values. In other words, many fields do not have values for percent sand and clay.

What I want to do is that I have 1062063 field boundaries (polygons) and get the values of percent sand and clay from gSSURGO without having missing values. If some values are missing in gSSURGO, I would like to get the closest value from neighbor.


texts: I tapped on the down arrow closer to the Add Data bottom but the Add Basemap that appeared could not be selected.


texts: Including print size of my layout in label in QGIS?

texts:
I want to include the print size of my layout (e.g. "A3") as part of a label on the map, how can I write an expression to capture this information automatically?

I am using QGIS 3.12.


texts: Adding building and woodland heights to raster DTM using QGIS 2.18.19

texts:
I am using QGIS 2.18.19 to produce viewsheds of a proposed development to show where the development would in theory be visible from. I am using Ordnance Survey Terrain 5 as my height data (*.asc) which I have loaded and saved out as a GeoTIFF so that it is correctly geo-referenced to the coordinate reference system I am using (OSGB36).

At present I have run a viewshed of the development using the DTM which gives the theoretical visibility as if the earth was bare.  I have a separate vector dataset of woodland which I have converted to a raster.

Firstly, how can I add give the woodland raster a notional height so that each block of woodland has a height of 10m?

Secondly, how do I add the raster of the woodland (with notional woodland height) to the DTM so that I have a raster of the DTM with woodland heights?


texts: Couldn't load PyQGIS, QGIS 2.0.1 on Ubuntu 12.04 Precise

texts:
After upgrading to QGIS 2.0.1 I still get the error:

Couldn't load PyQGIS.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib/python2.7/dist-packages/qgis/init.py", line 63, in
    from qgis import core
RuntimeError: the sip module implements API v10.0 to v10.1 but the qgis.core module requires API v8.1

I have installed the latest python-qgis package (2.0.1-2+precise1). Am I missing something the right (older) SIP package?


texts: Setting ArcMap data frame extent with ArcPy?

texts:
I am currently working on a Python script (v2.7) to automatically update/adjust an ArcMap (v10.4.1) MXD file, including adding several layers and adjusting the data frame extent. The code is running without any documented errors and completes successfully, however I'm experiencing a strange issue with setting the data frame extent just before saving the final map.

I have based my code on the ArcGIS documentation found here, with the relevant code extracts shown below. At present, the new extent is not saving within the MXD document, instead rendering a 'global' extent when the final MXD document is loaded within ArcMap (the extent is large enough to encompass all layers). What is really confusing is that I have added a few print statements within the code to check the extent values before and after being set, and these are all returning the correct values (i.e. according to ArcPy, the extent is being set correctly). All other modifications to the MXD (e.g. layers, symbology, text annotations etc.) are also saving correctly.

Python Code:

# Setup the MXD document:
mxd = arcpy.mapping.MapDocument(mxd_output_path)
data_frame = arcpy.mapping.ListDataFrames(mxd, "Monitoring")[0] #only one data frame in the MXD file.

# Calculate and print the default MXD data frame extent:
print 'Extent check 1:'
newExtent = data_frame.extent
print newExtent.XMin, newExtent.YMin, newExtent.XMax, newExtent.YMax

# [Remove irrelevant layers here]
# [Add new layers here]
mxd.save()
# [Update legend here]
mxd.save()
# [Update layer symbology here]
mxd.save()
# [Update text annotations here]
mxd.save()

# Calculate and print the current MXD data frame extent now that layers have been added/removed:
newExtent = data_frame.extent
print 'Extent check 2:'
print newExtent.XMin, newExtent.YMin, newExtent.XMax, newExtent.YMax

# Print the desired MXD extent (to check values are correct):
print 'Desired MXD Extent:'
print mxd_extent

# Set the new desired extent:
newExtent.XMin, newExtent.YMin = int(mxd_extent[0]), int(mxd_extent[1])
newExtent.XMax, newExtent.YMax = int(mxd_extent[2]), int(mxd_extent[3])
data_frame.extent = newExtent

# Now check the MXD extent again to ensure the values have been set correctly:
newExtent = data_frame.extent
print 'Updated Extent:'
print newExtent.XMin, newExtent.YMin, newExtent.XMax, newExtent.YMax

mxd.save()

sys.exit()

Output:

Extent check 1:
1416032.76389 6813235.09719 1469048.16389 6844138.89719  # Default extent of the initial MXD data frame.

Extent check 2:
1213148.14815 6688750.0 1636851.85185 6936250.0  # Extent of the initial MXD data frame after adding desired layers (a global extent to cover all layers). This is the extent rendered by ArcMap when loading the final saved MXD.

Desired MXD Extent:
[1461338.0, 6811715.394055312, 1471338.0, 6817544.605944688]  # Desired extent values.

Updated Extent:
1461338.0 6811708.82692 1471338.0 6817550.17308  # Data frame extent values according to ArcPy after being updated (values are correct).

Final extent within ArcMap 10.4.1:

XMin: 1213148.148148148 m
YMin: 6689007.066639897 m
XMax: 1636851.851851852 m
YMax: 6935992.933360104 m

# Final extent is still the automatic 'global' extent for all layers (see Extent check 2).

Can anyone see if I've missed anything in the process for saving the desired extent to the MXD document?


texts: Trying to add a value in the second row of a table

texts:
I am trying to add a specific value to a cell of the second row of a feature-class-table. Doesn't work with my code:

    #First row
    rows = arcpy.InsertCursor(tb_value)
    row = rows.newRow()
    rows.insertRow(row)

    cur = arcpy.UpdateCursor(tb_value)
    for row in cur:
        row.setValue(fn_value_object, COUNTER)
        row.setValue(fn_name_area, gebietsname)
        row.setValue(fn_name_object, objektname)
        cur.updateRow(row)

    #Second row
    whereClause = """{0} = 2"""
    whereClause = whereClause.format(arcpy.AddFieldDelimiters(tb_value, "Rowid"))
    cur = arcpy.UpdateCursor(tb_value, whereClause)
    row = rows.newRow()
    rows.insertRow(row)
    for row in cur:
        row.setValue(fn_value_object, COUNTER2)

I tried it with a where-clause, but the value which is set in the second row is 0.


texts: Creating save button that saves mxd as previous version

texts: I'm running 10.4 right now and I was wondering if there's a way to create a save button add-in that would save the mxd as 10.2? I know there's the arcpy command saveACopy but I imagine that would keep the 10.4 version of the mxd and just create a copy of the mxd in 10.2. I was hoping to just make a button that would make the original mxd 10.2, and save it as 10.2 every time I used it. I don't want to create a whole bunch of mxds.


texts: How does MapInfo handle button identifiers?

texts:
As in create button pad statement:

Create ButtonPad { title_string | ID pad_num } As
        button_definition [ button_definition ... ]
    [ Title title_string ]
    [ Width w ]
    [ Position ( x, y ) [ Units unit_name ] ]
    [ ToolbarPosition ( row, column ) ]
    [ { Show | Hide } ]
    [ { Fixed | Float } ]

And In create button

{ PushButton | ToggleButton | ToolButton }
    Calling { procedure | menu_code | OLE methodname | DDE server, topic }
    [ ID button_id ]
    [ Icon n [ File file_spec ] ]
    [ Cursor n [ File file_spec ] ]
    [ DrawMode dm_code ]
    [ HelpMsg msg ]
    [ ModifierKeys { On | Off } ]
    [ Enable ] [ Disable ]
    [ Check ] [ Uncheck ]

As for my question the default button may already have ID so how would we know that ID is unique.


texts: Seeking General GIS Questions for Job interviews?

texts: What are some general GIS questions that are asked in an interview process, not related to any particular software but questions that can test one's core knowledge about GIS?


texts: Python script in ArcMap to fill a field in a shapefile based on information in other fields

texts:
I am trying to fill a field of a shapefile that is delevoped by a number of unions. The content of the field is supposed to inform about the origin of a polygon in the shape.

I am not experienced in python scripts, so my solution is not quite elegant:

def  FillInfo(Info,Info_WB,Info_UESG,Info_GB,Info_Moo,Info_HHS,Info_PT,Info_SN,Info_SA):
return Info_WB + ',' + Info_UESG + ',' + Info_GB + ',' + Info_Moo + ',' + Info_HHS + ',' + Info_PT + ',' + Info_SN + ',' + Info_SA

Info is the field that is supposed to contain the information regarding the origin of the polygon and Info_NN are the fields containing this information.

The problem is, I do not want a row of commas if the fields are empty.

How can I manage to only string together "valid" entries?


texts: Efficient computation of path profile with Numpy and GDAL

texts:
I have numpy array with SRTM elevation data and I need calculate path profiles - vectors with elevation data from one point (transmitter)  to every points of my map. Here's my current solution:

def get_elev_vector(self, coord1, coord2, step=90):
    if coord1 == coord2:
        return 0
    lat1, long1 = coord1
    lat2, long2 = coord2
    dist = self.get_dist(coord1, coord2)
    npt = dist / step
    vect = np.zeros(npt + 3, dtype='float32')
    vect[0] = npt
    vect[1] = dist
    vect[2] = self.get_elevation_direct(coord1)
    vect[npt] = self.get_elevation_direct(coord2)
    g = pyproj.Geod(ellps='WGS84')
    coordvect = g.npts(long1, lat1, long2, lat2, npt)
    i = 3
    for lon, lat in coordvect:
        vect[i] = self.get_elevation((lat, lon))
        i += 1
    return vect

#(tx, ty) transmission coordinates
while lat > latmax:
         long = longmin
         while long<longmax:
               vect =  self.carta.get_elev_vector((tx, ty), (lat, lon))
               arr[xarr, yarr] = 100
               yarr +=1
               lon += dlon
         xarr +=1
         lat +=dx

It works, but it take about 3 hours for 20x20 km area. Is there any way to make it work faster?

Add

    def get_elevation(self, coord):
    """TODO"""
    lat, lon = self.xyfromlatlon(coord)
    mlat = int(lat)
    mlon = int(lon)
    vicin = self.tile['numpy_array'][mlat: mlat + 2, mlon: mlon + 2]
    temp_bool = np.equal(vicin, -32768)
    np.putmask(vicin, temp_bool, 0)
    elev = billin_interpol(vicin[0][0], vicin[0][1], vicin[1][0],
                                        vicin[1][1], lat - mlat, lon - mlon)
    return int(elev + 0.5)

def billin_interpol(tl, tr, bl, br, x, y):
"""Bilinear interpolation.
   Return:
    float, interpolated value
"""
b1 = tl
b2 = bl - tl
b3 = tr - tl
b4 = tl - bl - tr + br
return b1 + b2 * x + b3 * y + b4 * x * y


texts: Extracting list of counties that are nested within larger geographic units in QGIS?

texts: I have one layer/shapefile that consists of county boundaries and another layer of larger geographic divisions that each contain about 15 counties. I basically want a list of all the counties that are in each of these larger geographic divisions. The larger super-county divisions generally follow county boundaries but there are some that don't follow county lines.  I was told earlier that a spatial join is the way to go, but after having exhausted (I think) all the options in both QGIS and Python's Geopandas it looks like a spatial join doesn't quite do what I want: create a table of counties with an simple indicator of which area(s) they are in (so if the county is in two areas there are two records, etc.). The spatial joins so far have also been including divisions that touch the county, whereas I just want the counties that are spatially in the larger division. Also, the "contains" and "within" commands don't seem to be successfully creating any inner matches. I'm using QGIS 3.4 for Mac.