texts:
I have some layers that i want to publish after creating html / open layers format web maps using leaflets. Every time i try, i get this error. in fact i am unable to use pluggins. Please suggest. Error as below:

I am new on this stack exchange and i could not figure out where to post my next question to Mr Evan. I am an Architect and an Urban Planner by profession. I use QGIS for urban planning projects with government of Jharkhand, Inida. basically i dont understand python scripts.... Is there a way to fix my problem so that i can use qgis2web for publishing maps on our government website please?

An error has occurred while executing Python code:

ValueError: invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "C:/Users/HP/.qgis2/python/plugins\qgis2web\qgis2web.py", line 58, in run
    self.dlg = MainDialog(self.iface)
  File "C:/Users/HP/.qgis2/python/plugins\qgis2web\maindialog.py", line 149, in __init__
    self.autoUpdatePreview()
  File "C:/Users/HP/.qgis2/python/plugins\qgis2web\maindialog.py", line 310, in autoUpdatePreview
    (auto_preview, message) = self.shouldAutoPreview()
  File "C:/Users/HP/.qgis2/python/plugins\qgis2web\maindialog.py", line 294, in shouldAutoPreview
    if total_features > int(self.previewFeatureLimit.text()):
ValueError: invalid literal for int() with base 10: ''

Python version: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
QGIS version: 2.18.20 Las Palmas, e8e15d5b1e

Python Path:
C:\Users\HP\.qgis2\python\plugins\GeoCoding\libs
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python
C:/Users/HP/.qgis2/python
C:/Users/HP/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.18/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS2~1.18\bin\python27.zip
C:\PROGRA~1\QGIS2~1.18\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.18\bin
C:\PROGRA~1\QGIS2~1.18\apps\Python27
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/HP/.qgis2//python
C:\Users\HP\.qgis2\python\plugins
C:\Users\HP\.qgis2\python\plugins
C:/Users/HP/.qgis2/python/plugins\qgis_resource_sharing
C:\Users\HP\.qgis2\python\plugins\qgis_resource_sharing
C:\Users\HP\.qgis2\python\plugins\qgis_resource_sharing\ext_libs
.
C:\Users\HP\.qgis2\python\plugins\DigitizingTools\tools
E:/GISmp/NF Infratech/Final_Amrut_Formulation_20180402/Saraikela/udhdcheck


texts: Unexpected behaviour of extract function in the raster package

texts:
Calculating zonal statistics in R with the extract function in the raster package, I found unexpected behaviour. I have a raster layer of rather large cell size and a polygon layer of relatively small, quadratic polygons. As an example, I want to use these nine polygons 19 - 27 with the raster plotted as background:

extract(raster, polygon, weights=TRUE, normalizeWeights=FALSE)

yields the following result:

[[19]]
          value weight
[1,] -102.39999   0.06
[2,]  -92.79999   0.03

[[20]]
     value weight
 -92.79999   0.06

[[21]]
     value weight
 -92.79999   0.09

[[22]]
          value weight
[1,] -102.39999   0.04
[2,]  -92.79999   0.02

[[23]]
     value weight
 -92.79999   0.04

[[24]]
     value weight
 -92.79999   0.06

[[25]]
     value weight
[1,]   -88   0.06
[2,]   -86   0.03

[[26]]
 value weight
   -86   0.06

[[27]]
 value weight
   -86   0.09

Apparently, the function collects the values of the raster cells overlapping with each polygon and assigns each value a weight corresponding to the area covered by the respective coverage within a polygon. If that worked perfectly, I'd be absolutely satisfied. However, there are some oddities:

Why is weight different for polygons 20 and 21, 26 and 27?
Why are weights ≠ 1 when a polygon falls completely within a raster cell?
Why does polygon 22 only get 2 values instead of 4 (and polygon 23 and 24 1 value each instead of 2)?

The help page states that weights "returns, for each polygon, a matrix with the cell values and the approximate fraction of each cell that is covered by the polygon(rounded to 1/100)". I suppose that weight rather uses a distance measure of the polygon to the raster cell centroid than an actual coverage fraction (?). When using normalizeWeigths=TRUE, this might become irrelevant. However, partly ignoring raster cells that fall within a polygon doesn't seem irrelevant at all.

Does anybody understand why this happens and how to solve this problem?


texts: ArcPad Studio default values only show up in ArcPad when I make new points

texts:
I am using ArcPad to do a habitat inventory (default value= "N/A") and invasive species survey (default value= "Absent") on a grid of preset points (the points are a shapefile). The default values only appear in my drop down boxes in ArcPad if I drop a new point onto the landscape, they won't appear when I click on a point from my preexisting grid of survey points.

The text is in quotes (such as "N/A") and I put it in the value tab in control properties on ArcPad Studio. Why won't it show up for my existing points?


texts: Exporting to PDF from ArcMap, it seems large datasets do not get clipped to page boundary?

texts:
I am puzzled by something about ArcMap's export to PDF.  I have a large contours layer being used on a map, much larger than the area shown in my neatline.  When I export to PDF I get a huge file size (24mb) but if I turn off the contours layer it goes way down (300k).  If I make a clip of the contours and use that the file size stays small.

In my export settings I am not exporting any Layers or Attributes (under the Advanced tab) so I would have thought that the PDF would be a "flat" file where the map is rendered onto the page, and the data would stop at the page's borders since there's no layer/attribute info that has to be embedded, and none of the spatial linework is useful when it is not on the rendered page.

So is there a setting somewhere in ArcMap that allows the export to clip spatial data to the export page extent to decrease file size, instead of including all linework for features that are not even visible? (what i assume is happening)


texts: Retrieve pixel value from raster layer in pyQGIS

texts:
I am trying to access the pixel data in all bands from a raster layer in QGIS from the Python Console. I have looked at several online resources including

http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/raster.html#query-values

but for the life of me I cannot get the code supplied by the cookbook to work. I have loaded an image in QGIS and it looks fine, using the reported x and y values (-757742.961, -3827190.956) from a point in the image. I come up with the following code:

ident = layers[0].dataProvider().identify(QgsPoint(-757742.961, -3827190.956), QgsRaster.IdentifyFormatValue)

where I know layers[0] is referencing the right data because layers[0].name() returns the layer name. the very large negative numbers on the QgisPoint seem weird to me, but I am assuming that they are coordinates in the mapped space. the values that get returned from

print ident.results()

are

{1: None, 2: None, 3: None, 4: None}

I would like to know why I cannot get the raster band values with this code, and if there is a quick way to correct the code. If anybody can offer a little insight into the large x and y values as well that would be great.

CRS data for the image:
CRS: WGS84 / UTM zone 37N | Authority ID: 32637


texts: How do I find the centroid of each patch in a raster?

texts:
I am trying to get the centroid of a several areas in a large raster data set.

The output needs to be raster format, with one pixel representing the center of each patch, in the same resolution as the input raster. I tried using the feature to point tool and then converting the point output to raster, but this takes an incredibly long time to process, meaning this task may take me several days as I have several rasters I need to do this for.

I was hoping to find a quicker way that doesn't involve switching between rasters and features. Essentially, I'd like to do the equivalent of 'feature to point' but with a raster.

Does anybody know a way to do this? I am relatively new to ArcGIS so don't know how to use Python unfortunately!

I'm using ArcGIS 10.2 Advanced license


texts:
I have made an attempt to create a buffer around some points useing PyQGIS. However, when running the following code (see below) I receive and IndexError saying that 'list is out of range'.

What might be the issue?

layerName = "C:/Users/Anna Nilsson/Desktop/AIRPOLIM-ES/GIS data/Kenya/cpp_KE_meters.gpkg"
iface.addVectorLayer(layerName,"coal plants","ogr")
outFn = "C:/Users/Anna Nilsson/Desktop/buffer1.shp"
bufferDist = 100000 #in map units

layers = QgsProject.instance().mapLayersByName(layerName)
layers = layers[0] #buffered layer is the first layer in layers list

fields = layers.fields()
feats = layers.getFeatures()

writer = QgsVectorFileWriter(outFn,'UTF-8',fields,QgsWkbTypes.Point,layers.sourceCrs(),'ESRI Shapefile')

for feat in feats:
    geom = feat.geometry()
    buff = geom.buffer(bufferDist,5)
    feat.setGeometry(buff)
    writer.addFeature(feat)

iface.addVectorLayer(outFn, '', 'ogr')

del(writer)

Error message:

Traceback (most recent call last):
  File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 19, in <module>
IndexError: list index out of range


texts: Can not add features to layers created from PostgreSQL's Updateable Views in QGIS

texts:
I can not insert on an updateable view with QGIS,

CREATE TABLE foo (
  id serial PRIMARY KEY,
  mytext text,
  geom geometry(point)
);
CREATE VIEW bar AS TABLE foo;

When I map bar as a layer and try to create a new feature on it, I get,

Could not commit changes to layer bar

Errors: ERROR: 1 feature(s) not added.

  Provider errors:
      PostGIS error while adding features: ERROR:  null value in column "id" violates not-null constraint
    DETAIL:  Failing row contains (null, asdf, null).


texts: We are trying to develop pur own quantized mesh generator and visualize these terrain tiles on CesiumJS. As an input we use SRTM data that belongs to north parth of TURKEY. We generate contours on DEM, extract points from contours and triangulate points using Delanuay algorithm. Finally we tile data according to TMS specification and encode data to terrain files. When we attemp to visualize these terrain files on CesiumJS, we receive some errors. We tile data for zoom levels between 10 and 16 because our region is relatively small compared to world. But while we are zooing to our region cesium requires tiles that are not in our zoom range and after a while when we keep zoom in everything disappears. We couldn't figure it out why this happens. Here is some pictures describe situation before and after a zoom.


texts: Is it possible to download the raw data (in .csv form) for EO-1 Hyperion via the Descartes Labs Platform?

texts: I'd like to import it into a Python file to work with it. Also, for EO-1 Hyperion, since I believe its relatively newly uploaded data, will I need to "clean" the data myself?


texts: Adding NetCDF files to Mosaic - no coordinate system

texts:
I have some NetCDF files that are displaying correctly in ArcGIS using the 'Make NetCDF Raster Layer'. The properties show an undefined spatial reference, but reads the eastings and northings to put it in the correct spatial location.

However when I try and add these netCDF files to a mosaic dataset, it states that the data does not have a valid coordinate system. I've attempted to force the coordinate system onto the data when adding to the mosaic, but it still fails.

Any ideas?


texts: What's the syntax to automatically show map center and composer name on the map?

texts:
I am trying to create some extremely user friendly print composer templates that have an awful lot of autotext  data that updates for each composer without having to manually type it in.

I have done this by using text boxes and inserting expressions for the required text. Currently I have file path, filename, project title, user , date and time etc but have not yet worked out how to add grid details etc.

I have got a grid with a frame and zebra around the outside of the map but it would be nice to be able to add a line of text that says something along the line of "Map centred on xxxxxx, xxxxxx" using the os grid reference, or something along those lines.

I would also like to add the composer name as an expression so its automatically updated


texts: I want to create the DEM by using the contour lines but I am unable to do so. Following the 3D analyst tool > Data Management Tool> Create TIN. Then I added contour line (shape file) as an input file and filled the necessary column but it doesn't create any TIN. As I go for closing the file it gives warning of result is running in background.


texts: How to count the number of 100m length chunks in a table with line geometry?

texts:
And by chunks I do not mean segments so I can't use st_segmentize for this
In other words I have a linetable which has many lines of varying length. Example:
id | st_length(geom) | intended count for result
1 | 30 | 1
2 |  72 | 1
3 | 150 | 2
4 | 10 | 1
5 | 230 | 3
6 | 350 | 4

What I'm after is the sum of the above intended column, so 1+1+2+1+3+4 = 12
I have come up with a way of doing this, but because lines can go up to 8k in length, it's just not a good solution
select a.count100 + b.count200 from
( select count(*) count100 from linetable where st_length(geom) < 100) a,
( select count(*) count200 from linetable where st_length(geom) >= 100 and st_length(geom) < 200) b

Is there a way to do this more efficiently


texts: Missing Raster/Vector Layers after converting KMZ using KMLToLayer tool of ArcGIS Desktop?

texts:
I am trying to write a tool that will let users upload a KML/KMZ file and then be able to view it in a client application (something like an esri js api or Flex app).

I am ok with storing the data in a feature class (file, personal, sde) once it is uploaded.

I have tried writing a Python script using the KMLToLayer geoprocessing tool (I'm in 10.04) but I'm getting spotty results.

My test kmz has two vector layers and two raster layers but my output has only one vector layer and nothing else.

Are there other tools I could use?


texts: How to classify points in mapinfo table into their enclosing polygons (non overlapping polys) in one run

texts: The objective is to classify a group of points to its enclosing polygons in one run rather than using select for each polygon and do it on one by one basis (for 100,000 point and 5000 polygons it can take for ever).


texts: Temporal Manager raster animation monthly instead of days in QGIS

texts:
I have raster files on a per month scale over several years. I struggle to create an animation that shows monthly changes. I would like to have an animation showing each monthly raster file (and my other overlapping shape files).
I have manually added dates in the form of using the first day of the month and the last day of the month (e.g. January 2000 has the start date 2000-01-01 and end date 2000-01-31)
However, with the Temporal Manager the output won't be on a monthly-step scale. It always seems to convert a one-month step into days. With days, you'll eventually end up in between months and the output is not as desired.
For instance, starting on January 01-2001, the first step shows 2001-01-01 to 2000-01-31 and the second step shows 2001-01-31 to 2001-03-02. The output then only shows January and March, skipping the February raster. This is not only because of 28 days in February, I get similar results for other months, too.
I tried to use monthly steps as 1,04 or similar, but this does not consistently work, especially when you have long time series over many years. I would like to simply show each month at a time.


texts: Point attribute from underlying raster data TIFFTAG

texts:
I have a layer of manually set points in qgis that have the following attributes at the moment :

id, lat, long

Additionally, I have a number of different overlapping raster images (sattelite data) that are all tagged with a date using the TIFFTAG_DATETIME in the raster's metadata.

What I would like to do is to form an additional attribute for the point layer that is called dates:

dates = ["2015-01-01", "2015-12-01"]

The list of dates should contain all the dates of satellite imagery that contain the particular point.

Any ideas how to do this in qgis. If needed I can also use different methods of tagging the GeoTiff file. Or maybe even create polygons that have the date as attributes. But the code that is creating and tagging the GeoTiff files runs outside of qgis.


texts: Coloring service area using QGIS and GRASS tool v.net.alloc

texts:
I try to work with v.net.alloc to find some service area for my problem in QGIS 2.18.13.
That algorithm work nice create categories from my roads for any hotspot like this :

and if use style categories then I have a simple coloring road map for any hotspot.
My question is how to coloring all service area and not only the service road like this example :

I need with the some method to coloring all area from service area using v.net.alloc.
any idea ?


texts: Removing labels from inset areas within main data frame

texts:
I have three inset maps (separate data frames) within my map. I want to not label the buildings within the inset map extent on the main data frame, but keep labels outside of the inset extent. If it can remain dynamic, that would be perfect.

This is for ArcMap.


texts: Calculating area-weighted mean of a raster in QGIS

texts:
I am working with a global raster dataset (WGS84 projection) where the value of each grid cell equals a rate (g N m-2 yr-1) (r_rate). I would like to calculate the average rate (i) for the whole raster and (ii) for 10 different zones, which are specified by another raster (r_zone).
I managed to calculte means for r_rate for each unique value in r_zone with the "Raster Layer Zonal Statistics" tool, however, different grid cells have different areas (grid cell area increases with latitude); so I was wondering how to calculate the area-weighted mean of all values in r_rate by zone.

Is there tool that does this automatically, or
Is there a tool to create a raster containing the area of each grid cell (r_grid_area)? That would allow me to do the calculation manually by multiplying r_rate by r_grid_area, then summing the resulting values by zone and dividing by the sum of r_grid_area-values in each zone.


texts: Loop through columns Python arcpy.ListFields

texts:
I am trying to run a Python script that loops through all fields in my input feature attribute table. I have searched extensively and tried to use arcpy.ListField to work but it seems all people got stuck on the same issue: we cannot get the columns we are trying to loop to work as input field.

Here is my script:

import arcpy

arcpy.env.workspace = "C:\Users\jacobyan\Desktop\JACOB"

fieldList = arcpy.ListFields("BG_SAR1.shp")

try:
  #Call all fields in the list
  for field in fieldList:
   outputname = str(field.name) + ".shp"
   print outputname
   arcpy.ClustersOutliers_stats("BG_SAR1.shp", "field", outputname, "GET_SPATIAL_WEIGHTS_FROM_FILE","EUCLIDEAN_DISTANCE", "ROW", "#", "SpatialWeights.swm","NO_FDR")

except:
  print arcpy.GetMessages()

The result I got is:

  FID.shp Executing: ClustersOutliers
  C:\Users\jacobyan\Desktop\JACOB\BG_SAR1.shp field
  C:\Users\jacobyan\Desktop\JACOB\FID.shp GET_SPATIAL_WEIGHTS_FROM_FILE
  EUCLIDEAN_DISTANCE ROW #
  C:\Users\jacobyan\Desktop\JACOB\SpatialWeights.swm NO_FDR Start Time:
  Wed Jul 29 14:45:56 2015 Failed to execute. Parameters are not valid.
  ERROR 000728: Field field does not exist within table Failed to
  execute (ClustersOutliers). Failed at Wed Jul 29 14:45:56 2015
  (Elapsed Time: 0.03 seconds)

I adjust "field" to "field.name" and try to replace it with FieldList[count], but none of those worked.

Here are two related posts I have looked at:
Iterating through columns in table using ModelBuilder?

https://geonet.esri.com/thread/56324


texts: Split a polygon layer with another polygon layer in QGIS

texts:
I have two layers :

The red layer with 2 features : 1 and 3.
The green layer with 3 features : area 1, area 2 and area 3.

I need a layer which contain my green layer split by my red layer. In that example, I would have a polygon layer with 6 features in it.
I would like the attribute table like :

area 1 | NULL
area 1 | 1
area 2 | NULL
area 2 | 3
area 3 | 1
area 3 | NULL

I didn't see such an algorithm in QGIS. What is the best way to do that ?


texts: QGIS processing scripts, more than one progress bar in the generated GUI?

texts:
Since I sometimes have to process cross product of two vector layers with geoprocessing scripts, causing me to use nested loops like

source_count = source_layer.featureCount()
target_count = target_layer.featureCount()
nsource = 1.0
for f_source in source_layer.getFeatures():
    ntarget = 1.0
    for f_target in target_layer.getFeatures():
        #do something
        targetprogress = 100 * (ntarget / target_count)
        ntarget += 1
    sourceprogress = 100  *(nsource / source_count)
    progress.setPercentage(sourceprogress)
    nsource += 1

When both layers consist of, let's say, some ten thousands of features, processing can be extremely time consuming, and to communicate the user that the processing is still alive, it would make sense to have a progress bar for each inner and outer loop.

I don't think this can be achieved with standard processing gui tools, but this combined with some Qt widgets? I'd like to do the processing in a script, not a plugin, in wich's Qt form various QprogressBars would be easy to implement.


texts: Why is sum of st_length() of segments 20% too big?

texts:
I'm running a query to return the total length of some bike paths, from OpenStreetMap. Compared to the known actual length of these paths, they're all a bit too big - something like 10-30%.

I know it may not be possible to down the exact reason, but any possible explanations would be greatly appreciated - I'm new to GIS and could have a basic misunderstanding.

The database is PostGIS with OSM extracts loaded in using Osm2pgsql in 'slim' mode. The routes are OSM relations which osm2pgsql converts into a series of lines, for each way with the given relation. My query looks like this:

select route_name,concat(to_char(sum(st_length(way)/1000.0), 'FM99990D0'), 'km')
from planet_osm_line
where route_name like '%Rail Trail' and (tags::hstore -> 'state') is null
group by route_name
order by sum(st_length(way));

Some selected results:

              route_name              | concat
--------------------------------------+---------

 Old Beechy Rail Trail                | 60.4km
 Great Southern Rail Trail            | 68.5km
 Ballarat-Skipton Rail Trail          | 72.2km
 East Gippsland Rail Trail            | 123.4km
 Murray to Mountains Rail Trail       | 142.5km
 Goulburn River Country Rail Trail    | 170.4km

Actual distances are:

Old Beechy: 46km
Great Southern: 49km
Ballarat-Skipton: 56km
East Gippsland: 94km
Murray to Mountains: 116km
Goulburn River Country: 134km

What could account for this discrepancy? (If anything, I was expecting the numbers to be too low, representing missing data in OSM. But they're all too high.)

EDIT Now that I actually do the calculation, it's more like 25-40% too high.

Here's the osm2pgsql command:

osm2pgsql  --database gis_aus --slim --create --username ubuntu --hstore --hstore-match-only --number-processes 8 [australia-latest.osm.pbf][2]

i

More info

I just measured the distance of this dead straight, flat road: http://www.openstreetmap.org/browse/way/138890161

Google Maps says 8.144km. PostGIS/OSM/st_length says 10.126km. Pretty big discrepancy.


texts: Creating arrows based on GPS velocities to show displacement

texts:
I am having trouble creating symbology in ArcGIS that can show velocity arrows of GPS stations. I have a point file with location information, velocity and direction of each GPS station. I want to create a map similar to the image I have attached. The size of the arrows stay the same but the length changes based on the velocity.  See below.

My first instinct was to use graduated symbols however that just scales the arrows and does not stretch them.


texts: how to calculate polygon area using field calculator QGIS?

texts:
I am trying to calculate the areas of some polygons and i want to use the field calculator to measure the area. The result i got using this method is different from using the QGIS measurement tool. I am confused on which is correct. How can i do this correctly?
Also is it possible to change the measurement unit of the field calculator to give result in meter square?


texts: How to create reports in ArcGIS using Python?

texts:
Does anyone have experience in creating reports from your ArcGIS data (geodatabase, map exports) using a python reporting engine? In my current project, we are using Jasper Reports in the following way: A custom geoprocessing tool creates a intermediate XML file containing the data from the Oracle SDE and an exported map image as encoded byte array. This file and a template from iReport is used to generate a PDF file by Jasper Reports.

I am looking for a different solution using a report engine based on python (Jasper is based on Java), I can imagine that a python approach can be better integrated in ArcGIS.

Did anyone tried this before?


texts: Insert (or Update) Cursor setting value to None not honored when field has a default value

texts:
To set a field to null, the InsertCursor or UpdateCursor is setting the value to None.

Here is a sample for the UpdateCursor:

with arcpy.da.UpdateCursor(test_fc, ['SERVICEINDICATOR'], """"OBJECTID" = 1""") as uCur:
for row in uCur:
    row[0] = None
    uCur.updateRow(row)

The field allows nulls but has a default value. When setting the value to null, it always sets to the default.

In other words, if the default is 'N', setting the field to None results in the row having 'N'.

How can the cursors respect the None/Null request?

This is an Oracle SDE database (so the answer to arcpy.UpdateCursor setting value to 0 instead of Null does not apply) and ArcMap 10.1


texts: Putting sequential numbers in Attribute table

texts:
When I use the field calculator in the attribute table and use $rownum, the numbers appear as "1, 10, 100" instead of "1, 2, 3, 4."

How do I make it sequential?


texts: Importing multiple files in Microstation V8i

texts:
I have several dozen Shapefiles (*.shp) that I want to Import into Microstation V8i.

Unfortunately, I can only choose one file at a time, so this would be a tedious task.

Is there a way to Import many files at once?


texts: Normally, I use the 3x3 lowpass filter if I need to filter a DEM. However in one case, for better results in curvature calculations, I would like to do 5x5 filtering. How is this possible in ArcGIS 10.3?


texts:
I have made a custom add-in for my building ID update tool. The objective is:
user will write an alphanumeric value in the combobox like 'x100'. When a user selects a bunch of polygons(building) and click on the button, it should increment its numeric part and update the value in the Build-ID column of the attribute field.

The code so far is:

import arcpy
import pythonaddins

class Pid(object):
"""Implementation for Group Building ID Updation_addin.Pid (ComboBox)"""
    def __init__(self):
        Pid.items = [""]
        self.editable = True
        self.enabled = True
        self.dropdownWidth = 'WWWWWW'
        self.width = 'WWWWWW'
    def onSelChange(self, selection):
        pass
    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
        pass
    def onEnter(self):
        Pid.items[0] = Pid.value
    def refresh(self):
        arcpy.RefreshActiveView()

class updateid(object):
"""Implementation for Group Building ID Updation_addin.updateid (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        if Pid.items[0] != "":
            sel = ""
            mxd = arcpy.mapping.MapDocument("CURRENT")
            layers = arcpy.mapping.ListLayers(mxd)
            for layer in layers:

                try:
                    desc = arcpy.Describe(layer)
                    if desc.FIDSet:
                        sel = layer.name
                        break
                except AttributeError as e:
                    print("FIDSet failed on layer - {}".format(layer.name))

            if sel != "":
                if arcpy.Describe(sel).FIDSet:
                    with arcpy.da.UpdateCursor(sel, "Build-ID") as curs:
                        for row in curs:
                            num1 = int(filter(str.isdigit, x)) + 1
                            str1 = str(filter(str.isalpha, x))
                            Pid.items[0] = str1 + str(num1)
                            row = (Pid.items[0],)
                            curs.updateRow(row)
                else:
                    pythonaddins.MessageBox('No Selection', 'INFO', 0)
                arcpy.RefreshActiveView()
            else:
                pythonaddins.MessageBox('No Selection', 'INFO', 0)
        else:
            pythonaddins.MessageBox('Please Enter Previous Building ID', 'INFO', 0)

This tool sends below error when loading it.

>>>
File "<string>", line 1
Group Building ID Updation_addin.Pid=Group Building ID Updation_addin.Pid()
             ^
SyntaxError: invalid syntax

When writing a value in combobox it sends below error.

>>>
TypeError: unbound method onEditChange() must be called with Pid instance as first argument (got unicode instance instead)
>>>
TypeError: unbound method onFocus() must be called with Pid instance as first argument (got bool instance instead)

When clicking on the button it says.

>>>
TypeError: unbound method onClick() must be called with updateid instance as first argument (got nothing instead)

Has anybody have any idea where it is failing.

Edit: I've tried making an instance of Pid class and called the method through it, but the errors remain same.


texts:
Environment: PostgreSQL: 9.5.15, PostGIS: 2.2.7
When analyzing a table containing GIS data, I get this output:

ANALYZE SCHEMA.TABLE;
NOTICE:  no non-null/empty features, unable to compute statistics
NOTICE:  no non-null/empty features, unable to compute statistics
Query returned successfully with no result in 1.1 secs.

What is the reason for the NOTICE, and can this lead to any problems in the future?


texts: Merging multiple temporal inputs in QGIS Graphical Modeler

texts:
I want to do a simple merge of some algorithm outputs in QGIS graphical modeler (not for an iterative process, like my previous question "Collect results of iterative processes in QGIS graphical modeler", but just for two outputs of parallel/forked extractions).
I feel like this is so basic, it should be obvious: Right where it says 'Input layers' I ought to be able to select multiple inputs, but choosing "algorithm-output" gives me only one pulldown menu.
How do I connect two outputs as input layers (as indicated in yellow)?

I tried using 'Expression' as Input, and there I can select output layers as variables (e.g. @outputX). However I don't know how to use this expression to use multiple variables, either (e.g. @outputX, @outputY gives an error:

Unexpected COMMA where $end was expected

other variations don't work as well, e.g. with space, semi-colon, ...).


texts:
I use the "difference" processing beetwen 2 layers to have polygons of layers A that do not intersect polygons of layer B. In these 2 layers there are not bad geometries and topology is cleaned. I checked for that with "check geometry and "verify topology"

After the difference, in the result layer I detected a lot of errors: duplicate nodes and self-intersection. The results is often flats polygons as we see on illustration below.

I would like to know why errors appear while layers A and B are clean. maybe problem of tpology beetwen A and B ?


texts: Tool Dialogs appear blank in ArcGIS for Desktop?

texts:
All of a sudden my Toolbox in ArcGIS 10.1 for Desktop has stopped working.

Last week i was using clip tool but the toolbox window was blank, i tried other tools but it shows the same blank window.


texts: Google Earth, Google satellite, and Bing aerial accuracy

texts: Does anybody know the accuracy of Google Earth, Google satellite, and Bing aerials, and at what scale? I think that you have different/better accuracy if you have subscribed to their professional version.


texts: Issue with QGIS 2.10.1 Clip and Intersect Tools

texts:
Having an issue in QGIS 2.10 -- clip and intersect don't seem to be working correctly. I am trying to show zipcode by a legislative district in Florida. When I clip the zipcode shapefile by the district one, some of the zip codes aren't being clipped (or intersected -- I'm getting the same result with both tools).

In the below screenshot, the bronze color is what both tools are giving me as an output. It should be giving me the bronze vectors + the areas that are blue-violet (created by the overlay of the semi-transparent blue district shapefile and the purple zip code shapefile). I don't understand why this isn't working, it seems pretty simple to me, but am I missing something?

The data for this project is here if needed: https://www.dropbox.com/s/ee70m26gdcvgbd8/FL%20HD%2069.zip?dl=0

Both shapefiles are from the US Census and are projected in NAD83.

I tried selecting only the zip codes that would be in the district, checking the "use only selected features" box in the clip tool, and got the same results.


texts:
I have an attribute table with a lot of fields that I added for data collected via gps. I would now like to duplicate that attribute table for use with another layer, based on different data.

Is there a simple way to do this other than manually?

I am using QGIS.


texts: Plotting “large” image with points with matplotlib - MemoryError

texts:
I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly.

I wrote like this:

# I am just giving the general characteristics of the data;
img = numpy.ndarray, dtype = uint8, shape = (3193,3293)
points = numpy.ndarray, dtype = int32, shape = (1502,2)

plt.imshow(img, cmap=plt.cm.gray_r)
plt.autoscale(False)
plt.plot(points[:, 1], points[:, 0], 'r.', markersize = 15)
plt.axis('off')
plt.show()

Is there any other way to do this without using that much memory?


texts: Symbolize a layer based on it's related table (1:M relationship class)

texts:
I have a layer of polygons joined by a relationship class to a table by Field = DistrictIDNumber

The Table has multiple entries for each polygon so it is a one to many relationship.

Is there any way to symbolize the polygons based on count of related entries? Lets say they are number of observations and the polygons are districts within a county. Can I symbolize the polygons, in graduated colors, based on the number of observations reported in that district?

I can't use the actual point data of the table.

I'm currently using ArcGIS 10.2 but have access to R, if you guys think this would be a more appropriate application.


texts: How to save ArcGIS process output to variable?

texts:
I've created script in Python for ArcGIS that simplify Line, and make buffer from processed line.

input = "input.shp"
name = "bord"
buffer = "buffer.shp"

gp.SimplifyLine_management(name, input, "POINT_REMOVE", "2000 Meters", "FLAG_ERRORS", "NO_KEEP", "NO_CHECK")

gp.Buffer_analysis(input, buffer, "10 Meters", "FULL", "ROUND", "NONE", "")

but it this case, I have to create 2 shapefiles (one for intermediate results, and one for output). But is it possible to save for ex. intermediate results to variable, and then use it as parameter for buffer, and print out geometry of buffer(as array of vertexes) to the screen? I'm using ArcGIS 9.3


texts: Displaying vertex coordinates of a polygon on a map in QGIS

texts: I have a polygon shape loaded in QGIS, and I'd like to display every vertex' coordinates on the map in a label or popup next to it, how can I do that?


texts: Reclassifying raster with 33 bands in ArcMap?

texts:
I have a file geodatabase raster dataset with 33 bands. Each band is comprised of pixels with values 1-31. This represents 33 years of landuse cover data (with 31 different landuse classes). I'm trying to move from this format to a single TIFF file that has 1 band comprised of pixels with the value 1-33, corresponding to the year that the pixel switched from forest to non-forest. Its a huge file (100GB), so I need to reduce the file size before I can do any analysis.

My plan is to reclassify each band/year into 0 (forest) and 1 (non-forest), then sum all the bands (using the raster calculator, I think?). However, the reclassify tool is only reclassifying a single band.

How do I do this for all the bands.


texts: How can I export a georeferenced image using a selected shapefile geometry in ArcMAP 10.7?

texts: Although I can transform the selected geometry to a graphic and cut the image from the graphic, I want to avoid this step and cut the image from the selected graphic. Is this possible from within an editing session?


texts: How to restrict zoom levels in the Google Maps API

texts:
Is it possible, in the Google Maps API v3, to restrict the zoom to specific levels (eg 16 and 7)?

In my case I wish to show city points at a global scale, then show suburb polygons when zoomed in - but I only want those 2 levels of zoom rather than the full 20 levels.

Thanks


texts: Geocortex can't validate secure service connection

texts:
I was able to add a service connection to my GIS server over http, but not https in 4.8.2. I just installed AGS, Web Adapter, GE, and it's a brand new server that I just stood up.

https://gisserver.domain.local:6443/arcgis/tokens does not work, but http://gisserver.domain.local:6080/arcgis/tokens does.

When I put both URLs into a browser, they both work and my Username/password generates a token.

Obviously, I use my own GIS Server and Domain... What might be the problem?


texts: replacing shapefile data source in subdirectories with feature class

texts:
I have lots of mxds in subdirectories of this folder. I would like to walk through them and replace a shapefile with a feature class from a geodatabase with something like this. This code here is not working. I'm not sure how to incorporate the feature class in this.

import arcpy, os
from arcpy import env
arcpy.env.overwriteOutput = True
ws = r"C:\Users\test\Desktop\New_folder"
oldpath = r"\\test\newfolder\oldfile.shp"
newpath = r"\\test\newfolder\newdatabase.gdb"
newfeatureclass = r"\\test\newfolder\newdatabase.gdb\feature"
for root, dirs, files in os.walk(ws):
    for f in files:
        if f.endswith('.mxd'):
            fullpath = os.path.join(root, f)
            mxd = arcpy.mapping.MapDocument(fullpath)
            print "Replacing path for " + f +"..."
            mxd.findAndReplaceWorkspacePaths(oldpath, newpath + newfeatureclass)
            mxd.save()
            del mxd


texts: StoryMap Layout - How to get pop up text from map to appear in docked left panel

texts:
https://mdphgis.maps.arcgis.com/apps/MapSeries/index.html?appid=756c49ef7d8940aab28b945b20da343f
I found this story map on ArcGIS Online, and I'm trying to figure out how I can replicate the layout in my own story map. What I want to do is have a map on the right with my point data, and have the information from the pop-up with the corresponding point appear on the left side of screen in a docked text panel.
The closest I can get is using the sidecar panel with the map on the right hand side, but when I click the pop up, it appears within the map which I don't want.


texts: Where can I find info on PlanetScope satellite (cubesat) constellation?

texts: I'm evaluating PlanetScope data, and can visually see there is a lot of difference between images at the same location even though metadata stats like sun angle and azimuth angle appear to be similar. I am wondering if there is a list somewhere of all the cubesats in orbit and that lists launch date and/or provides technical info on differences in the constellation?


texts: Analyzing long lat location data to find locations in proximity

texts:
I am looking for a tool to analyze location data (long lat values from vehicle GPS available). The goal is to identify locations which are in close proximity (within a circle of 30-60ft) and then average values which are assigned to the different locations. Background is that it should be the same GPS values every time since the vehicle is visiting the same location but due to inaccuracies of the GPS the location slightly varies. I am trying to identify the location data which belongs to the same location. Any suggestions?

PS: First time user, let me know if you need more information.

Adding example data for clarification:

long lat   date       reading
32...-81.. 1/19/2015  167
32...-81.. 1/20/2015  345
32...-81.. 1/22/2015  556
32...-81.. 1/25/2015  597
32...-81.. 1/28/2015  658
32...-81.. 1/30/2015  298

Is there software available which could group the locations in above example according to proximity (for example group all locations which are within 30-60ft) and then compute the average of the readings?


texts:
I wanted to clip lines with polygon geometry:

from shapely.geometry import Polygon, LineString
import geopandas as gpd

polygon = Polygon([(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)])
line1 = LineString([(0.5, 0.5), (2, 2)])
line2 = LineString([(0.9, 0.9), (2, 0.6)])

poly_gdf = gpd.GeoDataFrame(geometry=[polygon])
line_gdf = gpd.GeoDataFrame(geometry=[line1, line2])

fig, ax = plt.subplots()
poly_gdf.plot(ax=ax, alpha=0.5)
line_gdf.plot(ax=ax, color='green')

When I do it with:

gpd.overlay(line_gdf, poly_gdf, how='difference')

The result is:

TypeError: overlay only takes GeoDataFrames with (multi)polygon  geometries.


texts: Is atmospheric correction necessary when working with multi-spectral indexes?

texts: When you are working with Landsat Level 1 data and calculate indexes, e.g. NDVI, NDBI, SAVI ..., do you calculate them using raw data (pixel DN value), or atmospherically corrected data (surface reflectance)?


texts: Are there ISO 19131 compliant spatial dataset specifications?

texts:
ISO 19131 is a standard for spatial dataset specifications (the way a dataset is created and supplied).

Do you know examples of specification documents (possibly available online) compliant with this standard?

(I am aware this is not a very exciting question, but I need it!)


texts: Seeking software to show direction photo was taken?

texts:
I am hoping to find a more efficient way to create a a photo location map that is used for my job. We take photos (anywhere from 20 to 100+) while outside in the field and back in the office we must create a map with the photo number and an arrow showing the direction the photo was taken.
(I have attached an example to show what I am referring to).

I was wondering if anyone had an idea for a better way to go about this?

Currently we must create a text box for each photo # and place that on the map in layout view, and then place an arrow shape and rotate the direction, also in layout view.

We just recently started using Collector for ArcGIS so there is a possibility of having geotagged photos in the future. I'm open to any and all suggestions.


texts: running tlb from bin -- interop.scripting.dll not found

texts:
I rebuilt a custom command in VS Express 2013, added from file to a custom toolbar in ArcMap 9.3.1. The form appears, but upon running I immediately get an error about a missing Interop.Scripting.dll file. I wonder if this is due to the fact that the reference to this dll points to the obj\Debug folder and not bin\Debug, where the tlb (type library) file resides. This is what VS automatically points to, however, and I don't think I'm supposed to change those references. I had the impression I could use custom commands without deploying an executable msi?

To be clear, I am building this from source - there should be no need to use regasm or the sort to register the COM files.

Here's a glance at some of my references. I think this is where the problem lies.


texts:
I created a polygon which covers a park. But I want to distinguish some small buildings located inside the park. Consequently, I want to distinguish them and use them as independent patches inside the original polygon. I used to do it the "Add ring" function in the QGIS 2.2.

But I don't know, how can fill those empty holes, which were resulted.
I tried the "Fill rings" options (in QGIS 2.2), but I was not lucky with it.

Does anybody have an idea, how can I fix this problem?


texts: Data Plotly plugin in QGIS 3.16 print layout

texts:
Is there a possibility to increase the size of the label on the diagram in this plugin?
When I resize the pie chart, the label stays the same size, and then it doesn't look good.


texts: Merging multiple rasters applying priority rules using ArcGIS Desktop?

texts:
I have three raster layers covering the same geographic area. I would like to merge them into a single raster layer. The layers have different levels of importance, so I would like the merge to move through the rasters in an order that I specify, and assign the first numerical value it finds that isn’t zero to the output raster. If it doesn’t find any non-zero values, it should assign zero to the output raster.

The following picture illustrates the problem. The green raster is more important than the blue raster which is more important than the yellow raster. When merging these three rasters, I want the tool to look for a value in the green raster: if this is any number other than zero, assign this value to the output raster. If it is zero, look in the blue layer: if this is not zero, assign this value to the output raster; if it is zero, look in the yellow layer. If the value of all three layers is zero, assign zero to the output raster.

Using this illustration, the output raster would have a value of 100 in cell A, 10 in cell B, and zero in cell C.

I am using ArcMap 10.3 and have access to all tools.


texts: Automating attribute field completion based on closest value in a list

texts:
I created the following model based on the fields that is needed for asset valuation. Please see below.

I would like to auto-populate the "Code" field basde on certain criteria, for example.

The "size" field determines the Code field: if a pipe is 110mm thick a Code of "P_1" is added to the code field. This is later used to lookup the unit rate of said pipe.

Now here is where i am stuck: I would like to write a python script that will auto populate the Code field for me but the size value is not always constant. In some cases the pipe will be attributed the size of 108mm. I would like the script to then assign the "P_1" code to this pipe as the is a 2mm difference.

Is this possible within Arcmap or will i need to use a post gis program?


texts: Extract all unique values from a RGB raster

texts:
I have a .png file in RGB format showing the intensity of ship traffic:

For my analysis I need to convert it to a one-band raster with values between 0 and 1 where 0 means lowest density and 1 means highest density.
When I click on a raster cell the value is for example (0, 109, 146) or (0, 77, 178) or (255, 255, 255). Knowing that the .png file uses a blue-yellow-green-red color ramp, is there a way to automatically convert it to the grayscale raster with values ranging from 0 to 1?

I thought about the folowing solution:

I extract all unique colors from the image
I assign a numeric value to each color and create a color - value lookup table
For each raster cell, I check the color and set the cell value to the
corresponding value from the lookup table

Now, my question: How do I extract all the unique colors from the image?

I need to use open-source software like QGIS or R.


texts: layer mask does not mask labels, only vector data

texts: I am using ArcGIS 10. I made a layer mask (polygon) that blocks out everyting in a number of vector layers that is outside the area of interest (outside the boundary of two districts). I successfully applied the mask, however I note that the labels outside the districts of interest remain (i.e. the labels inside the mask area). Some of the labels are in an annotation feature class in a geodatabase. Some are not (i.e. I just have the lable features checkbox ticked). All labels are not masked. I have even tried switching it from the Maplex labelling engine to the standard engine, to no avail.


texts:
I'd like to show a dynamic image (csv import) in my leaflet map, like:
.bindPopup("my dynamic imgage: " + <img src={row.myPicture}/>);

but can't figure out how to combine the img src with the dynamic content.


texts: QGIS crashes when using PostgreSQL/PostGIS triggers

texts:
When using PostgreSQL/PostGIS triggers saving layer edits gets slower and slower every time when saving a layer edit. This issue occurs after a few up to a few dozen saved layer edits. Finally QGIS freezes completely.

I've tried the posted triggers in the folowing link:

How to use interacting PostgreSQL/PostGIS triggers in QGIS to create multiple labels on polygons?

Has anyone else made this observation? I've installed QGIS 2.12.


texts: Disparity between QGIS and ArcGIS for Desktop georeference results?

texts:
I am georeferencing a static map in JPEG format. I would prefer to use QGIS for a variety of reasons. I've never georeferenced with QGIS before, so I may not have the process quite right.

I georeferenced the image using the georeferencer plugin and a Bing aerial map from the OpenLayers plugin. The result looks great in QGIS.

I used WGS84/ Pseudo Mercator for both the project and for the output TIFF. The issue arose when I loaded up the georeferenced TIFF in ArcGIS for comparison.

It appeared about 16 miles from where it was supposed to be. It's in the ballpark, but clearly nowhere near good enough.

Could this be some sort of issue with on-the-fly projections?

At every step of the way in both programs I set the coordinate system to WGS84/ Pseudo Mercator.

What could be going wrong?


texts: ArcGIS Pro and ArcMap refuse to split a polygon

texts:
I have a polygon feature class in a file geodatabase that I'm attempting to Split into smaller polygons. I had no problems with the first 5 polyygons but the next ones just won't split. I've tried in closing and restarting the map session, starting a new session with no other data loaded, and compacting the file-gdb, in both ArcGIS Pro 2.6 and ArcMap 10.8.
In Pro the error is

Split failed. New geometry must intersect polylines and intersect
polygons in two or more places.


texts: import arcpy in multiprocessing make script to hang indefinitely

texts:
I have a simple script to test multiprocessing with arcpy, but the script hang indefinitely. The problem is with the import arcpy statement that seems to be a problem in the child processes. Other multiprocessing script without import arcpy are working correctly

import arcpy
import multiprocessing

import os, sys
multiprocessing.set_executable(os.path.join(sys.exec_prefix, 'python.exe'))

def testExists(data):
    print data
    return arcpy.Exists("foo.gdb")

if __name__ == '__main__':
    data = ["foo.gdb", "bar.gdb"]
    pool = multiprocessing.Pool(2)
    result_arrays = pool.map(testExists, data)
    print result_arrays
    pool.close()
    pool.join()

Any idea what can cause the problem?


texts: Adding domain choices to a new field in a feature class

texts:
I have added a field to two news feature classes - one of the fc's is in a dataset and the other is in a database in the SDE. The new field, in each fc, needs to have three domain choices, seen in the image in the Coded Values section.

But the choices that appear in the table with the dropdown arrow are , Legacy, OneFiber, and OneFiber.

When I access the Subtypes tab in the feature classes, I can't do anything because it is completely greyed out. How can I add these choices?
Edit: I have now run the Create Domain tool and the Add Coded Value to Domain tool (image):

But the Assign Domain to Field tool failed. I think the problem is that I don't know how to create more than one value choice for the domain.


texts: Prevent leaflet from zooming after adding a route

texts:
The leaflet routing machine hello world adds a route on the map and automatically zooms to fit the route.

var map = L.map('map');

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; OpenStreetMap contributors'
}).addTo(map);

L.Routing.control({
  waypoints: [
    L.latLng(57.74, 11.94),
    L.latLng(57.6792, 11.949)
  ]
}).addTo(map);

How can I prevent this zooming from happening? I just want to add the route, and that nothing moves or zooms anywhere.


texts: How to export joined feature classes without losing field name?

texts:
I want to export a feature class uisng arcpy that join with other feature class.I use the below code to join and export feature class. The problem is that field names of  the result feature class have change, for example the field name must be "junction" but it changes to "schema_junction". I don't want to lose the names. Is that any solution to maintain the names?

import arcpy
arcpy.env.workspace =r"D:\gisdata\test.gdb"
arcpy.env.overwriteOutput ="True"
fcp = "primary"
fcs  = "schema"
fclyr=arcpy.MakeFeatureLayer_management(fcp,"fclayer")
fcjoin=arcpy.AddJoin_management(fclayer,"code",fcs,"code")
fccopy=arcpy.CopyFeatures_management(fclayer,"result")


texts:
In openlayers3, is there a method for removing the Z when getting the coordinates of a feature with layout=XYZ?  Something akin to this but built into ol3?

function strip(geom, test) {
    if (!geom.length) return;
    if (typeof geom[0] !== "number") {
        return geom.map(function(g) { return strip(g, test); });
    }
    return geom.filter(test);
}


texts: Creating points based on distance and bearing from survey point using QGIS?

texts:
I am plotting witness tree data to calculate pre-settlement tree density. I have a shapefile with points along section lines (square miles) at each half mile. I am making another table that contains tree data - distance, bearing, and diameter - related by survey point to the existing shapefile attribute table. Is there a way to create points on the map for the trees based on the distance and bearing from each survey point?

I'm not necessarily asking for a detailed set of instructions (although if anyone wishes to, I'd be grateful) but rather just if it's possible and a couple key words to continue searching how to do it.


texts: Pipe, redirect or stream to osmfilter from "standard in" (stdin)

texts:
So many tools support chaining, or piping in data from standard input. This can decrease times needed for disk writing and also better use the memory of a machine. Examples of chaining: GDAL - "Chaining", and osmconvert. For example:

bzcat europe.osm.bz2 | osmconvert - -o=europe.o5m

How can I do similar operations to include osmfilter? Something like this:

cat input.osm | osmfilter > output.osm


texts: Disable right click "Open attribute Table" in ArcMap using arcObjects

texts:
I have a requirement on the ongoing project to allow the tables to be accessed by only the users with right privileges. So I am looking for methods to disable adding tables to view programmatically. I know about looking for the standalone table getting added to StandAloneTable Collection but it is after the fact that user had tried to open the table by clicking the "Open Attribute Table" in right click context menu on the layer in TOC. But It would be good to disable the "Open Attribute Table" menu item instead of allowing user to click and find out.

Is there any way to disable the "Add Table" and "Open Attribute Table" menu items in TOC of ArcMap programmatically?

Here is the image of right click Context menu item, I want to disable.

Open Attribute Table


texts: Order of coordinates for extent property in layer Tile?

texts:
I was just going through the documentation for OpenLayers 3.11 and came across Tile(). Now it accepts a lot of properties: opacity, preload , map, etc.), but the one I am interested in is extent. Basically, it allows me to set an extent of which tiles I would like to load, so an initialization with the extent parameter might look like as follows:

new ol.layer.Tile({
    visible: false,
    preload: Infinity,
    extent: [-16655.5402445057125, 6609968.258934638,0,6809968],
    source: new ol.source.BingMaps({
      key: 'Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3',
      imagerySet: styles[i]
      // use maxZoom 19 to see stretched tiles instead of the BingMaps
      // "no photos at this zoom level" tiles
      // maxZoom: 19
    })
  })

Notice how the extent parameter accepts an array with 4 values in it. My question is about getting the correct order of the values inside the extent array.


texts: "Official" definition to hyperspectral sensor

texts:
I was checking in the literature about a formal definition for hyperspectral sensors, and the most complete definition I found was from The Center of Space Research (@ University of Texas in Austin):

  Hyperspectral data sets are generally composed of about 100 to 200
  spectral bands of relatively narrow bandwidths (5-10 nm), whereas,
  multispectral data sets are usually composed of about 5 to 10 bands of
  relatively large bandwidths (70-400 nm).

Is there any consensus about it? Does exist an international body or forum to deal with remote sensing definitions?


texts: GDAL code does not work on anaconda interpreter

texts:
I wrote a code that projects a raster to a new coordinate system.

from osgeo import gdal

filename = r"C:\Users\rsl\Desktop\New folder\SN228122015_mosaic.tif"
input_raster = gdal.Open(filename)
output_raster = r"C:\Users\rsl\Desktop\New folder\SN228122015_mosaic_p.tif"
gdal.Warp(output_raster,input_raster,dstSRS='EPSG:4326')

The code works great on pycharm when the interpreter is OSGEO, but when I run it when the interpreter is anaconda (like on jupyter notebook), I get this message error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-9021d776efc4> in <module>()
      4 input_raster = gdal.Open(filename)
      5 output_raster = r"C:\Users\rsl\Desktop\New folder\SN228122015_mosaic_p.tif"
----> 6 gdal.Warp(output_raster,input_raster,dstSRS='EPSG:4326')
      7

C:\Users\rsl\Anaconda2\lib\site-packages\osgeo\gdal.pyc in Warp(destNameOrDestDS, srcDSOrSrcDSTab, **kwargs)
    547
    548     if _is_str_or_unicode(destNameOrDestDS):
--> 549         return wrapper_GDALWarpDestName(destNameOrDestDS, srcDSTab, opts, callback, callback_data)
    550     else:
    551         return wrapper_GDALWarpDestDS(destNameOrDestDS, srcDSTab, opts, callback, callback_data)

TypeError: in method 'wrapper_GDALWarpDestName', argument 4 of type 'GDALWarpAppOptions *'

How can I make my code to work on the anaconda environment?


texts: Feature Layer parameter showing only Polygon Shapefiles

texts:
I have created a Python Tool in ArcGIS where most of the paramaters musts be ONLY Polygon Shapefiles. You can also look on my previous question:
Filter the Feature Layer parameter in Python Script Tool
Also, the user must be able to select ONLY Polygon Shapefiles either from the current MXD or his/her system.

In order to solve it, I tried to give the type "Feature Layer" on each parameter and filter them to show only polygons. But, I didn't manage to put the extra filter for Shapefiles. In this case it is the only think I miss.

The second attempt was the implementation of the answer on my previous question:

Filter the Feature Layer parameter in Python Script Tool

In this case, I had to enrich the suggested code with:

    lyr.supports("DATASOURCE")

because I have groups in my data frames. I got the list of Polygon Shapefiles that are already open in the current MXD but I don't have the option to select a shapefile from the user system because (as suggested) the parameter type is String (the folder icon on the right side of the field is missing!).

To conclude:

Is there a way to filter the dropdown list of Feature Layer parameter inside ToolValidator, so that it shows ONLY Shapefiles (Polygons are already filtered)?
If the above is NO, then is there a way to add the folder icon next to the String parameter so that the user can select an external Polygon Shapefile?
If none of the above two answers are YES, then is there any other solution?


texts: Describing borehole information with geojson (javascript)

texts:
I deal a lot with borehole information and looking the best way to move it around in javascript / take advantage of javascript libraries (e.g. leaflet) for looking at this information on mobile devices / maps.  I'm most interested in the popup/mouseover actions to describe additional data contained within a point.

In plan, these are points.  In reality, it's a line I am looking at end on with a number of data points stacked in the same x,y location.

For example
Point 1 (x,y,z collar location):

+------------+-----------+---------+
| Depth from | Depth to  | Reading |
+------------+-----------+---------+
| 0          | 2         | 4       |
| 2          | 4         | 7       |
| 4          | 7         | 15      |
+------------+-----------+---------+

etc.

Is there a good way to capture the above using geojson?  Currently I parse a lot of it in JSON (or multidimensional arrays) in javascript.  I can shoe-horn it into geojson by making many depth parameters, but it's pretty awkward (and even more awkward when I have multiple different types of data at varying depths along the same hole).

What does everyone use for borehole data and leaflet/other sources? Looking for advice / a point in the right direction, as the direction I'm going is defining my own internal format and writing my own scripts for populating the downhole information in tables during mouse-overs (which is time consuming).


texts: Selecting multiple values from a string in ArcMap?

texts:
I have a text field containing values like "1A,2P,13,17,22,34".

I want to select the values that I need by a definition query of a layer.

For a single value worked using LIKE and % but I need to select up to 3 values that will be used for defining my layer. How is it possible?

I am working on ArcGIS Desktop.


texts: Are there no italic fonts in Print Composer?

texts: QGIS 1.7 doesn't seem to have an 'italic' choice when annotating a map in Print Composer, only 'regular' or 'bold' fonts, a rather surprising omission if correct.  Is there some other way to create an italic font in Print Composer?


texts: Finding polygons inside polygons from a shapefile in QGIS

texts:
I have a parcels shapefile that contains polygons. Condos are also drawn, but inside the master lot. I want to be able to grab all the condos inside the master lot. I saw this question/answer:
 Finding all polygons inside of a polygon, but that is for POSTGIS and I'm working with shapefiles. I'm writing a plugin for owners lists, so I need this type of search to be included in order to get a complete owners list. The spatial query doesn't allow a search on the same layer which is a problem.

The basic question is: How do I select polygons inside polygons within the same shapefile?


texts: Unload QgsVectorLayer from Python script

texts:
I have a Python script that processes several country sized OpenStreetMap PBF files at a time. The problem I'm having is that: each time I open and process one of these files, I lose anywhere from 200MB to a gig of hard drive space (I'm assuming to some temp storage directory somewhere).
When I process loads of these files, I eventually end up running out of disk space and the script crashes. I've tried several ways to get the script to unload the QgsVectorLayer object that I'm processing in an attempt to reclaim some disk space. These include:

Placing the loading & processing of the individual layers into a separate method that (I assumed) would be automatically removed once the method returns.
Explicitly calling del on the layer object.
Calling QgsProject.instance().removeMapLayer on the layer in the hope to get it removed some how.

Unfortunately, none of these worked, so far the only thing that seems to unload the layers and delete the temporary files is allowing the script to complete fully.
Is there a way for me to ensure that, once I'm done with a QgsVectorLayer, I can close it, and have it clean up its temp data?


texts: Querying 3D Model in Google Earth Similar To Polygons

texts:
Right now I have polygons that represent a water surface in case of a flood event. Using polygons is becoming untenable, so I would like to pursue alternatives.  One alternative I thought of is generating a collada 3D model instead.  Before I go down that route, I wanted to know if it was possible to be able to query the 3D model in Google Earth.  I know you can put metadata per polygon and query that polygon directly in Google Earth by clicking on it, but I would like to do that with a 3D model.

Is that possible?

It's fine if it's data per triangle, but if it was somehow possible to get the interpolated value at the click position that would be great as well.


texts: Different results using $length (field calculator) in QGIS versions 2.18 and 3.0

texts:
I use the field calculator to measure the length of LineStrings in my shapefile layer, but i get different results when using QGIS 2.18 or QGIS 3.0.

If I am using the local coordinate system the difference between the QGIS 2.18 and QGIS 3.0 is not significant. If I am using WGS84 (I know you should always use the local coordinate system) I get two different results based on the version I am using. In 10 km the difference is almost 2 km..

Does anyone know what might be the reason? Did the algorithm behind the length calculations change in QGIS 3?


texts: Finding centroid of cluster of points using R

texts:
While searching the web, solutions for finding centroids of polygons come up rather often. What I'm interested in is finding a centroid of a cluster of points. A weighted mean of sorts.

Can you provide some pointers, pseudo code (or even better, an R package that has already solved this) or links of how this issue can be tackled?

@iant has suggested a method to average coordinates and use that for the centroid. This is exactly what crossed my mind when I saw the right picture on this web page.

Here is some simple R code to draw the following figure that demonstrates this (× is the centroid):

xcor <- rchisq(10, 3, 2)
ycor <- runif(10, min = 1, max = 100)
mx <- mean(xcor)
my <- mean(ycor)

plot(xcor, ycor, pch = 1)
points(mx, my, pch = 3)

cluster::pam()$medoids returns a medoid of a set of cluster. This is an example from @Joris Meys:

library(cluster)
df <- data.frame(X = rnorm(100, 0), Y = rpois(100, 2))
plot(df$X, df$Y)
points(pam(df, 1)$medoids, pch = 16, col = "red")


texts: How to speed up OpenLayers with WFS in IE?

texts:
I'm using Openlayers, Geoserver and noticed that IE is very very slow to display WFS layers. I haven't so many WFS features, about 300. Google base layer appears after 1 sec. but my two WFS layers need each from 10 to 20 seconds to display. With Chrome, it requires only 2 seconds.

I tried to disable style rules, events, no change. It's really a client issue, my cpu goes up to 50% for iexplore during features loading. I tried with IE8 and 9, with two differents pc, same results.

It seems that I'm not the only one. I can keep using Chrome but would be interested to share ideas

Olivier


texts: Finding outlier point in set of points, by distance, using QGIS?

texts:
I need to identify and eliminate the outlier points in a set of points, as depicted below. It seems a simple task, but I cannot find the answer anywhere.

I suspect that the proper way to go is through a density analysis. But I cannot figure out.

I am using QGIS.


texts: How to show different attributes in print composer

texts: we have shape file with different attributes wich we want to show in the print composer. The goal is that we open 1 vector layer and the print composer shows 4 different maps (4 attributes). Is there a solution for that?


texts: Position of a map element depending on the position of another map element

texts:
In my layout, the legend is placed between other elements. The scale bar is located above the legend and an overview map below it. You can see it in the screenshot below.
The legend is expanded or reduced according to the map elements (red arrows). However, the following element (overview map) is static and does not follow the lower limit of the legend and is overrun.
Is it possible, to place elements dynamically according to the position and size of other elements?


texts: Select features that do not intersect with another polygon in QGIS

texts: See the image below. What I want to do is select all features that do NOT intersect with the features of the selected layer. How do I go about doing this?


texts:
I have a customer who can only export structured map data as a GeoTiff file. My job is to convert this file into proper SVG.

How can this be done?

I have googled about gdal, but obsiously it is not supported; see also format list


texts:
I'm looking for a solution to the following problem.

I want to find the shortest route for a truck, picking up garbage from households. I know the amount of garbage each household is producing and I do know how much garbage the truck can hold. The scenario is of course that the truck drives of to pick up garbage until its full, or to the point where it is almost full, but the next household is providing so much garbage that the truck would be overloaded. Then the truck should come back.

I do have ArcGIS and the Network Analyst extension at hand and was wondering if this is possible to achieve with these tools. I don't mind if there is some scripting required, that's not the problem.

Has one of you done something similar and could give me a hint on how to do it?


texts: Extracting pixels from a raster list according to a value range and position in R

texts:
I'm working on a script on R and I have a doubt.
I have a directory with a raster dataset of NDSI MODIS files.
I want to create a list(or stack) of rasters whose first pixel (x=1, y=1) value is between 0.1 and 0.9 from that directory.
I'm a bit lost on how to put conditions in the creation of file lists on R.
To make the list I have used the list.files function.
setwd("/Desktop/NDSI_MODIS") #Working directory
modis <- list.files('/Desktop/snowcover_MODIS', pattern = ".tif" ) #list of files

The issue is to put the condition on that list.


texts:
Is there difference between a tile server or a layer server?
Can I load tile in ArcGIS control in WPF from some other source?
Can I host my own layer server? Or is there any such thing as layer server?


texts: Can I grant a user of the ArcGIS server a publisher privileges and prevent him from publishing service or at least do some restrictions on what he can publish?


texts: Spatial join Python command to summarize attributes

texts:
I am trying to run the Spatial Join function through the Python shell in ArcGIS 10.  When you do the point-and-click method of spatial join, you are given a tool window with an option that asks "How do you want the attributes to be summarized?"  However, the Python syntax doesn't show a parameter for this option.

How do I control the attribute summarization through Python?  Why is there no parameter for this?


texts:
When I retrace a polygon using the measure area tool and get what I believe to be an accurate area measurement. However if I utilise the field calculator within the attribute table to calculate the area of all my polygons, I get a significantly different area measurement than the one above which I believe to be completely inaccurate.
What is the cause of this discrepancy?
Any ideas why the field calculator is throwing out the wrong figures ? I'm using a WGS84 projection - EPSG4326


texts:
I have a polygon layer with several fields, like: population, wage, age, etc.

I would like to show the percentile value for those fields.

How can I do that in an automatic way with QGIS 2.6.1?


texts: What does the code RTTYP represent in the USA Tiger road files?

texts:
I'm trying to figure out what a particular code represents in the US Census Tiger Line files for roads. I downloaded roads for the US from here. I've searched the documentation (link to large pdf) and the web; all that I can find is the following:

All Roads (county-based) Record Layout   [top]
File Name: tl_2010_[state-county FIPS]_roads.shp
Field   Length  Type    Description
STATEFP     2   String  State FIPS code
COUNTYFP    3   String  County FIPS code
LINEARID    22  String  Linear feature identifier
FULLNAME    100 String  Concatenation of expanded text for prefix qualifier, prefix direction, prefix type, base name, suffix type, suffix direction, and suffix qualifier (as available) with a space between each expanded text field
RTTYP       1   String  Route type code
MTFCC       5   String  MAF/TIGER feature class code

I assume that RTTYP        1   String  Route type code means it is some sort of classifier related to Primary Road or Secondary Road but I can't find that written down anywhere. If I examine a shapefile with this data I see the following:

I understand that MTFCC is a classifier from here :

24  S1100   Primary Road
25  R1011   Railroad Feature (Main, Spur, or Yard)
26  R1051   Carline, Streetcar Track, Monorail, Other Mass Transit Rail)
27  R1052   Cog Rail Line, Incline Rail Line, Tram
28  S1100   Primary Road
29  S1200   Secondary Road

so I can figure out what each road segment represents, but I'm curious to know what the RTTYP codes mean. I would love to find information about the surface material (whether it is asphalt or concrete, but I assume that information is not included).


texts: QGIS copy data atttribute table columns instead of join

texts:
I used the Joint data table feature in QGIS, because I though that in this way I will be able to copy these columns in the layer, which I am working on.
I used the python code to develop an instantly data attribute table which I want, as shown below:
QGIS 3x apply one data attribute table for more than 1 layer
 your_layer = QgsVectorLayer("Polygon", "Poles", "memory")
 prov = your_layer.dataProvider()

 prov.addAttributes([QgsField("Type", QVariant.String),
 QgsField("Address",  QVariant.String),
 QgsField("Postcode", QVariant.String),
 QgsField("Location", QVariant.String),
 QgsField("X", QVariant.Double),
 QgsField("Y", QVariant.Double),
 QgsField("Latitude", QVariant.Double),
 QgsField("Longitude", QVariant.Double),
 QgsField("ObjectID", QVariant.String),
 QgsField("Length", QVariant.Double)])

 your_layer.updateFields()
 QgsProject.instance().addMapLayer(your_layer)

My created data attribute table looks like above.
Next I used the "Joins" option in order to merge attributes from two data attribute tables.

Now it looks like I can neither edit nor keep it in my layer. When I remove the temporary layer created by python code, all my joins are gone. Is there a way to keep them editable in my data attribute layer?
The refactored fields won't work here, as we still have separate data attribute layers. I need all these fields placed in my current data attribute table automatically. The problem is strongly related to this issue. Is it possible?


texts: How to plot with matplotlib directed graphs obtained from QgsGraphBuilder?

texts:
Developing a plugin for QGIS, I have a shapefile with graph vertices and graph edges and I would like to plot a selection of them, with matplotlib, as a directed graph. How can I do that?

For now, I have something like this:

from qgis.networkanalysis import *

vl = self.iface.mapCanvas().currentLayer()
director = QgsLineVectorLayerDirector(vl, -1, '', '', '', 3)
properter = QgsDistanceArcProperter()
director.addProperter(properter)
crs = self.iface.mapCanvas().mapRenderer().destinationCrs()
builder = QgsGraphBuilder(crs)
graph = builder.graph()


texts:
This is my formal:

("Standort_ger_fre_mosaic" ^ 0.4) *
("Habitattradition_raster_rec.tif" ^ 0.3) *
("Vollständigkeit_rec.tif" ^ 0.1) *
("Vorkommen_ungestörter_Lebensräume_rec.tif" ^ 0.1) *
("Vorkommen_von_Arten_dynamischer_Lebensräume_rec.tif"^ 0.1)

I would like to charge the pixels of the above-mentioned layers together.
As a final product, I would like to have a file that has different values for each pixel.
When I do the computation, my final product has only one value in each pixel. This is equal to 0

I am working with ArcMap 10.6


texts: Shapefile layers as variable in WPS process

texts:
i created a new WPS process. I have a class with method and class with implementation into GeoServer.

@DescribeProcess(title="overlayWPS", description="Creates buffer around point and overlays it with polygon layer. Returns areas of overlay.")
public class OverlayPolygons implements GeoServerProcess {

    @DescribeResult(name="result", description="output result")
    public String execute() throws IOException{
        Process p = new Process();
        return p.overlayPolygons();
    }
}

i would like to put input shapefiles as parameter which can user change in wps requiest builder, now i have static URL to specific shp

String overlayPolygons() throws IOException {

        String areas = "Object : Area of overlay";

        ShapefileDataStore sfds;
        sfds = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\lesy_cr.shp"));

        SimpleFeatureSource fs;
        fs = sfds.getFeatureSource("lesy_cr");

        ShapefileDataStore sfds2;
        sfds2 = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\chranene_uzemi_cr.shp"));

        SimpleFeatureSource fs2;
        fs2 = sfds2.getFeatureSource("chranene_uzemi_cr");

I found out there must be some @DescribeParameter annotation, but i cant figure out how to use it at all.


texts:
I’m new to R and having trouble applying an equation that finds the vector gradient of a raster image. I understand the equation just fine, but still new enough to R to be confused on how to translate the equation into code. The equation is attached in an image below, where d is the distance between adjacent pixels, i and j are the horizontal and vertical unit vectors in the image plane, and x and y are the image coordinates. Φ represents the image.

Can anyone provide any advice on how to translate this into R to get the desired output?

Equation was taken from a 2004 publication, the pdf can be found here:
http://seaice.alaska.edu/gi/publications/mahoney/Mahoney_2004_IGARSS_LandfastIce.pdf


texts: reprojection number of rows and columns don't match

texts:
I have a 500m sinusoidal raster that I converted it into an approximately equivalent 500m WGS84 using the raster package in R by using the following script:
library (raster)
library(maptools)
#Load the tif file
TIF <- raster("~/TIF.tif")
plot(TIF)
# Define the SRS of the original tif
SRS <- "+proj=sinu +lan_0=0 +x_0=0 +y_0=0 +R=631007.181 +units=m +no_defs"
#Define the Lat/Long SRS of the output Tif in WGS84
llcrs <- "+proj=longlat +ellps=WGS84 +datum=WGS84"
#Load original tif data
df <- as.data.frame(TIF, xy=TRUE)
#Define Transform
rll <- projectRaster(TIF,crs = llcrs)
#ras_sinu <- raster(nrow=391, ncol=695, ext=extent(-9031818, 4773511, -870816, 4954666), crs=incrs)
#rs <- rasterImage(w, ras_sinu)
plot(rll)
WGS84 <- raster("~/WGS84.tif")
plot(WGS84)

Next I checked whether the number of rows and columns match or not?
 summary(values(TIF))
 Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's
 0.0    25.0    50.0    50.5    75.0   100.0  230368
summary(values(WGS84))
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's
    0.0    26.0    51.0    50.5    76.0   100.0  454803

table(is.na(match(values(TIF),values(WGS84))))
FALSE
271745
ncell(TIF)
271745
ncell(WGS84)
496125
ncell(TIF) - ncell(WGS84)
-224380
sum(is.na(TIF[])) - sum(is.na(WGS84[]))
-224435
res(TIF)
463.3127 463.3127
res(WGS84)
0.00577 0.00417

I was checking answers to similar questions and it was mentioned after reprojections, the number of pixels change, hence that is why I am seeing a difference between the two rasters. This I guess means that the resolution of both the rasters is different as well. Is there a way in R to resolve this issue in R (i.e. the reprojected raster in WGS84 has a resolution approximate to 500m)?


texts: PSelect Field if field_name contains string, then change that field_name, using PyQGIS

texts:
I am trying to select a field (column) in an attribute table for a shapefile based on whether the name of that field contains a string. Then, I need to either change the name of that selected field or create a new field and populate it with the contents of the selected field. I want to use the Python console because I need to repeat this procedure for 125 shapefiles. However, I am inexperienced with this.
For example, in the following two attribute tables, they both have a field that contains 'P.V.Q./G.P.Q.' but with different names attached. I would like to change the names of all the fields in all my shapefiles that contain 'P.V.Q./G.P.Q.' to read only 'P.V.Q./G.P.Q.'

My pseudo-code is:
For every shapefile in Group:
  if(shapefie_Field contains 'P.V.Q./G.P.Q.'):
    change field_name to 'P.V.Q./G.P.Q.'
  elif(shapefile_Field contains 'Q.S'):
    change field_name to 'Q.S'
  elif (etc.)

The reason is that I need to join 125 shapefiles together and the attribute fields need to match up.


texts:
I'm writing this as an utter Ubuntu newbie. I want to run the script found on Save points to a shapefile with GDAL. But I get the following error, yes this error is similar to the question posted here. Stick with me.

Python 2.7.2+ (default, Oct  4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import point_store
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "point_store.py", line 3, in <module>
import osgeo.ogr
File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 21, in
<module>
_gdal = swig_import_helper()
File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 17, in
swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /usr/lib/python2.7/dist-packages/osgeo/_gdal.so: symbol
VSIFTruncateL, version GDAL_1.8 not defined in file libgdal.so.1 with link
time reference

After reading the question I reference above I tried this:

sudo pip install GDAL==1.8.1

And then I got the following error:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
Ada/C/ObjC but not for C++ [enabled by default]
extensions/gdal_wrap.cpp:149:20: fatal error: Python.h: No such file or
directory

compilation terminated.

error: command 'gcc' failed with exit status 1

Does anyone have an idea how I can get my gcc to happy fun times? There are lots of forum posts around about this error but I'm still looking for that "aha" moment.


texts: QGIS shortcuts for new tasks / for right-click menu?

texts:
I am looking for a QGIS keyboard shortcut to rename layers (QGIS 3.10.3). I can´t find any in the shortcut-menu. Therefore two questions:

Can I create keyboard shortcuts for new actions that aren´t listed yet in the current shortcut list?
Is there a shortcut for "right-click"? I can see when I right-click on the layer that one character in "rename layer" is underscored (in German: "n" in "Layer umbenennen"). Therefore I assume there`s a shortcut possibility, but I can´t find it.

I appreciate any help!


texts: Customize display of WMS GetFeatureInfo results

texts:
I have a popup that gets the feature info on the map, what I want to do is to customize the display of the WMS GetFeatureInfo Results, I don't want to avoid automatic alphabetic sorting of the attribute declared on the source (see the code). Please tell me how to do that, here's my code:

  action = new GeoExt.Action({
    control: new OpenLayers.Control.WMSGetFeatureInfo({
    autoActivate: true,
    infoFormat: "application/vnd.ogc.gml",
    maxFeatures: 6,
    layers: [layer1],

    eventListeners: {
      "getfeatureinfo": function(e) {
        var items = [];
        Ext.each(e.features, function(feature) {

            items.push({
                xtype: "propertygrid",
                title: feature.fid,
                source: {"aaaaa": feature.attributes['aaaa'], "bbbb": feature.attributes['bbbb']},
            });
        });
        new GeoExt.Popup({
            title: "informations",
            width: 250,
            height: 300,
            layout: "accordion",
            map: map,
            location: e.xy,
            items: items
        }).show();

      }

    }
   }),
    map: map,
    text: "infos",
    tooltip: "Informations "
      });
    actions["infos"] = action;
    toolbarItems.push(action);
    toolbarItems.push("-");


texts: How to use Google Maps projection with GeoDjango/PostGIS

texts:
I am building a web service with GeoDjango which involves user submitted events including a location.  I created a model field for my location using django.contrib.gis.db:

location = models.PointField(srid=900913)

I chose to specify 900913 as I read that this is the projection used by Google Maps and I am getting the location by placing a marker on a Google map.  The coordinate is presented to me in lat/lng form.  I am storing this point in a PostGIS DB using GEOS:

location = geos.Point(data['lng'], data['lat'], srid=900913)

If I want to view this point on a map, I get the lat and lng from my DB (e.g. lat = location.coords[1]) and use them to centre my map and this works fine.

When I want to browse a map and display events from DB which lie inside the map bounds I use GeoDjango's within query and the maps bounds (in lat/lng format):

    bounds = geos.Polygon.from_bbox((swLng, swLat, neLng, neLat))
    events = Event.objects.filter(location__within=bounds)

This appears to work fine and I display pins on the map corresponding to the lat/lng of these events.

So far nothing would suggest that anything is going wrong, however I am completely new to this stuff and I want to ensure that I'm getting it right for when I inevitably want to use my location data in more complex ways.  The reason I'm suspicious is that my Django admin pane does not display the location correctly on the OpenStreetMap.  It shows a point which appears to correspond to the (0,0) point shown here.  The displayed text version of the location field is SRID=900913;POINT(-1.277482509613037 50.874104373286066), which is clearly still in lat/lng.  As I move my mouse around the admin map I can see the displayed coords in the bottom right corner are in 900913 format, and not in lat/lng.

Please can you explain how I can store my location points in the correct format, and what advantages this has over simply using lat/lng (my guess is that if I want to specify say a distance in km for lookups, I can't use my lat/lng locations).


texts:
Using Leaflet in a GeoDjango app, I have an underlying layer(town parcels), and another layer(open space parcels) which i'd like to update(add) by cloning the geometry only from the town parcels. I'd like this to happen on the admin page where other various fields are filled in. Althugh it doesn't necessarily have to happen on the admin page, just preferable.

This would make adding features less painful for users as opposed to tracing underlying features, especially complicated polygons.

I'm using the django-leaflet plugin as well as the django-geojson plugin

How can I start thinking of the process needed?

I do not have the skills to write a plugin.


texts:
I'm doing several segmentation tests between satellite and drone images with rsgislib. On the satellite images I had no problem but when I try the drone images the following error appears after the elimination of clumps:

Relabel clumps.
Opening clumps file: ./stack_image_clumps_elim.tif
Processing using Disk
Traceback (most recent call last):
segutils.runShepherdSegmentation(image,image_clump,img_mean,gdalformat='GTiff',numClusters=100,minPxls=50,distThres=50,sampling=100,kmMaxIter=50)
      File "/home/ubuntu/anaconda3/envs/osgeo-env-v1/lib/python3.7/site-packages/rsgislib/segmentation/segutils.py", line 191, in runShepherdSegmentation
        rsgislib.segmentation.relabelClumps(elimClumpsFile, outputClumps, gdalformat, processInMem)
    _segmentation.error: Could not create GDALDataset.

Do you think it could be a gdal problem?

The clip data of the image I'm using is this:
gdalinfo -proj4 /home/ubuntu/Scrivania/Dataset/clip.tif

Driver: GTiff/GeoTIFF
Files: /home/ubuntu/Scrivania/Dataset//clip.tif
       /home/ubuntu/Scrivania/Dataset//clip.tif.aux.xml
Size is 709, 381
Coordinate System is:
GEOGCS["WGS 84",
  DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
PROJ.4 string is:
'+proj=longlat +datum=WGS84 +no_defs '
Origin = (16.099964890241999,39.047416366858158)
Pixel Size = (0.000000160878672,-0.000000160878672)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  16.0999649,  39.0474164) ( 16d 5'59.87"E, 39d 2'50.70"N)
Lower Left  (  16.0999649,  39.0473551) ( 16d 5'59.87"E, 39d 2'50.48"N)
Upper Right (  16.1000790,  39.0474164) ( 16d 6' 0.28"E, 39d 2'50.70"N)
Lower Right (  16.1000790,  39.0473551) ( 16d 6' 0.28"E, 39d 2'50.48"N)
Center      (  16.1000219,  39.0473857) ( 16d 6' 0.08"E, 39d 2'50.59"N)
Band 1 Block=709x1 Type=Float32, ColorInterp=Gray
  Min=3.064 Max=71.527
  Minimum=3.064, Maximum=71.527, Mean=17.079, StdDev=5.091
  Metadata:
    STATISTICS_MAXIMUM=71.52693939209
    STATISTICS_MEAN=17.079104771775
    STATISTICS_MINIMUM=3.0640306472778
    STATISTICS_STDDEV=5.0911572606558
    STATISTICS_VALID_PERCENT=100
Band 2 Block=709x1 Type=Float32, ColorInterp=Undefined
  Min=3.802 Max=75.472
  Minimum=3.802, Maximum=75.472, Mean=24.900, StdDev=6.595
  Metadata:
    STATISTICS_MAXIMUM=75.472129821777
    STATISTICS_MEAN=24.900370899054
    STATISTICS_MINIMUM=3.8024840354919
    STATISTICS_STDDEV=6.5952746947653
    STATISTICS_VALID_PERCENT=100
Band 3 Block=709x1 Type=Float32, ColorInterp=Undefined
  Min=1.194 Max=78.540
  Minimum=1.194, Maximum=78.540, Mean=21.044, StdDev=8.013
  Metadata:
    STATISTICS_MAXIMUM=78.540351867676
    STATISTICS_MEAN=21.044218785929
    STATISTICS_MINIMUM=1.1944425106049
    STATISTICS_STDDEV=8.0133438150243
    STATISTICS_VALID_PERCENT=100
Band 4 Block=709x1 Type=Float32, ColorInterp=Undefined
  Min=8.460 Max=178.914
  Minimum=8.460, Maximum=178.914, Mean=48.266, StdDev=16.729
  Metadata:
    STATISTICS_MAXIMUM=178.91448974609
    STATISTICS_MEAN=48.265627691868
    STATISTICS_MINIMUM=8.4597034454346
    STATISTICS_STDDEV=16.728918023443
    STATISTICS_VALID_PERCENT=100
Band 5 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 6 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 7 Block=709x1 Type=Float32, ColorInterp=Undefined
Band 8 Block=709x1 Type=Float32, ColorInterp=Undefined

How can I solve the problem?


texts: What it means when choosing a "dpi" when exporting a PDF map in ArcGIS?

texts:
I'm trying to understand something when exporting map as PDF file in Esri's ArcGIS for Desktop.

The ability to choose paper size.
The ability to choose DPI.

Thought that those are printer parameters. Supposedly when I export a map to the computer the only parameters whom need to set are paper ratio and pixel number for chosen ratio.

Before exporting I will check if my screen can handle this amount of pixels on this ratio (DPI and screen size)  and my printer with this amounts of dots on a given paper size (DPI).

So DPI and paper size are properties of the printer not of the PDF file itself.


texts: Shapefiles and attributes from ArcGIS Pro missing in ArcMap?

texts:
I have data that is a series of digitised polylines that due to issues with maintaining the Z component have been exported (from another software package) as XYZ points in .csv format.
Using ArcGIS Pro i have then converted these to polylines and in Pro i can see a full attribute table as seen here.

When i either export to featuredatabase or shapefile all my attributes are lost... and i gain one i dont want or need!

Is there a way to maintain the data that i want in the resulting file?

I need a number of the attributes to be able to colour\sort\query the data later.
I have attempted the same thing in ArcMap and QGIS, i have tried converting to featuredatabase and shape, but whatever i do i cannot keep my data how i want it?


texts: Global shipping network datasets for download?

texts:
Does anyone know if global shipping routes for free download (preferably ESRI shapefile) exist? I would need them for my research only as a background presentation on the world image. They can be rough presentation, I would need something like this: http://www.arcgis.com/home/webmap/viewer.html?layers=12c0789207e64714b9545ad30fca1633&useExisting=1

I have already tried the link of Global Shipping Lane Network from Oak Ridge National Labs (mentioned in this post What are the existing datasets of world maritime routes?), but the link does not function anymore.


texts:
I'm having some trouble converting a simple site schematic drawn in AutoCad into a shapefile for use in QGIS. A co-worker who works remotely has done the Autocad Drawings, and has exported as shapefiles, and sent me the .dwg, .dxf files, and when I load into qgis, they don't resemble the actual map drawn. It looks to me like maybe the autocad file might have been set up incorrectly? I've never worked with Autocad, wondering if someone may be able to shed some light on whats going wrong. I'll attach a pdf of the schematic he has done, and a screenshot of what appears in QGIS when I load his shp export, or dxf. i'll also attach the .dxf and .dwg file if someone wanted to have a look at them and see if there was something obviously wrong.

List item


texts: Land Administration Domain Model example implementations

texts: Does anybody know of a sample implementation? I am currently trying to adapt it to my country but the LADM is rather abstract. Anybody have any idea how to go about this?


texts: Leaflet rendering TileMill tiles in the wrong order

texts:
I'm stumped, and quite a lot of searching has turned up nothing helpful.
I'm on the first step of what will ultimately be a map with three raster layers and three layers of markers (with controls to toggle between the rasters and their associated data, with popups/tooltips for the data), but I can't get the Tilemill tiles to render properly. (I created the rasters in QGIS, ran them through GDAL to colorize and re-project them, and then put them into TileMill.)
To wit:

That's in Chrome. This is Safari:

And here's the code, which looks quite innocuous to me (I've commented out everything but the tiles at this point, so that's all I've included):

 <title> - Leaflet demo</title>

Map

Has anyone ever encountered this problem? If so, how did you overcome it? I'm eager to start into the rest of the process of making this map (by which of course I mean "uncovering the next problem to solve").
Edited to add: I tried re-exporting a new MBTiles file, uploading it as new data, and creating a new Mapbox project from that data. No dice. Next step in isolating the issue would be to set up the MBTiles file on a server, skipping Mapbox, but that seems more likely to create problems than to fix them.


texts: How can I improve the speed at which QGIS 2.4 handles network data? (Seems much slower than 2.2 - even with small datasets)

texts:
I recently downloaded and installed QGIS 2.4 Chugiak on a Windows 7 64-bit machine with a quad core processor and 8GB RAM.

I'm having a few problems using datasets of all sizes from a network drive - the data is slow to render and there is an annoying low-pitched "beep" each time I zoom in/out. In the previous release (2.2), this network data would render almost instantly for small datasets with no sounds.

I've also noticed that opening the attribute tables for this network data is very slow. E.g. a dataset with just 91 records takes almost 30 seconds - something that was almost instant in QGIS 2.2 Valmiera.

Using the dataset on a local drive removes the problems, though this is not an option as we have several members of staff working on the same datasets and want to avoid having multiple file versions all over the place!

Have any network settings been changed from 2.2 to 2.4?


texts: Where can I find a binary ogr_FileGDB.dll compilled for Windows?

texts: Need GDAL 2.0 with support FileGDB driver. The GDAL build from http://gisinternals.com does not contain this driver.


texts: Generating a polygon tile index from multiple vector datasets

texts:
OK. well this is silly, in that there is no way it should be as difficult as it has been for me to find information regarding how to generate a polygon tile index from multiple vector (contour) tiles. With web publishing, tilecaches, etc. all the search results are not what im looking for.

I have a folder full of about 50 contour shapefiles tiles that combined cover a US county. However there was no index distributed with the contour file collection, so I need to create one based on the bounding boxes, convex hulls, or some other function for each contour tile, and merge those together in a meaningful layer to be used to locate tiles necessary for a particular area...

I'm failing to see a tool to do this in either QGIS or ESRI? I must be missing something so if someone could point me in the right direction, that would be great.

Thanks