texts: Getting list of valid layers in TOC using PyQGIS?

texts:
To get the list of TOC layer names I used the approach suggested here:

for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    print layer.name()

But this method is not reliable due to it is able to catch "phantom" layers that are created when the preview option in DB Manager plugin is used (see this ticket) and were never added to TOC by user. Here is what happens:

>>>def laylist():
>>>  l=[]
>>>  for layer in QgsMapLayerRegistry.instance().mapLayers().values():
>>>    item = layer.name()
>>>    l.append(item)
>>>  print l
# There is only one layer 'buf' (a shp-file) in QGIS TOC. Check the TOC
>>>laylist()
[u'buf']
# Now open DM Manager, connect to the PostGIS DB and preview one of the spatially enabled tables ('park_kvartal3_utm') without adding them to TOC
# Check TOC again:
>>>laylist()
[u'park_kvartal3_utm', u'buf']
# Now in DB Manager select another spatial table ('itog_region_utm') and preview it without adding it to TOC
>>>laylist()
[u'park_kvartal3_utm', u'itog_region_utm', u'buf']
# Close DB Manager and catch exception.
Exception RuntimeError: 'wrapped C/C++ object of type PGVectorTable has been deleted' in <bound method PGTableDataModel.__del__ of <db_manager.db_plugins.postgis.data_model.PGTableDataModel object at 0x7f17550dedf8>> ignored
# Check TOC content again after the DB Manager is closed. Notice: no layer was added to TOC by user during DB Manager session. The names of table remains:
>>>laylist()
[u'park_kvartal3_utm', u'itog_region_utm', u'buf']

However scripts from the Processing Toolbox displays only valid user-added layers in corresponding comboboxes, which indicates that there is another method for fetching layer names (or filtering valid ones) is implemented.

How to get only layers that are displayed at TOC?


texts:
I am using ArcObjects 10 and when I select a feature using queryFilter I get this exception :

An exception of type 'System.Runtime.InteropServices.COMException' occurred in EMS.exe but was not handled in user code

Additional information: Error HRESULT E_FAIL has been returned from a call to a COM component.

This is my code :

 featSel = ems.featureLayer as IFeatureSelection;
 featSel.Clear();
 idList = featSel.SelectionSet.IDs;
 featureClass = ems.featureLayer.FeatureClass;
 queryFilter = new QueryFilterClass();
 queryFilter.WhereClause = "code=1088" ;
 selectionSet = featureClass.Select(queryFilter, esriSelectionType.esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, null);

I get the exception on the last line.

I think this is related to the shapefile version as it worked with ArcGIS 10.4.


texts: Modeler - QNEAT3 - selected destinations instead of "all origins" to "all destinations"

texts:
I would like to calculate the distance between points from table A (80 000 entities) , to points from table B (500 entities), filtering with a relation parent-infant (or just using a common field pointing from A to B). Other way to explain it : I don't need to have all the distancies between all the "points A" to all the "points B", but only the distancies between the "points A" to the point B that is mentionned in one field from table A (relation 1 to 1).
I need to use the modeler (as I would like to be able to do it again), but I am a beginer in the modeler... I tried with collecting "unique values" from table B + selection by attribute from table A where the common id is corresponding to B id

Then I used the OD Matrix from layers as Table : from Point Layer A (result of the selection by attribute) to Point Layer B.

The final result is a OD matrix with 80000*500 entities... (in theory, as I tried in fact with less than 500 and less than 80000).
I hope my description is clear...
Do you have an idea ?
Thanks for your coming help :D


texts:
I use QGIS to create surface plots for measurements made in the field. I use the contour plugin. I usually create ~50 contours in order to make a smooth surface. When I use print composer, I generally go in and remove most of the legend items so the legend isn't too large to fit. This is tedious and I'm working on a report with many (50+) plots... I want to do a conditional format. Something like divide the largest value by 10, then use only variables in the 10 "bins".

The issue is that I can't figure out how to "index" the individual values within the legend. If I select the legend item of interest (the contour grid values), then use expression builder, I seem to only be able to "index" one item in the legend (for instance, "symbol_count" is 1 and the "symbol_label" is only the first label in the legend. Here is an example:

I'm hoping there is some way to represent the entire value range within the legend as a variable so I would be able to work with the values, pare them down to ~10, then have them represented in the legend without so much clutter (or having to manually edit). Are there any legend experts that can help me identify a variable that represents the numbers vector for my legend(s)?


texts: gdalwarp reprojects only a portion of the raster

texts:
I´m trying to re-project a raster from epsg:4326 to epsg:3035 to work with European based datasets.

I have been using this command:

gdalwarp -srcnodata 9.95924e+36 -dstnodata 9.95924e+36 -s_srs epsg:4326 -t_srs epsg:3035 $loc_t$temp.tiff $loc_t$name.tiff

This should create a re-projected tiff file. However the result seems to be that only a 6th of the raster is re-projected and the rest is simply not there.

The image shows two problems. Only the top center part of the raster is showing, with the others either missing completely or as nodata, and there is a gap at the pole.

I am not sure what is causing this as the on the fly re-projection using grass shows no problem as seen here:

Lastly I found this post. Here the solution to a similar problem was the addition of the -wo command:

gdalwarp -wo SAMPLE_STEPS=1000 -s_srs epsg:4326 -t_srs epsg:3035 $loc_t$temp.tiff $loc_t$name.tiff

This does not seem to help. Does anyone have an idea what I am doing wrong?


texts: Map series group dynamic text in ArcGIS Pro

texts:
I am in the process of creating a rather large group of map series in ArcGIS Pro 1.3.1, and am making use of the Dynamic Text to generate page titles.

One of the options under Insert > Dynamic Text is "Page with Count", which gives the page number within the entire count of pages.

I have grouped my map series into different areas, and would like these numbered per group.  Is there a way to modify the dynamic text strings to display the number in a group rather than overall?

I have grouped by Page Name, which groups them nicely

but instead of giving me a title "Map Group 1 (1 of 5)" or "Map Group 2 (2 of 3)" etc., it just gives me `"Map Group 1 (1 of 8)" and "Map Group 2 (7 of 8)".


texts: Geoprocessing tool Difference from the Terminal?

texts:
I have used QGIS Geoprocessing tool Difference to cut polylines (SHP) into to smaller pieces using a polygon (SHP). This works very good in QGIS.

Now, to speed up the process, I'd like to be able to do the exact same thing but from the Terminal (so I can later make a shell script).

Maybe GDAL has these functions? In that case, how?

I'm using a Mac.


texts: Clicking polygon in OpenLayers map to change color and zoom polygon centre?

texts:
My problem is when I click on a polygon element on the map I would like to color another color and zoom by centering that object automatically.

map.on ('click', function (e) {
      console.log (s);
     // coordinate = evt.coordinate;

     var feature = map.forEachFeatureAtPixel (e.pixel, function (feature) {return feature;});

     var coordinate = e.coordinate;
     var hdms = ol.coordinate.toStringHDMS (ol.proj.transform (coordinate, 'EPSG: 31700', 'EPSG: 3857'));

      var selected_polygon_style = {
     strokeWidth: 5,
     strokeColor: '# ff0000'
     // add more styling key / value pairs as your need
     };

     feature.setStyle (selected_polygon_style);
     layer.addFeatures (feature);

)}

That's how I did it but it looks like it does not work.

This is the error code:

Uncaught e {code: 41, name: "AssertionError", message: "Assertion failed." See https://openlayers.org/en/v5.3.0/doc/errors/#41 for details. "}


texts: ogr2ogr export postgreSQL to ESRI file GDB wkbUnknown layer geometry type

texts:
I have 18 postgreSQL tables that I am trying to export to a ESRI file GDB using ogr2ogr. I have the FGD plugin installed.

all the tables in postgreSQL are good, I can bring them into QGIS or Arcgis and export them and there are no errors whatsoever. However when I try and use the below command ogr2ogr gives me an error. the same error in this post Exporting PostgreSQL table to FileGDB: wkbUnknown layer geometry type

Here is my command:

ogr2ogr --config FGDB_BULK_LOAD YES -progress -append -f "FileGDB"
C:\Users\rizagha\Desktop\data.gdb  PG:"host=localhost user=postgres
password=xxx dbname=free" -t_srs EPSG:4269 -overwrite

error(-1) FGDB layers cannot be created with a wkbunkown layer geometry type.
error 1: terminating translation prematurely after failed
translation of layer oak_buffer_union (use -skipfailures to skip errors)

The SRID is in http://spatialreference.org/ref/esri/102689/
the esri SRID of 102689 and I had to manipulate the SRID insert into postgis query to this

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 9102689, 'esri', 102689, '+proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000.000000001 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs ', 'PROJCS["NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet",GEOGCS["GCS_North_American_1983",DATUM["North_American_Datum_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["False_Easting",19685000],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-84.36666666666666],PARAMETER["Standard_Parallel_1",44.18333333333333],PARAMETER["Standard_Parallel_2",45.7],PARAMETER["Latitude_Of_Origin",43.31666666666667],UNIT["Foot_US",0.30480060960121924],AUTHORITY["EPSG","102689"]]');

I replaced the  9102689 with 102689 (first input in the values parentheses) because it was throwing an error using the one from spatialreference.org

so could it be ogr2ogr is not able to read the SRID?

also note the table ogr2ogr is throwing the error on is the second table in the DB, which sort of debunks the argument that the SRID is the problem....

I ran ogrinfo PG:"host=localhost user=postgres password=xxx dbname=free" oak_park_buffers -so

INFO: Open of `PG:host=localhost user=postgres password=xxx dbname=free'
      using driver `PostgreSQL' successful.

Layer name: oak_park_buffers
Geometry: Unknown (any)
Feature Count: 341
Extent: (19871669.064638, -322397.313040) - (20029921.991180, -164853.625252)
Layer SRS WKT:
PROJCS["NAD_1983_StatePlane_Michigan_Central_FIPS_2112_Feet",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["False_Easting",19685000],
    PARAMETER["False_Northing",0],
    PARAMETER["Central_Meridian",-84.36666666666666],
    PARAMETER["Standard_Parallel_1",44.18333333333333],
    PARAMETER["Standard_Parallel_2",45.7],
    PARAMETER["Latitude_Of_Origin",43.31666666666667],
    UNIT["Foot_US",0.30480060960121924],
    AUTHORITY["EPSG","102689"]]
Geometry Column = geom
osm_id: String (10.0)
type_: String (0.0)
fclass: String (20.0)
name: String (100.0)
keypin: String (80.0)
landusecod: String (80.0)
landuse: String (80.0)
localfips: String (80.0)

this layer always throws an error, when I try and export to to FileGDB

when I run st_isvalid all the rows return true and when i run st_geometrytype on this layer they all return st_polygon

picture of the table:


texts: How to drag label using DragFeature or ModifyFeature?

texts:
I am new to OpenLayers. I have seen the examples in which DragFeature is able to move my points, polygon and lines. But when it comes to test the Label moving in IE8, then the dragging functionality doesn't work,though I am able to drag the label in Firefox.

Please provide me help here.


texts:
I have two points, origin and point, defined in Latitude (geodetic), longitude and altitude.

Now I want to convert point position in NED coordinates, using origin as center of the NED coordinate system.

What's the best way to perform this conversion?


texts: Use ST_Buffer with a conditional distance based on an attribute

texts:
I am quite new to postgres/postgis and are still learning basic skills.
I have imported a pointlayer shapefile into my postgres database.

I need to make a buffer of varying radius around the points depending on attribute.
I have been reading about the ST_buffer function in the documentation but I am having problems to interpreting it so far.

I am trying to use
SELECT
geometry ST_Buffer(geometry g1, float radius_of_buffer);

I have tried
SELECT geometry ST(mypoints.geom, 100)
FROM
myschema.mypoints

I hope someone could help me to write it out properly

Best Regards


texts: How to convert coordinates in a .csv into another CRS in QGIS

texts:
How can I convert coordinates which are stored in a csv and in a certain format  in a different CRS, i. e. I want to convert GK 3 (EPSG:31467) into WGS 84 (EPSG:4326).

I am using QGIS and already tried different methods such as saving a shapefile into another with a different CRS but this did not work out! I hope you can help me! Thanks!


texts: How to add up columns of different layers?

texts: I have multiple shape file layers of a city with its districts that have the same shape and information, only the last two columns are different (The picture shows one of the three attribute tables). Now I want to add up the last column (contains numbers from 1-5) of each shape file and write the result in a new layer that has the same shape. I thought about using 'merge vector layers' and then using the field calculater to sum up the columns but the algorythm adds new rows with the districts so I end up with three times as many districts whereas I need three new columns with the numbers so I can add them up.


texts: Can I edit pixels values of an image with GDAL?

texts: There is a method with GDAL (used in C/C++) to edit pixel values of a georeferenced image, maintaining the original file? Or I have to create a new dataset? My goal is to maintain ALL originals metadata, so I think the creation of a new dataset is drawback.


texts: Do I need to set arcpy.env.workspace at the beginning of my python code?

texts:
I am new to Arcpy and have been doing simple tasks such as AddField_management and updateCursor. However I have been getting error msgs, such as errors 99999 etc. The errors I get are related to schema lock or layer not refreshing. So I need to run part of the code, close my mxd and open it again,do this over and over.

I am probably doing something wrong or forgetting something. Per example, I am not setting env.workspace or in_memory or creating temp _lyr files.
This is an example of a simple code I am using, from start to finish.

inFeatures = "MyLayer"
fields = ['x','y']

# Add fields to your inFeatures
for field in fields:
    arcpy.AddField_management(inFeatures,str(field),"DOUBLE")

with arcpy.da.UpdateCursor(inFeatures, ('x','y',"shape@")) as cursor:
    for row in cursor:
        row[0] = row[2].firstPoint.X
        row[1] = row[2].lastPoint.X
        cursor.updateRow(row)

I get the following errors, 'x' was created by 'y' wasnt. I close my mxd and open it again, and I can see field 'y'. Now I run UpdateCursor, nothing changes (still see Null> values). Or I get the error

  A column was specified that does not exist

I close the mxd, open it again and I can see the updated columns. This is happening for all my codes, not only this one (ie. not refreshing). My question is, do I need, always, to set my env.workspace?
I am running ArcGIS 10.1, files are feature datasets, using Python window in ArcGIS, file path is not long, layers do not have spaces.


texts: Rasterize the full area of a polygon, not only midpoints, using R

texts:
The default function in raster::rasterize is to see if a point is within a polygon and if yes, make a cell. This results in that some of the outer parts of the polygon is not covered by the new raster.
Is it possible to use rasterize (or fasterize or whatever) in a way, so that the entire polygon is covered?


texts:
I have a sample image from DigitalGlobe site, where TIFFTAG_IMAGEDESCRIPTION field reported by gdalinfo looks as follows:

TIFFTAG_IMAGEDESCRIPTION={
  bandList =
  [
    6;
    2;
    3;
    7;
    4;
    8;
    5;
    9;
  ]
}

I want to set a description in multiband tiff from command line, but I can't guess how to set a new line character ("\n" doesn't work). How to set a new line character in gdal_edit.py when editing TIFFTAG_IMAGEDESCRIPTION?

gdal_edit.py -mo TIFFTAG_IMAGEDESCRIPTION='{band_list = [ 2; 3; 4 ]}' B2-B3-B4.TIF


texts: Using data from SQL Table instead of File Geodatabase Table

texts:
Does anyone know of a method to use the table from SQL Server table using OS Authentication, instead of a File Geodatabase Table in ArcPy?

I have been using the below to reference the table

tableTemplate = r"C:\Data_table.gdb\DataTable"

where DataTable consists of a set of rows and columns. I have created a similar table in sql server and want to use the same instead of the above File Geodatabase Table.

I have tried the below so far with no luck:

arcpy.CreateDatabaseConnection_management(out_folder_path="Database Connections",

                                          out_name="DataTable.sde",

                                          database_platform="SQL_SERVER",

                                          instance="gis-server",

                                          account_authentication="OPERATING_SYSTEM_AUTH",

                                          database="TemporaryDatabase",

                                          version_type="TRANSACTIONAL",

                                          version="dbo.DEFAULT")
tableTemplate = r"Database Connections\TemporaryDatabase.sde\DataTable"

Am I doing something wrong somewhere? I get an error : "Database Connections\DataTable.sde\DataTable does not exist or is not supported." I am using arcpy.CopyRows_management later in the script.


texts: Adding annotation colors the points in red

texts:
I wanted to add annotations programmatically to my layers. But the trouble is that after adding annotations, the points become red and I can't make difference between the layers. Here is the code I used:
def add_annotation():
    #get all layers
    layers = QgsProject.instance().mapLayers()

    for layer_id, layer in layers.items():
        print(layer.name())
        if layer.name() in ['mylayer1', 'mylayer2']:
            iter = layer.getFeatures()
            canvas = iface.mapCanvas()

            #Take the attr to be shown
            for feature in iter:
                geom = feature.geometry()
                point = geom.asPoint()
                attrs = feature.attributes()
                #2, 19, 20
                waypointText = attrs[2]+' '+attrs[19]+' '+attrs[20]
                html = "<strong>" + str(waypointText) + "</strong>"
                a = QgsTextAnnotation()
                c = QTextDocument()

                #Add text to annotation
                c.setHtml(html)
                a.setDocument(c)

                a.setFrameSize(QSizeF(150, 60))
                a.setMapLayer(layer)
                a.setFrameOffsetFromReferencePoint(QtCore.QPointF(30, 30))
                a.setMapPosition(point)
                a.setMapPositionCrs(QgsCoordinateReferenceSystem(layer.crs()))

                i = QgsMapCanvasAnnotationItem(a, canvas)


texts: Merging shapefiles with attributes using PyQGIS?

texts:
I have some shapefiles. They are all the same kind of shape and all have the same attributes.

If I wanted to merge them manually the "Vector/Data management tools/merge shapefiles to one" works fine.

However, as per the question title, I'd like to do this using Python from a script.

I went hunting for the "merge shape files" in the hopes I could cobble it into my script but I couldn't find it.

I tried writing one myself iterating over the features and copying them into another layer as per the pyQGIS cookbook but lost the attributes along the way.

feature_list = inputlayer.getFeatures()
  for feature in feature_list:
    (res, outFeats) = outputlayer.dataProvider().addFeatures( [ feature ] )

I also tried writing a script using the iface copy features function with the same loss of attributes as a result.

qgis.utils.iface.setActiveLayer(importlayer)
importlayer.setSelectedFeatures(range(100))
#(there are exactly 100 features)
qgis.utils.iface.actionCopyFeatures().trigger()
iface.setActiveLayer( outputlayer )
outputlayer.startEditing()
qgis.utils.iface.actionPasteFeatures().trigger()

Can someone help me fix my code to retain the copied attributes or point me to a pyQGIS script to achieve this result?


texts:
Could someone kindly explain how to get QGIS (any stable basic version) on my old Mac (OS X 10.6)?

I'm completely new with QGIS and all the instructions that I can find beats me.


texts: Seeking geospatial library for .NET Core?

texts:
I am trying hard to find any geospatial library that supports .NET Core, however with no success so far. Do you have tips for any?

My requirements are:

work with different coordinate systems
compute intersection of 2 geometries
compute buffer of a polygon/polyline
compute polygon area
compute length of a polyline


texts: How to get 2010 Census Block Data on Race and Age?

texts:
I'm interested in observing racial segregation in public & charter elementary schools in San Diego city (not county).

I believe the best way to analyze this would be at the block level and have the following questions:

1) I played around with Fact Finder to get San Diego county by race at the block level, but I only want city. How do I get the city level only?

2) What do I do with the data to get forward in my project? Join it through Access?

3) What's the difference in analyzing at the block level versus block group level?

4) Can I get this same data (race and age) from ACS versus AFF?


texts: Using for loop in least cost path analysis using ArcPy?

texts:
I am doing a least cost path analysis. I need to create a for loop that will run 3 times and select the correct weight from each of the two lists (slope and land).

Slope = [10, 20, 30]
Land = [30, 20, 10]

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = (c:\)
arcpy.CheckOutExtension("Spatial")

#------------------------------------------------- Times calculation

outTimes10 = Times("Slope",10)
outTimes20 = Times("Slope",20)
outTimes30 = Times("Slope",30)

#------------------------------------------------- Times calculation

outland30 = Times("land_tif", 30)
outland20 = Times("land_tif", 20)
outland10 = Times("land_tif", 10)

#------------------------------------------------- Added two raster together

outPlus1030 = Plus("outTimes10", "outland30")
outPlus2020 = Plus("outTimes20", "outland20")
outPlus3010 = Plus("outTimes30", "outland10")

#------------------------------------------------- Cost Back link

outBacklink = CostBackLink("Hiker.shp","outPlus1030", 100000,
                           "c:/sapyexamples/output/distRast")

pair1bl="CostBac_shp1"
pair2bl="CostBac_shp2"
pair3bl="CostBac_shp3"

#------------------------------------------------- Cost distance

outCostDist = CostDistance("Hiker.shp", "slope", 200000, "pair1bl")

pair1cd="CostDis_shp1"
pair2cd="CostDis_shp2"
pair3cd="CostDis_shp3"

#------------------------------------------------- Least cost path

outCostPath = CostPath("Hiker.shp", "outplus1030", "pair1bl", "EACH_CELL")

path1="CostPat_shp1"
path2="CostPat_shp2"
path3="CostPat_shp3"

I am new to python. I need help with creating a for loop that will select numbers from the two list do the times calculation, plus calculation, cost backlink, cost distance, and least cost path.

I do not know how to direct the output of the calculation to be saved in a different file name everytime the loop runs.


texts: Converting data type in ERDAS IMAGINE and ArcGIS for Desktop?

texts:
My tif image data type is float (i.e. my data is between -1 to +1) and I want to convert it into 8bit unsigned integer.

I used ERDAS IMAGINE import tool to do this, while converting it into img also.

However, in the output image the data is only shows 0 and 1.

I want to convert -1 as 0 and +1 as 255.

How can I do this in ERDAS IMAGINE and ArcGIS for Desktop?


texts: Changing field / alias names in a shapefile using ArcMap10.2

texts:
I have a query regarding changing field and alias names in a shapefile.

ArcGIS info for 10.2 says: ...For example, you can do any of the following:
Define an alias for a field name so the field appears in the table with a name that is easy to understand. This is helpful because you cannot change the names of fields in your data once they are created.
....

I'm bringing MapInfo files over into ArcMap and run into the 10 character truncation limit when changing to a .shp. Note that I need to use the shapefile format.

As I cannot change the properties in the .shp format, I import the shapes into a .gdb and then change the Name fields in Properties using ArcCatalog. My query is how to change the Alias to align with the now-changed 10 character limited Name.


texts:
I have a problem with ArcGIS Server 10.2.2 Cache displaying (cache format: Compact, JPEG, 256x259 tile, 96dpi, total levels 12)
The problem is that after a crash event (as an example of an unexpected failure of the power network), not all of the areas in the Cache are displayed at service, and some areas of the area are not displayed at different scales. The only solution that helps to make things work correctly is to change the Cache location as an example: from C: // ServerCache, to C: // Servercache2. (Deleting a service and rebooting in the same name does not work).
ArcGIS Server Clear Cache REST dir also does not help.
I add a video to understand my problem more clearly
https://streamable.com/ko617


texts: Overlaying grids with a polygon to determine the average value of the overlapping grids for that polygon

texts:
I would like to add the average, minimum and maximum value of, let’s say soil moisture (variable "value" in my case), to each NUTS3 region (= a NUTS3 region is a polygon of a certain small area in Europe).

However, soil moisture values are stored in little grids. Therefore, I need to find a way to calculate which grids overlap with a certain NUTS3 region in order to determine the average soil moisture value for that NUTS3 region. Visually, it can be compared to this picture where little grids approximate together the shape of US states: http://fieldguide.mt.gov/RangeMaps%5CESMapQUAD_9217.jpg

It is possible that one NUTS3 region consists of 2 full grid cells and 3 half grid cells, while another NUTS3 region consists of only a 0.75 grid. It is also possible that some grids are empty because I don’t have values there.

My raster and NUTS shapefile can be found through the following link:
https://drive.google.com/folderview?id=0By9u5m3kxn9yfjZtdFZLcW82SWpzT1VwZXE1a3FtRGtSdEl1c1NvY205TGpack9xSFc2T2s&usp=sharing

library(rgdal)
grid <- readOGR(".", layer = "Filled_grid") # the
variable "value" is the variable that I want to transfer to the
respective NUTS3 regions.
nuts <- readOGR(".", layer =
"NUTS_RG_60M_2006") # in the end, in this shapefile should be an
additional variable with the average of "value". This information
should come from overlapping the NUTS3 regions with the grids.

I would like to find a solution for this problem in R. For ArcGis, I already found numerous related questions (such as Extract Raster Value into Polygon Attribute ) that can help me.

In R, I found out that the rasterToPolygons command of the raster package, cannot help me because it takes forever due to the amount of data I have.

Another option in R could be this one: https://stat.ethz.ch/pipermail/r-sig-geo/2011-March/011093.html , however, it does not work for me and I am not sure how to indicate that I want the max, min and mean of the variable "value". I believe the mean reason why I have trouble with solutions proposed on the internet is the fact that I stored the raster data in a shapefile, and then want to overlap with another shapefile (with the nuts3 regions). But this shouldn't be a problem, or is it?

I am a beginner in ArcGis but have some basic knowledge in R.


texts: How do I edit an existing ArcGIS .lyr file?

texts:
I have downloaded a layer file. The layer names are long, and I want to change these to approved abbreviations, for ease of data input.  For instance, the layer file values look like this:

A1.1.1 Broadleaved woodland - natural.

A1.1.2 Broadleaved woodland - plantation

I want my students just to be able to use A1.1.1, A1.1.2 etc as the values. Is there a way of editing these files?


texts: Labeling a 2D feature layer in ArcGIS javascript API 4.x

texts:
I'm in the process of updating my application from ArcGIS JS API3.x to 4.7. I'm unable to add labeling to a feature class. As per ESRI, they support labeling only for 3D or a MapImage layer in 2D. In 3.X i was able to add a label class to a feature layer to show the labels.

Is there a way to add the labels in 4.x?


texts: I'm looking for a way to identify contiguous polygons that share certain attributes (contiguously-owned parcels). I understand that in ArcGIS there is a 'Polygon Neighbor' tool with a 'Report by Field(s)' parameter that would allow you to do this. I don't just want to identify all the neighbors of each polygon, I want to identify only neighboring polygons that share a specified attribute.


texts: Flattening JP2 files to single band (i.e. averaging bands)?

texts:
I have created thousands of png tiles using ArcGIS and have merged groups of them into large jp2 files for serving via GeoServer. I need to flatten these to a single band so that I can apply a colour map to achieve transparency.

Merge single band and multi band color images is similar but the suggested tool  "Composite Bands tool in arctoolbox" only merges single band to 3 band. I need the reverse!

This is based on the following question Getting a constant background color for transparency

I have arcgis 10.1, qgis/gdal, erdas imagine and global mapper.


texts: Parameter Data Type to Accept Both GDB or Feature Dataset

texts:
I would like the parameters in my script to accept both gdb workspaces or feature datasets. I have tried both "DEWorkspace" and "DEFeatureDataset", but both of these accept either gdb or feature datasets, and not both.

Here's a list of all options: http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/defining-parameter-data-types-in-a-python-toolbox.htm

Any idea on how to work around this? I'm thinking there might be a filter for "DEWorkspace", but haven't managed to figure out how that works.


texts: I want to convert a shapefile to a KML using QGIS. When I do it, the output I obtain is without attributes. And I want a similar product as it is provided by shape2kml of zonum solutions.


texts: Preload map tiles that are outside current map view in Leaflet

texts:
I am using Leaflet framework for showing basemaps and the GeoServer layers.

When I zoom out or pan the base map, tiles outside current view are first shown blank and then loaded with tile content. Here I need first the actual zoom level tiles to be already loaded and shown (little blur) and then the new zoom level tiles (which is more clear) when on map is zoomed/panned.

I tried updateWhenIdle, updateWhenZooming and maxNativeZoom option variables but still the same. How can I achieve this?

Creating a map object :

leafletMap() {

      if(!this.map)
      {
        this.map = new L.Map('map', { center: new L.LatLng(51.51, -0.11),crs:L.CRS.EPSG3857});
      }
      else
      {
         //this.map.invalidateSize();
      }}


texts: ArcGIS 10 add-in: ComboBox add-in component focus issue

texts:
Update 9/9/11: Here is a minimal example project that will reproduce the issue for me (VS 2008 solution): http://wfurl.com/09061bf

I have an ArcMap 10 add-in with a ComboBox class that I place on a toolbar. When I attempt to display a MessageBox after the user submits a value by typing in the ComboBox and pressing Enter, the ComboBox steals the keyboard focus from the MessageBox, so when the user tries to dismiss the MessageBox by pressing Enter again, the ComboBox's OnEnter event handler runs again instead of the MessageBox being closed.

Without any checks against this, you might end up with numerous MessageBox instances on top of one another with no way to dismiss them except by clicking OK on each one.

Attempts to work around this behavior have failed and include:

Disabling the ComboBox before showing the MessageBox and re-enabling it afterwards. The enabled state doesn't change until after the MessageBox is closed and the focus issue still occurs. Employing Application.DoEvents has no effect.
Setting a class-level boolean that tells the OnEnter handler to simply return when true (Set to True just before showing the MessageBox and False afterward.) The focus issue remains, meaning it takes 3 Enter keystrokes to dismiss the MessageBox, but at least the OnEnter code doesn't run again.
Setting the MessageBox's parent window to the ArcMap application using the IWin32Window overload (actually this is necessary to get the MessageBox to show in the middle of the ArcMap window instead of on top of the ComboBox).
Explicitly setting the MessageBox's MessageBoxOptions property to 0x1000 (MB_SYSTEMMODAL) or 0x2000 (MB_TASKMODAL)
Using IApplication.StatusBar.set_Message() instead of MessageBox. The ComboBox's HintText message, even if not specified, or set to an empty string, instantly overrides anything I write in the set_Message main pane (0), so this method is essentially useless with Addin ComboBoxes.

Anyone have any other ideas as to what else I can try, or must I once again look at a WinAPI solution to deal with the ArcGIS framework's shortcomings?


texts: How to convert a Polyline of GPS Ordinates into Polygon having vertices as GPS Coordinates and find its area in Python


texts: CartoDB Table and Visualization Privacy Settings and "Uncaught Error: sql is read-only in NamedMaps"

texts:
I developed an application using cartodb.js, and I made a duplicate table/database to reference (and updated my table name, layer URL, and API key references in my code). With this new table, the app gives the following error when the layer is added to the map (after it displays the layer on the map – which surprised me): ”Uncaught Error: sql is read-only in NamedMaps”.

Previously I had been using a table and a visualization that had a “Only visible to people with the link” (orange lock icon) privacy setting for both. I was able to perform read queries (SELECT SQL statements) to the table/layer without the need for an API Key and had no errors returned. I only had to use my API Key when using INSERT, UPDATE, and DELETE SQL statements.

With the new table and visualization, I have the same privacy settings specified: “Only visible to people with the link”. But now, it gives the “Only visible to people with the link” error when I try to do a SELECT SQL query using sublayers[0].setSQL( “SELECT …”).

Two questions:

Shouldn’t I be able to do SELECT SQL queries with a visualization and its table set to a privacy setting of “Only visible to people with the link”?
If I choose to make my table and/or visualization “Private” (red lock icon), I presume I can execute SQL queries using ` $.getJSON(“http://username.cartodb.com/api/v2/sql?q=SELECT...&api_key=12”)`. But, how do perform `sublayers[0].setSQL( “SELECT …”)` calls? (Wouldn't I need to include an API Key?)


texts:
Can anyone tell me what the units are for the Cache Size setting in QGIS please? Is it bytes, KB, Mb, MB?

When I look in the directory specified by the path (/Users/.../.qgis/cache/) the cache folder is just 6KB.

Any assistance appreciated
thanks


texts: loss of attribute data when copying between layers

texts:
I am trying to copy points from one layer to another in QGIS 2.2

The problem I get is that all the attribute data from the copied points is missing when copied onto the new layer, the columns show up as blank.

Both layers have the same columns.

Is this a problem with 2.2 or is there an easy fix for this?


texts: Selecting layer by visible extent using Select Layer by Location in ArcPy?

texts:
I am trying to use arcpy to select just the visible extent of layers within a user's area of interest (AOI). For example, if the user wants to select these roads within  the AOI:

Is it possible to select just this visible portion using Select Layer by Location (i.e. arcpy.SelectLayerByLocation_management)?


texts: Calculating the longest path length in drainage network using Python

texts:
I have a drainage network and I want to obtain the longest path length between two coordinates of the shapefile; is there is a way to automate this process in Python?
For example, in the image, I want to get the green path from the black drainage network and calculate the length of this.


texts:
I'm trying to convert a layer to a .kmz file, and ArcMap says it works. It even shows up in my file directory(image attached)
However, this file isn't actually in the folder it's supposed to be in. I've tried just right clicking the file in the Recent Files list and choosing Open File Location, which opens the folder it's supposed to be in, but it still isn't there. I'm not sure why the file isn't actually being created, or what I could do differently.


texts: Generating Canopy Height Model (CHM) with Quick Terrain Modeler?

texts: I currently looking forward to process LiDAR point clouds (forest data) using Quick Terrain Modeler (QTM), but is it possible to create Canopy Height Model directly using the software?


texts:
I am reading a shapefile in Python using geopandas, join some tabular data and export to geopackage using geopandas.

The entire process is very easy. However, when I export the vector data, the file is quite large and contains unnecessary details. Comparing the process to raster data, I can choose a data type e.g. Unsigned Integer 32, Float 64, Boolean etc.

Is there something similar for the geopackage format? Currently my vertices have the following format (examaple of one coordinate, file contains multipolygons):
31.90590570688292, 29.85788703615783

How can I store the vertices using 32bit precision for each coordinate? Ideally the answer would be in python (and geopandas / fiona)


texts: How to show the horizontal zoom slider on the top right of the map

texts:
The below posted code is to show a map with zoom bar or slider. The code is taken from here:
https://openlayers.org/en/latest/examples/zoomslider.html

I attempt to show the zoom slider number three, that's why I set the target of the map to map3. the result is, never a horizontal zoom bar on the top-right but a tiny small button on the left.
How can I show the horizontal zoom slider on the top right of the map?
app.component.html:

Default style

Placed between zoom controls

Horizontal and completely re-styled

app.component.ts:
import { Component } from '@angular/core';
import Map from 'ol/Map';
import View from 'ol/View';
import 'ol/ol.css';
import MousePosition from 'ol/control/MousePosition';
import {createStringXY} from 'ol/coordinate';
import {defaults as defaultControls} from 'ol/control';
import {addCoordinateTransforms} from 'ol/proj';
import {applyTransform} from 'ol/extent';
import {get as getProjection, getTransform} from 'ol/proj';
import {transform} from 'ol/proj';
import {ZoomSlider} from 'ol/control';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app1';

  map : any;
  constructor() {}
  ngOnInit() {

    var source = new OSM();
    var layer = new TileLayer({
      source: source,
    });
    var map = new Map({
      layers: [layer],
      target: 'map3',
      view: new View({
        center: [0, 0],
        zoom: 2,
      }),
    });
    var zoomslider = new ZoomSlider();
    map.addControl(zoomslider);

 }
}


texts: Search box to find multiple markers with same property in leaflet

texts: I have a json file with a property product ID. I need to find the markers having the same product ID and display it on the map. I used the custom search plugin present in the leaflet. But it searches only one marker at a time and displays on the map. But in my case I have multiple markers with same product ID. Could anyone help me on this? Are there any otehr plugins avalilable to search multiple markers and display on the map?


texts: Auto generate attributes when drawing new polygons?

texts:
Is it possible so automatically generate attributes when drawing new polygons?

Lets say i draw a large polygon thats fills a whole area/city in layer "A", and give it the attributes i wanted like city name, owner etc.

Is it possible when drawing new smaller polygons inside the larger polygon, either in the same layer or maybe layer "B", to automatically give the new polygons the same attributes that the large one has?

This would save lots of time when a bunch of new features has to be drawn with the same attributes.


texts: What are units of Distance Matrix tool results in QGIS?

texts:
I have a point data set. Now there are cluster of points based on a field. So I take out one such cluster which has points with same field.I want to find distance between all the points in cluster and find out if any point is far away so that I can check if that point is faulty.

Ok to elaborate more on the above one, I have say just 4 points and I have tried to use the distance matrix from the ftools plugin in QGIS.I have chosen the linear matrix and got a csv output. The distance which gives it here what would be the unit for it.


texts: How to extract .mpk file package in ArcGIS

texts:
I am trying to extract .mpk map package but shows me

  ERROR 000824:the tool is not licensed

Here is the link of map which  I am trying to extract.


texts:
I have been trying to generate heatmap using kernel density estimation from python console in QGIS.

This is command i'm using:

processing.runandload("saga:kerneldensityestimation", "D:/test/Towns.shp", "A_RAIN_MM", radius, 0, "0,1,0,1", 0.00848754, "D:/test/raster.tif")

The result I'm getting is a image with black shade which is totally different from the heatmap i generated using QGIS user interface.

After googling, I found this link:
kernel density estimation. This contains the list of parameters which kernel density estimation takes, but it does not contains any description about the parameters. What these parameters are i do not know. Can i anyone tell me what i'm doing wrong? Or is there another way of generating heatmap?


texts: Using gdal_calc.py with conditionals on a float not giving correct results

texts:
I have two binary rasters (A and B) that I want to divide and get a binary raster (C) such that if A/B is greater than or equal to 50% (0.50), C = 1 and if not, C = 0.

Rasters A and B are of Byte type with unique values [0 1] (hence binary).

My command is as follows:

'gdal_calc.py -A rasterA.tif -B rasterB.tif --outfile=rasterC.tif --calc="((A/B) >= 0.50)" --NoDataValue=200 --type=Byte'

The output raster looks good except that where pixels in rasterA = 1 and rasterB = 2, rasterC = 0 when it should be = 1 (1/2= 0.50). I'm guessing this is related to how in Python when you divide two integers by each other, the output truncates to an integer, but what do I need to change about the command to get my desired result?


texts: Network analyst functionality: assigning optimum location for two facilities

texts:
Hoping for some advice on using the network analyst tool to determine the optimal location for two facilities.

For context these would be a depot and tip locations servicing a set of households as demand points. The importance of having two locations optimally located is to minimise drive time from when a vehicle has to travel from households to tip (when at capacity) and also at the start/end of the day to return to the depot from households.

Any advice on an approach, or experience of doing similar would be great.


texts:
I have been facing issues trying to achieve a very simple task which consists in deleting selected features with pyqgis.
Here is a sample of my code :

I select manually the features of the shapefile A
I select all the features of the shapefile B that intersects the selected features of shapefile A
I try to delete all the selected features of the shapefiles A and B

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

iface.actionSelect().trigger()
shapefileA= iface.activeLayer()
shapefileA.selectedFeatures()

shapefileB= QgsProject.instance().mapLayersByName('shapefileB')[0]

# SelectByLocation:
alg_params = {
    'INPUT': shapefileB,
    'INTERSECT': QgsProcessingFeatureSourceDefinition(shapefileA.id(), True),
    'METHOD': 0,
    'PREDICATE': [0]
}

processing.run('native:selectbylocation', alg_params)

with edit(shapefileA):
    for feat in shapefileA.selectedFeatures():
        shapefileA.deleteFeature(feat.id())

with edit(shapefileB):
    for feat in shapefileB.selectedFeatures():
        shapefileB.deleteFeature(feat.id())

The problem is that the script doesn't work instantly, I need to run it twice to make it work ! (If I run it once it seems it only selects the features of the shapefiles A and B but I have to run in another time for the delete of the features of shapefile A and B to be effective...)
Does someone know what I'm doing wrong ?


texts: Reshape nearby polygons so that they share a common border

texts:
I am looking for an algorithm for reshaping polygons that are close to each other.
Given 2 polygons that have certain parts within proximity E reshape the polygons such that they share a common border within the area of proximity.
Example input:
        Q1   Q2
        +-----+
P1  P2  |     |
+----+  |     |
|    |  |     |
|    |  + Q5  |
|    |   \    |
+----+    +---+
P4  P3    Q4 Q3

Example output:
         Q1  Q2
         +----+
P1  P2Q /     |
+------+      |
|      |      |
|      + Q5P  |
|     / \     |
+----+   `+---+
P4  P3    Q4 Q3

As for what I tried: some Googling and thinking. I suppose I have a rough (untested) idea how I could do that but I don't want to reinvent the wheel.


texts: How to bring the Tiger Census Reporter API to GeoPandas

texts:
I'm trying to read the Tiger2016 API (from Census Reporter) into Geopandas. I'm not quite sure how to import the geometry. I'm assuming I need to convert the geometry lists into something geopandas can read.

import geopandas as gpd
import pandas as pd
import requests
from shapely.geometry import Point

def get_geography(geoid):

    api_url = 'https://api.censusreporter.org/1.0/geo/tiger2016/{0}?geom=true'
    r = requests.get(api_url.format(geoid))
    geo = r.json()

    #print(geo)
    land_area = geo['properties']['aland'] / 2589988  #
    pop = geo['properties']['population']
    pop_density = population / land_area
    #print(geoid, land_area, population)

    df =  pd.DataFrame({
                        'GeoId': geoid,
                        'LandArea':land_area,
                        'Population': population,
                        'PopulationDensity': pop_density,
                        'geometry' : geo['geometry']
                         })

    #df['geometry'] = Point(df['geometry'])
    #return df
    crs = {'init': 'epsg:4326'}
    gpdf = gpd.GeoDataFrame(df, crs, geometry= df.geometry)
    return gpdf

get_geography('86000US54901')
-> TypeError: must be real number, not list

df.geometry look like:  coordinates    [[[[-88.482952, 44.089387], [-88.481774, 44.08924], [-88.481035, 44.090236],


texts: What are the white round holes at Antarctica and Arctica visible at pictures from Cryosat-2 satelite program?

texts:
At pictures from Cryosat-2 sometimes there is round hole(white circle) at the pole:

https://directory.eoportal.org/web/eoportal/satellite-missions/c-missions/cryosat-2
https://www.researchgate.net/figure/Difference-between-CryoSat-2-DEM-elevation-and-airborne-laser-altimeter-measurements-in_fig5_320632081
What is this exactly? If this is measurement problem please describe the reason the problem exists.


texts: How to delete lines that do not overlap a polygon?

texts:
I'am new to QGIS and I run into a problem. I have two shapefiles, one with line data and one with polygon data. I would like to remove all the lines that do not overlap the polygon.

So remove all the green lines that do not overlap the blue polygon. What is the best way to do this? I tried the difference tool but I was not able to achieve what I intended.


texts: Label specific lines in attribute table with syntax- ArcGIS?

texts:
I try to label a point layer for values in lines 1-11 only in this attribute table in field "OBJECTID" with this syntax (i saw this question also Labeling specific features in ArcGIS for Desktop?):

def FindLabel ( [OBJECTID]):
    for [OBJECTID]:
        return [OBJECTID] [0:10]

but i get an error:

syntax error: invaild syntax (< string>, line 2)

UPDATE:

i get this result when using ahmadhanb SQL query:


texts: Finding nearest point in SpatiaLite without GEOS

texts:
I want to find the nearest point having latitude and longitude stored as Point in SpatiaLite. I read this and it has this example:

SELECT feature_name, feature_class,
     ST_Distance(Geometry, MakePoint(-70.250, 43.802)) AS Distance FROM XYGNIS
WHERE distance &lt; 0.1 AND ROWID IN
(SELECT ROWID FROM SpatialIndex
  WHERE f_table_name = 'XYGNIS' AND search_frame =
  BuildCircleMbr(-70.250,    43.802, 0.1))
ORDER BY distance LIMIT 10

I cannot use it, however, since ST_Distance requiring compiling SpatiaLite with GEOS, which is in LGPL, which I cannot use. Is there a way I can do arithmetics to calculate distance and set that to a "variable" and then find the one with the minimal distance?


texts: Creating new PostGIS connection in QGIS?

texts:
I am trying to create a new PostGIS connection and I am doing as it follows:

The password I inserted is postgres, I don't know what should be inserted there. And when testing the connection, I get this as a response:

What do you suggest me to do?


texts: ESRI Directions widget version 4. Adding Stops?

texts:
Is there a way to add stops programatically to the latest Directions widget, or must I use the widget GUI?  (I see that it is still 'beta')

Version 3 of the JS API has this function:
Version 3 add stops


texts:
I installed and configured the qgis client ( Version 1 ). It works for the "Hello world" map, but anything else ( e.g. naturalearth ), causes the mapserv fcgi to crash. I tried to figure out what is going on, but I can't figure it out.

I tried installing GWC 2, but couldn't even get pass the yarn command.

I am new to QGIS, so can someone bring me up to speed on the web client i.e. which one to install and how?

I am running qgis 2.18.16 on Ubuntu 16.04 . I pulled the qgis web clinet from Github. As I mentioned it works for the hello world map, but not for anything more complex. When I try, for example with naturalearth_110million.qgs, I see this error in the Apache error log:

[fcgid:error] [pid 28782] mod_fcgid: process /usr/lib/cgi-bin/qgis_mapserv.fcgi(28791)
exit(communication error).

Can you tell me how can I run the fcgi from the command line with the appropriate parameters?


texts: PostGIS: What is the difference between regular R-tree and R-tree on top of GiST?

texts:
I have built a spatial index structure that I am trying to compare with other existing spatial index structures. I have to either code (in Java) the same logic that PostGIS uses or find a java library that uses this logic (and I have been unable to find one).

PostGIS says that their spatial index structure is an R-tree on top of GiST.

I have read this post.

I have 3 questions:

1) What is the main difference between a regular R-tree and an R-tree on top of GiST?

2) Do you know any disk-based R-tree libraries in Java? The ones I have found are in-memory R-trees.

3) If I were to find an R-tree implementation (or write on my own), how difficult is it to make this implementation into an "R-tree on top of GiST"? I know how R-trees work.


texts: ArcGIS - Suggest returning result but find not finding result?

texts:
I have done a bit of searching but have not found anything like what I am seeing when using ArcGIS Rest API. My setup is pretty much what is suggested on the documentation... I make a call to the suggest REST endpoint with text which returns a handful of suggestions that contain the one I am looking for. When the find REST endpoint is called with the magickey and text it returns an partial address (has everything except the street number). Below is my example:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?Category=Street%20Address&f=json&text=5%20Barron%20Way,%20E

Which returns this JSON

{"suggestions":[{"text":"5 Barron Way, Eastman, Georgia, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Evergreen, Montana, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsNt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Everman, Texas, USA","magicKey":"GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnsbt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false},{"text":"5 Barron Way, Exford, Victoria, AUS","magicKey":"GST7YMc0AM9UOsEm7jbtIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUnskt7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF","isCollection":false}]}

The first suggestion is selected which triggers a call to the following find endpoint

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?magicKey=GST7YMc0AM9UOsE3GY8tIS9GOghnYnwZGZpkJiyzCP9_JR52GZbtGSyJAnyUns8t7hc0YQWMYcyGnsxuIM9aYMTMCRhvSoauJoFF&f=json&outfields=AddNum,StName,StType,City,Region,Postal,Country&text=5%20Barron%20Way,%20Eastman,%20Georgia,%20USA

which returns this result

{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[{"name":"Barron Way, Eastman, Georgia, 31023","extent":{"xmin":-83.145949999999999,"ymin":32.172302000000002,"xmax":-83.139949999999999,"ymax":32.178302000000002},"feature":{"geometry":{"x":-83.14294854543823,"y":32.17530230405913},"attributes":{"AddNum":"","StName":"Barron","StType":"Way","City":"Eastman","Region":"Georgia","Postal":"31023","Country":"USA"}}}]}

which as you can see does not contain the full address that the suggest REST endpoint told me about. Has anyone encountered this before? Are there any workarounds? I don't want to provide a suggestion to my end users only to find that it can't be used because the find endpoint doesn't return the address suggested.


texts: Unable to register a shared folder on a network drive as a data store on ArcGIS Server

texts:
I have two servers (both windows VMs). ArcGIS Server and Desktop are installed on ServerA. ServerB is where all the data is stored (various SQL databases including 1 SDE, and folders).

We have a shared folder on ServerB that a number of images are stored in, this folder needs to be registered with the ArcGIS Server so we can publish the data in this folder.

The path to this folder on ServerB is C:\ImageStore[Data], and ImageStore is the shared folder. I have mapped to this folder from Server A calling it Z:\, and can access the data no problem.

However when I try to register this location with ArcGIS Server it fails, see image:

I have tried every combination of 'Publisher Folder Path:' and 'Publisher Folder Hostname:' I can think of in the boxes above; not using the drive letter but the UNC path instead, including the share folder name in the path, using server.domain.com, and various formats of the above, all to no avail.

The mapped folder can be connected to in ArcCatalog on ServerA with no issues, so the images can be viewed in ArcMap.

The folder has no security restrictions on it at all, completely open permissions.

About halfway down this page, there is an image that indicates what I am doing should work. The ArcGIS Server help doc also says you should be able to register a network folder.

Has anyone had any success doing this?

ArcGIS Server and Desktop are version 10.2.2.


texts: Invalid redirect_URI Web AppBuilder Deployment from Server?

texts: I have configured an ArcGIS Web AppBuilder Map as an application in ArcGIS Online.  It is consumed by IIS6 on a Windows 2003 Server Machine.  When I hit the URL; I receive ERROR 400 Invalid URI_indirect.  My application was copied to my server from AGOL. What is the solution for this if I am not using Web AppBuilder in Development mode?  What should my URI be when I register the app in AGOL


texts: Missing Data in Landsat 7 and 8 (NOT due to Scan line Error)

texts:
I have created numerous annual median composites of Landsat 7 and 8 data using Earth Engine Python API. For some reason, there are some parts of the subset showing as no data (Figure1), despite there being data available in the Landsat repository on Earth Explorer (Figure2 = screenshot from the individual image in the same year in Earth Explorer).
Any ideas as to why this data is not protruding to my annual composite?
The third image is the annual composite of Sentinel 2 image.
Here is the function within the Earth Engine Script used to generate the composite:
def obtain_image_median(collection, time_range, area, satname):
Parameters:
    collection (): name of the collection
    time_range (['YYYY-MT-DY','YYYY-MT-DY']): must be inside the available data
    area (ee.geometry.Geometry): area of interest

Returns:
    image_median (ee.image.Image)
 """
collect = ee.ImageCollection(collection)
if satname == ['L7']:
    ## Filter by time range and location
    collection_time = collect.filterDate(time_range[0], time_range[1])
    image_area = collection_time.filterBounds(area)
    image_2 = image_area.filterMetadata('CLOUD_COVER','less_than', 40)
    image_median = image_2.median()
    return image_median

if satname == ['L8']:
    ## Filter by time range and location
    collection_time = collect.filterDate(time_range[0], time_range[1])
    image_area = collection_time.filterBounds(area)
    image_2 = image_area.filterMetadata('CLOUD_COVER','less_than', 40)
    image_median = image_2.median()
    return image_median

elif satname == ['S2']:
    ## Filter by time range and location
    collection_time = collect.filterDate(time_range[0], time_range[1])
    image_area = collection_time.filterBounds(area)
    image_2 = image_area.filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than', 40)
    image_median = image_2.median()
    return image_median

median_img = obtain_image_median('LANDSAT/LT05/C01/T1_TOA',
                                     inputs['dates'], ee.Geometry.Polygon(inputs['polygon']),inputs['sat_list'])


texts: Comparing speed of Spatial Analysis with GeoJSON versus shapefile in QGIS?

texts:
I have a large dataset that I want to perform spatial analysis on in QGIS.

Specifically, I want to perform a polygon intersection analysis between two polygon layers.

Given the size of the dataset this may take hours to complete.

Does the file type impact the performance of executing the spatial analysis i.e. will shapefiles take longer to execute than GeoJSON, or vice versa?


texts: How to rotate, move or modify features using Leaflet?

texts: I am looking for a Leaflet pluging for move (drag and drop), rotate or change a polygon or polyline feature. Also I´d like to capture the feature vertex coordinates once it has been moved to the new position. Otherwise is it posible to do that using perhaps OpenLayers o TurfJS? Which is the most appropiated way to do that, including saving modified feature into the backend?


texts: Cesium: Failed to obtain image tile X : 0 Y : 0 Level : 0

texts:
I'm trying to make a Cesium-based 3D web-viewer. At the moment I'm stuck with an error. Let me describe the situation:

I have a PostGIS database, containing the 3D geometry of a building (which I extracted from my main database, containing many more building geometries).

I have entered this database into Geoserver 2.7.2.

I wrote a simple Cesium script calling the WMS which is serving the database.

  Error: error occurred in "v": Failed to obtain image tile X : 0 Y : 0
  Level : 0.

Now, I read some things on this error, something about missing top level tiles. But all this internet literature seems to be about terrains, but that is not what I am doing.

Is there someone who can explain me what is going wrong?


texts: QGIS giving multiple centroids per polygon?

texts:
I have a shapefile for the boundaries of European NUTS regions, and I would like to compute the centroid for each of those regions. When I do this in QGIS (2.6.1 on OSX, using polygon centroids from the fTools menu), I get multiple centroids per region. Sometimes the centroids are nearly overlapping, sometimes they are further apart. How can this be? Am I doing something wrong? To be complete: I am using the NUTS_BN_60M_2006.shp data, available from Eurostat

I've added a screenshot; this part is particularly bad, but other regions have the issue as well.


texts: Calculating the number of lines for each pair of origin/destination point - QGIS3

texts:
I have shapefile that looks like this: I need to make a matrix (or just to add a couple of fields in the attribute table, something like the origin-destination matrix), which will have the number of links that go from each point to target point. I mean, I don't have physically point, just beginning and end of each line. For example, matrix/attribute table should look like this:

Target_point_coord     Point_coord_1    Point_coord_2  ...   Point_coord_N
  point_coord_1              0            15           ...     50
  point_coord_2             15             0           ...     2
         ......................................................
  point_coord_N             50             2                   0

this means that 15 lines from point 2 go to point 1, 50 lines from point N to point 1, etc. Or to be more clear, this also means that 15 lines have started at point_coordinates_2 and ended at target_point_1, and so on. The lines are not directed so that I have for the row 2 that 15 lines from point_coord_1 go to Point_coord_2.

I approximately have about 150 points and I also have the list of that points in the CSV file, if it's matter.

Is there is a way to do this in QGIS or PyQGIS? And if it is, how?


texts: where to copy ST_geometry.so on Linux server?

texts:
I run PostgreSQL 9.2 on an Ubuntu server. Through ArcCatalog 10.1 I can connect to the database (although it is empty right now). When trying to "Enable Enterprise Geodatabase" I get the following error:

You must copy the latest ST_GEOMETRY and dependent libraries to the PostgreSQL software location. Refer to the ArcGIS help topics for more details.

I've copied st_geometry.so from the ArcGIS install location on my Windows machine to the Ubuntu server. I placed the file in /var/lib/pgsql/9.2 .

Still, I get the same error message. Is there something else I have to do in order to have the ST_GEOMETRY library "installed"?


texts: Python create polyline shape by array coordinate point

texts:
I have a *.csv file that have a specific field that contain array coordinates representing a route. This is a example:

[(39.72412, -104.9995), (39.72412, -105.00091), (39.72417, -105.00157), (39.72422, -105.00159)]

How can I create with Python a polyline shapefile by this array point coordinate?
Open Source or Esri solution is the same.
I have try with this code using the help below, and i have add a fix to read specific field by csv:

with open(csvfile,'rb') as f:
reader = csv.DictReader(f)
for row in reader:
    listrow=ast.literal_eval(row["route"]) #row will be a string representation of a list so it its converted to a list with ast.literal_eval
    line=arcpy.Polyline(arcpy.Array([arcpy.Point(*coords) for coords in listrow]))
    icur.insertRow((line,))

del icur

the code works fine, but i would read a second field of csv to see into shapefile.
My csv have for each row the array coordinate and ID, how i can write also the ID in line shape?


texts: Open --> Setting --> Project Properties will shut down Qgis

texts:
When I want change my project and I select setting and the project properties .
It's will give me some message, like "Exception - Bad allocation"
How do fix the problem ?

http://imgur.com/XEHcs


texts:
I would like to be able to have the Lat/Longs of each zipcode in the United States so that they can be mapped out as polygon shapes
I have used https://github.com/OpenDataDE/State-zip-code-GeoJSON in the past which has a lot of zipcodes but it is not complete.
Does anybody know a database that has this information as complete as possible?
I am willing to pay for this data as well if it comes from a premium service.


texts: Using transform() in the QGIS function editor?

texts:
I'm trying to transform coordinates of a feature for part of a script to populate a calculated attribute field.

This works in the expression box:

x(transform($geometry,'EPSG:4326','EPSG:3857'))

This is how I tried to implement that in the function editor:

def gridLocation(value1, feature, parent):

    place = feature.geometry()
    tr = QgsCoordinateTransform('EPSG:4326','EPSG:3857')
    place.transform(tr)

    x_val = place.asPoint().x()
    # ...

but x_val is still returning the original x value.

What's the proper way to use transform?


texts: Why does shapely intersection of two lines change behaviour when fiona module is imported?

texts:
I am having issues with calculating an intersection of two LineStrings using Shapely.  Such an intersection should return a point, yet my code returns a LineString.  I found a simple example of an intersection of two lines, and it works as expected:

from shapely.geometry import LineString

line1 = LineString([(0,0), (2,2)])
line2 = LineString([(0,2), (2,0)])
print(line1.intersection(line2))

The resulting printout is:

POINT (1 1)

However, here is my code (with everything stripped out except for just enough to replicate the issue):

import fiona
from shapely.geometry import LineString

sch = {}
sch["properties"] = {}
sch["geometry"] = "LineString"
file = fiona.open("d:/tmp/test.gpkg", "w", driver="GPKG", schema=sch)

line1 = LineString([(0,0), (2,2)])
line2 = LineString([(0,2), (2,0)])
print(line1.intersection(line2))

The (incorrect) intersection result now becomes:

LINESTRING (2 2, 0 0)

So, something about fiona is changing the behavior of intersection.  If I comment out the call to fiona.open (but leave the import fiona) the result is an OSError:

Traceback (most recent call last):
  File "test2.py", line 11, in <module>
    print(line1.intersection(line2))
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\geometry\base.py", line 620, in intersection
    return geom_factory(self.impl['intersection'](self, other))
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\topology.py", line 65, in __call__
    self._validate(other, stop_prepared=True)
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\topology.py", line 19, in _validate
    if stop_prepared and not hasattr(ob, 'type'):
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\geometry\base.py", line 352, in type
    return self.geometryType()
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\geometry\base.py", line 348, in geometryType
    return geometry_type_name(self._geom)
  File "C:\OSGEO4~1\apps\Python37\lib\site-packages\shapely\geometry\base.py", line 70, in geometry_type_name
    return GEOMETRY_TYPES[lgeos.GEOSGeomTypeId(g)]
OSError: exception: access violation reading 0x0000000000000000

Any idea what is going on?


texts:
I normally work using .shp or .dwg files but have been asked by a client to supply survey data in "File Geo-Database (.fgdb)" format. Is this a recognized File geodatabase file extension? From what I can see this file extension is for Fontographer for Mac, and .gdb is the correct file extension. Or is .fdgb a legacy file format? Would someone be able to clarify this for me?

Also a ESRI File Geodatabase export from QGIS 2.18.3 seems to output a directory with contents (e.g. \myData.gdb...) rather than a singular file. Is this expected behavior?


texts: Add an Array of values as properties of FeatureCollection? (Both have same size and order.)

texts:
I've got a FeatureCollection of P points and data in an Array with P entries (values/rows) where the order between items in the FC matches the items/rows in the Array.
How can I add the values from the Array as properties of the Features in the FeatureCollection?

My workflow is:

Images[N]
N x Sample points(FeatureCollection)[P]
Array[P,N]
some array manipulations
Array [P,W]
W x Sample points(FeatureCollection)[P] or having W properties

W dimension is small enough and can easily be just a single value that is added to the Feature Collection.
But the P is quite high and iterating over it seems inefficient.
I need this to visualize the results.


texts: Changing layout background from red to blue through button add-in with C# and ArcObjects?

texts:
I am working on Arc Objects using C# and I have to make a button add in, such that if I click button one time then layout background color changes to red and then if I click again then button add in change the background color from red to blue in Arc Map.
I have successfully changed layout background color to red and blue but I want that color keep changing on each click from red to blue and then from blue to green.

Here is my code:

using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Desktop.AddIns;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.ArcMapUI;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace lecture5test
{
    public class Button1 : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        public Button1()
        {

        }
        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //

            ArcMap.Application.CurrentTool = null;

            RgbColor r = new RgbColor();
            IRgbColor iRgb = (IRgbColor)r;
            iRgb.Red = 255;
            iRgb.Green = 0;
            iRgb.Blue = 0;
            IColor ic = (IColor)r;
            // Page iPl = ArcMap.Document.PageLayout;
            IPageLayout iPl = ArcMap.Document.PageLayout;
            IPage pPage = (IPage)iPl.Page;

            RgbColor b = new RgbColor();
            IRgbColor bRgb = (IRgbColor)b;
            bRgb.Red = 0;
            bRgb.Green = 0;
            bRgb.Blue = 255;
            IColor ib = (IColor)b;

            RgbColor g = new RgbColor();
            IRgbColor gRgb = (IRgbColor)g;
            gRgb.Red = 0;
            gRgb.Green = 255;
            gRgb.Blue = 0;
            IColor ig = (IColor)g;

            pPage.BackgroundColor = ic;
            pPage.BackgroundColor = ib;
            pPage.BackgroundColor = ig;

        }

        private void EnableDynamicDisplay()
        {
            throw new NotImplementedException();
        }
        protected override void OnUpdate()
        {
            Enabled = ArcMap.Application != null;

        }

    }

}


texts: How to detect snapping event while editing layer in QGIS? (For custom topological control)

texts:
QGIS 3.14 - plugin. I have a requirement to draw lines which must start and end snapped to point geometries of another layer. I need to be able to detect a vertex snap event while drawing linear geometries so I can know whether the line feature is snapped to a feature from the point layer and if it is then I need to have the id of the snapped feature.
I managed to create my own SnappingMapTool derived from QgsMapToolEmitPoint. My custom tool does exactly the logic I need - it detects a snap event and gives me the snapped layer and feature identifiers.
The problem is QGIS replaces my MapTool with its own whenever I start drawing geometries. How do I somehow access or override the snapping event while drawing geometries? I need to check if the edited/created lines have their ends snapped to a point layer.
How it works at the moment - you can see in the console when the MapTool gets replaced.


texts: I want to resample rasters of e.g. 2 m resolution to the same raster cell size and projection of an existing raster (25 m). However I cannot really find answers how to do it properly. I managed to resample the input raster to 25 m, but this means the new raster grid has its own grid projection/orientation, thus not matching the 25 m raster grid of the masking raster.


texts: How to geocode a single address in Python Script/ ModelBuilder?

texts: How to geocode a single address (not table of addresses) in ModelBuilder and/or python Script? I want to enter the address and then geocode it. I am using arcgis 10.2.2


texts: How to store and edit data with a defined topology using open software and formats?

texts:
I'm looking for a way to store and edit spatial data that preserves topological information.

In my concrete application, I need to represent triangular meshes, which consist of unique nodes and triangular polygons. So far, I have been working with two separate shapefiles, one for the nodes and one for the triangles. This has the drawback that the two aren't topologically connected: If I move a node, the affected polygons in the other shapefile can't be updated accordingly.

Is there a standard open format for storing and editing spatial data of different types (points and polygons) that are connected topologically, similar to what I understand ESRI Coverages to be?


texts: Merge files in multiple FGDBs within parent folder

texts: I have a folder with multiple file geodatabases (FGDBs). Each FGDB has 4 different feature class tables. I want to merge the similar tables (i.e. merge all riparian, merge all soils separately) across FGDBs in the parent folder. Is there any way to accomplish this without dragging each individual file into the merge functions input? Please see image.


texts: How to get all pixel values of raster within a GeoJSON FeatureCollection in PostGIS

texts:
I need to extract all pixel values in a raster within a GeoJSON mask, using ST_Intersects.

Attempt (throws invalid GeoJson representation):

select row_to_json(t) from (select * from table_name where st_intersects(st_transform(st_setsrid(ST_geomfromgeojson('{"type":"FeatureCollection","features": []}'), 4326), 3857), rast)) as t;

It seems FeatureCollection type GeoJSON is not straight-forward. How can I wrap this?


texts: How to download TIGER data (for Postgis_tiger_geocoder) for one state through FileZila

texts:
I'm having issues to download  Tiger data from the census site using the PostGIS packaged postgis_tiger_geocoder loader scripts. I want to try it using FileZila.

FTP site: ftp2.census.gov
USER:  anonymous
PASSWORD:  anonymous

Once I'm on the folder of interest:

/geo/tiger/TIGER2016/

There are a lot of folders from which I have to download files:
Which files do I need to download for the postgis_tiger_geocoder to work

How can I handle to download the files for one state from here?


texts: How to refresh features on a OL3 map automatically?

texts:
I am using OL3 and GeoServer and PostGIS as database. My database is connected to GeoServer and OL3 conected to GeoServer and reads the points in database as vector layer and shows on the map.

My data are changed every 5 seconds (position of points). I want to refresh the map automatically each 5 seconds to show the movement of the points.

Is there any way to do this?

EDIT:
I am using WFS like this:

var vectorSource = new ol.source.ServerVector({
    format: new ol.format.GeoJSON(),
    loader: function(extent, resolution, projection) {
        var url = 'http://localhost:8000/geoserver/cite/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cite:MyFeature&maxFeatures=50&outputFormat=application/json';
        $.ajax({
            url: url
        })
        .done(loadFeatures);
    }
});

I can use window.setTimeout(function () { location.reload() }, 5000); in the loadFeatures function to reload the page each 5 seconds. It is working but I am searching for a better way which refreshes the features and not the complete map.


texts: How to use QGIS Graphical Modeller to join specific fields?

texts:
I wish to join one field from a shapefile to another shapefile within the QGIS graphical modeler. I am aware that there is a 'Join attributes table' algorithm but this joins all of the fields from the shapefile.

Outside of the graphical modeler, I can use the Joins process in the layer properties but I would much rather be able to utilise this function within my models.


texts: Simply trying to add another layer to openlayers3 script

texts:
I'm simply trying to add new layers with each as their own variable so I can turn them on and off, instead of just stacking all the layers under the variable layers.

See script below

<script>
var layers = [
  new ol.layer.Tile({
    source: new ol.source.MapQuest({layer: 'osm'})
  }),
];

var poly1 = new ol.layer.Tile({
    source: new ol.source.TileWMS({
      url: 'http://localhost:8080/geoserver/wms',
      params: {'LAYERS': 'sample:sample', 'TILED': true},
      serverType: 'geoserver',
    })
  });

var map = new ol.Map({
  layers: poly1, layers,
  target: 'map',
  view: new ol.View({
    center: [lat, lon],
    zoom: 4
  })
});
</script>

For some reason when add more than one layer to the layers line of code here

var map = new ol.Map({
layers: poly1, layers,

they both will not display, if I have one of the other they work, but can't get more than one variable working... I assume this is a simple syntax error but has me stumped and cannot seem to get it working.


texts: Breaking LineString into MultilineString group by distance between two points and it's time

texts:
This is line string of my geometry column that created by postgis and shown in qgis:

This is multiline string like above:

I am new on gis and How can i do break line and convert it into multiline?
I have converted geometry to multiline by this code:

st_astext(st_multi(st_linemerge(st_union(j.shape)))) as multiLine

but there is just one line as a MULTILINESTRING.it is like MULTILINESTRING((xx yy , aa rr)).How can i do break for example by distance between two points and creation date time for breaking line?
Is it possible?


texts: How to create a stylefunction considering different geometries for different styles in OL?

texts:
I want to style a layer that contains MultiPolygon geometries as well as Polygon geometries (using OL 4.1.1). All geometries should be coloured. The text lables on the other hand should just be set for the largest polygon (in case of MultiPolygon). How do I consider different geometries for different styles (e.g. ol.style.Fill and ol.style.Text) in the same style container (ol.style.Style)?

Some code for illustration:

var styleFunction = function(feature, resolution) {
    return new ol.style.Style({
        geometry: selectLargestPolygon(feature), // the single Polygon or largest in case of MultiPolygon
        // geometry does not need to be set in case of fill...
        fill: new ol.style.Fill(...), // should always consider the whole geometry! (not just the largest Polygon in case of MultiPolygon!)
        text: new ol.style.Text(...) // should just consider the largest polygon
    });
};


texts: Clipping a raster with a shape layer fails by returning an empty raster (nan - 0)

texts:
I am trying to clip a raster layer by a shape define by a polygon.
(A previous question was about a line layer clipping, whereas this one relates to raster layer)

The resulting layer is however an empty layer. To be more specific the resulting layer is raster of 1846x1202 pixels, but it seems to be filled with no-data value.

I am clipping the raster via menu Raster -> Extract -> Clip

Here are some views of the work:

Polygon Shape (Mask):

Raster Layer to clip

Resulting layer (after clipping): Nothing !

Layers' icons in QGIS Layer Windows

If I do a clipping using a Extent (rectangular selection) instead of Mask Layer (clipping with shape), it works: so I suspect I have a problem with my polygon layer.


texts: Using Redfearn's formula to convert between WGS84 and UTM?

texts:
I have GPS data at 1 point per second for several weeks in WGS84 latitude/longitude form.  It was collected using a UBLOX GPS in 2015 in Australia (Zone 55s)

Would it be correct to use Redfearn's formula to project WGS84 data to Northings/Eastings? Normally it seems that Redfearn's formula is used with GDA94 rather than with WGS84:

http://www.ga.gov.au/geodesy/datums/redfearn_geo_to_grid.jsp
http://www.ga.gov.au/scientific-topics/positioning-navigation/geodesy/geodetic-techniques/calculation-methods
(excel spreadsheet halfway down page)

I would like to get Northings/Eastings in meters. The data is only accurate to 2-5m at the moment, but I don't want to make it worse so would need to use a conversion that is accurate to within a few cm.

I could just use the ArcMap (ArcPy) projection but since I have very large files (1 point per second) even ArcPy is very slow. Therefore I'd rather put the formula directly into Python.  I'll probably use ArcPy later to check some of the results.

The data is collected on animal collars (in Zone 55s). The collars could be used anywhere in Australia (or possibly overseas) so I'd like to use a formula that could be transferable to another part of Australia (although that could involve user input about approximate location).

I've also been investigating how to convert WGS84 (presumably = ITRF2008?) into GDA94 and then to MGA, but this seems very complicated and I think it may be simpler just to work in WGS84 UTM since I don't really need it for an official map.


texts:
I have a simple question. I have calculated the area of the polygons in my shapefile, but the number seems confusing for me. I need the area to be shown in km2 but instead I get numbers like:0.004008  What are the units of this number?

When I used the "measure area" icon, that is, when I measured the same polygon manually the size of the polygon shows me: 50.342km2

See, the two numbers are completely different. How is that??

Thanks for any help!!


texts: Having arcpy.da.SearchCursor access only selected row in attribute table?

texts:
In ArcMap 10.2, I'm attempting to build a tool that, when run, will iterate through a network of pipes to locate an outfall point. My network is composed of polyline data representing pipe, with input points at the junctions between polyline sections. Pipes have an Upstream and Downstream field, corresponding to Input points and Outfall points (at pipe terminus). My thinking is to have a user select a point in the network, at which point a search cursor in the input table would pull the ID value for said point, and feed it to a search cursor in the Upstream field of the pipe table. From there I would have two search cursors (one Upstream, one Downstream) iterate through until an Outfall value is reached in the Downstream field (all Outfall ID values begin with "OF"). All ID field values are strings.

I'm having trouble getting my initial search cursor to return only the value of the selected row for the input table. Here is my code so far:

import arcpy
arcpy.env.workspace = "C:\\Users\\Don\\Desktop\\Key\\Thesis\\Storm_Sewer"
arcpy.MakeFeatureLayer_management("GISDATA_STORM_INPUT_COMB", "inpLayer")
arcpy.MakeFeatureLayer_management("GISDATA_STORM_PIPE", "pipLayer")

fc = "inpLayer"
ds = "pipLayer"
pfield = "US_strip"
field = "ID_COMB"

bCursor = arcpy.da.SearchCursor(fc,field)
pCursor = arcpy.da.SearchCursor(ds,pfield)

for row in bCursor:
    print(row[0])

Is it possible to have the searchcursor only act on the selected row? I had thought that, so long as the cursor was acting on a feature layer, this would occur automatically. Instead, this code feeds me back all the values in the field.


texts: CartoDB: Can't find where to change Google Drive log in credentials

texts:
I'm trying to create a new table in CartoDB.

I click New Table
I click the Google Drive data tab
I click the connect with gdrive button
At this point it seems to be automatically logging in to the wrong Google Drive account.

Is there a way to reset that so I can get into the right account?

I'm trying to marry up my table with a Google spreadsheet.

Thanks!


texts:
I wrote a project macro which, when loaded, hides all toolbars except for one which contains a couple of my plugin buttons. I know it's possible to trigger core buttons like the following example:

self.iface.actionPanToSelected().trigger()

But is it possible to do this for a custom-made plugin?

I noticed I could identify the objects of the toolbar using:

from PyQt4.QtGui import QToolBar
for x in iface.mainWindow().findChildren(QToolBar):
    # x.objectName() returns the names of the toolbars
    if x.objectName() == 'Example':
        print x.children()

[<PyQt4.QtGui.QLayout object at 0x0000000023589840>, <PyQt4.QtGui.QToolButton object at 0x0000000024DCE488>, <PyQt4.QtGui.QAction object at 0x0000000024DCE510>,
<PyQt4.QtGui.QToolButton object at 0x0000000024DCE598>, <PyQt4.QtGui.QToolButton object at 0x0000000024DCE620>]

But unsure how to trigger the buttons...


texts:
In my asp.net 3.5 application, I'm using Google Map API v3. I want to draw layers using MapInfo Tab File and showing them on a Google Map.

Anyone have any idea about how to do this?


texts: Common information shared between Geopackages

texts:
I'm trying to build a map in which I have a few geographical units organized as such.

Commune ---1:N---> Contrada
Contrada ---1:N---> Vineyards

One commune may contain many contradas, which in turn may contain many vineyards. On the saide, I also have a list of owners, which may own vineyards spread along many contradas and communes.

What I'd like to do is to have a central producer list and in each vineyard feature, have a metadata field referring to it.

Currently, I have one geopackage file for each commune, using QGIS3. I'm trying to find a way to share this information across geopackages without duplicating that information in each of the communes geopackages, but can't seem to find an easy way.

Or should I just put everything in the same geopackage (at the risk of it getting a bit large) and instead create a geometry-less table in that whole package?

It does seem like the easier solution, but I'm not sure if it will create other challenges down the line.


texts: RStudio's Graphic Device plotting rasters too tiny?

texts:
I am having some issues when plotting rasters with the raster::plot function. It seems that my Rstudio's graphic device has some problem and the plots are just very very tiny. As of illustration, if the outcome of

raster::plot(raster::raster(matrix(1:100,10,10)))

is

whereas if plotting it on R application or through my Mac's terminal, the output is just perfect. This happens to any raster I try to plot. In both applications, my raster and sp packages version are the same (2.6-7 and 1.2-5, respectively).

I am running RStudio version 1.0.136 on a 64bit iMac (late 2015). The R version running is 3.3.2. My os is version 10.12.6 (macOS Sierra). Any thoughts?

This question follows up raster::plot() plotting raster too small- is there an alternative on ggplot?, where I thought the issue was the raster file.


texts: Using wildcard to find similar values between two fields with ArcPy cursor

texts:
I am using ArcMap 10.8. I have joined two street tables and am trying to correlate a couple fields. One field has a full street description ("FullStreet") and the other simply has the street name ("StreetName"). For quality assurance purposes, I have made a flagging field ('Flag'); the goal is to populate this field with "mismatch" in the case of completely different values, and "close" in the case the StreetName value is contained within FullStreet.
For example:

FullStreet
StreetName
Flag

N WEMBERLY LN
WEMBERLY
CLOSE

N WEMBERLY LN
YOCUM
MISMATCH

I started with field calculator, but soon learned that wildcards are not supported, so I am trying to write a code with Python (v3.7). I think I am close, but am still having trouble incorporating the wildcard aspect:

streets = ("C:/.../Streets_M21.shp")

p_full = str('PSTR_FULNA')
my_full = str('FullStreet')
streetname = str('StreetName')
flag = str('Flag')
t_street = ( '%' + (streetname) + '%' )
fields = [p_full, my_full, t_street, flag]

with arcpy.da.UpdateCursor(streets, fields) as cursor:
    for row in cursor:
        if row[0] == row[1]:
            row[3] = "match"
        elif row[0] in row[2] and row[3] != "match":
            row[3] = "close"
        else:
            row[3] = "mismatch"

        cursor.updateRow(row)

When run, this generates the an error: RuntimeError: A column was specified that does not exist.
This must be referring to t_street, the wildcard attempt. I have also tried (*) as the wildcard operator, but when run, I get Cannot find field '*StreetName*'
How can I write this code so if the value in StreetName is anywhere within FullStreet, they will correlate?


texts: Extract raster properties and use them in QGIS graphical model

texts:
I would like to generate a tool that reclassifies rasters in 10 classes with equal intervals. Since QGIS reclassifies tools does not allow to automatically create classes with such methods, I was wondering if I could do it myself inside the graphical modeller this way:

Extract the min and the max of a given raster
Divide the range of those values in ten breaks
Use those breaks to generate a reclassification table
Import that reclassification table inside the reclassify tool.

I know that the last step is possible, but I'm not sure about the other ones... Can we process data and informations like this inside the graphical modeller? I know it's possible with Python but for a teaching purpose, I would like to know if it's possible with the graphical modeller specifically.


texts: Panels with dev notes in Google Earth Engine

texts:
I have developed a script and would like to publish it. I wanted to add dev notes, but can't find a good way to format the label such that it has a scroll wheel down. My script looks like this:

var longLabel = ui.Label('This is my very long label. I would like to be able to add line breaks to it so that it does not trail off infinitely to the right. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' )
longLabel.style({
  width:'400px',
  height:'500px'
})
var panel = ui.Panel()
panel.style({
  width:'400px',
  height:'500px'
})
panel.add(longLabel)
Map.add(panel)

I would like the panel to have the width specifications in the script, but perhaps with line breaks partition the label text into a scrollable box.


texts: How to display the GeoJSON from PHP on the map?

texts:
I am using MapboxGLJS. I retrieve the coordinates from my database and I put it in GeoJSON format on PHP which look like this:

   <?php
            $sql = "SELECT * FROM waypoint";

            $server = "localhost";
            $username = "root";
            $password = "";
            $db = "scandrone";
            $conn = mysqli_connect($server, $username, $password, $db);

            $result = mysqli_query($conn, $sql);

            $geojson = array('type' => 'FeatureCollection', 'features' => array());

                    while($row = mysqli_fetch_assoc($result)){
    $marker = array(
            'type' => 'Feature',
            'features' => array(
                'type' => 'Feature',
                "geometry" => array(
                    'type' => 'Polygon',
                    'coordinates' => array(
                         $row['longitude'],
                         $row['latitude']

                    )
                )
            )
        );
    }

        echo json_encode($marker);
?>

And when i did an "echo json_encode($marker);" i got this

[{"type":"geojson","data":{"type":"Feature","geometry":{"type":"Polygon","coordinates":{"longitude":"2.0556640625005","latitude":"45.641158147526"}}}},{"type":"geojson","data":{"type":"Feature","geometry":{"type":"Polygon","coordinates":{"longitude":"3.3959960937499","latitude":"44.852208244354"}}}},{"type":"geojson","data":{"type":"Feature","geometry":{"type":"Polygon","coordinates":{"longitude":"1.4404296875004","latitude":"44.508493826826"}}}}]

Now I need to display this on my map. How can I do this?


texts: ArcMap fill polygon with points (highest possible number) (Bin Packing Problem: Best Fit)

texts:
Is there a tool for ArcMap 10 that fills a given polygon with point geometries?

The points should have a pre-defined distance between themselves, but the points position can vary. Fishnet is not an option because it wont create points based on the polygon's shape.

I first thought of using the Network Analyst extension but that seems to need a network layer, which doesn't exist in my case.

Here is an example of the fill-pattern I'm thinking of. Now let's say the minimum distance between each point is 100 meters. Some adjacent points have a greater distance because of the shape of the polygon

I hope it's a bit clearer now what I'm searching for


texts: Why the spatial reference of a GeoTIFF image (generated in Python) is missing in ArcGIS?

texts:
I have a NC file that I am converting it to a GeoTIFF in Python. Here is the code I am using:
lat_bounds, lon_bounds = [-8, 5], [40, 65]

lat_indices = np.where((lat > lat_bounds[0]) & (lat < lat_bounds[1]))[0]
lon_indices = np.where((lon > lon_bounds[0]) & (lon < lon_bounds[1]))[1]

subset = co_data[lat_indices.min():lat_indices.max(), lon_indices.min():lon_indices.max()]

xmin,ymin,xmax,ymax = [-8,40,5,65]
nrows,ncols = np.shape(subset)
xres = (xmax-xmin)/float(ncols)
yres = (ymax-ymin)/float(nrows)
geotransform=(xmin,xres,0,ymax,0, -yres)

output_raster = gdal.GetDriverByName('GTiff').Create(r"C:\Users\....\test1.tif",ncols, nrows, 1 ,gdal.GDT_Float32)
output_raster.SetGeoTransform(geotransform)
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)

output_raster.SetProjection( srs.ExportToWkt() )
output_raster.GetRasterBand(1).WriteArray(subset)
output_raster.FlushCache()

However when opening my file in ArcGIS or QGIS I get an error message that the image's spatial reference is missing.


texts: Changing Linear Units on Scale Bar to a unit not listed

texts: In ArcMap, how can I change my linear units on a scale bar for layout view to a unit not listed on the drop down menu in units of the scale bar?  I want to get survey chains in my map as a scale bar.


texts:
I have been attempting to make a Tool within a Toolbox with four different parameters. My code consists of the following:

def getParameterInfo(self):
    """Define parameter definitions"""

    # First parameter = layer with customized features
    source = arcpy.Parameter(
        displayName = "Source layer with customized features",
        name = "source",
        datatype = "Feature Layer",
        parameterType = "Required",
        direction = "Input")

    # Second parameter = layers to which customized features will be applied
    updlayers = arcpy.Parameter(
        displayName = "Layers with features to be updated",
        name = "updlayers",
        datatype = "GPValueTable",
        parameterType = "Required",
        direction = "Input")

    labelFontSize = arcpy.Parameter(
        displayName = "Label Font Size",
        name = "labelFontSize",
        datatype = "GPDouble",
        parameterType = "Required",
        direction = "Input")

    labelBoldFont = arcpy.Parameter(
        displayName = "Bold Font:",
        name = "labelBoldFont",
        datatype = "GPDouble",
        parameterType = "Required",
        direction = "Input")

    updlayers.columns = [['Feature Layer', 'Features']]

    params = [source,updlayers,labelFontSize,labelBoldFont]
    return params

From my understanding, the params list is the list that will later be included as one of the inputs into my execute function. A portion of my execute function is as follows:

def execute(self, parameters, messages):
for a in range(0,len(parameters)):
        arcpy.AddMessage("This is the item at index " + str(a) + " " + parameters[a].name)
    updlayers = parameters[1].values
    labelFontSize = parameters[2].value

Hence, params from getParameterInfo() will be parameters in the execute function. Is that correct? Either way, I am having trouble with my last parameter, labelBoldFont. I essentially want this to be a checkbox in my tool so that the user can choose to have their label text to be bold or not. However, the parameters list in my execute() function only has three elements and not four (labelBoldFont is not being included in the list???). I have done some thorough testing and I can't seem to find the issue with my code. Any ideas as to what the source of the problem would be?


texts:
I try to find normalized icons to use for the BOYLAT ( lateral buoy )

I find description, but for the boylat it seems that different shape to show different buoy
link for the description

http://www.caris.com/s-57/object/boylat.htm

and the link for the list of shape

http://www.caris.com/s-57/attribut/boyshp.htm