texts: How to cover data by circles, limited by a maximum of values?

texts:
I have a regular grid with a cell width of 200 meters (available as raster and vector data set). Each cell has a value from 0 to 2000.

I now want to draw circles around these cells in such a way that the sum of values inside the coverage of the circle reaches a maximum of 2000. The radius of the circle can be unlimited, but should not exceed 20,000 meters. The circles may touch or overlap and there's no limit in circles, but there should be as little circles as possible.

I am aware that this will be an iterative procedure. I just have no idea how to approach this. I have R, QGIS, PostGIS and Python at my disposal.

Maybe there is some kind of clustering here that already does what I want it to do. Probably you could also use rectangles as a basis for the calculation, the radius is quite similar.

Edit
Maybe another idea is to grow squares from (n+1)^2 cells instead of circles...


texts: Is it possible to run an R script on a layer in QGIS?

texts:
I'd like to run an R script on a layer loaded in QGIS (to rotate a set of points created there using the Vector:Research Tools:Regular Points tool). I thought ManageR might work but cannot get it working on OSX ...

Of course, I could do it manually (create layer -> run script from within R -> find output and reload into QGIS) but surely there is a more elegant solution?


texts: How to check whether a correlation is actually temporal or spatial?

texts:
I have two variables probability (of a fire) and temperature between 2001 and 2018 over multiple grid cells. When I look at the correlation through a simple Spearman it seems good (p = 0.01, r = 0.8). However, someone pointed out that time and space may influence this correlation, and potentially one more than the other e.g. spatial more influential than temporal.
Is there a way to look the influence of spatial and temporal correlation on the correlation of the probability and temperature?


texts: PDF export extent of 600 polygons in QGIS using PyQGIS

texts:
Within one polygon shapefile, I have 645 features spread across the UK which I need PDF plans of. The plans do not need to be scale specific, just so long as the extent (plus a 40px padding to show some of the surroundings) is shown.

The closest thing I've found to achieving this is the plugin Maps Printer. Except I don't have time to create 646 unique print layouts, I want to use one.

The process I have in my head is to select row 1 in the attribute table, zoom the canvas to the selected feature, then set the map (in the print layout) to the canvas extent, then export and repeat for row 2, 3 etc...

The name of the PDF would be defined by a field in the attribute table called "Title No".


texts:
I have created a simple QGIS script using QGIS 2.18.3 and windows 10 and it works fine without errors.But I want to move that script to another PC where I have QGIS 2.6 and windows 7.

I first copy-paste my plugin in .qgis2 to the other PC and QGIS loads this script without errors but if try to execute the script then I take that error :

minidump written to C:
\users\username\AppData\Local\Temp\qgis-20170316-131340-2756-3012-e2a51df.dmp

Any idea why? In the plugin I have more pushbutton where show some details that button works but it doesn't work in the final execute?
Maybe it's the Windows user's permission?

UPDATE : PLUGIN CODE

my plugin is simple for test:

    fileInfo = QFileInfo(input)
    baseName = fileInfo.baseName()
    filePath = str(os.path.abspath(input))
    rlayer = QgsRasterLayer(filePath, baseName)

or i try that code from this post:

from qgis.core import QgsRasterLayer
from PyQt4.QtCore import QFileInfo

def StringToRaster(raster):
    # Check if string is provided

    fileInfo = QFileInfo(raster)
    path = fileInfo.filePath()
    baseName = fileInfo.baseName()

    layer = QgsRasterLayer(path, baseName)
    QgsMapLayerRegistry.instance().addMapLayer(layer)

    if layer.isValid() is True:
        print "Layer was loaded successfully!"

    else:
        print "Unable to read basename and file path - Your string is probably invalid"

raster = '/home/zeito/Desktop/output2.tif'

StringToRaster(raster)


texts: Feature normalization (scaling) for Hyperspectral images

texts: I have been straggling with the concept of feature normalization for the hyperspectral images. Respect to my problem I have attached a picture of my problem which clearly stands the issue which I have.


texts:
I have never been using Cesium but recently found a web storage with multiple *.b3dm files. It looked like they represent buildings that could be helpful for my company. However I could not see if they can be converted to a regular *.dwg, *.obj, *.fbx or any other 3d model format.
Is it possible at all?
UPD. 17.08.2020
Here is a link to a sample b3dm file: https://drive.google.com/file/d/1sqWlowHWTxv-BdL_9SFFZarZXe79gi0s/view?usp=sharing


texts:
Using python I would like to iterate through a point layer and select from a line layer each line that touches a particular point. To try and familiarize myself with selecting items with python I'm just trying to write a script that selects lines that touch the selected point. This is what I have but I only get "AttributeError: 'list' object has no attribute 'selectedFeatures'".

layer_select = QgsProject.instance().mapLayersByName('Points')
layer_to_select = QgsProject.instance().mapLayersByName('Lines')
for selected_feat in layer_select.selectedFeatures():
    to_select = []
    for feat_to_select in layer_to_select.getFeatures():
        if feat_to_select.geometry().intersects(selected_feat.geometry()):
            to_select.append(feat_to_select.id())
    layer_to_select.setSelectedFeatures(to_select)


texts: How do you create a point within a polygon that is the farthest from all edges of the polygon in ArcGIS Pro?

texts: I am curious how one could create a centroid for an irregularly shaped polygon in ArcGIS Pro, that lies within that polygon's boundaries, with the concept of centroid in this case meaning a point farthest from the edges of a polygon (i.e. the most centrally located). For example, with a polygon of this shape in the image below, what steps or tools could I use to create a point that lies within that polygon and is as far as possible from the edges of that polygon?


texts: Cannot find results of MakeFeatureLayer, cannot use SelectFeatureByAttribute

texts:
I have a goal: take a feature class, select some of the records by attribute, and make a layer for further processing. Should be simple, but I am having multiple problems. Note: I am working in a Python 2.65/ArcGIS 10 environment (may be cause of some of these issues). I start with my gdb

 master_dict = {'Alabama': ['01009', '01013'], ...}
 statePath = "<...>/gdb/master_merge_footprints.gdb"

I want to iterate through the gdb and find specific features based on state names. This part works. I can even print the fields just to test that the feature class exists:

 stateNames = ['Alabama', 'Alaska'...]
 for name in stateNames:
     arcpy.env.workspace = statePath
    featureclasses = arcpy.ListFeatureClasses()
    fip_merge_list = []
    for fc in featureclasses:
        if name in fc:
            print fc
            fipslist  = (master_dict[name]):
            for fip in fipslist:
                 ### Here's where the problem occurs

Here is where the problem occurs. As I mentioned if I've tried several things to make sure that fc exists,  including fieldnames = [field.name for field in arcpy.ListFields(fc)]. I am able to print the field names and verify that the field for the where clause also exists. I create a hard output path to an existing gdb just to make sure the process will work. When I run this however, nothing shows up in my gdb when I check in ArcMap. I can manually run a selectByAttributes function in ArcMap directly on this fc as well.

select = arcpy.MakeFeatureLayer_management(fc, statePath + "/%s_temp_lyr_%s"%(name, fip),"FIPS_CODE = '%s'"%(fip))

The process runs and doesn't throw an error, but nothing is showing in my gdb. So I tried just using the SelectLayerByAttributes_management with fc and it throws an error:

select_1 = arcpy.SelectLayerByAttribute_management (fc, "NEW_SELECTION", "FIPS_CODE = '%s'"%(fip))

  Traceback (most recent call last):   File "", line 1, in

      select_1 = arcpy.SelectLayerByAttribute_management (fc, "NEW_SELECTION", "FIPS_CODE = '%s'"%(fip))   File "C:\Program Files
  (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 4259, in
  SelectLayerByAttribute
      raise e ExecuteError: Failed to execute. Parameters are not valid. The value cannot be a feature class ERROR 000840: The value is not a
  Raster Layer. ERROR 000840: The value is not a Mosaic Layer. Failed to
  execute (SelectLayerByAttribute).

So, I can't make a layer from my feature class, I can't select by attributes, and I am stuck. I have manually verified that the feature class exists (both in Python and ArcMap), I have verified that the field exists, and I have verified that the fip exists. Any advice on what I am doing incorrectly here?


texts: Setting custom spatial reference/coordinate system to shapefile using ArcPy?

texts: I have a python code which converts JSON text file to a shapefile. I have to set coordinate system to this shapefile created. I do not want to access the .prj file from my computer as this code will be embedded in a web toolbox.


texts: Using ArcPy to shorten polylines of varying lengths by 44% of original length (or by value contained in field)?

texts:
I have a feature class containing tens of thousands of polylines of varying lengths that were constructed from only a start and end point (of note, they are all at different angles, and many lines overlap one another).  That said, I also have the original point file if it would be easier to work with.

I am looking for a way to shorten these lines by 44% of their original length.

Perhaps by creating a new point 44% "down the line" from the original starting point, then maybe removing the original end point and then redrawing the line?  Seems like that would work.

Of note,the data are projected, albers_NAD83.  These are just straight lines, ie with a start point and an end point.  The points also contain additional attributes that I would need to retain.


texts: Determining azimuth of continuous polyline segment

texts: I have a polyline which represent the river bank of a particular section of a river drawn based on Satellite imagery. As you can see in the picture, it is drawn in red color. I have also a vertices which are generated from this polyline (yellow circle in picture). I want to measure azimuth in decimal degree with 6 precision of every line segment of this polyline, which will be added to the attribute table and can shown as labels in middle of the line segment. How can I proceed to do with QGIS?


texts: Polygon Clip While mainting Ratio Policy

texts:
In my project, I am using drivetime polygons to clip block group data to get the population in that drive time. The drive time shapefile I am testing on has 5 polygons. I want to update the population field for each polygon by summing the population in the clipped demographic data for that polygon.

I am using the Ratio Policy to make sure I don't take the whole block population but only the ratio of the overlap.

I have been able to execute this in ArcGIS desktop with a shapefile that only contained one polygon. I am now trying to execute this using python in a loop so that each polygon in the shapefile creates a temporary clipped feature layer to use for the population sum.

The ratio though doesn't seem to be honored in the code.

temp = 'temp_lyr'
arcpy.MakeFeatureLayer_management(demographic, temp)

# Create a describe object
desc = arcpy.Describe(temp)
print desc.dataType

# Get the field index and set ratio policy
if desc.dataType == "FeatureLayer":
    print ("is featurelayer")
    # Create a fieldinfo object
    field_info = desc.fieldInfo

    field_info.setSplitRule(field_info.findFieldByName("TOTPOP_CY"), "RATIO")
    #arcpy.MakeFeatureLayer_management(demographic, temp, '', '', field_info)

print ("Next Phase")

print field_info.getSplitRule(field_info.findFieldByName("TOTPOP_CY"))

# iterate through drivetime polygons
# use updateCusror because we will have to update the TotPop field
# call for the shape@, totpop field

with arcpy.da.UpdateCursor(drivetime, ['SHAPE@', 'TOTPOP_SUM']) as cursor:

    clipoutput = "ClipOutput_lyr"
    for row in cursor:
        summed_total = 0 #summed population

        #obtain the intersection between the demographics and drive time
        #output a temporary file that contains all the block groups that
        #intersect
        arcpy.Clip_analysis(temp , row[0], clipoutput)

        #create cursor to access data in intersection
        cursor_clipped =
        arcpy.da.SearchCursor(clipoutput['OBJECTID','TOTPOP_CY'])
        #loop through cursor and add together tot pop for the drivetime area
        for block in cursor_clipped:
            print "block",cursor_clipped
            summed_total = cursor_clipped[1]+ summed_total

    row[1] = summed_total
    print summed_total
    cursor.updateRow(row)
    arcpy.Delete_management(clipoutput)


texts: Joining the attributes of two nearly congruent streetnetworks (lines) in QGIS

texts:
I have two streetnetwork layers containing both different attributes, none of them is similar so I can´t do a simple join. Unfortunately they are not congruent, but the line objects are close to each other. I need to add the attributes of one street network to the (geometry) of the other; so all attributes of the two layers are at one layer.

I tried with a buffer and union, but the results where bad.

The best would be if all attributes go to the blue street network. The problem is for those segments (yellow box marked), where two red lines are parallel to the blue lines. Because each of the red line contains different values of the attribute I wont to join.
So maybe it would be easier to put the attributes of the blue network to the red one?


texts: Storing station data in netcdf and plotting on map using R. Station wise with location as attributes or all grid points?

texts:
I have around 100 stations of data spread over around 60 deg lon x 50 deg lon which I want to save as a netcdf using R. Do I have to make a netcdf with all grid points with non-stations being NAN or can I just store the stations (with positions) as netcdf and plot lon/lat wise when needed on a map?
I need to make a NETCDF so that I can plot this dataset using other software like GRADS or compare with topography etc.


texts: What restrictions on KML/KMZ upload exist in Google Maps API v3?

texts:
I am currently using the google maps api v3 to load kml files
into my web application. The file I am having trouble with
is a KML which is 274 KB big. It will not load (uncompressed the
file is about 8mb). If I take out elements from the file to shrink it,
then i does load in my web app.

But when i use *http://maps.google.com/?q=http://myapp/kml/mykml.kmz,
then the KML loads perfectly.
If someone can shed some light on this it will be greatly appreciated


texts: Pansharpening ALL(8) worldview 3 and worldview 2 bands

texts:
Trying to pansharpen all the bands instead of just the R,G,B,NIR bands in worldview-2 and -3 imagery.

ArcGIS Pro only has inputs for those previously mentioned bands in the pansharpening tool. Is there a way to properly pansharpen all the bands? Or do I break it up separately and then pansharpen the remaining four bands pretending that they are RGBNIR and not Cirrus, Yellow, RedEdge, NIR2 as inputs?

also is this even technically "allowed"? Since the pan band only stretches over a certain wavelength.


texts:
In a previous stackexchange question

I got help to use a geojson property to create layers on a map.

However, the layer control only keeps the latest point he gets so I can't switch on/off all points of a "destination".

If all markers have a different destination it will work but if some markers shares same destination it fails.

Here is the playground.

The geojson used is just an extract for the test. I 'need' to place hundreds of points in a few categories ("destination" in my case). Let's say, all museum and all schools, and I'd like to control the visibility of the layer on the map.


texts:
I am trying to reclassify DEM using arcpy.sa.Reclassify and it is showing an error.

Following are my commands:

dem_re=arcpy.sa.Reclassify("dem_extfish.tif","VALUE",arcpy.sa.RemapRange([[391, 677, 1],[677, 963, 2],[963, 1249, 3],[1249, 1535, 4],[1535, 1821, 5],[1821, 2107, 6],[2107, 2393, 7],[2393, 2679, 8],[2679, 2965, 9],[2965, 3242,10]]))

dem_re.save("reclass_dem_eleband.tif")

The above command gives the error:

ExecuteError: ERROR 999999: Error executing function.
Failed to execute (Reclassify).

However, it was reclassified using ArcMap but have been producing the error with ArcPy.

The full error and traceback are as below:

ExecuteError                              Traceback (most recent call last)
<ipython-input-39-d371dde30892> in <module>()
----> 1 dem_re=arcpy.sa.Reclassify("dem_extfish.tif","VALUE",arcpy.sa.RemapRange([[391, 677, 1],[677, 963, 2],[963, 1249, 3],[1249, 1535, 4],[1535, 1821, 5],[1821, 2107, 6],[2107, 2393, 7],[2393, 2679, 8],[2679, 2965, 9],[2965, 3242,10]]))

C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py in Reclassify(in_raster, reclass_field, remap, missing_values)
   5751         reclass_field,
   5752         remap,
-> 5753         missing_values)
   5754 Reclassify.__esri_toolname__ = "Reclassify_sa"
   5755 Reclassify.__esri_toolinfo__ = [

C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Utils.py in swapper(*args, **kwargs)
     51
     52             try:
---> 53                 result = wrapper(*args, **kwargs)
     54             finally:
     55                 # Reset the geoprocessor state to the original setting.

C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\sa\Functions.py in Wrapper(in_raster, reclass_field, remap, missing_values)
   5745             remap,
   5746             out_raster,
-> 5747             missing_values)
   5748         return _wrapToolRaster(u"Reclassify_sa", unicode(result.getOutput(0)))
   5749     return Wrapper(

C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\geoprocessing\_base.py in <lambda>(*args)
    508         val = getattr(self._gp, attr)
    509         if callable(val):
--> 510             return lambda *args: val(*gp_fixargs(args, True))
    511         else:
    512             return convertArcObjectToPythonObject(val)

ExecuteError: ERROR 999999: Error executing function.
Failed to execute (Reclassify).


texts: Given an SVG drawing of a building, and 2 GPS-reference points, as well as where north is in the drawing, how can I import a building into QGIS so the 2 GPS-reference-points are at the same coordinates  ?


texts: POSTGIS error in getting proper intersected output (St_intersect, st_buffer)

texts:
I need to get gid, area and geometry  of table1  which are  intersecting with
 200 buffer of table2. I tried to structure the query. Please refer below:

create table SMI_1 as
SELECT ST_Buffer(geom, 200) from table2;

create table SAH_2 as
SELECT a.gid,a.shape_area, a.geom
FROM table1 a
INNER JOIN SMI_1 b ON ST_Intersects(a.geom, b.st_buffer);

With this I am not getting desired output. It is not clipping the features of table1  with the shape of the table2.


texts: Avoiding intersections with QGIS Spline plugin (Version 2.0)

texts: Has anyone gotten the QGIS 'avoid intersections' option to work when adding polygons via the Spline plugin? When checking the option and enable topological editing, I continue getting overlaps in my polygons when adding using the spline tool. When adding polygons using the regular add polygon tool, the intersections are successfully avoided and no overlap occurs with new polygons.


texts: ArcGIS Pro not loading associated world file with .PNG raster

texts:
I am fairly new to GIS, and brand new to ArcGIS Pro (came from ArcMap).

I recently created a visual basic program that generates an image from the Google Static Maps API with a respective ESRI world file (.PGW).  Below is an example image with the corresponding world file:

0.000171661
0
0
-0.00012673
-122.8704705
42.4147755

The image is named "staticmap.png" and the world file is "staticmap.pgw", they are both saved in the same folder.  Here are some of the things I've tried so far:

Loading it in without the world file present, it loads in the Pacific Ocean.
Assigning the Mercador Web Map and then loading the image with world file in my map, which results in it appearing outside of Africa (it should be in southern oregon).
Deleting all references to the image / world file in ArcGIS Pro and regenerating both, loading into my map without a projection (It loads in the same spot it loaded without a world file present).  This step convinced me that the program is ignoring my world file for some reason, maybe I wrote it incorrectly?
Tried it in ArcMap with the same results.


texts: Standard direction format in GIS software

texts:
I am working on an application, where the user can place some items on a map. Some of these items have a direction, currently saved as radians where 0 is towards right/east. We want to enable the user to batch add items via some kind of spreadsheet, and we became unsure if this "0 means towards right" is meaningful.
When I look at a compass, 0 means towards north.

Do you know if there is an established direction standard in GIS, for example that 0 (radians or degrees) should always mean north (or east)?


texts: What are units for calculated area in QGIS?

texts:
I have a shapefile of counties in the US, and I would like to calculate the area of each polygon so that I can run a population density calculation. However, I am having trouble calculating the areas.

My steps were:

Vector -> Geometry Tools -> Export/Add Geometry Columns

I set the input layer to the layer I wanted to add the geometry columns to, then set Calculate using to "Layer CRS" (which is NAD83, EPSG:4269). My understanding was that it would then calculate the area in meters since NAD83 is in meters, but the values are too low to make sense (i.e. 0.2 area for a whole county).


texts: Have loaded a CSV layer with a QGIS plugin (so far so good) but cannot add a field to it in the same plugin

texts:
I have created my first ever plugin in QGIS 2.10.1 Pisa, and the layer loads fine, but after two days of trying, I cannot get the plugin to also add a field.  The following code in the "def run(self):" section doesn't cause any error, but also does not add the field.  Can anyone tell me what I'm doing wrong here, please?

filename = self.dlg.lineEdit.text()
uri="file:///"+filename+"?"+"delimiter=%s&xField=%s&yField=%s"%("\t", "Set Grid Easting", "Set Grid Northing")
vlayer = QgsVectorLayer(uri, "SpreadTests", "delimitedtext")
QgsMapLayerRegistry.instance().addMapLayer(vlayer)

vpr = vlayer.dataProvider()
vpr.addAttributes([QgsField("Testing", QVariant.Double)])
vlayer.updateFields()


texts: Updating selected feature/record using ArcObjects (VBA)?

texts:
I would like to edit a selected feature/record via ArcMap vba, but I'm not having much luck with this code sample (see code below). I'm not getting an error, but the record selected is not updating.

Private Sub Update_Click()

Dim pMxDoc As IMxDocument

Dim pLayer As ILayer

Dim pInFtrLyr As IFeatureLayer

Dim pFtrSel As IFeatureSelection

Dim pFeatureClass As IFeatureClass

Dim pFields As IFields

'Dim ii As Integer

Dim pPoint As IPoint

'Dim pSegColl As ISegmentCollection

Dim pEnumLayer As IEnumLayer

Dim pMap As IMap

Set pMxDoc = ThisDocument

Set pMap = pMxDoc.FocusMap

Set pEnumLayer = pMap.Layers

Set pLayer = pEnumLayer.Next

Do Until pLayer Is Nothing

If pLayer.Name = "Copy of Wells_test" Then

Set pInFtrLyr = pLayer

End If

Set pLayer = pEnumLayer.Next

Loop

Set pFtrSel = pInFtrLyr

If pFtrSel.SelectionSet.Count = 0 Then

MsgBox "Please select one Well record", vbOKOnly

Exit Sub

ElseIf pFtrSel.SelectionSet.Count > 1 Then

MsgBox "Please select one Well record", vbOKOnly

Exit Sub

Else

If pFtrSel.SelectionSet.Count = 1 Then

Set pPoint = pInFtrLyr.FeatureClass.GetFeature(pFtrSel.Selectio nSet.IDs.Next).Shape

End If

End If

Set pFeatureClass = pInFtrLyr.FeatureClass

Dim pFSelection As IFeatureSelection

Set pFSelection = pInFtrLyr

Dim pFClass As IFeatureClass

Set pFClass = pInFtrLyr.FeatureClass

Dim pFCursor As IFeatureCursor

Set pFCursor = pFClass.Update(Nothing, True)

Dim pID As New esriSystem.UID

pID.value = "esriEditor.Editor"

Dim pEditor As IEditor

Set pEditor = Application.FindExtensionByCLSID(pID)

Dim pFeature As esriGeoDatabase.IFeature

Dim pEnumFeature As esriGeoDatabase.IEnumFeature

Set pEnumFeature = pEditor.EditSelection

Set pFeature = pEnumFeature.Next

Do Until pFeature Is Nothing

pFeature.value(pFeature.Fields.FindField("Type")) = "update"

Set pFeature = pEnumFeature.Next

Loop

End Sub


texts: How to setBounds on a CartoJS 4 boundingBox?

texts:
I have tried to find an example on how to setBounds on a carto.filter.BoundingBox with no success. There is examples of carto.filter.BoundingBoxLeaflet which takes map as parameter.

  const bboxFilter = new carto.filter.BoundingBoxLeaflet(map); //map is a leafLetJS map object

The filter.BoundingBox documentation says setBounds takes a carto.filter.bounds object as parameter, but no example anywhere. I tried

  var mBnd = map.getBounds();   //map is a leafLetJS map object
  const bboxFilter = new carto.filter.BoundingBox();
  var bnd = carto.filter.Bounds(mBnd._northEast.lat, mBnd._northEast.lng, mBnd._southWest.lat, mBnd._southWest.lng);
  bboxFilter.setBounds(bnd);

with no luck.


texts: Creating a raster of percent of pixel occupied from shapefile

texts: Starting from a polygon shapefile, How can I produce a 1km raster, where the cell values are the percentage of the pixel occupied by the shapefile. For example the values would range from 0 to 100%. I would like to use freely available python tools like osgeo, shapely, rasterstats etc to produce the output raster and it needs to be an efficient solution because it is a global extent 1km calculation.


texts: Uploading CSV data to color a map on QGIS

texts: I'm using QGIS, and I've put KML files in as seen in the photo. Each polygon is a distinct feature with a name. I'm trying to upload a CSV file which has a list of the same exact names as the features in the KML files, but has an associated value (say, X) in the beside column. I want X to dictate the color of the KML polygons, but I'm not sure how.


texts: Find country perimeter lengths using PostGIS

texts:
I have polygons representing world countries and I am attempting to find the length of their borders in miles
I have tried
using ST_Perimeter
SELECT ST_Perimeter(geom::geography) * 0.000621371  AS dist
FROM   countries
WHERE  cntry_name = 'Ireland'

and using ST_Boundary
SELECT ST_Length(ST_Boundary(geom)) *  0.000621371 as dist
FROM   countries
WHERE  cntry_name = 'Ireland'

but continually get a result which is inaccurate.
What is the correct way to find total length around a polygon/country?


texts: Why does the AxMapControl no longer expand to fill the space when I press the Show/Hide Map Legend button?

texts:
I have a .NET application dependent on ArcGIS 9.3.1 which I am upgrading to ArcGIS 10.2.

I have an AxMapControl sat in a panel in a Splitter on a tab. There is a legend which can be made to appear/disappear using the Show/Hide Map Legend button.

When the application is built against the ArcGIS 9.3.1 DLLs, the map expands to fill the available space if you hide the legend using the button. Nice!

However, when building against the ArcGIS 10.2 DLLs, the map does not expand if the legend is hidden. The map remains the same size and the legend vanishes to reveal a useless grey panel next to the map.

This seems to be a problem internal to the control. Does anyone have a workaround (other than reverting to the 9.3.1 DLLS)?


texts:
There are like ten zoom-tool icons but no one seems to do what I look for - to zoom to a rectangle that will be created by dragging mouse from top left corner of it to bottom right corner of the rectangle.

Can you please tell me how to achieve this in Quantum GIS? I am using the latest 1.8.0-Lisboa version.


texts: Cut many lines with many polygons: Too much for my CPU/RAM?

texts:
I have a line-shp (80mb) and a polygon-shp (5mb) and want to intersect them. In result, the lines (contours) should be cut by the polygons.

After using one of the tools "Vector -> Geoprocessing -> Dissolve/Clip/Intersect" to do so, the loading bar keeps at 0%. Same by marking just 10 of the 6000 contours to intersect them. The CPU usage is at 50% (one core 100%) all the time, even for more then 30minutes...

What is the problem? How to solve it? But don't tell me, I need a new computer! :)

  My config: AMD II X2 240 ; 4GB RAM; xubuntu 12.04; Qgis 1.8


texts: How to turn a string field with 2 numbers in two numerical fields in the atribute table?

texts:
I have a feature class with a big number of features.

In the attribute table I have a string field made from two numbers separated by an underline (e.g.: 0_1, 98_237, 31_31...). I want to create two new numerical (long integer) fields with the numbers before and after the underline (e.g.: 0_1 0 1, 98_237 98 237, 31_31 31 31...)

How can I do this using field calculator?


texts: Converting .grd to .asc using MapBasic in MapInfo 16

texts:
Can someone please provide an example to show how this would work.

For example, I am trying to convert from .GRD to .ASC, would my MapBasic code look like this:

public void Convert(string "C:\Users\file1.grd", string "C:\Users\Converted", string ESRI ASCII and Float grids)
{
    RasterProcessing.Convert(string "C:\Users\file1.grd", string "C:\Users\Converted", ESRI ASCII and Float grids);
}

Clearly I am doing something wrong here as I get unrecognized command error from MapInfo.

Could someone please explain how to rectify this.

I have looked at a similar post here: mapbasic convert raster to mrr

but was not able to find success. I tried the manual too and I wasnt sure how to address the parameters.

Edit:

I am really new to coding in general. I was under the impression that this code needed to be input into the MapBasic window to run.
I tried editing the code to something like this but it failed:

Dim strInFilePath as string
strInFilePath = "C:\New folder\trial.grd"
Dim strOutFilePath as string
strOutFilePath = strInFilePath
Dim strDriver as string
strDriver = "ESRI ASCII and Float grids (*.asc)"

public void Convert(strInFilePath, strOutFilePath, strDriver)
{
RasterProcessing.Convert(strInFilePath, strOutFilePath, strDriver)
}


texts: Which Leaflet Basemap with shaded relief should I use for a WebGIS?

texts:
I'm having difficulties to show shaded relief in our Basemap.

Where can I find a free and clean basemap service, that shows only shaded relief? With no labels, no roads, no rivers, no cities, etc., ready to use my cartographic base.


texts: Determing which Which georeference system was used on an Ecuadorian Topo Baselayer

texts: I'm creating a map in Western Ecuador, and am attempting to use a military topo baselayer for it.  The map comes with UTM grid lines on it so georeferencing it was easy but I'm unsure of what projection was used for those UTM grid lines on it.  Does anyone know how I could find that out or Where I could find a different topo layer for Ecuador?  Thanks for any help!


texts: Using GDAL Warp results in odd pixel sizes and gaps

texts:
I am mosaicking one meter and three meter rasters to two meters in Python with GDAL Warp using the following code:

cl_string = "-of GTiff -co COMPRESS=LZW -tr 2 2 -tap -r near -overwrite \
-multi -wo NUM_THREADS=ALL_CPUS"

warp_options = gdal.WarpOptions(gdal.ParseCommandLine(cl_string))
warp_name = "warpped.tif"
ds = gdal.Warp(warp_name, vsis_paths, options = warp_options)
ds = None

Which results in the following:

The image shows half-width pixels and frequently has gaps (not shown here). How can I ensure the pixels have the correct width?


texts: Duplicate and triplicate values in raster symbology for Unique Values using ArcMap

texts:
I'm using ArcMap 10.7.1 on Windows 10 to symbolize some rasters. Looking at the the unique values, I found duplicates and even triplicates using the Symbology window (see picture).

There are about 20 of these cases. I know I could combine the unique values manually by grouping, but I have 100 of these layers to process, so I would like to correct the problem so they don't happen in the first place. The fact that so many duplicates and triplicates exist makes me wonder what's going on behind the scenes and if there's something strange with my data or the way the raster is formatted.


texts: Iterate through Landsat 8 ImageCollection to sample and extract data

texts:
I'm interested in sampling Landsat 98 data around a solar farm on the California/Nevada border.  I need to sample low-cloud (<5%) scenes for defined periods of time (pre-/post-construction)
At the moment, I have used https://landsatlook.usgs.gov/explore to identify a single scene with <5% cloud cover and have used this individual tile in GEE to sample points at 100m intervals to ensure my method works.
My script so far is :
//var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_RT')
//                  .filterDate('2018-08-01', '2018-08-11');
var image = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_039035_20200705')
///var image = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_L2SP_039035_20200705_20200913_02_T1_SR')
var trueColor432 = image.select(['B4', 'B3', 'B2']);
var trueColor432Vis = {
  min: 0.0,
  max: 30000.0,
};
var thermal = image.select(['B10', 'B11']);
var thermalVis = {
  min: 11734,
  max: 38499,
};

var aoi =
    /* color: #98ff00 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[-115.50906528445387, 35.63597003699956],
          [-115.50906528445387, 35.528750545150906],
          [-115.36349643679762, 35.528750545150906],
          [-115.36349643679762, 35.63597003699956]]], null, false);

//Sample at 100m distance
var samples = image.sample({
  region: aoi,
  scale: 100,
  tileScale: 16,
  geometries: true})

print(samples.first())
// Visualize the image
// Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3, gamma: 1.2}, 'Image');
Map.addLayer(samples, {}, 'Samples')
// Map.centerObject(aoi, 12);

Map.setCenter(-115.435272, 35.584001, 14);
// print(samples.first())
// .addLayer(samples, {}, 'Samples')
Map.addLayer(trueColor432, trueColor432Vis, 'True Color (432)');
Map.addLayer(thermal, thermalVis, 'Thermal bands');

// Export the sampled points as shapefile
Export.table.toDrive({
  collection: samples,
  folder: 'earthengine',
  fileNamePrefix: 'Sateline_solar_samples',
  fileFormat: 'SHP'})

The approach described here is doing something similar though processing the data in GEE wheras I am (currently) sampling the band data, exporting it, and then processing it in Excel.  (I would like to do this all in GEE in due course).
Using the USGS portal noted above I have determined another 24 images in 2020 that I would like to process, though have also found pre-processed USGS ARD (Analysis Ready Data) though this is not available on GEE and would need to be imported.  This is about 10Gb of data for the single area of interest I'm wprking with which doesn't seem scalable in the medium term.
I'm new to GEE and programming, but it looks like I need to filter the Landsat 8 ImageCollection - by data, ROI, and cloud cover, and then iterate through the filtered Collection to sample and extract my data.
Is this right, and, if so, how do you go about iterating through a filtered ImageCollection, sampling and exporting the data from each image?  The only documentation and exemplification I can find on GEE relates to compositing, or means/anomalies.
Pointers wellcome - happy to go


texts:
I try to export geographical data from a postgis database to a shapefile with pgsql2shp.

Normally this works fine, but now I receive the following error.

Preparing table for user query... Done.
Initializing... ZMflagQuery: ERROR:  function zmflag(geometry) does not exist
LINE 1: SELECT max(zmflag("geometrie"::geometry)) FROM "__pgsql2shp7...

The query I use is:

pgsql2shp.exe -f 'foldername' -h luna -p 5432 -u user-P pw -g geometrie dbname "select * from bag.adressen a where a.wnpcode = '3386'"

I haven't had any earlier problems with pgsql2shp.


texts: Geocoding addresses from Excel in QGIS 3

texts: I have a set of addresses in Belgium in Excel and I would want to geocode/transform them in coordinates in order to be able ta visualize them in QGIS 3.4. Does someone know how I could do?


texts: Identifying Left and Right Mouse Button Clicks in PyQgis application

texts:
I am relatively new to PyQt. I am trying create a custom plugin for Qgis which enables the user to select some features by drawing polygon on the canvas using mouse clicks and then performs intersection of the selected features with another layer. What I want to do is that when user right clicks on the canvas the polygon selection should stop. For this I have to identify between the right and left mouse signals. I have made a dummy function just to test this functionality:

def mousePressEvent(self):
    print "code enters mousePressEvent function"
    if event.buttons() == "Qt::LeftButton"
        print"Left button pressed"
    else:
        print"Right button pressed"

I am trying to call this function as follows:

QObject.connect(self.clickTool,SIGNAL("canvasClicked(QMouseEvent,Qt::MouseButton)"),self.mousePressEvent)

But I am unable to call the function. I guess I am doing something wrong in canvasClicked section.


texts: Leaflet Feature bindpopup does not display (OnEachFeature)

texts:
I am attempting to have a click event popup with some data pulled from Wikipedia and displayed on my Leaflet map for each point that displays GeoJSON data.
My data is displayed on map as you can see here:

Each GeoJSON point has a property:name associated with it that would be used for the Wikipedia search. My problem is that I can not get the layer.bindpopup function to properly display a popup when any feature is clicked. This may be an issue due to my use of the leaflet-ajax plugin, I am not sure.

After consulting multiple solutions found here:

Leaflet

Geeks With Attitude

Savas Labs

Github

And other threads on gis.stackexchange, I have not been able to make the popup work for me. My cursor changes during hover, but I can not select the highlighted shapes on my map.

What might I be doing wrong with the following code?


texts: OpenLayers3: How to draw line with beetwen two points

texts:
I've following code:

var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
  source: source
  style: new ol.style.Style({
    stroke: new ol.style.Stroke({
      color: "#ffcc33",
      width: 2
    })
  })
});

map.addLayer(vector);

var drawInteraction = new ol.interaction.Draw({
  source: source,
  type: "LineString"
});

map.addInteraction(drawInteraction);

How I can draw only 2 points start and end?


texts: Normalize raster in arcpy: Input Raster changed to Dataset?

texts:
I am trying to normalize the raster in arcpy by unchanged location over time.  As such, I

read the raster ('inRaster')
read unchanged locations as polygon ('inPoly')
Extract by mask unchanged location
calculate MEAN and SD of unchanged extracted land
normalize original raster by values of unchanged land

Everything works great until step 5, where I got an error:

RuntimeError: ERROR 000732: Input Raster: Dataset 0.152711537046664 does not exist or is not supported

Well, my Input Raster had somehow to changed, as the Dataset 0.152711537046664 represents exactly my mean value...  When I let to print all values (mean, SD, inRasterandoutRaster), my input variables seem correct:

 inRaster is C:/Users/ndvi_0419
 Mean is 0.152711537046664
 SD is 2.85148713249969E-02
 outRaster is C:/Users/norm_ndvi_0419

For normalization formula, I am using arcpy.sa algebra, suggested here: Using Loop with Raster Calculator in ArcPy?

normRaster = (Raster(inRaster) - rMean)/rSD

Do you know what could be the issue in my code?

My whole code:

# Import modules
import itertools, arcpy, os

# import envronmental settings
from arcpy import env
from arcpy.sa import *

# Define working environment
inWD = "C:/Users/analyzed"

# Set Snap Raster environment
arcpy.env.snapRaster = os.path.join(inWD, "rectif.gdb/r_20160502")

# Define variables
inRaster = os.path.join(inWD, "VI.gdb", "ndvi_0419")
inPoly = os.path.join(inWD, "normBlackSquare.gdb", "n_0419")

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute ExtractByMask
outExtractByMask = arcpy.sa.ExtractByMask(inRaster, inPoly)

#Get raster properties: Mean and STD
rMean = arcpy.GetRasterProperties_management(outExtractByMask, "MEAN")
rSD = arcpy.GetRasterProperties_management(outExtractByMask, "STD")

# Save the output
outName = os.path.basename(inRaster)
outRaster = os.path.join(inWD, "normVI.gdb", outName)

# Print values to check if inputs are correct
print "inRaster is " + inRaster
print "Mean is " + str(rMean)
print "SD is " + str(rSD)
print "outRaster is " + outRaster

# This formula seems not to work right!!!
normRaster = (Raster(inRaster) - rMean)/rSD
#normRaster.save(outRaster)
# print "Normalized raster saved"

#Return (check-in) the spatial extension
arcpy.CheckInExtension("spatial")


texts:
I am very new to using GIS software so apologies if this is a silly question.  I am trying to build a virtual raster catalog to allow me to work with OS address base and codepoint data sets.  Everytime i try to build the raster catalog file it is giving me an error saying "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program."

Any clues anyone?

Thanks in advance.


texts: How to Convert Multiple Raster in to NettCDF in Arcmap 10.1?

texts:
My name is Paresh Chaudhary and I've worked in the field of Geometics since 2008. I have 30 day by day surface temperature images of MODIS, aqua satellite. Now i want to convert it into a NetCDF raster in ArcMap 10.1. I know one tool, Raster to NetCDF in Multidimension Tools tool set which does this but you can't input multiple images. So is it possible to convert 30 temperature variables into NetCDF raster? I would like to visualise all images with time and also perform temporal analysis.

Thanks a lot in advance


texts: Insertion of a raster geotiff in PostgreSQL database

texts:
I am new in PostgreSQL and psql.
What is the method to insert a raster geotiff in a postgreSQL database using command psql? What is the best format? Someone indicates to save a raster image as BLOB format.


texts:
This should be very straightforward, but I can't seem to find this exact conversion scenario.  I understand pixel / row / and lat and long coordinates but it seems like none of these values agree with each other, nor is there information contained in the .tif metadata for 4 specific GCP, but many more, not just the corners. How is this supposed to run?
gdal_translate -of NITF image_HH.tif image_HH.nitf

outputs
Input file size is 132928, 13699
0...10...20...30...40...50...60...70...80...90...100 - done.
ERROR 6: The 4 GCPs image coordinates must be exactly at the *center* of the 4 corners of the image ( (0.5, 0.5), (13698.5 0.5), (132927.5 13698.5), (132927.5 0.5) ).

and
gdalinfo image_HH.tif

outputs
Driver: GTiff/GeoTIFF
Files: image_HH.tif
Size is 132928, 13699
GCP Projection =
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
GCP[  0]: Id=1, Info=
          (1,1) -> (111.069111116576,15.3557160509762,1.27591192722321e-07)
GCP[  1]: Id=2, Info=
          (132928,1) -> (114.68068434691,14.5410844662899,1.05239450931549e-07)
GCP[  2]: Id=3, Info=
          (1,13699) -> (110.903453210568,14.629538715478,1.08033418655396e-07)
GCP[  3]: Id=4, Info=
          (132928,13699) -> (114.503997460899,13.8200059186205,8.84756445884705e-08)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_COPYRIGHT=Copyright SSTL 2019
  TIFFTAG_DATETIME=2020:06:15 15:32:05
  TIFFTAG_IMAGEDESCRIPTION=16 bit Detected ScanSAR Product
  TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
  TIFFTAG_SOFTWARE=Software Version: V1.13
  TIFFTAG_XRESOLUTION=0.0033333334
  TIFFTAG_YRESOLUTION=0.0016666667
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,13699.0)
Upper Right (132928.0,    0.0)
Lower Right (132928.0,13699.0)
Center      (66464.0, 6849.5)
Band 1 Block=132928x1 Type=UInt16, ColorInterp=Gray


texts: Explode clusters of overlapping points in ArcGIS Javascript API

texts:
In my map application built on ESRI's javascript API there are a number of points that share a lat/long. I need a way to allow the user to see all of the points at a specific location by exploding them outward when the top point is clicked. The effect would need to be something like this.

I know this can be done in other libraries, but I can't find anything similar in the ESRI universe. ArcGIS is a client requirement so I need to stay within that API.


texts: Understanding Date Time Format output in ArcGIS REST API?

texts:
It looks like the output format for dates from the ArcGIS REST API at 10.1 is in ticks.

Has this always been the case?

Can it be changed at the server level or the request level?


texts:
I am trying to use Bing maps on my HTML page using OpenLayers and geoEXT.
the problem is when I change the center of the Bing map nothing happens, also when I try to zoom on the map on certain point like this:

Bing.setCenter(new OpenLayers.LonLat(rec.get('x'),rec.get('y')).transform('EPSG:4326','EPSG:26191'), 9);

It doesn't zoom on this point with the x and y, all I get is the zoom with degree 9.

Here's the code:

var Bing;
var apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
 Bing = new OpenLayers.Map("map");
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    var road = new OpenLayers.Layer.Bing({
            name: "Road",
            key: apiKey,
            type: "Road"
        });
        var hybrid = new OpenLayers.Layer.Bing({
            name: "Hybrid",
            key: apiKey,
            type: "AerialWithLabels"
        });
        var aerial = new OpenLayers.Layer.Bing({
            name: "Aerial",
            key: apiKey,
            type: "Aerial"
        });
        Bing.addLayers([road, hybrid, aerial]);
        var center = new OpenLayers.LonLat(-93.27, 44.98).transform(
            'EPSG:4326', 'EPSG:3857'
        );
        Bing.setCenter(new OpenLayers.LonLat(-110, 45), 3);

 bingpanel =  new GeoExt.MapPanel({
          region:"center",
          height: 400,
          width: 600,
          map: Bing

      });


texts: Installing Fiona into cloned conda environment in ArcGIS Pro gives ImportError

texts:
I am trying to install Fiona into a cloned conda environment in ArcGIS Pro. I have cloned the default environment and tried to install it both through ArcGIS and through the conda prompt (through default channel setup and specifying conda-forge). I have tried cloning an environment, removing everything except arcgis and arcgispro and then reinstalling gdal/fiona/geopandas.

Everything I try results in an ImportError (or worse):

>>> import fiona
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\dev_37\lib\site-packages\fiona\__init__.py", line 83, in <module>
    from fiona.collection import BytesCollection, Collection
  File "C:\ProgramData\Anaconda3\envs\dev_37\lib\site-packages\fiona\collection.py", line 9, in <module>
    from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified module could not be found.

I am experienced using conda outside of ArcGIS and have a few working conda environments for different purposes. However, I would like to have access to ArcPy and Fiona (really GeoPandas) in the same environment as I have one dataset that is very large and stored in a gdb and reading/writing with GeoPandas is way slower than with ArcPy, but I also have a large number of functions written in GeoPandas that I would prefer not to rewrite in ArcPy.

I believe the cause of the issue is that ArcGIS Pro uses a different (Esri) GDAL than you get from a typical install via anaconda or conda-forge:

gdal                      2.3.3               arcgispro_1  [arcgispro]  esri


texts: QGIS Find distance between specific sets of points between two different point layers

texts:
I have a large postcode dataset of ~1.6 million observations in Layer A.

I have a smaller dataset of ~5000 observations in Layer B.

Layer A contains an ID that matches postcodes with observations in Layer B.

I want to find the distance between every observation in Layer A, and the associated observation in Layer B, using the common ID field.

Note, I do not want to do Nearest Neighbor Analysis, there is a specific network structure.


texts: How to insert Polyhedralsurface into POSTGIS?

texts:
I am unable to store a polyhedralsurface object in my POSTGIS database.

My table has two columns:

name character varying,
geom geometry(POLYHEDRALSURFACE)

I am trying to insert the following geometry:

INSERT INTO public.geometries(
        name, geom)
VALUES ('Cube', ST_GeomFromEWKT('SRID=4326;POLYHEDRALSURFACE(
((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)),
((0 0 0, 1 0 0, 1 0 1, 0 0 1, 0 0 0)),
((1 1 0, 1 1 1, 1 0 1, 1 0 0, 1 1 0)),
((0 1 0, 0 1 1, 1 1 1, 1 1 0, 0 1 0)),
((0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 1))
)'));

but POSTGIS throws an error:

Geometry has Z dimension but column does not


texts:
I would like to create a map of a small zone in Cesium. It would be a 3d map, with some building appearing with real size like this => https://cesiumjs.org/NewYork/

I have searched about how to do this kind of building representation using KML, CityKML, GLTF, or COLLADA.

Now, my problem is I don't understand how to I create this data. I searched for UI tools in order to

=> import a building model (gltf for exemple)
=> placing it at a location on the map
=> adding some information to the building like building name
=> export that model (as gltf/json, or kml, or any) so I can import in Cesium.

Is there tools to do this ? I can't find any


texts: How much math does a GIS Analyst need to know?

texts:
For someone studying to pursue a career as a GIS Analyst, what math courses should he/she take?

Here's a long list of free Math courses from MIT to serve as a frame of reference.

Which are essential, useful, useless?


texts: For ArcMap10: I know there are multiple way to do this, but I wanted to see what was the most efficient for this case, as I will be doing it repeatedly in my workflow. I have a .shp polygon layer with multiple polygons within it. I need to change one polygon within this, and am simply dividing it into two pieces. They are property tracts, and one owner has sold half of his portion, now making it two separate tracts. So, the property tract is currently 1028, and needs to become 1028 and 1028A. I have thought of simply deleting, and re-drawing, but is there a more efficient way?


texts: Filled contour polygons from Terrain50 polyline contours

texts:
I am trying to create filled polygons from the Ordnance Surveys Terrain 50 contour polylines.

I have tried the simple Feature to Polygon tool in ArcGIS 10.4, but this does not bring across the height attributes.

Is there a simple way to quickly create filled polygons? I would like to ideally do it across a large section of the UK.


texts:
DEM is used to produce Slope raster. I use Snap raster but it does not work.
Based on some posts, I uncheck background processing of geoprocessing but it did not make difference.
Both the input and out are in the same coordinate system.


texts: Leaflet: how can I find all geo-json features at a certain position

texts:
For a small project we are using leaflet with geojson features instead of openlayers backed by geoserver.

Now, when I click in the map, I want to see a list of all features in that position.

I use the onEachFeature to attach a popup to all visible features (in separate layers), but not entirely unexpected, only the top-item catches this click-event and shows the popup.

I have been looking in the documentation and searching for examples, but I did not find something useable. In the openlayers+geoserver I would use the WFS service to get all features, and then I would display the returned result.

Do I need to switch to geoserver, or is this possible with geojson features (in leaflet) as well?


texts: ArcMap: How to create legend for specific data frame?

texts:
I'm coming up a problem in map production where I have two data frames, but it seems like I can only create a legend using the items in the original data frame (the order doesn't seem to matter as I can reorder them and I'm still only able to add items to the legend that are in the original data frame). I can sort of get around this by dragging all the files into the original data frame, but that results in some weird display problems.

I've gone through the Legend properties, but there doesn't seem to be anything there. Anyone have any suggestions as to how to specify which data frame is used for legend building?


texts: I am trying to stub an IFeature with RhinoMocks, but I am having so much trouble doing it. Does anyone have experience with it?


texts: Use colums in attribute table to set colors and line thickness directly automatic

texts: i have a column in my attribute table called 'Color' and 'Line' where I store rgb color codes and line thickness values (in map units) to give my layer elements a color and thickness. You can do it manually style => layerproperties.However I would like to use pyqgis to directly plot it properly.


texts: Calculate new coordinate based on distance traveled between two other coordinates

texts:
We have two coordinates (latitude, longitude) and let's assume we want to travel along a straight line between them. After traveling a certain distance along this line, we would like to calculate a new coordinate for this location. How can this be done?

Point startCoord = new Point(52.515343254180486, 13.384435940499088);
Point endCoord = new Point(52.51544771840784, 13.386055994744083);
double totalDistance = 110.23868303918874; // in meters
double intervalDistance = 50; // in meters

Note: Distances between points will always be fairly small.

Possible solution:

Based on this post we can find the angle between startCoord and endCoord.

Using the intervalDistance as hypotenuse, we can find x and y distances away from the startCoord using simple trig:

double dx = intervalDistance * Math.sin(angle);
double dy = intervalDistance * Math.cos(angle);

And based on this post, we can calculate the new coordinate based on the x and y distance away (in meters) from the startCoord.


texts: Mouse hovering on KML layer in ArcGIS API for JavaScript?

texts:
I am using ArcGIS API for JavaScript for map.

i want show an popup info window when mouse hover on kml layer.

I am trying this code for and using  mouse-over event , But this is not working on kml layer.

my code is:

 var kmlUrl = "http://www.arcgis.com/sharing/rest/content/items/a7c2aaaa083741f58825cc3f39c53a22/data";

          var kml = new KMLLayer(kmlUrl);

            map.addLayer(kml);
            kml.on("load", function() {
              domStyle.set("loading", "display", "none");

            });

           kml.on("mouse-over",function (event) {
             alert('test');
          });


texts: Offline satellite map of a specific area for an iOS app

texts:
I have a client that wants an offline satellite map as part of an iOS application. The map is of a specific area and needs to be able to be loaded without a connection. From my research I'm pretty sure I can do what I need to do using TileMill and route-me. There are two things that I don't understand:

Where can I get a satellite image that I can use in TileMill? (Paid is fine)
How do I get it into TileMill?


texts: How to re-register a one way replica geodatabase

texts:
Long story short. Arcmap crashed during one of my regular synchronizations of a replica geodatabase created through one-way replication checkout. Upon reloading it seems to have unregistered the replica without copying the changes to the master SDE geodatabase.

We have backups of the distributed databases but it seem that the link between the modified/replicated personal gdb and our main SDE database has been broken.

Does anyone know of any fixes or ways to reestablish this linkage so we can perform the normal reconcilie / post operation to sync the version?


texts: How to call the stock Grid (Interpolation) tool without specifying an algorithm in QGIS Python console?

texts: Question says it all. Looking to use the Raster > Analysis > Grid (Interpolation) tool in a python workflow, but need to be able to run it with the default of no specified algorithm. I can only find GDAL/OGR interpolation methods that already specify the algorithm in the processing toolbox.


texts:
Does anyone have an example of using the Cesium pinBuilder with a remote URL?  All the examples I have seen use local assets (with buildModuleUrl())

This is what I'm trying:

var pinBuilder = new Cesium.PinBuilder();
var url = 'https://hearmynamefiles.storage.googleapis.com/gp/220px-Jeanine_anez2.png';

var leaderPin = Cesium.when(pinBuilder.fromUrl(url, Cesium.Color.GREEN, 96), function(canvas) {
    return viewer.entities.add({
        name : 'Anez',
        position : Cesium.Cartesian3.fromDegrees(-75.1705217, 39.921786),
        billboard : {
            image : canvas.toDataURL(),
            verticalOrigin : Cesium.VerticalOrigin.BOTTOM
        }
    });
});

This same URL works fine to create a billboard, so I must be doing something wrong when I try to create a pin with it, but I'm not getting any errors.


texts:
I'm having a problem with one map tile in QGIS. It appears like this when zoomed out:

But it appears normal when zoomed in:

A colleague has tried the same tile in MapInfo, where it appeared fine at any scale, but I'm still having problems in QGIS.


texts: How Leaflet makes request to get the tile image

texts:
I have used Leaflet in my web app for a while. And I studied the source code, but didn't find the code or function for sending HTTP request. If I missed the code, which part is for this function?

If it is not done in the Leaflet level, and how does it work? How does the Leaflet.js and server communicate with each other?


texts: Creating new layer through DB Manager in QGIS 3

texts:
When I load a polygon .shp-file into QGIS 3.6 and run a query finding the centroids of the polygons, I cannot load it back to the layers panel. The same operation works fine in QGIS 2.18.2.
The query looks like this:
select id, st_centroid(geometry) as geom
from polygon_table

My main intention is to do the same operation in PyQGIS 3, and automate this process by allowing the user to choose the shp file from a GUI and load both the polygons as well as their centroids simultaneously.


texts: Create a raster layer that represents the distance from each polygon cell to the closest point in a buffer

texts:
Let's say I have polygons A and B (green), polygon centroids (white), buffers around these centroids (blue), and a collection of points (red). I want to create a raster layer that represents the distance from each polygon cell to the closest point (red) within the polygon buffer (blue). For the raster of A, the distance should be to the closest point (red) in A's buffer region. I think I need to first rasterize the shapefile containing A and B, but I'm getting an error.

I created a basic example of this setup in QGIS.


texts:
I am trying to build a linear reference route that uses the DEM derived distance instead of the default 2D distance. I have tried this How To (https://support.esri.com/en/technical-article/000008984) by Esri but it ends up using the 2D distance instead (I have checked it multiple times - but no change).
Does anyone have a recommendation on what to do or what tool to use?


texts: Does a projection's WKT reflect the computer's locale?

texts:
This should be quick - we're trying to determine if there are problems parsing some WKT text because the system locale considers the decimal separator to be a comma instead of a period.

Anyone know?  References would be handy so I can show the devs.

Our specific implementation is using Esri's Web ADF but I am curious to know how other systems handle it, and whether or not the OGC has established an official opinion.


texts:
Can anyone advise me if it is possible to nominate what format Google Earth exports it's .kml file in?

i.e. Can you export directly as a UTM file, DDD or DMS file somehow via a selection?  At this stage I have only been able to find that it only exports as DDD.


texts: Making all values in raster same using QGIS?

texts:
I need to convert all the values in a raster to one certain value. How can I do this? (I tried using raster calculator, but any operation that would result in a raster having all one value makes it create a raster with no data for whatever reason)

I tired using constant grid, and it also makes rasters with no data

My inputs were:

The raster I created showed no data:

To make sure, I looked at the histogram of data values, and it confirms no data (the data should be all 1)


texts: Creating polygon around set of points using PyQGIS

texts:
I need to create a polygon (as close to a regular polygon) around a set of points like this image below, and I've to do this with PyQGIS for QGIS 3+. Don't matter, plugin or script.

So, I thought in offset the points and create a polygon from it. But, there may be in the middle of the set a point that does not belong to the border, like red ones in the image.
I need suggestions (not code, but is welcome too) to solve this problem.


texts: Filling SRTM 1-arc second V4 voids using SRTM 1-arc second V3 with different resolution

texts: I want to fill voids in the SRTM 1-arc second V4 (resolution 30m) DEM for Europe. Is it possible to directly fill the voids using SRTM 1-arc second V3 (resolution 90m) without resampling it to 30m resolution?


texts:
Does anyone know how I can use a wildcard in a geodatabase path?
Basically I have this old script that uses both shapefiles and geodatabases. I would like to update the script to have a wildcard in the folderpath as each month the filename changes(from the download). This will make it so I don't have to change the path each month.
I managed to source glob.glob for the shapefiles, but it doesn't seem to work for the geodatabase.
For example this works for my shapefile
EL = glob.glob("L:/Support/Data_load/Tenements/%s/QLD/QSC_Extracted_Data_*/QSC_Extracted_Data_*/Exploration_permits_for_mineral.shp" % (d))[0]

I tried this for my geodatabase but this does not work
Moo = glob.glob(r"L:\Support\Data_load\Tenements\{}\SA\Mineral tenements - exploration\Exploration Licence Applications-Mineral and_or Opal_*\Exploration Licence Applications-Mineral and_or Opal.gdb\Mineral_and_or_Opal_Exploration_Licence_Applications")[0]

and I get the error
IndexError: list index out of range

I work in GIS not python so am just wanting a simple quick fix that I can apply to this script to get it working again and be done with it.


texts: Smoothing/reinterpolating raster with GDAL?

texts:
Short:
I want to change the resolution of a raster and smooth the gray ramp like shown in the images bellow. The preference is to use GDAL, PIL or Numpy.

Description:
I'm kriging points into rasters with an output resolution of 20 meters with the High Performance Geostatistical Library. I don't want to change the output resolution because the interpolation time increase exponentially.
With this resolution the output image is ugly (pixelated and aliased). I don't know if it is conceptually correct but I want the image to be smoother like in the example bellow. It's something like 'reinterpolating' the image into a better resolution one. I'm using python so my preferences are GDAL, Python Imaging Library or Numpy. The answer could be theoretical, like pointing out the algorithm name or the concept of this kind of operation.

Source:

Destination:

EDIT Results with gdalwarp cubic spline:


texts: MapInfo / MapXtreme is it possible to get the Features from a Table

texts:
I'm trying to get the Features from a table with MapXtreme 7.0.0. I use winforms with the MapControl from MapInfo.

Is it possible to get all the Features from a table?

Something like: table.GetFeature();


texts: Finding Code in QGIS Select Features Toolset

texts: Can anyone tell me in what directory the pre-installed Python scripts for the QGIS selection tools (i.e., Select by Point, Select by Polygon) are found?  I am using on a Windows 7 installation of QGIS 2.0.1.


texts: Upgrade to GRASS 7.8 - "NameError: name '_' is not defined"

texts:
I have recently updated to GRASS 7.8 and I am now getting this error any time I try to execute a command:

leni@eecdd4f59c3b:/app$ grass78
Default locale not found, using UTF-8
Default locale settings are missing. GRASS running with C locale.Traceback (most recent call last):
  File "/usr/bin/grass78", line 2206, in <module>
    main()
  File "/usr/bin/grass78", line 2084, in main
    message(_("Starting GRASS GIS..."))
NameError: name '_' is not defined

I'm not really sure what to make of it.

This happened when I rebuilt a docker image where I install the latest version of GRASS. This is the relevant part of the Dockerfile:

FROM ubuntu:18.04

# system environment
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y software-properties-common vim
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update

RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable
RUN apt-get update
RUN apt-get install -y grass

RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git

# update pip
RUN python3.6 -m pip install pip --upgrade
RUN python3.6 -m pip install wheel

Does anyone have any ideas? I wanted to roll back to GRASS 7.6, but I am stuck on Ubuntu 18.04 now for other compatibility reasons and it seems that GRASS 7.6 does not have a release for Ubuntu 18.04.

It looks like it is looking for a function called ´_´ and not finding it, but that doesn't really tell me much


texts:
Possible Duplicate:
  Iterative position within Field Calculator/Python

I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to start from 1 and progress up until the end of the county group and then start over.


texts: Density analysis producing extreme values?

texts:
I have point data of gas flares and I am trying to create a simple density raster of those flares. Results are either 0 or in the 100,000-1,000,000 range (when there's 5 to 40 or so points in each box).

At least as I see it, I am trying to do the most basic of point density analyses. I'm just simply trying to count up how many points are in that box! I'm using a reference raster of 15 arcseconds. My point density dialogue is as below. Note that I've tried it two different ways with very similar results.  Any suggestions of where I'm going wrong? I'm guessing it has to do with my search radius, but how do I tell Arc I want my search radius to be the same as the pixel?

Dialogue:

Results:

Environments: Processing extent same as reference raster
Input: Gas Flares Points
Population: none
Output: ...\Flare_Dens.tif
Output cell size: 0.004167 (15 arcsecs in dec degrees, same as raster I'm snapping to)
Neighborhood: Rectangle
Radius: Map, 0.004167 x 0.004167

OR (getting similar results in the >100,000 range)
Radius: Cell, 1 x 1


texts:
How can i move the center/origin of my marker image(map pin), so that my marker pin points always on the same point

(in CSS  transform-origin: center bottom;)

how can i achieve this in CARTO CSS?


texts:
I recently purchased a Dell XPS-8300 (i7-2600|16 GB DDR3 RAM|64-bit Windows7) which I intend to use primarily for GIS programs. I bought a refurbished model because it was much cheaper and because I am able to choose a graphics card of my own.

I am currently in the process of purchasing said card, but I haven't really seen much  information about what kinds of cards are optimal for ArcMap or QGIS rendering as opposed to Battlefield 3 or Skyrim.

I am currently looking at an XFX AMD Radeon HD6870 PCIE 2GB Dual Mini or an XFX AMD Radeon HD 6870 900M 1 GB DDR5 DUAL MINIDP HDMI DUAL DVI PCI-E Video Card

The 2 GB model is about $40 more than the 1 GB.

I have a 460 watt power supply and do not know if the extra ram affects power consumption. The 1 GB model, from all reviews, should work fine with my system, so I am hoping the 2 GB would work fine as well.

However, since I already have 16 GB of onboard ram and have read that GPU RAM isn't really important unless you go under the amount needed for a given program and settings, I am wondering if this extra GB would be worth it for my purposes:

For example if I have a parcel dataset with hundreds of thousands of polygons, would that extra GB of GDDR5 RAM significantly improve the time it takes to render the polygons when I scroll/zoom in on ARCmap/QGIS; or does it mostly worthless due to the fact that I already have 16 GB that can be used?

Also are there any specific advantages/disadvantages to using a ATI vs NVIDIA card for GIS display programs in general?


texts: Event layer not editable when using ModelBuilder in ArcMap

texts: I have created a model using ModelBuilder in ArcMap where points are automatically plotted based on coordinates. I have noticed that the layer cannot be edited and if I try I get the following message; "event later not editable".


texts: I have a table with a series of lat/long points - how do I convert them into polygons?

texts:
I have an Excel sheet with about 150 points (lat and long in decimal degrees) which belong to about 15 different polygons. The columns I have are FID, NAME (the same between polygons), POINTS (points for the polygons), LAT, LONG, ELEV.

So a sample row might have: FID: 0, NAME: LO, POINTS: LO1, LAT: xx.xxxxxxxx, LONG: -yy.yyyyyyyy, ELEV: zzzz

The NAME field is the same for the different points that make up one polygon (so ~10 fields have the name LO, and the points are numbered as NAMEx [so the LO polygon will have different rows with LO1, LO2, LO3, etc. in the POINTS field).

I have already successfully converted these points to a shapefile in Arc, is there a way to make them into polygons? I have access to ArcMap 10.1 or 10.2. Thanks all.


texts: ArcGIS server extension: Marshal.ReleaseComObject() or not?

texts:
The ServerSimpleImageServiceRESTSOE example uses Marshal.ReleaseComObject(). The other examples seem to not use this.

When should I use Marshal.ReleaseComObject()?

As I understand if I am not using ReleaseComObject the garbage collector deletes the COM object when it finds appropriate. Since the COM objects not necessarily consume any memory this may be almost never.

Could keeping workspace, rasters etc open as COM objects eventually lead to crashes? If so will there be thrown an exception that explains that the system is running out of filehandles etc?

On the other hand "Calling ReleaseComObject affects all managed references to a COM object in the current process.".
May not this cause problems since several instances of the server may run in the same process?


texts: Google Earth Engine: How to Create A Table From Lists

texts:
I want to create table-format feature collection from a couple of lists. These lists only have 4 elements in it. My objective is to create a feature collection with a column per list and a row per element (2x4 table). But, I'm getting a feature collection with 3 columns and only 1 row (feature 0). How do I get four different features instead of one?

My code: https://code.earthengine.google.com/ab24d70e19e02bf96a908ad9f3815f5e

Thank you,

Luis


texts: Matching projected tiles from carto with a another tile service

texts:
Web Mercator projection is not a good match for polar region, and I need to use "Sphere Azimuthal Equidistant" for a project: https://epsg.io/53032

I'm able to add the projection to PostGIS/Carto by running this query:

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 53032, 'ESRI', 53032, '+proj=aeqd +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs ', 'PROJCS["Sphere_Azimuthal_Equidistant",GEOGCS["GCS_Sphere",DATUM["Not_specified_based_on_Authalic_Sphere",SPHEROID["Sphere",6371000,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Azimuthal_Equidistant"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",0],PARAMETER["Latitude_Of_Origin",0],UNIT["Meter",1],AUTHORITY["EPSG","53032"]]');

This gives me this top level tile (0/0/0) from Carto:

I need to match this tile with another service (WMTS), where I need to specify the extent and resolution. Is there somehow I can get this information from Carto? How is the top level tile defined?

About projections in Carto: https://carto.com/blog/free-your-maps-web-mercator/


texts: Coloring SpatialLines by attribute in R?

texts:
I have a SpatialLinesDataFrame dataset of rivers in R. The dataset consists of lines (river segments) with a "Turbidity" attribute. I want to create a map and legend, where:

Turbidity between 0 and 10 is yellow
Turbidity between 10 and 20 is orange
Turbidity between 20 and 30 is red

Here is my sample dataset:

library(sp)

#create the sample SpatialLines with 3 lines and 1 attribute
x1 <- c(15.10,15.20, 15.25)
y1 <- c(48.9, 49.1, 49.0)
Line1 <- Line(cbind(x1, y1))
LineString1 <- Lines(list(Line1), ID=1)

x2 <- c(15.25,15.21)
y2 <- c(49.0, 49.12)
Line2 <- Line(cbind(x2, y2))
LineString2 <- Lines(list(Line2), ID=2)

x3 <- c(15.21,15.12)
y3 <- c(49.12, 49.05)
Line3 <- Line(cbind(x3, y3))
LineString3 <- Lines(list(Line3), ID=3)

spLines <- SpatialLines(list(LineString1, LineString2, LineString3))
spLinesDF <- SpatialLinesDataFrame(spLines, data.frame(Turbidity=c(5, 24, 16), row.names=c(1, 2, 3)))

#this is the color breaks that I want to use in map and legend
breaks = c(0, 10, 20, 30)
colors = c("yellow", "orange", "red")

#this doesn't assign the correct colors to my line values
plot(spLinesDF, col=colors)

What commands do I use to match the color breaks (0, 10, 20, 30) with the colors(yellow, orange, red) and with the Turbidity attribute values in my map and in the legend?

I know that for raster I could use simple commands like:

brk <- c(0, 10, 20, 30)
col <- c('yellow', 'orange', 'red')
plot(raster, col=col, breaks=brk)

But for SpatialLines, the plot doesn't appear to support the color breaks parameter.


texts: Displaying an uploaded image in Google Earth Engine

texts:
I have been trying to view an uploaded image on google earth engine, but I am not able to tell what's the problem with the code, as I didn't see any error or layer on the base map after running the code.

var image = ee.Image("users/chandrakant/RZSC_2000_2015_Trial_2");
var vizParams = {
  bands: ['b1'],
  min: 0.0,
  max: 1000.0,
  palette: ['bbe029', '0a9501', '074b03'],
};
Map.setCenter(6.746, 46.529, 2);
//Map.addLayer(image, vizParams, 'Rootzone Storage Capacity');
Map.centerObject(image);

print('Projection, crs, and crs_transform:', image.projection());
var reprojected = image.reproject('EPSG:4326', null, 500);
print('Projection, crs, and crs_transform:', reprojected.projection());
Map.addLayer(reprojected, vizParams, 'Reprojected');

I have tried several things, even tried to reproject the image, but nothing seems to work at all.

The tiff image is shared in the link below.
https://www.dropbox.com/sh/hpqj2tfei8o82xo/AADNPWEA4PN9ybNN6zx8771Ca?dl=0

The image properties show my band to be masked, I don't know why.

Pixels
Reprojected: Image (1 band)
b1: masked              \\Masked, why??
Objects
Reprojected: Image (1 band)
type: Image
bands: List (1 element)
0: "b1", float, EPSG:4326, 1x1 px
id: b1
crs: EPSG:4326
crs_transform: List (6 elements)
data_type: float
dimensions: [1,1]
origin: [19369,20037]
0: 19369
1: 20037
properties: Object (2 properties)
system:footprint: LinearRing, 5 vertices
system:index: 0


texts: Can I use avaraging to pinpoint the exact location of a stationary GPS device?

texts:
I have a simple Android app that keeps track of users' location, using the following setting of the LocationManager to avoid constant updates and thus battery drain

minTime = 60sec (minimum time interval between location updates)
minDistance = 50m (minimum distance between location updates)

So far so good. However, not unexpectedly, I kind of suffer from the limited accuracies of GPS. Ideally, I would like to identify in which restaurant a user is eating, even if the restaurant is in a shopping mall with other restaurants or other POIs (e.g., shops) nearby. Right now the accuracy is not good enough to make this reliably work.

I wonder if this a common problem and there are tried and tested solutions.

My current approach is to keep a history of a user's last locations. Every time the user is moving - I use the ActivityRecognitionApi for that - I clear the history. As soon as a user is still, I add any new location to the history. To identify a user's location, I simply average the coordinates - using a simple mean (maybe better the median); I'm not far from the equator, it's only for quick testing. The assumption here is, of course, that all coordinates in the current history are indeed coming from the user being still at one location. Another approach might be clustering. With this I wouldn't need the activity recognition, which is also never 100% accurate. But if there is simpler solution out there, I'd be more happy.

The whole thing is just a basic research prototype. So the backend component handling user's history is in Python. Maybe there are good packages out there that can help me here.


texts: Adding value in raster file from attribute table in QGIS?

texts:
I have a raster (in tif format) with one band (an ID number). I also have an attribute table with several fields(columns) for each ID number of the raster file. For instance,
raster.tif: 1 band (ID)
table.txt : ID, field

So, the two files have a common value (the ID field).

How can I add the column "field" from the table.txt in the raster.tif ?


texts: Problem adding WFS Layer to QGIS project

texts:
I want to load data using an WFS into qgis 1.7.4.
After connection to the server is established, data seems to be downloaded, but no data is displayed in qgis, neither geometry nor attributes.
The data is in EPSG31467. I have changed the coordinate system in the qgis wfs settings to EPSG31467. It is then displayed as being set to 'urn:x-ogc:def:crs:EPSG31467'.
On another machine, there is no problem adding the data?
Any help is greatly appreciated! Thanks a lot!
t


texts: How can I clear a vector layer features in OpenLayers 4?

texts:
I want to clear my vector layer features, I did it before in OpenLayers 2 with destroyFeatures(); command, I research many times but I can't do that in OL4. How can I do that?

My OpenLayers 2 code:

    if (self.selectFeatureLayer) { self.selectFeatureLayer.destroyFeatures(); }
    if (self.markerLayer) { self.markerLayer.clearMarkers(); }
    if (self.layerRuler) { self.layerRuler.destroyFeatures(); }
    if (self.measureControls) {
        if (self.measureControls.line.active) {
            self.measureControls.line.deactivate();
            self.measureControls.line.activate();
        }
        if (self.measureControls.polygon.active) {
            self.measureControls.polygon.deactivate();
            self.measureControls.polygon.activate();
        }
    }


texts: Writing Shapes with GeoTools: Data fields with UTF-8 content are invalid

texts:
i'm creating Shapes using GeoTools SimpleFeatureType, SimpleFeatureBuilder and featureBuilder.add(...). (i can add snips if requested)

Data Source is postgresql.

Displaying the shapes with QGIS shows "???" in the locname field (there should be "東京都" for Tokyo) same problems for wikimedia.

Last year, i did the conversion postgresql -> shape using pgsql2shp, which was running fine. No, i can't switch back to that!

Is there any way to specify which encoding to use in geoTools? Or whatelse am i doing wrong?


texts: Cropping black marks on edge of geotiffs using ArcGIS Desktop?

texts:
Are you aware of any way to crop a geotiff while maintaining the co-ordinate information?

I am trying to crop a series of geotiffs of multi-beam data which have a black frame on one or two edges (in arcmap 10) which i can't remove, even setting the background colour to no colour does't work (it is set so that only the multibeam image is showing though).

Im not actually a 100% sure what the marks are, the data was worked in fledermaus to create DTM's and exported as geotiffs then to arc .

I've read the other entries about this problem but i not really confident on how to use gdal or code. I no longer have access to fledermaus so cannot re-edit etc.


texts:
I have built a fusion table with a geo location search.

Right now, my search function centers on the results of the geocoded address. I would like the map to detect the nearest marker and zoom out/in depending on how far away the nearest marker is. For example, if there is a marker in Colorado, but you are searching an address in Wyoming, your search will render a map big enough to show you your location AND the nearest marker. However, if you are in Los Angeles, and you are searching in Los Angeles, the map will zoom in to include all of the markers in the area, not the markers in surrounding cities/states.

Any ideas on how to accomplish this?

Here is my code:

var map, layer;
var geocoder;

function initialize(location) {

console.log(location);
geocoder = new google.maps.Geocoder();
var userlocation = new google.maps.LatLng(location.coords.latitude, location.coords.longitude);

map = new google.maps.Map(document.getElementById('map-canvas'), {
center: userlocation,
zoom: 8
});

layer = new google.maps.FusionTablesLayer({
query: {
  select: '\'Geocodable address\'',
  from: '1x265dMvUClEGEVHD_3VRBvSRXk-mbs4jcO2xy29K',
}
});
layer.setMap(map);
}

function codeAddress() {
var address = document.getElementById('address').value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
  map.setCenter(results[0].geometry.location);
} else {
  alert('Geocode was not successful for the following reason: ' + status);
}
});
}

navigator.geolocation.getCurrentPosition(initialize);


texts:
I have read the documentation for this but still unsure of what the function spsample does.

The documentation is here:

https://www.rdocumentation.org/packages/sp/versions/1.3-1/topics/spsample

I came across this while trying to do interpolation on a dataset, referencing this page: https://mgimond.github.io/Spatial/interpolation-in-r.html

Just to clarify, is this function trying to split an area of interest using a grid, and trying to put a value for each cell on the grid using the data that we feed into the function? But I am not sure why the idw function would require a grid that has values. I thought the inputs to idw would just be the points we are trying to interpolate.

Can someone clarify?


texts: ESRI JavaScript FeatureLayer constructor makes graphic geometry null in featurecollection object

texts:
I'm pulling point data by lat long from my SQLServer database via webservice and creating a JSON FeatureCollection object as the webservic response. When I attempt to create a FeatureLayer from this FeatureCollection, the geometry attribute of the features becomes null, while the attribute array of each feature and the layerdefinition comes through fine. Here's a sample of my code and JSON:
JSON:

    {
"layerDefinition": {
    "geometryType": "esriGeometryPoint",
    "objectIdField": "ObjectID",
    "drawingInfo": {
        "renderer": {
            "type": "simple",
            "label": "",
            "description": "",
            "symbol": {
                "color": [
                    205,
                    212,
                    144
                ],
                "size": 50,
                "angle": 0,
                "xoffset": 0,
                "yoffset": 0,
                "type": "esriSMS",
                "style": "esriSLSSolid",
                "outline": {
                    "color": [
                        205,
                        212,
                        144
                    ],
                    "width": 0,
                    "type": "esriSLS",
                    "style": "esriSLSolid"
                }
            }
        }
    },
    "fields": [
        {
            "name": "ObjectID",
            "alias": "ObjectID",
            "type": "esriFieldTypeOID"
        }, ...some more fields...
     ]
     },
    "featureSet": {
    "features": [
        {
            "attributes": {
                "ObjectID": 1,...more attributes...
    },
            "geometry": {
                "type": "point",
                "x": -8242964.882933755,
                "y": 5071902.135513675,
                "spatialReference": {
                    "wkid": 102100
                }
            }
        },

Code:

    function onGetFeatureJsonReturn(msg) {

      var featureCollection = JSON.parse(msg.d);
      var featureLayer = new esri.layers.FeatureLayer(featureCollection, {
         id: 'HourlyDataLayer'
       });
       map.addLayers([featureLayer]);
    }


texts:
While running a Dissolve, when using statistics fields, I keep getting an error that the parameters are not valid.

Here is my code:

toBeDissolved = r"D:\TestingAfterMeeting\toBeDeletedTestingData\output.shp"
output = r'D:\TestingAfterMeeting\toBeDeletedTestingData\TestingDissolve\output_diss.shp'

arcpy.Dissolve_management(toBeDissolved,output,dissolve_field='Code_CLDC',statistics_fields=[['Code_DDA','LAST'],['Code_Provi','LAST'],['Number_CLD ','LAST']])

Been looking at it for a while... maybe someone else sees the mistake.


texts: Create table of type info or dbase has not nullable fields

texts:
[updated]
In a script tool i use the CreateTable_management function to calculate some values as a result of an intersection of two polygon layers. The script uses a Parameter to specify path und name of the table (type is Table inside the script too parameter list).
But unfornutately, if the user selects a folder and name to store the table, CreateTable_management adds two, some three fields automatically and sets them as NotNullable. So i can't ignore them with my insert cursor. This only happens with folders, not with geodatabases (i tried only geodatabase, though).

What can i do about this? Can i suppress the field creation?

import arcpy
import os
# ...
# p5 = arcpy.GetParameterAsText(4) e.g.:
p5 = "C:/temp/foo"
arcpy.env.overwriteOutput = True
# ...
outpath = os.path.dirname(p5)
outname =  os.path.basename(p5)
res = arcpy.CreateTable_management(out_path=outpath,
    out_name=outname)
field_names = [f for f in arcpy.ListFields(p5)]
for fn in field_names:
    print fn.name, fn.isNullable

# in my script i'm creatin the fields i need here ...
arcpy.AddField_management(p5, "myField", "LONG")
# the insert cursor fails with info tables
ic = arcpy.da.InsertCursor(p5,["myField"])
for d in range(10):
    ic.insertRow([d])
del ic

print "Table data:"
field_names = [f for f in arcpy.ListFields(p5)]
for fn in field_names:
    print fn.name,
print ""
sc = arcpy.da.SearchCursor(p5, ["*"])
for r in sc:
    print r


texts: DEMs not displayed properly in 3D in ArcScene and QGIS

texts: Some of my DEMs are rotating about an axis off the screen, if that makes sense. I defined them with a CRS of GCS 1984 and projected it in UTM. I am only loading one at a time to provide perspective views, and have tried in ArcScene 10.5 and QGIS 3. I have tried reprojecting, but nothing has worked. A couple of them are displayed correctly, but a majority are not. What part of the properties should I check?


texts: Map from video game with Cartesian coordinates in Mapbox GL JS

texts:
I want to create an interactive map in the browser from the RPG video game. I think I'm quite experienced in both backend and frontend development, so this is definitely not one of that naive questions, but I'm pretty new in the word of GIS.

Background

The game map uses Cartesian coordinates x,y,z and has approximately 4 km². The base internal unit is 1 cm. z = 0 is sea level and all three coordinates go into negative values too.

I exported the whole map into the Blender and already recreate a small part of the map in the GeoJSON format. I'm using multiple FeatureCollections to describe lands, rivers, buildings, etc. I kept coordinates for the polygons the same as they are in the game. I'm using just x and y coordinates.

And now, I want to use some library to visualize it on the web. I did quite a big research and find these two (free) mainstream libraries - Leaflet and Mapbox GL JS. Both can handle GeoJSON as an input, but Mapbox GL JS uses WebGL for the rendering and overall looks a bit more modern.

Question

I don't know how to project my Cartesian coordinates from the GeoJSON files into Mapbox GL JS lib, so the game's map will not be distorted and when the user clicks somewhere, he gets right coordinates.

Research

I created PoC in the Leaflet, where everything seems to work with CRS set to Simple. But according to this comment on the Github, Mapbox JS GL doesn't support Cartesian coordinates yet. Can I overcome this limitation somehow? I thought about some projection from x,y to lon,lat or something, but this is really not my cup of tea...


texts: Getting returnDistinctValues functionality from 10.1 in ArcGIS Server 10.0?

texts:
It is possible to get returnDistinctValues functionality from AGS 10.1 in AGS 10.0?

From ArcGIS Server REST API:

 New in 10.1 SP1

Support for a new parameter called returnDistinctValues
that accepts a boolean value was added. When true query
result would contain distinct values
based on the fields specified in outFields parameter.

Maybe someone knows some smart query?


texts: Set ArcGIS Tool Parameter to Obtain From it's own Source?

texts:
I am building a python tool in ArcGIS. When I build the parameters I will have 3:

Choose a shapefile (parameter data type = shapefile)
Choose an SQL query (parameter data type = SQL Expression)
Choose an output folder for a .xls report (parameter data type = Folder)

The first 2 parameters are an either/or scenario. The user will either choose a shapefile for the input or they will build an SQL Query on a very specific feature class (I do not want them to choose both parameters).

Whichever option the user choose, the parameter will be eventually used as the 'clip feature' in the arcpy.Clip_analysis function.

Is there a way to limit the user from choosing both (i.e. if they choose the shapefile option, have the SQL query grey out automatically and vice versa). Maybe using the validator class?
I want to 'Obtain From' a very specific feature class to be used in the SQL parameter. The parameter property for 'Obtain From' only allows me to obtain from another parameter. Is there any way to 'Obtain From' it's own source? It won't allow me to enter a default datasource and choose that for the 'Obtain From'. Maybe I can also do this through the validator class as well?


texts: Compute zonal statistics in QGIS with overlapping features

texts:
I would like to compute zonal statistics in QGIS (preferably using the Python console) of a polygon layer with overlapping features.

I've seen different questions (and answers) on how to compute zonal statistics, but none of them refer specifically to how to deal with overlapping features in QGIS. However, I've read in different posts that overlapping features might complicate things when using, for example, ArcGIS.

The question is:

Do you know if the QgsZonalStatistics class works well with layers with overlapping polygons?

If not, is there any alternative to carry out this task in QGIS? For example, to compute zonal statistics iterating over the different features of the layer?


texts: How to set the angle of an Annotation when use a shared symbol

texts:
I am creating annotations in an add-in and am trying to rotate the annotation using the Angle field while using a shared symbol, however when I try and set the Angle field directly it always sets back to 0. What is the correct way to set the Angle field?

Most of the properties for shared symbols seem to be set on the ISymbolCollectionElement interface, but Angle is not available.

Here is a simplified snippet of my code. Comments have indicated 3 lines where I have attempted to set the angle to no avail:

annotation_fc = //annotation feature class
insert = //annotation insert cursor

//get the shared symbol
var anno_class = annotation_fc.Extension as IAnnoClass;
var symbol = anno_class.SymbolCollection.Symbol[8];

//create the element using the shared symbol
ITextElement element = new TextElement() as ITextElement;
(element as ISymbolCollectionElement).SharedSymbol[symbol_id.Value] = symbol;
(element as ISymbolCollectionElement).Text = anno_text;
(element as ISymbolCollectionElement).Geometry = p;
(element as ISymbolCollectionElement).FlipAngle = 360;

//this Property does not exist, but seems like where I should be setting the angle
(element as ISymbolCollectionElement).Angle = 45; // <<---------------------------------

//does not affect final feature, angle is still 0
//also seems like the wrong way to set the angle
element.Symbol.Angle = 45;  //<<---------------------------------

//creating the annotation feature
var feature_buffer = annotation_fc.CreateFeatureBuffer();
(feature_buffer as IAnnotationFeature2).Annotation = element as IElement;
feature_buffer.Value[feature_id_index] = feature.OID; //this is set in the inserted feature
feature_buffer.Value[status_index] = 0; //this is set in the inserted feature

//this is not set in the inserted feature, angle will be 0
feature_buffer.Value[angle_index] = 45; //  <<---------------------------------

//insert the feature
insert.InsertFeature(feature_buffer);

I am using ArcMap 10.5 and this is being executed inside a Tool Add-In.

EDIT:

To get around this issue for now I've altered my code in the following ways.

First I removed the insert cursor. Instead I am using IFeatureClass.CreateFeature() and IFeature.Store(). It should be noted this method will also always set the feature's "Angle" field to 0, just like above.
After calling Store() I cache the feature OID for later.
Now I loop back through the features using an Update cursor. The Update cursor allows me to set the "Angle" field without any issues.

This two pass solution is not ideal, but will serve as a temporary workaround.


texts: QGIS print a map for each polygon in KML

texts:
I'm brand new to QGIS. I imported a KML file as a layer into QGIS. I'd like to print a map for each polygon in the KML. I saw a tutorial that said to check the box "controlled by atlas", but the box is grayed out. How can I get the result they have here with the KML coming out of Google?

https://www.qgistutorials.com/en/docs/automating_map_creation.html


texts: pgAdmin version 4-5.3 where is the geometry viewer

texts:
Updated the pgAdmin to latest version 4-5.3 on Windows 64 bit, I can not find the geometry-viewer anymore.
So howto "activate" the geometry-viewer in the latest version?
Update:
As @JGH shows in the answer the button for the geometry-viewer is very FAR right, you have to scroll a LOT to reach the geometry-viewer-button. Before version 4-5.3, the columns-width by default was small. You can change this by setting the following preference:

Voila, now you have the same "design" like in older versions of pgAdmin


texts: I want to compute an area of certain object on a picture using Monte Carlo method. The picture shows some shape on white background. To do so I figured out that I'd get the coordinates of non-white points and then I'd launch the rest of the routine in e.g. Excel. My problem however is that I don't know about any application or software that performs what I want - i.e. getting coordinates of pixels of some specified colour. Can someone suggest some application or software which can do what I want?


texts:
I'm using QGIS (Zanzibar) for a project in my university and that includes finding the stream order and some shape parameters. So I tried using the strahler order to calculate the stream orders and lengths but the algorithm gives me a distorted image which I can't get values from.
P.S.: Using CRS WGS 84 and ASTER map files.


texts: Stopping execution of plugin or deactivating running plugin using plugin name without closing QGIS in pyqgis?

texts:
How do I stop the execution of plugin or deactivate the running plugin using plugin name without closing QGIS in pyqgis?

lstofplugins=qgis.utils.active_plugins
for k in range(len(lstofplugins)-2):
    self.iface.actionExit().trigger()

I have tried this coding ,but it is closing QGIS application itself..


texts: Using field calculator to auto-increment within a range?

texts:
I am trying to use field calculator to number points between -700 and 700. I have used this code block:

rec=0
def autoIncrement():
  global rec
  pStart = 700
  pInterval = -1
  if (rec == 0):
   rec = pStart
 else:
  rec += pInterval
return rec

which works great, but only numbers between 700 and 0, but I would like it to number all the way to -700 before starting over. Is this possible with this approach or do I need to try a different method?


texts: Change pixel size of 30m for 23.5m in QGIS

texts: I need to change pixel size in raster file file with Pixel Size = (28.086057277202915,-28.086057277202915) using Qgis for Pixel Size = (23.951601289061028,-23.952379920305706) what kind of function I can use?