texts: Grouped "labels" for QGIS 3.0 Point Cluster styling?

texts:
I'm trying to make a cluster visualization of a vector point layer about trees with a few requirements:

The clusters need to change depending on zoom level (solved)
The clusters need to indicate how many vector objects are clustered (solved)
The clusters need to have labels that describe the objects that are clustered
This needs to be done with styling, so that the CRS can be copypasted (the data table will be updated and the clustering needs to be automatic)

I would like to show something like this in the final product (I inserted the black text with hand in MS Paint for reference):

The data for the trees:

The Point Cluster is only a visualization, so automatic labeling will create labels to individual objects, not to each cluster. Also, the @cluster-functions are only available inside the Cluster Point styling context. This is why I would like to make another layer with Cluster Points styling, which has a Font Marker as the cluster symbol. The text for the symbol would need to have conditional formatting. I would do it in SQL with something like this:

select count(*), "type"
from @cluster
group by "type";

Which would yield something like this:

This would show the text in the way I need it on each different zoom level. However, I can't find a way to get a grip of the objects inside each cluster. The @cluster does not actually work.

How do I make grouped text clusters with Cluster Point styling, and how do I get a hold of the objects inside clusters?


texts:
I will have to switch from ArcGIS Pro to QGIS because my uni license runs out soon.
Do you know how I can import my map styles from ArcGIS Pro to a QGIS project?
I only know how to do it in ArcMap which I cannot use anymore.


texts: QGIS Web Client cannot select Map Layer or use Layer Order

texts:
I have installed the QGIS Web Client from git with the install.sh script and went directly to copy a QIS project in the project directory (with map layers in Postgis). After struggling with CRS (in the end I needed to set the project to 3857 when my layers are in 4326) and configuring properly the OWS properties I could obtain a nice result. However, I am not able to select/deselect map layers neither to use "Layer Order".

Testing many settings I realized that I cannot even have the examples "Hello World" and "Natural Earth" working at all even after a re-install. The former just shows OSM and the latter is stuck on "Loading Map".

I can't figure out what is wrong even looking at the information given in the log.

Platform is Ubuntu 14.04.


texts: Calculate or Estimate TRUE AREA from an irregular polygon and a DEM in QGIS

texts:
I have to calculate or estimate the surface area (sq m) considering the elevation data on several places (wich i have in different shapefiles, and some multipolygon shapefiles).

I'm aware of this QGIS calculate the 3d surface area of a region? but this is only for rectangular polygons.

I have the shapefiles and the DEM. Working on QGIS 2.14


texts: Pseudo-Mercator projection with Decimal Degrees?

texts:
Hope this isn't a duplicate, did some searching but none seemed quite the same.

Projection I want: WGS84/Pseudo-mercator. Selected. Looks Great.

Canvas units I want: Decimal Degress. Selected. Denied. Assumed reason: WGS84/Pseudo_Mercator's CRS code is:

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs

I assume the units argument is over-riding the user's canvas units choice?

Is there any way around this? I don't know how to create a custom CRS but if it's easy enough to do, would it just be a case of copying the line above and omitting the bold bit?

Thanks!!


texts: Creating spatial bookmarks from existing layer using QGIS?

texts: I have a layer with counties. I would like to import the bounding box of each county as a spatial bookmark and name it accordingly. Is this possible?


texts: weighted point data interacting with linear data

texts:
I am looking for a way to test a hypothesis;

"the closer my point feature is to my line feature (both vector), the higher the score of C will be"

(for other sections of my research so far I have looked at overall density of my points using heatmap, and at the distance from line features using the distance matrix)
for this stage so far i have created a weighted heatmap based on the score of C in my database, but i don't know how to relate this to my line data
my desktop currently looks like this:

a look at other questions seems to suggest using interpolation but i'm not entirely sure how this works, i used the method to produce the image in the picture above but i dont know how to interpret it

so any ideas how to present weighted attribute data and relate it to my line data? if interpolation is the answer, links to description of interpolation in laymans terms are requested.
am using qgis 2.10


texts: black and white aerial ortophoto classification using texture with GRASS

texts:
I have a b&w image i want to classify; the trouble is that mere spectral classification yields a lot of error,
I saw this in wikigrass

  In case of panchromatic maps or limited amount of channels, it is
  often recommended to generate synthetic channels through texture
  analysis (r.texture)

And there's nothing more about it in that page;
How can I use the outcome from r.texture in a classification, together with the segments of i.segment or i.smap?


texts: How to generate rectangles considering only a percentage area of a base object?

texts:
I am trying to generate a rectangle by considering a small percentage of area of the extent of a geometry object in the PostGIS.

I have tried to use the ST_Scale function. It successfully generates a rectangle that corresponds to 0.01% of area of the extent of my geometry by using the following command:

select st_area(st_scale((select st_envelope(geom) from tab limit 1), 0.01, 0.01, 0.01)),
st_area((select st_envelope(geom) from tab limit 1));

As response I got:

--0.152626509356218;1526.26509356218 = 0.0001 = 0.01% of the area

However, for 0.1%, 0.5% and other percentages it does not work. Is there other way to generate these rectangles?

I need to generate rectangles that have 0.1%, 0.5%, and 1% of area of the extent of a given geometry.


texts: Using arcpy.mapping print command to display mxds in loop?

texts:
Here's the code for the third parameter that list the local printers:

# Third Parameter
printer = arcpy.Parameter(
    displayName="Select a Printer",
    name="printer",
    datatype="String",
    parameterType="Required",
    direction="Input")
# Set a value list for the available local printers
printer.filter.type = "ValueList"
printer.filter.list = arcpy.mapping.ListPrinterNames()

This works and lists all of my local printers. The problem is it can't print the looped MXDs. It looks like python can't find them in the loop according to my arcpy.AddMessage(). Here's the code:

# Get inputs
InputMXD = parameters[0].valueAsText
PDF_Folder = parameters[1].valueAsText
printer = parameters[2].valueAsText

# Set workspace as defined by user
#env.workspace = PDF_Folder
arcpy.env.workspace = r"c:/temp"

#List Names for Inputs
arcpy.AddMessage("PDF_Output: "+PDF_Folder)
arcpy.AddMessage("Printer Name: "+printer)
arcpy.AddMessage("MXDs before Loop: "+InputMXD)
MXDList = arcpy.ListFiles(InputMXD)
arcpy.AddMessage("After MXDList")
arcpy.AddMessage(MXDList)
for MXDPath in MXDList:
    arcpy.AddMessage("MXD Path: " + MXDPath)
    MXD = arcpy.mapping.MapDocument(MXDPath)
    arcpy.AddMessage("MXD: " + MXD)
    arcpy.mapping.PrintMap(MXD, printer)

It's showing the mxds before the loop, but it isn't printing them once the loop hits. Any ideas? It's showing "[]" when it should be showing what's in the "MXDList".

Update 2

When I use this:

 MXDList = glob.glob(os.path.join(InputMXD, '*.mxd'))

I got the same result as the image above.  It's still not running through the loop.  Here is my parameter setup for the InputMXD.

    # First parameter
    InputMXD = arcpy.Parameter(
        displayName="Input MXDs",
        name="InputMXD",
        datatype="DEMapDocument",
        parameterType="Required",
        direction="Input",
        multiValue=True)

When I use this code with workspace set to my InputMXD:

    MXDList = arcpy.ListFiles("*.mxd")

I get this result.  It doesn't want to list my MXDList.

Updated 3

When I try the newest code with the AddMessage and put my printing code below it the results say this.

Traceback (most recent call last):
  File "", line 104, in execute
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 609, in __init__
    assert (os.path.isfile(mxd) or (mxd.lower() == "current")), gp.getIDMessage(89004, "Invalid MXD filename")
AssertionError: Invalid MXD filename.


texts: I would like to get the areas related to the polygons resulting from the intersection between two SpatialPolygonsDataFrames: 'A' and 'B'. SpatialPolygonsDataFrame 'B' has 3 different 'classes', which represent polygons with different shape and size. In reality, 'A' is PRIO-GRID data (regular polygons) and 'B' is GREG ethnic database (with 3 layers that indicate different ethnic groups). In ArcGIS, the command is 'Tabulate Intersection" with option 'classes' where we can put the different class layers'. Is there any alternative in R?


texts: Why does Topo to raster tool stall in ArcMap 10.1?

texts:
I'm having the following problem -
An 8 mile by 4 mile set of 2 foot contours.
Whenever I start the topo to raster tool, I get a constant loop of the tool running.  And running, and running, and running, with no effect, even after letting the process run over 10 hours overnight.

Settings that I'm using are as follows:
Cell size 5
Extent same as input
Margin: 50
Drainage: Enforced
input data: contour
maximum number of iterations: 20
Roughness Penalty:
Discretisation error factor: 0
Vertical standard error: 0
Tolerance 1: 1
Tolerance 2: 100

Any help y'all could offer, would be a great, great help.  I would also be interested to know other workarounds to make a DEM from detailed contour information.


texts: How to generate thumbnails from shapefile and display them on my web site?

texts:
I tried to generate thumbnails from shapefile and display them on my web site (using jsp). I had been read this and this question. Very similar questions, but I know nothing about Python...

Is there any open source tools or projects to deal with it?Is there any solution or idea to implement it via ArcGIS JavaScript API or other solutions?


texts: ExtendedData and Description coexisting in the same placemark?

texts:
I am brand new to KML. I would like to ask if it is possible to have both ExtendedData and Description for the same placemark and have both appear in Google Earth Interface? I am asking because when I add a description to my placemark all the ExtendedData disappears in Google Earth and gets replaced by the newly entered description, although when I paste the placemark to Notepad the ExtendedData is still there.

Is there any way these two can both exist and appear at the same time?


texts: Cannot import CSV to dbase via Table_to_Table in ArcMap

texts: I have a CSV file with greater than 5 million records. When I imported it to dbase via the Table_to_Table function in ArcMap, it raised ERROR(99999). As a result, only 2 million or so records were imported...


texts: L.Polygon getting distorted when panning a map

texts:
I am using Mapbox with leaflet. I have drawn a simple polygon with a hole inside that polygon. I have done this using L.polygon and passing an array of points inside it and another array in reverse direction creating a hole as mentioned in the API docs of leaflet here.
 the output is as shown in the image below

When we pan the map, I don't want that circle to move from it's place on the screen and hence, on panning of map i am redrawing the circle on the center of the map. But the problem is, when i pan the map, the circle gets distorted. I know, map tiles needs time to load but the circle is also getting loaded and hence not giving clear view, as shown in the images

at start of the panning

and when i keep on dragging

Then once i finish dragging, the circle is normal again (i.e the overlap of map tiles over the circle goes away). This is giving very bad experience to the user
note: I am showing the hole as kilometers within reach, considering the user is at the centre of the circle


texts: How to use Geometry objects (Point and LineString) in Hibernate Spatial

texts:
I'm developing an application in java (underlying database is postgresql 9.1) using hibernate 5, hibernate spatial and more technologies.

Previously to my knowledge of the JTS classes to represents coordinates and polylines, I made a custom class to represent a single Latitude and Longitude object: LatLng. To represent polylines, I used List. That became a bad practice when I made use of them, when large objects were made CRUD operations lasted a lot.

So I investigated a bit and found JTS library, which was included within Hibernate Spatial. I realised that my LatLng class could be replaced with Point and polylines List with LineString. That would be an impressive development in performance.

So I get hands on and decided to change my code. I changed the dialect from org.hibernate.dialect.PostgreSQLDialect to org.hibernate.spatial.dialect.postgis.PostgisDialect but maintained the original org.postgresql.Driver driver.

This is an example of one Point attribute within a class, plus it's mapping xml file:

private Point domicilioCoord;
...
<property name="domicilioCoord" >
    <column name="TRABAJADOR_DOMICILIOCOORD" not-null="false" />
</property>

As you can see, there isn't any type attribute within the property tag. If I introduced type="org.hibernate.spatial.JTSGeometryType" (which it'd be the right choice I guess), I got an error saying "Could not instantiate Type: org.hibernate.spatial.JTSGeometryType". I also tried org.hibernate.spatial.GeometryType with the same result. So I decided to remove the type attribute and it worked...

After some inconvenients, I make it work, at least I could initialize the application with no errors. I realised that Point columns were of bytea type in the database, which strikes me a bit.

When retrieving data from the database (data which contains the previously commented Point attr), I get another error. My opinion is that this error is shown due to the lack of an UserType implementor class (which JTSGeometryType and GeometryType are).

I opened a thread on StackOverflow to ask for help.

My question is: how can I map Point and LinearString in hibernate? Is it possible not storing them as bytea?


texts:
I'm brand new to ArcMap with no training at all and very little GIS knowledge coming from MapInfo 7.8 .

What is the most efficient and quickest way to search for an address?

I update our counties phone records for the 911 dispatch system on a daily basis. Sometimes 20-30 records at a time. Using the select by attributes window for each one is sooo slow, but does open up the attribute window on it's on for each selection. The "find" tool is much faster to enter the address however after each selection, you make the changes, you have to clear the selection and clear the search box in the tool. would be nice if after I entered the address, a double click would open the attributes for that address, then again a double click on the next address would open the attribute table for that one. There are no options within the "find" tool to "create new selection" like there are for other search methods. I'm sure it sounds trivial but coming from what i'm used to the current search options are far less efficient.

Are there any good Add-Ins for improved searching?


texts: How to join multiple nearest neighbouring nodes using postgresql or python?

texts:
I have many short paths SHP file  which look like a longer dashed path.
Is there an efficient way to connect these paths to one continuous path?
If possible, I want to avoid a hundred times manually selecting 2 nodes pairwise and joining them. And the distance between all the lines are not same


texts: Adding metadata to a geographic gridded data-set and projecting it

texts:
I asked a question before that nobody answered...but I kind of figured it out myself. But I still remain with some things that I just don't seem to get right. Can anybody please find the time to help me? It really seems like something trivial... Thanks!

-

I want to transform a geographicly gridded latlon data-set into a polar stereographic projection with gdalwarp. For this I need to add the correct metadata to my gridded data-set, and I can't seem to get this right.

It is regularly spaced with 0.04 degrees from 0:360 longitude and -86:-60 Latitude (Antarctica). Only thing I have is the grid, so it comes without a header. I however have added the current header to the dataset:

ncols        9001
nrows        651
xllcorner    0
yllcorner    -86.000000000000
dx           0.04
dy           0.04

The first problem I get is that when I gdalinfo it I get:

Corner Coordinates:
Upper Left  (   0.0000000, -59.9600000)
Lower Left  (   0.0000000, -86.0000000)
Upper Right (     360.040,     -59.960)
Lower Right (     360.040,     -86.000)
Center      ( 180.0200000, -72.9800000)

Which seems wrong (as it is 0.04 off). Possibly I have to use a gridsize of 9000/650 instead of 9001/651, but also this is confusing to me as I then omit a line. Do I set the header correctly?
Other than defining the grid and the coordinates like this, what do I need to do with the projection data? Need I add     -s_srs WGS84 (this is what I do) or something like -s_srs EPSG:3031 (South Polar Stereographic)? This gives me the following:

Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563,
        AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (0.000000000000000,-59.960000000000001)
Pixel Size = (0.040000000000000,-0.040000000000000)

I want to finally project it onto the following system:

PROJCS["unnamed",
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]],
PROJECTION["Polar_Stereographic"],
PARAMETER["latitude_of_origin",-71],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]]]
 Origin = (-2800500.000000000000000,2800500.000000000000000)
Pixel Size = (1000.000000000000000,-1000.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
 INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-2800500.000, 2800500.000) ( 45d 0' 0.00"W, 54d40' 3.36"S)
Lower Left  (-2800500.000,-2800500.000) (135d 0' 0.00"W, 54d40' 3.36"S)
Upper Right ( 2800500.000, 2800500.000) ( 45d 0' 0.00"E, 54d40' 3.36"S)
Lower Right ( 2800500.000,-2800500.000) (135d 0' 0.00"E, 54d40' 3.36"S)
Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E, 90d 0' 0.00"S)

Now there are 2 things occuring with my results when I warp it like this:

gdalwarp -s_srs WGS84 -r cubic data1.txt data2.tif

(i use either an existing data-set (I want to remap so...) or set the -te and -tr parameters, and get the same results....)

I get a warped file which fails to do the entire file (there is probably something going wrong at the 0/360 longitude transition. As expected it omits the value that falls at -360.04
I get only half of the file!! Only the right side of the projection is done...

So my questions are:

How do i correctly set the correct projection parameters and how do I deal with polar stereographic data? Why can't I properly set the latitude and longitude range?
What in earth is going wrong when it only projects the right side?

Thanks for the help!


texts:
I have ring polygon (I'm filling GAP between parcel by INDEX4000).
I'm trying to use split feature to split (cut) the ring polygon into road and water, but it does not work. Any ideas?


texts: Howto do not re-run already executed transformers in FME?

texts:
I have a FME workspace with several transformers. I have already run the workspace.

Now I change a transformer at the end of the workspace (marked in red here).

How can I ensure that only the new part (red) is executed when I execute it again? The part already executed (green) should not be executed again (to save time).


texts: Using a template matching correlation image to extract lines

texts:
I need to measure the length of the rows which are visible in the images. I have used template matching with a portion of the row as the template.

Along a row, there will be matches which are identified as points, as seen in this image.

Now I am unsure which direction to take this approach this problem

1) If I am able to constrain the direction, I could try to draw best-fit lines and clip the lines with a manually digitized boundary

2) Use the correlation image instead to generate segments and measure the lengths of the segment.


texts: Set Image Source of a composer item in PyQGIS

texts:
I have QPT file witch has map item and logo item..

here is my code:

    canvas = QgsMapCanvas()
    QgsProject.instance().read(QFileInfo(projectqgs))
    bridge = QgsLayerTreeMapCanvasBridge(QgsProject.instance().layerTreeRoot(), canvas)
    bridge.setCanvasLayers()
    composition = QgsComposition(canvas.mapSettings())
    composition.loadFromTemplate(document, substitution_map)
    map_item = composition.getComposerItemById('map')
    map_item.setMapCanvas(canvas)

but then i need to set Image Source path to my logo item.. Of course i need something like this:

logo_item = composition.getComposerItemById('logo')

then what should i do? is there anycode similar to this:

logo_item.setImageSource(path_to_image)


texts: raster calculator (spatial analyst) tool not working in arcpy

texts:
I am using arcpy and while running the script it is unable to find RasterCalculator() method? Even after imporiting arpy module

>>> RasterCalculator("IDSI_2002.img + IDSI_2007.img","D:/PythonScripts/test.img")
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'RasterCalculator' is not defined

Calculator' is not defined


texts: How to efficiently access the features returned by QgsSpatialIndex?

texts:
The PyQGIS Cookbook explains how to set up the spatial index but it only explains half of its usage:

create spatial index — the following code creates an empty index
index = QgsSpatialIndex()

add features to index — index takes QgsFeature object and adds it to the internal data structure. You can create the object manually or use one from previous call to provider’s nextFeature()
index.insertFeature(feat)

once spatial index is filled with some values, you can do some queries
# returns array of feature IDs of five nearest features
nearest = index.nearestNeighbor(QgsPoint(25.4, 12.7), 5)

What's the most efficient step to get the actual features belonging to the returned feature IDs?


texts: CHaMP Topo Processing Menu not active in ArcMap 10.1

texts: After converting a .tiff file to TIN, I have now installed the CHaMP Topo Processing Add-In which should allow me to convert Topo TIN to DEM. However, after installation, the entire toolbar is grey and inactive (including Convert Topo TIN to DEM from drop down). Any advice on why this might happen?


texts: Strange distance measurements in distance matrix

texts:
I'm trying to create a distance matrix between two point shapefiles in QGIS 2.6. Both are in WGS84 UTM Zone 30N co-ordinates (and so is the project file), but the distance matrix returns values such as 5673346.938, instead of expected numbers of between 1 and 5km.

I saw a similar thread mentioning disabling 'on the fly projection changes' - I've done this, and no change.
Threads already checked:
Distance Matrix QGIS

Unable to obtain linear distance matrix

Here are samples of the two shapefiles I'm using, stripped down to just ID and location.
http://www.datafilehost.com/d/32dc1dc6

http://www.datafilehost.com/d/61fff8f3


texts:
I am new in python 3 and I have a question, I have a script in QGIS 2.8 and is working, but my problem is in QGIS 3 the next part of script read the file but don't add the new line in each row.

import os
import numpy as np

os.chdir(r'C:\IDW_v3')
file="HP.txt"
HP = np.loadtxt(file, dtype='float')
np.savetxt('HP_2_np.txt', HP, fmt='%10.5f', delimiter=' ')

Result in 2.8

Result in version 3

Any idea?


texts: Merging overlapping line segments in ArcGIS Desktop?

texts:
I'm working with fish distribution data, and have combined several 24k habitat maps into a single layer that I'll call "critical habitat"

In merging multiple distributions into one dataset, there are line segments that overlap one another.

Part of my project involves measuring the stream mileage in this "critical habitat" data set, but because there are stream segments with overlapping geometry, I'm unable to simply calculate each stream length and sum the for the whole dataset. I believe doing so would 'double-count' in those areas where there is feature overlap.

Is there a way to merge these multiple overlapping features into one, or is there any way to accuracy calculate the total feature extent while avoiding any 'double-counting'?


texts: I am currently creating three carbon distribution maps for three different forest management scenarios. I created a shapefile map with a 1 km x 1 km grid and computed the carbon value per pixel (per km²). Now I created the maps and noticed following problem: In scenario 1 the highest carbon value is 13, in scenario 2 the highest value is 19. However value 13 and value 19 have the same color in the different maps, because they each are the highest values in their scenario. So what I need is that one color is always applied to the same value. I am using a graduated style.


texts:
Can QGIS be installed on Windows 8?
I'm going to buy a laptop with Windows 8, but I have no idea if Windows 8 can run QGIS.


texts: Effectively displaying demographic data on a printed map

texts:
I would like to plot the following per zone (30 zones total) data on a printable/non interactive map:

Average age
Average household income
Number of households
Population density
Number of people
Number of workers

How would you display the above 6 layers effectively on one map?


texts: Writing If-Then statement in ArcGIS Pro field calculator using Python?

texts:
I've been using ArcGIS Pro over ArcMap recently because ArcMap is giving me some incorrect summary statistics that I use to populate a data field in a number of feature classes. The problem is that I'm not very familiar with Python and I haven't been able to translate my VB Script expressions into Python.

The expression considers two data fields from the summary statistics table for each unique Site ID and either gives the study panel number [LAST_panel], or the evaluation status [LAST_Eval_Status] if the status is either "Dormant" or "Reject" and enters a value into a "Panel_Status" field in a point feature class.

Pre-Logic Script Code:

dim PS

if [PARK_GRTS_EVAL_Statistics.LAST_Eval_Status]="Dormant" then
  PS="Dormant"
elseif [PARK_GRTS_EVAL_Statistics.LAST_Eval_Status]="Reject" then
  PS="Reject"
else PS= [PARK_GRTS_EVAL_Statistics.LAST_panel]
end if

PARK_PCM_GRTS.Panel_Status =

PS

In the expression above, PARK is a stand-in for a location code, since there are multiple locations and datasets I'm working with. The workaround I've been using is to create the summary statistics in ArcGIS Pro and then doing the field calculator in ArcMap 10.5 but it would be more efficient if I could do it all in ArcGIS Pro. Plus it would benefit me to learn a bit of Python.

How do I translate this into Python 3?


texts: Using defined function code block with Python in ArcGIS

texts:
I am running a Field Calculation within a Python script in ArcGIS.  Within this Field Calculation I am calling a defined function within a code block.

Here is the dialogue that I ran and works:

This worked.  However, I cannot get this to translate into my Python code:

Here's the code:

#Calculate YSLB
expression = "output(!MTH_BRNT!,!YR_BRNT!,!YSLB!)"
code_block = "def output(MTH_BRNT,YR_BRNT,YSLB):/n month = str(month_val)/n month_current = int(month)/n month_fire = int(MTH_BRNT)/n year = str(high_year)/n year_current = int(year)/n year_fire = int(YR_BRNT)/n Mc = (12*(year_current-1)) + month_current/n Mf = (12*(year_fire-1)) + month_fire/n return (Mc-Mf)/12"
arcpy.CalculateField_management(fuel_age_out,"YSLB",expression,"PYTHON_9.3",code_block)


texts: Attribute Error: 'unicode' object has no attribute 'extent'

texts:
I keep getting this error from this line.

arcpy.CreateFishnet_management(os.path.join(Output_Folder, "Full_Grid.shp"), str(NAR_U9.extent.XMin) + " " + str(NAR_U9.extent.YMin), str(NAR_U9.extent.XMin) + " " + str(NAR_U9.extent.YMin + 10), Cell_Size_Width, Cell_Size_Height, "0", "0", str(NAR_U9.extent.XMax) + " " + str(NAR_U9.extent.YMax), "NO_LABELS", NAR_U9, "POLYLINE")

I can't seem to find anything online about what the 'unicode' part means. I'm giving it specific values for the coordinates for the corners so I don't understand where it's looking for an extent attribute.


texts: Performing surface albedo calculation using Landsat 7 and Google Earth Engine?

texts:
I am trying to run this code with Google Earth Engine but I get an error on a Land sat 7 dataset.

  expression is not a function

my code:

var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T2_SR')
                  .filterDate('2018-01-01', '2018-12-31')
                  .filterBounds(ROI);
var albedo = dataset.expression(
  "((0.356*blue)+(0.130*red)+(0.373*nir)+(0.085*swir)+(0.072*swir2)- 0.018)/ 1.016",
  {
    red: dataset.select('B3'),
    blue:  dataset.select('B1'),
    nir:  dataset.select('B4'),
    swir:  dataset.select('B5'),
    swir2:  dataset.select('B7')
  });


texts: Extracting point data for each lat and long from raster file into a dataframe

texts:
I have gridded data files  ( see sample -each file consist of monthly precip and is label pYYYYMM) https://www.dropbox.com/sh/63z166tjxyu12s5/AAAs3Ccn1zdVoBYMj8Y1o303a?dl=0.

I am trying to extract the point data for each territories of Canada and so that i can get a time series for each lat and longitude within the dataset

library(raster)
files= list.files( ,pattern='*.grd',full.names=TRUE)
s <- stack(files)
# Setting Missing values
s[s >= 170141000918782798866653488190622531584.00] <- NA_real_
# read in my point of interest,
pt<- read.csv("latandlong")

This data is available https://www.dropbox.com/s/3p4u4pyxkyo2q15/latandlong.csv?dl=0

# Setting the data points to spatial value using the first two columns
point <- SpatialPoints(pt)
df1 <- extract(s, point, df=TRUE,method='simple')
write.csv(df1, 'precip.csv')
str(df1)
data.frame':    409 obs. of  1922 variables:
$ ID     : num  1 2 3 4 5 6 7 8 9 10 ...
$ t190001: num  -18.8 -19.6 -20.2 -20.8 -21.9 ...
$ t190002: num  -23 -23.4 -23.8 -24.8 -25.6 ...
$ t190003: num  -14 -14.4 -14.5 -15.3 -15.9 ...

When I run the extract function advised by RobertH, this work but I just need one final step. I also  need the corresponding x-y values and lat / lat coordinates  to be included in my dataframe as well or is there any way to extract data for each territories   directly for each point.


texts: Does UTM Zone 52N belongs to Korea or Malaysia?

texts:
I have a shapefile 'watershd.shp' of a region of South Korea without any projections. I want to view this 'watershd.shp' area along with a point shapefile (point.shp) which I got from Google Earth.
When I define the projection of watershed.shp to UTM Zone 52N, the 'watershd.shp' is shown somewhere between Malaysia and New Guennie. This website shows that the UTM zone for South Korea is 52N while another website shows me that UTM zone 52 N is for Malaysia region and for Korea it is UTM 52 S.
How can I assign correction projection to this shapefile which is without projection, but belongs to Korea region?
The proj file for 'watershed.shp' reads as

PROJCS["Tokyo_Transverse_Mercator",GEOGCS["GCS_Tokyo",DATUM["D_Tokyo",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",200000.0],PARAMETER["False_Northing",500000.0],PARAMETER["Central_Meridian",127.0028902777778],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",38.0],UNIT["Meter",1.0]]


texts:
I checked the official GeoTIFF documentations and there is no reference to color maps. Regardless, I see color maps or tables referenced everywhere, including in other questions.
I am aware that a GeoTIFF can be converted into a RGBA GeoTIFF, but this would simply be a completely different GeoTIFF with the original information lost, unless the legend is also saved separately.
I am asking if there is a way to not change the values of the GeoTIFF and to include in it a threshold based color map (or maybe a rule based one) that can be later interpreted by most software correctly.


texts:
I am using hydrologic modeling software, and it include a grass program that I need to run from the grass shell.

How do I get the grass shell to recognize/run the program?

The program is in the folder "/home/rowan/RHESSys/bin". I have tried to modify the .grassrc6 file, but that does not seem to work.

In the grass shell, the results of g.gisenv:

GISDBASE=/media/sf_C_DRIVE/lassen/grassdata
LOCATION_NAME=lassen_national_forest
MAPSET=PERMANENT
PATH=/usr/lib/grass64/bin:/usr/lib/grass64/scripts:/home/rowan/.grass6/addons:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/rowan/RHESSys/bin:/home/rowan/RHESSys/g2w/grass2world
MONITOR=cairo7
GRASS_GUI=wxpython

Even so, when I type the name of the program "g2w" the grass shell cannot find it, even though it is in the PATH variable.

What am I doing wrong?

The output of ls -la /home/rowan/RHESSys/bin is:

total 3872
drwxr-xr-x 2 rowan rowan    4096 Aug 11 12:29 .
drwxr-xr-x 7 rowan rowan    4096 Aug  7 14:39 ..
-rwxr-xr-x 1 rowan rowan  186476 Aug 11 12:02 cf10.0b2
-rwxr-xr-x 1 rowan rowan   37219 Aug  7 14:52 g2w
-rwxr-xr-x 1 rowan rowan   83094 Aug 11 12:29 lairead
-rwxr-xr-x 1 rowan rowan   32292 Aug 11 11:54 rat
-rwxr-xr-x 1 rowan rowan 3607040 Aug  7 14:50 rhessys5.18

My .bashrc file has:

export 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/rowan/modflow2005/Unix/src:/home/rowan/RHESSys/bin'
export 'GISBASE=/usr/lib/grass64'


texts: Counting the number of times a polygon has been intersected by a buffer layer

texts:
For my final project in a GIS-related course, I have chosen to look at the historical data of earthquakes in California to try and make a kind of risk assessment based on cities and their population density.
For this, I have created a buffer around each earthquake, where the radius is dependent on the magnitude. The resulting circles are then areas of effect.
These two layers look like the following:

What I would like to do is then, for each city polygon, count how many times a buffer intercepts with it, to get a number telling how many times, an earthquake has affected the area.
I have been looking a bit into the "num_geometries" function of the field calculator, but am unaware whether this would be an ideal route to go.
Edit:
The two layers with their unique fields.
The city layer:

The earthquake layer:


texts: Exporting an interactive map to web/online

texts: I have made a map on QGIS for staff locations and symbolised the points by their job position, then created new layers for each position. I then used the qgis2web plugin to export it, but didn't realise that you can't share it with people or upload the link to a website because to everyone else it comes up blank. Is there a way to export a map online so that it can be shared with people who can click on points and find the data attributed to it e.g. staff name etc., and have the legend so people can click on and off layers they don't want to look at e.g. tick off assistants and only look at senior members of staff?


texts: Interpolating a string input into an output layer name in QGIS' Graphical Modeler

texts:
I believe that the answer to my question is 'no' but am hoping that I missed something in my Googling and trawling of StackExchange... I have a simple Graphical Model built in QGIS (2.12) that asks the user to specify a 'Site' string input which will be used to find a matching feature in a shapefile (e.g. 'Dartmoor' or 'Sussex'). A number of operations are then performed to create a buffer around urbanised areas falling inside the site, and the result is then added as a new layer to QGIS.

What I am trying to figure out is if there is any way to have the name of the new layer added to QGIS be 'informed' by the Site specified by the user. Right now, everything gets added with the same name (e.g. 'Urban Buffer') but it would be mighty handy if the output were automatically renamed to 'Dartmoor Urban Buffer' or 'Sussex Urban Buffer' by the model since that would prevent confusion if the user wants to create multiple buffers one after another.

Is there any way to parameterise the  at the end of the model so that it uses the Input string as part of its name?

I've attached a screen grab just to show where the string is coming from (how it's named) and what the last dialogue box is offering. There's no point including the details of the rest of the model since it's only the first input and last output that I'm trying to 'connect' in some way by sprinkling some syntactic sugar in the Buffer spec.


texts: Can I avoid runtime raster interpolation by creating an image pyramid to match the zoom scales?

texts:
For image quality and performance reasons, it would be best to perform interpolation of my large TIFF image of the world (10GB) beforehand to all the zoom scales I need to display at so that MapGuide (my map server) doesn't have to do it at run-time.

Is there a way to determine what zoom scales I should use based on the size of my image pyramids, or vice versa (I'm using GDAL for creating image pyramids)?


texts: I'm making a unit conversion code to convert from an Earth-Centered, Earth-Fixed (ECEF) location to a Latitude, Longitude, and Altitude (LLA) location and vice versa. I'm also making a code to convert from East, North, Up (ENU) to both of these locations as well. I have the code written out but I don't have any reliable data to test my code. Does anyone know of a link I can go to for the different location units of major cities and the north/south poles? If not a link to a reliable conversion calculator would help as well.


texts: clicking button in QueryAttributesTask by code

texts:
I need help, I have a website developed using Argis Server 9.3 and Visual Studio 2008. The map is inside the website via an iframe and it receives the input to be used in a custom query via javascript, this is working fine, except that, the users still have to clic the button of the QueryAttributesTask component to execute the query task. Does anyone knows how can I call the button clic code from another button (like an asp button)?

Any ideas on how to accomplish this?


texts:
I've been through multiple iterations / gyrations, and while there may be multiple problems here, the recurring issue is that the codeblock does not identify the existence of any syntax errors, but when it hits the first instance of drawing a value from a field, I get an error like "FACIL_ID" not defined.

Here's my most recent code:

import arcpy
from arcpy import env
env.workspace = "K:/Geobase/S-file/Floor Plans/GIS/SHP/Workspace"
expression1 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + "-001" + '"'
expression2 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + '"'
MyLength = len(str(SPACENAME))
if MyLength ==4:
  arcpy.CaluclateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression1)
else:
  arcpy.CalculateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression2)


texts: Time distance by roads from specified point (raster analysis)

texts:
I just started to learn arcgis, so even simple tasks looks difficult to me. Can you give me please some guidelines how to create raster where each cell contains time distance by road from specified point?

I have following inputs:

polyline layer with roads (contains table where each road segment has assigned type, so i am able to derive new field with speed limit),
landuse raster,
layer with points (cities).

I read something that it can be done by using network analysis, but I'm interested in raster analysis, since I know some basics about it.

Here is my thoughts:

convert roads to raster via "Polyline to raster" tool (value field: speed)
reclassify roads raster so that, each cell will obtain time derived from speed.
???

Maybe raster analysis contains only distance tools, that computes length as "flight distance". So if network analysis is the only way, what are the steps?


texts: QGIS: Running field calculator from Python. Adding new calculated field

texts:
I would like to add a new field to a layer, creating a new memorylayer from the existing layer. Where I create a new field using the expressions that are available to the "Field calculator" using the code below.
However this does not work, checking the output returns nothing.
InnSA = 'C:/myLayer.shp'
outSA = 'C:/myNewLayer.shp'

oldLyr = QgsVectorLayer(InnSA, "SA", "ogr")
params = {'INPUT':oldLyr, 'FIELD_NAME':'Split', 'FIELD_TYPE':'0', 'FIELD_LENGTH':'2', 'FORMULA':'1 + ((@row_number - 1) % 9)', 'OUTPUT':'memory:'}
newLyr = processing.run('qgis:fieldcalculator', params)

writer = QgsVectorFileWriter.writeAsVectorFormat(newLyr, outSA, 'utf-8', newLyr.crs(), driverName="ESRI Shapefile")
del(writer)

Checking the print output:
>>> print(type(oldLyr))
<class 'qgis._core.QgsVectorLayer'>
>>> print(type(newLyr))
<class 'dict'>

I have used other processing tools in the exact same way (e.g. 'qgis:buffer', 'qgis.extractbyexpression')
What am I doing wrong, and are there better ways of doing this?


texts: I have a function that grabs the vertices of a line feature--why aren't the full lines getting processed?

texts:
I am writing a function called getVertices. It uses arcpy to take a line feature class and turn it into an array of vertex lat/longs. It is a part of a larger script.

Here is the function:

def getVertices(line_feature):

    vertices =[]
    desc = arcpy.Describe(line_feature)
    shape_field = desc.shapeFieldName
    cursor = arcpy.UpdateCursor(line_feature)

    for row in cursor:
        shape = row.getValue(shape_field)
        part = shape.getPart(0)

        for point in part:
            coordinates = (point.X, point.Y)
            vertices.append(coordinates)

    return vertices

It does not work with all line feature classes, however. After processing many different line feature classes, I am seeing that in some of them only a chunk of the line is being processed--maybe the first 30 vertices, for example, or 3 vertices in the middle of the line.

I can't pin down if this is an issue in the function or in the line feature. To be clear, these are simple lines. I've double checked that the line features have no gaps in them.

What could the issue be?

EDIT: Here is the solution, which accounts for the multipart features lurking in my data.

def getVertices(line_feature):

    vertices =[]
    desc = arcpy.Describe(line_feature)
    shape_field = desc.shapeFieldName
    cursor = arcpy.UpdateCursor(line_feature)

    for row in cursor:
        shape = row.getValue(shape_field)
        part = shape.getPart()
        for p in part:

            for point in p:
                coordinates = (point.X, point.Y)
                vertices.append(coordinates)

    return vertices


texts: What is the best way to store Flickr's Shapefiles Public Dataset in SQL Server 2008?

texts:
I'm wanting to import specific locations from the Flickr Shapefile Dataset into SQL Server would like to know what is the best way to store the data in SQL Server 2008?

Link the the 1.0 Dataset: http://code.flickr.com/blog/2009/05/21/flickr-shapefiles-public-dataset-10/


texts: Need specific filenames similar to input files upon conversion to .tif files

texts:
I am working on conversion of multiple .nc files (3 hourly data) to .tif files.

The issue that I am facing is the original file names are as follows: 3B42A.20050101.18.7A.SUB.nc;
3B42A.20050101.21.7A.SUB.nc; 3B42A.20050102.00.7A.SUB.nc; 3B42A.20050102.03.7A.SUB.nc; 3B42A.20050102.06.7A.SUB.nc.... and so on
And on conversion to .tif, it is giving me output files as 1.tif, 2.tif...... But I want original file names in the output, i.e. 20050101.18.tif; 20050101.21.tif; 20050102.00.tif; 20050102.03.tif; 20050102.06.tif;.....and so on for entire year.

Can anyone help me with this. I am working in R.

Naming convention of files is as follows: '3B42A' is the data product name. '2005' is the year 2005, '01' is month and '01' or '02' are dates. '18','21','00','03','06' = data at 6pm, 9pm, 12am, 3am and 6am respectively (i.e. 3 hourly data as mentioned above).

Commands I am using is as follows:

    > library ("raster")
    > library ("ncdf4")
    > rasterfiles   <- list.files("F://TestCoding//Test", "*.nc", full.names = TRUE)
    > d1 <-  stack(rasterfiles)
    > d2=unstack(d1)
    > outputnames <- paste(seq_along(d2), ".tif",sep="")
    > for(i in seq_along(d2)){writeRaster(d2[[i]], file=outputnames[i])}


texts: Extract data from the .dbf affilated with a set of shapes

texts:
I have a set of shapes that I produced from a spatial merge. It has 1.6 million postcode polygons, however when I save it in QGIS to .csv it only saves two thirds of the data. I'm not sure why this happens.

As an alternate plan I've been trying to open the .dbf directly in Python although I haven't been successful yet. It's too large to open in Excel.

Why would only part of my data be written to the .csv in QGIS? Is there an alternate way to extract the .dbf data and convert it to .csv?


texts: Error using ST_AddPoint for adding a new point to a polyline in PostGIS

texts:
I have two PostGIS tables, one where I store points, named "nodes" and another with where I store multilinestrings, named "lines".
I'm trying to append a new vertex to a line using one of the nodes executing a query similar to the following SQL sentence:

UPDATE lines SET
the_geom = ST_AddPoint(the_geom, (select the_geom from nodes where id_node='XXXXX')  )
WHERE id_line='YYYY'

But I get:

ERROR: lwline_deserialize: attempt to deserialize a line which is really a Invalid type

Any suggestions?


texts: Detecting if a geocoordinate point is land or ocean in Java

texts: I'm trying to find whether a given location with latitude/longtitude is a land or water. Is there any library in Java that gives me a result of my question?


texts: Impossible to export a 3D city models as KML tiles

texts: I want to display 3D city models, stored in a CityGML file, in a Cesium Virtual Globe. I used the software "3D City Database Importer/Exporter" to store this data in a PostGreSQL/PostGIS database. Then, to display in a Cesium Virtual Globe, I have to export this data as KML tiles. When I exported a single object, form level LoD2 of detail, displayed as Geometry, a SQL error occured. In the console, it is written the input geometry has an unknown SRID (0). I tried to edit the SRID from 0 to 2154 in the tab Database of "3D City Database Importer/Exporter". Nevertheless, I got the same error. Thus, how to fix this error ?


texts:
I am facing this error while creating a new terrain in Hec RAS ?
Importing 1 of 1: dem_rep.tif
Step 1 of 4: Translating to GeoTiff with SRS...
Error creating Terrain: The system cannot find the file specified
Cleaning up files...
How to resolve it?


texts:
I'm trying to call GDALOpen from a function to open a tiff raster and then use the dataset further in my main or other functions.
This is the code I have so far:

int main( int argc, char* argv[] ){
GDALAllRegister();
GDALDataset *poRasterDataset;
openRaster(poRasterDataset, argv[1]);
...}

void openRaster(GDALDataset * poDataset, char* rasterName){
poDataset = (GDALDataset *) GDALOpen(rasterName, GA_ReadOnly);
...
}

My problem is if I do it this way my program crashes because it finds the poRasterDataset to be empty in main after calling openRaster, but if I call GDALOpen from main I have no problem using the dataset. I'm not very experienced in C++ but I suppose it has to do with how I'm passing poDataset in main after calling openRaster.


texts: Reclassification using (Semi Automatic Plug-in) in QGIS 3.16.3

texts:
I have already performed the classification according to the following classes:
1 Water
2 Built-up
3 Vegetation
4 Bare Soil

Now I wanna reclassify my model according to the proper emissivity values for each class:
0.98 Water
0.94 Built-up
0.98 Vegetation
0.93 Bare Soil
Every time I do the "Reclassification" I get only zero values.


texts:
I  have some shapefiles & I want to implement some known GIS algorithms (buffer, intersection, voronoi, etc) & serve the results using an Openlayers UI through WPS.

A minimal setup could be a WPS platform & and a web page having some Openlayers code.

I did a quick search in ZOO & 52-north but I am not sure where to start.
My feeling is that ZOO intergrates better with Openlayers but even the installation seems too complicated..

Any ideas or even better any success stories (just to avoid re-inventing the wheel)?


texts: Accuracy of coordinates from 1960's Scotland?

texts:
I have been provided with Lat/Long coordinates from a reference station recorded in 1969. When I plot the coordinates into Google Earth the location appears to be out by c.100m. Is this due to the accuracy of the navigation at the time? If so can anyone recommend a way of estimating the equivalent coordinates using GPS available today?

The position in question was in Aberdeen.

The coordinate position was provided as thus: 57 08.95'N; 2 05.68'W.

There was a location sketch which when compared to Goolge Image was out by c.100m.

So if I transform from say ED50 to WGS84 I might be on the right track?


texts:
I'm trying to run slope analysis in ArcGIS. I have written an ArcPy script that converted feature layers to raster files. Now I have a list of rasters (each with a unique name) in the table of contents and I need to run slope analysis to create new rasters for each one. I've written a script that works, but only on the raster at the bottom of the list in the table of contents.

Here is my script:

import arcpy
import os
from arcpy import env
from arcpy.sa import *
# Set the current workspace
in_workspace = r"E:\DEM Files"
out_workspace = r"E:\DEM Files"
MXD = arcpy.mapping.MapDocument("Current")
DF  = arcpy.mapping.ListDataFrames(MXD, "Layers")[0]
rasters = arcpy.ListRasters("*", "TIFF")
for rasters in DF:
        # Set local variables
        inRaster = rasters
        outMeasurement = "PERCENT_RISE"
        zFactor = 1
        # Execute Slope
        outSlope = Slope(inRaster, outMeasurement, zFactor)
        outSlope.Save()
MXD.save()

del MXD`


texts: Which is the correct OpenLayers JavaScript to import?

texts:
In the OpenLayers examples online such as this one:
https://openlayers.org/en/latest/examples/accessible.html

I see them import the following script:

<script src="https://openlayers.org/en/v4.6.4/build/ol.js"</script>

However, in many places online such as this SE question:
OpenLayers take user input of XY and create a point

I see them use this script for open layer:

<script src="http://openlayers.org/api/OpenLayers.js"></script>

What are the differences? Is it just a version difference? Why is one called ol.js and the other OpenLayers.js?


texts: When adding one polygon over another polygon the last added polygon is going behind existing polygon

texts:
I'm drawing a geological map so I've several polygons in a single layer as geological units. After finishing the map I need to add a few new geological units (means new polygons), but they are all overlapping one or more existing polygons.

If I draw a new polygon by "duplicate and digitize" tool or not the polygon is always going behind the existing polygons. Otherwise I tried to do by "add ring" on a single polygon there is no problem but if it comes across overlapping more than one polygon at this time "unknown error occurred" message displays.


texts: Import KML to Postgis and preserve style

texts:
We have a number of KML files we have authored and are currently using Google to share with end users.

For future needs, we would like to import these documents into a Geo Spacial database (we choose PostGIS). We later want to be able to display these KMLs in client applications. We have not picked a client end rendering tool yet but it will likely be something like OpenLayers or Leaflet.

After experimenting with importing the KML to PostGIS using ogr2ogr we have found that the style specification in the KML (given in Style elements and linked to from features with StyleURL elements) are not being translated to the layer tables generated by the tool. We are able to reassemble the layers in a viewer like QGIS but since the styles do not translate we lose icons, colors, transparencies, etc.

Is there in option for ogr2ogr to import this data to PostGID? Or another compatible tool? What would be the logical step to preserve these styles and allow a client rendering tool like OpenLayers/Leaflet to display them in their original form?


texts: Applying correct ZIP Code when Geocoding?

texts:
I need to batch geocode a set of addresses, some of them are missing the zip code causing the lat/lng to be placed incorrectly.

Is there a good way easily correct this?

I am using a few geocoders, GPS visualizer, Esri's US streets geocoder, and OSM geocoder in QGIS.


texts: Locating points based on location and attribute difference using ArcMap

texts:
I am not sure if this is feasible or not but here is what I am looking to do:

I have a point feature class where a certain set of the points all fall within 10-15 feet of another point. Ideally, those two points would share the same attribute value (address).

How do I locate all the points that are within 15 feet of another point but only the points that DO NOT have a matching address?


texts: Clickable hyperlink from GeoJSON field in feature

texts:
How do I make a URL a hyperlink when the information is called from a GeoJSON field? I have tried adding html tags, but since the link is not in-line, it does not work. (Script below) LOC_Catalo is the field with the URL.

  // load GeoJSON from an external file
 $.getJSON("Syriashape.json",function(data){
// add GeoJSON layer and popups to the map once the file is loaded
L.geoJson(data, {
   style: function (feature) {
   return {};
   },
   onEachFeature: function (feature, layer) {
       layer.bindPopup(feature.properties.Sheet_Numb + "</br>" + "  " + feature.properties.LOC_Catalo);
   }
}).addTo(map);
  });


texts:
I have a polygon shapefile cotegorised according to a specific field. I want to present that 3D with the help of Qgis2three.js (sth like that). I have installed the plugin and have chosen the polygon settings from Qgis2threejs window but when I clicked run button the browser lagged (didn't respond) temporarily and then the result windows showed nothing.

What is the problem?


texts: Why is SQL Server 2019's STDistance Very Slightly Different Than The Vincenty Formula? (Same Up To ~0.0001km)

texts:
I'm trying to make a C language equivalent to STDistance. Through research, I've narrowed down what STDistance uses, which apparently is the (inverse) Vincenty Formula. The problem is, I've tried comparing a few different pairs of lat-long points in STDistance and using the Vincenty Formula, on here and also using this Python code (with the lat/longs filled in):
import geopy
from geopy.distance import geodesic

point1 = ()
point2 = ()

print(geodesic(point1, point2).km)

And also, I converted STDistance meters to kilometers by dividing the result by 1000. The thing is, once the results get past the 4th decimal point they seem to be completely different. I understand this is relatively negligible, but I'd like to figure out why this is happening. Is the problem related to floating-point errors that happen in SQL Server? Rounding? Or perhaps something else, like a bug?
Here's an example:
Using the two random lat-long points, (35.22229, -119.02138) and (38.148205, -121.0777), here are the results I get.
SQL Server Code:
DECLARE @g geography;
DECLARE @h geography;
SET @g = geography::STGeomFromText('POINT(-119.02138 35.22229)', 4326);
SET @h = geography::STGeomFromText('POINT(-121.0777 38.148205)', 4326);
SELECT @g.STDistance(@h);

Python Code:
import geopy
from geopy.distance import geodesic

point1 = (35.22229, -119.02138)
point2 = (38.148205, -121.0777)

print(geodesic(point1, point2).km)

Now, from SQL Server I get the result, 373073.004092576 (in meters), or in kilometers, 373.073004093. On the other hand, from Python, I get 373.07302837349175 (in kilometers). And then finally, from here (the inverse calculator) I get 373073.028 (in meters), or in kilometers, 373.073028.
Any idea what's happening with this?


texts: Tabular editing of feature layer in ArcGIS Online?

texts:
I have a point feature layer in AGOL that contains the locations, station names, and a bunch of other metadata attributes (when the site was created, whether or not it's active, etc.)

Is there a good way to allow selected editors to edit the data in the attribute table without going through a pop-up?

The ideal scenario would be to join the point locations with a google sheet containing the attributes. I know that this can be done by publishing a google sheet csv to web, but those can't be saved as an item in AGOL, and I want to use this layer in multiple maps.

I am also considering ArcGIS Pro and Desktop for editing, but the users that need to edit have no GIS experience.


texts: I'm new to arcgis and arcpy, so some of my lingo and terminology may be off. I have a script that takes a feature layer as an ainput. From there I want to be able to count the number of selections in the feature layer. I also want to determine what type of layer it is, i.e. polygon, polyline, point, etc. Again, my terminology may be off. Can anyone help me with this??


texts: Clipping multipatch with 2D polygons using ArcGIS Pro

texts:
I am using ArcGIS Pro.
I have a multipatch dataset and 2D polygon dataset.
Is there an automated way how I can clip one multipatch into separate features?
Using clip and split tools gives a topological error. I have a lot of features, which means that using editing tools won't work. Converting multipatches to a footprint can help clip the features, but can I recreate essentially the same multipatch, only split in some parts.
For example, I have polygons named 1147, 684 and 56 (shown in red, outlines in black). They are overlayed by one multipatch (shown in purple, outlines in red). I need to create 3 separate multipatches, which I can add attribute data with spatial join.
There are also multipatches that do not intersect with 2D polygons. In this example, that is not the case, but multipatch area can be bigger than 2D polygons, for which I have to use some sort of fusing.


texts: How to extract a land cover type from Corine Land Cover raster in R

texts:
I would like to know how I can extract a certain land cover type from a CORINE raster (GeoTiff) in R. I have the .tif file read in using raster function from raster package.

How can I binarize this raster so that land cover "Pasture" land cover type, which happened to have the value 231, is converted into 1 and all the others are turned into 0. Below is a piece of code you can use to explain your answer. I would like to save this new raster as a new raster.

raster("CLC2018_CLC2018_V2018_20.tif") -> corine   # Read in using raster function from raster package
plot(corine) # Gives the map below.

Thanks in advance!


texts: What GIS editors work with GIS data that is stored in SQL-Server

texts: If I store my vector GIS data in SQL-Server, what editors can I use to edit the GIS data?


texts: Adding GeoJSON tile set to an existing map

texts:
I'm confused on how to add my GeoJSON tileset to an existing map built with a default style. Do I add the GeoJSON by ID or by style? Here is what I'm working with now.l

Added .geojson to Tilesets as FCC_States2_4326-7v9iga
ID = mmcinnis.crxr86ot

style made with tileset:
mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy

    <script>
    mapboxgl.accessToken = 'pk.eyJ1IjoibW1ja...';
    var map = new mapboxgl.Map({
        container: 'map',
        style: 'mapbox://styles/mapbox/light-v10',
        //style: 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy',
        center: [-99.9, 41.5],
        zoom: 1
    });

    map.on('load', function () {
        map.addSource("fcc-states2-4326", {
            type: "geojson",
            data: "mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy"
        })

        map.addLayer({
            'id': 'example',
            'type': 'fill',
            'source': "fcc-states2-4326",
            'layout': {},
            'paint': {
                'fill-color': '#088',
                'fill-opacity': 0.8
            }
        });
    });
    </script>


texts: What is ArcGISCacheMgr.exe and why does it have a lock on my folder?

texts:
I've got a 10.0 gp service running on Windows Server 2008.  The gp service writes to a folder on the server.  The parent of this folder is shared.

When it comes time to delete folders on the server, occassionally I find that it is locked by ArcGISCacheMgr.exe.

Does anyone know what this process does, or how I can get it to let go of my folder?

Update: The ArcGISCacheMgr.exe process is running under the ArcSOC user account, so this makes me think it has something to do with ArcGIS server.  (The folder is created by the gp service.)


texts: Using more than one condition in a CASE expression

texts:
I am currently trying to update the attribute "barcode" of layer that has many features.
If the value is null or "0" then I take the value from barcode 2.
I wrote the code bellow: The first condition (value is null) works well, just the other does is ignored apparently, any idea why this happens?
CASE WHEN ("barcode"is null  or '0') THEN
 "Joined layer_barcode_2 "  ELSE "barcode" END


texts:
How do I create an attribute list from points that run along roads in a shapefile containing road data?

The points don't intersect the road centre lines and are not consistent in their distance from the roads.


texts: Create 3mx3m Vector Grid on Worldmap with equirectangular projection in QGIS

texts:
I would like to create a 3meter x 3meter Raster Grid on a Worldmap in QGIS. I am fairly new to the whole topic but I have found out that the equirectangular projection should be the most accurate, like displayed here

I am currently using MMQGIS to draw grids but I have problems finding the right granularity and rendering it on the whole map. How can I make sure I am getting 3mx3m grids and which world map should I download?

I later want to index each rectangle and from my calculations there should be about 57 Trillion is that correct?

510 * 10^14 (size of world) / 9m2 (size of grid) := 5.667 * 10 ^13 := 57 Trillion


texts: Leaf Area Index (LAI) processing software

texts:
I took a bunch of hemispherical vegetation images with a fisheye lense in the field. Now I am looking for a software that can (semi-)automatically translate these images in LAI values. So far I struggled with CanEye but didn't get results.
Anybody knows a good freeware solution?


texts: Leaflet: trying to calculate tile row and column

texts:
I have a map, where I am using EPSG:25832 as CRS, and I am trying to add a tilelayer, which needs to get tileinformation in EPSG:3857 CRS - let me elaborate on that:

The source, from where I retrieve my data, has an URL, in this format "x={x}&y={y}&z={z}". So, I am trying to convert the data I have, in the "getTileUrl", which I am overriding.

I have tried using the functions specified here:
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#ECMAScript_.28JavaScript.2FActionScript.2C_etc..29 in the hope of calculating the tileinformation in that manner.

I did somewhat get it to work, by doing the following:

         baseLayers['dotLayer'].getTileUrl = function (tilePoint) {
         var toRet;
         var newPoint = L.point([tilePoint.x, tilePoint.y]);
         var _x = LeafletMap.containerPointToLatLng(newPoint);
         //long2tile(lon,zoom)
         var _newX = parseInt(Math.floor( (_x.lng + 180) / 360 * (1<<tilePoint.z) ));
         //lat2tile(lat,zoom)
         var _newY = parseInt(Math.floor( (1 - Math.log(Math.tan(_x.lat.toRad()) + 1 / Math.cos(lat.toRad())) / Math.PI) / 2 * (1<<tilePoint.z) ));
            toRet = L.Util.template(this._url, L.extend({
                s: this._getSubdomain(tilePoint),
                x: _newX,
                y: _newY,
                z: tilePoint.z
            }, this.options));

            return toRet;
        }

I also tried the "tile2long / tile2lat"-functions, but I could not find out how to use result correctly in proj4js, or find out how to use the result from that...

Sadly, this results in me getting something back, but not what I wished for: I am getting the same tile in each tile, if that makes any sense?

So, my question is, how will I make this work as intended? Kindly let me know, if I am not supplying all info needed - and no, I can not change it to a WMS, sadly.

Best regards.


texts: Specifying element type for DXF creation using ogr2ogr

texts:
I am trying to create a DXF from a Polygon Shapefile using ogr2ogr:

ogr2ogr -f DXF parcels.dxf parcels.shp

The problem is that the polygons are written as hatch elements.

How do I specify that ogr2ogr should create LWPOLYLINE elements (Or any other supported type)?

I have tried this from command line and from QGIS 'save as' option with the same result.  I don't remember this being an issue in the past, but seems like it started with GDAL version 1.10.x.


texts: Unable to run scripts with arcpy using ArcGIS Pro and Pycharm?

texts:
I have installed ArcGIS Pro 2.0 which runs Python 3.5.3. I am trying to get started with the Arcpy library using the IDE PyCharm.
I started a new project and pointed to the python file of the ArcGIS Pro installation (interpreter):

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe

Then I tried to execute the following two lines of code:

from arcpy import env
arcpy.env.workspace = "C:/Users/me"

And I get an error:

 from arcpy import env
 ImportError: cannot import name 'env'

I tried as well with different modules from arcpy but they all return the same error; meaning that they can not import each module.

Then I tried to run the same lines of code through the Python Console embedded in PyCharm and it works.

What am I missing here?


texts:
I am trying to edit .tif rasters in python, but I have some issues regarding the tiff to array conversion.
I read there are multiple options for opening rasters (gdal, PIL, matplotlib), but which of those is the best for allowing me to convert to array, edit (apply local filters), then convert back to .tif?

For example, I get a strange result when opening arrays from a .tif raster using PIL library.

The code looks like this:

import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.cm as cm
import numpy as np
import pywt as pw
import tkFileDialog as tk
from PIL import Image

def fct(fisier):
    img = Image.open(fisier)
    arr=np.array(img, dtype=np.float)
    plt.imshow(arr, cmap=cm.Greys_r)
    plt.show()
    print(arr)
    return arr, img
file = tk.askopenfile(initialdir='C:/temp', mode='rb')
fct(file)

But the array that is displayd in all white, and has this form:

[[ -2.14748365e+09  -2.14748365e+09  -2.14748365e+09 ...,   0.00000000e+00
    0.00000000e+00   6.19762981e+08]

What do I need to do in order to open the tiff raster as an array, so I can edit it further?


texts: Need to change the histogram values in ERDAS Imagin 2014

texts:
Can I change values in a histogram column in the attribute table of continuous or thematic raster image in ERDAS Imagine 2014?
If yes, please explain where and how!


texts: What projection should I use to find true distance between two points?

texts:
I am a beginner of ArcGIS and I encounter a problem of true distance.

I used "create fishnet" to have a grid map within 0-40N, 20E-90E.
Suppose each two points are connected with a railway/road (which does not follow the great circle path of the two points), is it still possible to know the true distance in kilometers of this railway/road between two points? Especially when the two points has a huge difference in latitudes.
I found this difficult because the fishnet is built using coordinates, and it seems projection use degree as linear unit could not give true distance if not along the Equator or a specific longitude.


texts:
I'm using ubuntu 18.04 and if I download QGIS 2.18 and I try to run it, I get this:

libpng warning: Application jmp_buf size changed
Segmentation fault (core dumped)

If I try with QGIS 3.2, the error is:

libpng warning: Application was compiled with png.h from libpng-1.6.34
libpng warning: Application  is  running with png.c from libpng-1.2.56
libpng error: Incompatible libpng version in application and library

So it's clear that the problem is with libpng.

I purged libpng-dev and reinstall again but nothing changed.

I tried to purge libpng16-16 but I get:

sudo apt purge libpng16-16
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgdk-pixbuf2.0-0 : Depends: libpng16-16 (>= 1.6.2-1) but it is not going to be installed
                      Recommends: libgdk-pixbuf2.0-bin
 libgtk-3-0 : Depends: libcairo-gobject2 (>= 1.10.0) but it is not going to be installed
              Depends: libcairo2 (>= 1.14.0) but it is not going to be installed
              Depends: libfontconfig1 (>= 2.12) but it is not going to be installed
              Depends: libpango-1.0-0 (>= 1.40.5) but it is not going to be installed
              Depends: libpangocairo-1.0-0 (>= 1.40.5) but it is not going to be installed
              Depends: libpangoft2-1.0-0 (>= 1.40.5) but it is not going to be installed
              Depends: adwaita-icon-theme
              Recommends: libgtk-3-bin
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

and then:

~$ sudo apt install libgdk-pixbuf2.0-bin libgtk-3-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgdk-pixbuf2.0-bin is already the newest version (2.36.11-2).
libgtk-3-bin is already the newest version (3.22.30-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
~$ sudo apt install libgtk-3-0 libgdk-pixbuf2.0-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgdk-pixbuf2.0-0 is already the newest version (2.36.11-2).
libgtk-3-0 is already the newest version (3.22.30-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

At this point I'm afraid of breaking something if I continue trying things, so I come here for advice before.

I deleted and reinstalled ubuntu. I installed first thing qgis and it was working. Afterwards I compiled gdal, from source to have it from python as stand alone. It might be this, but I had done this previously without any problems.


texts: Cause of MapServer Internal Server Error: Premature end of script headers: mapserv.exe?

texts:
I have changed MapServer version up to 6.2, changed folders Apache/cgi-bin and Apache/php, and replaced file cgi-bin/libmap.dll with ignore/oracle/libmap.dll.

When I type 'mapserv -v' in cmd it shows me 'input=oraclespatial', but when I try to open in browser localhost/cgi-bin/mapserv.exe there is 'Internal Server Error' and 'Premature end of script headers: mapserv.exe' in logs


texts:
I have an OpenLayers  map with EPSG:3857 projection. I would like to add WMTS layer http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/ORTO which support only matrix for EPSG:2180 and 4326.

Is any way to reproject this WMTS layer?

I was trying with this code but the layer is shown in wrong place.

    var WMTS2 = new ol.layer.Tile({
                    opacity: 0.5,
                    extent: projectionExtent,
                    source: new ol.source.WMTS({
                        url: 'http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/ORTO',
                        layer: 'ORTOFOTOMAPA',
                        matrixSet: '2180',
                        format: 'image/jpeg',
                        projection: 'EPSG:2180',
                        tileGrid: new ol.tilegrid.WMTS({
                            origin: ol.extent.getTopLeft(projectionExtent),
                            resolutions: resolutions,
                            matrixIds: matrixIds
                        }),
                        extent: projectionExtent,
                        style: 'default'
                    })
                });


texts: Where to find books or course materials to help prepare for Esri Technical Certification in ArcGIS Desktop and Developer?

texts: Where I can find books or course materials to help prepare for Esri Technical Certification in ArcGIS Desktop and Developer?


texts: GeoDjango error: Only numeric values of degree units are allowed on geographic DWithin queries

texts:
I'm trying to get N points within 5000 meters of a certain point. My database is Postgres(PostGIS). I have a model like this:

class Theatre(models.Model):
    geom = models.PointField(srid=4326, blank=True, null=True, default=None)
    objects = models.GeoManager()

Then I ran a couple lines in Django shell:

Theatre.objects.filter(geom__dwithin=(GEOSGeometry('POINT(30.111199 -97.309990)'), D(m=5000)))

and I get the error:

ValueError: Only numeric values of degree units are allowed on geographic DWithin queries.

I found the documentation in here and it discusses calculating the geometry distance. What am I doing wrong?


texts: Changes in esri config in VS2010 has no effect

texts:
I've created a DockableWindow in my Add-In (vs 2010, c#, arcobjects 10 sp2) and the esri config was updated with the following:

<DockableWindows>
    <DockableWindow id="CTArcMapAddin_AreasDockWindow" class="AreasDockWindow+AreasDockWindowImpl" caption="Areas" image="Images\AreasDockWindow.png">
      <InitialPlacement height="300" width="250" state="unpinned" position="left" />
    </DockableWindow>
  </DockableWindows>

I run the Add-In and the dockable window shows up on the left side...

Then when changing the "position" value to "right" and running the addin again it's still positioned to the left...why does that change not show through...a bug maybe?


texts: Clipping multiple rasters by set distance / extent in QGIS

texts:
For a current project, I have 72 geo-referenced OS maps in place.

Unfortunately, all maps have a narrow border with the grid squares / scales on (see image), which obscures the sides of the adjacent maps.

Is there any way to clip this border from all the rasters at once / in bulk, without having to manually clip each raster by extent?

All maps are saved as .jpgs with corresponding TAB-files.


texts: What projection to use for many parts of the world

texts: I'm creating a poster which has many separate maps (rivers of the world). I'd like to use a similar projection for each of them, so they're comparable in terms of shape and size. I guess I want some parameterized projection, but which are good candidates, and what parameters to use?


texts: Bulk exporting of maps based on attribute table using QGIS?

texts:
I have 73 locations that I have plotted in my attribute table, which I've labelled and can successfully create a map using Template Selector and then export this to a PDF for processing.

Is there a way to export every entry in the attribute table to a map without having to go through them one-by-one?

I'm using QGIS 2.18.14


texts: Adding pictures to Print Composer from paths in table using QGIS?

texts: For each feature I want a picture related to that feature. So its obvious to have written a path in the tables attribute. Then I´ll label that attribute somehow by brackets like [%path%]. But it´s not that simple and need some guidance how to write it correctly?


texts: QGIS 3.10.1 shapefile layer and imported aerial are not matching up

texts:
I am having trouble matching up the shapefile Annex downloaded from the City of Bellevue, WA GIS page and the Google satellite imagery loaded as an XYZ Tile layer from the URL https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}.

The Annex shapefile shows up in Africa somewhere when it should be showing up in the Pacific North West in Washington State. I have set the CRS for the project to WGS 84 EPSG 4326. I have also set the aerial and the shapefile layer CRS to the same WGS 84 EPSG 4326.

Can someone try this and see what is going on here?


texts: Creating closest distance line between points and lines in QGIS

texts:
QGIS
I have multiple lines in one layer (trench) and multiple points in another later.

I've searched the whole Internet for a plug-in which can: connect points to the nearest line, creating a new line in a new layer.

Maybe the plug-in is already there, but I couldn't find it...

What I have:

Desired output:


texts: Writing GeoJSON data into PostGIS in perl?

texts:
I am working with GeoJSON files and need to store them in PostgreSQL using perl.  I can do this in 2 steps:

open (JSON,">$path/tmp/current.json");
print JSON $fullJSON;
close JSON;

followed by:

`/usr/bin/ogr2ogr -f "PostgreSQL" PG:"dbname=database user=datauser" "$path/tmp/current.json" -nln datatable -append`;
 unlink ("$path/tmp/current.json");

But I was hoping for a pure perl solution, without using the ogr2ogr executable.  I was reading about Geo::GDAL, but not sure if this is the right tool.

I was experimenting a bit with some code I found:

my $sth = $dbh->prepare("INSERT INTO datatable (geom) VALUES (GeomFromEWKT('SRID=?;POINT(? ? ?)'));")

But couldn't quite get the syntax right.  The whole JSON string is:  $fullJSON

If anyone has any info or code to perform this task, I'd love to see it.  It seems pretty straight forward.


texts: Conditional formatting with color and icon for table in print layout

texts:
I used the conditional formatting option in the attribute table (figure 01) in QGIS 3.12.

I created a layout with the map and the attributes table (figure 02). With the option “apply layer conditional styling colors" (figure 03). But the icon (symbol) did not appear in the table.


texts: Importing .gpx/.shp file via ogr2ogr into postgis db

texts:
I have a file with lines that make up the european coastline, and I'm trying to import it into my database. This is what I tried:

ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres password=1234 dbname=gisdb" test.gpx

***Between the command and the error there's a crap ton of stuff that looks like this: C5941E00209CA85032B412CD49AD2727C5941 ***

ERROR 1: Terminating translation prematurely after failed
translation of layer tracks (use -skipfailures to skip errors)

Edit: I think I should point out the file is about 6 million lines long, if that's helpful.

Result of ogrinfo -so test.gpx tracks:

ogrinfo -so test.gpx tracks
Had to open data source read-only.
INFO: Open of `test.gpx'
      using driver `GPX' successful.

Layer name: tracks
Geometry: Multi Line String
Feature Count: 1
Extent: (943609.753900, 267126.306700) - (7136351.648900, 6825119.320900)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
name: String (0.0)
cmt: String (0.0)
desc: String (0.0)
src: String (0.0)
link1_href: String (0.0)
link1_text: String (0.0)
link1_type: String (0.0)
link2_href: String (0.0)
link2_text: String (0.0)
link2_type: String (0.0)
number: Integer (0.0)
type: String (0.0)
ogr_Shape_Leng: Real (0.0)


texts: Printing with ArcGIS API for Javascript?

texts:
Any examples of how to print a map using the ArcGIS API for Javascript (JSAPI)?

All from the client?


texts:
I have noticed in the QGIS source code that the map layers gets added in two
different places, in the Canvas and in the registry as follow:

    QgsMapLayerRegistry::instance()->addMapLayers(theMapLayers, TRUE);

    //! Create the Map Canvas
    m_pMapCanvas = new QgsMapCanvas(0, 0);
    // Set the Map Canvas Layer Set
    m_pMapCanvas->setLayerSet(myRList);

It seems like two separate copies of the map layers is being added to two different places, is there is away to make this more efficient?


texts: How to use hyperlink for image popup in web map based on QGIS 3.4.3?

texts:
I have a point shapefile layer, that I added into it a hyperlinks row. Each hyperlink is for a image, all in me dropbox.
When I identify a point, I see the selected image.
However, when I export it to web map with QGIS2WEB plugin, I see only the hyperlink not the image. When I click on the hyperlink the image is open in a different window.
I like to see the image directly, can it be done?

Here are the steps I made:

In the layer properties I selected "Attachment" in the "Widget Type", I click on the "Use a hyperlink for document path (read-only)" and set the "Integrated Document Viewer" on Image type.

At this point I was able to create a hyperlink from the attribute table.

On QGIS the image is visible, using identify feature

As I wrote, when I use the QGIS2WEB plugin, I see only the link and not the image.

How can see these image directly?


texts: How to reproduce Stamen's Toner PostGIS setup?

texts:
I'm trying to render Stamen's toner map with Landez which uses Mapnik. The style I'm rendering is from Stamen's toner project. I'm using the one which only renders labels (no lines). I imported the portion of osm (not planet) using osm2pgsql and I've also ran the motorway script. I have not imported the natural earth, because I cannot download the data (https://github.com/Citytracking/toner/issues/53), but I doubt I need it for text labeling only.

In the style its asking for map source from table (or perhaps view) such as "admin1_labels_50m_z5", but I have no idea the sources of these tables or views? How to create them?


texts: Combining polygons that are within another polygon using ArcGIS Desktop

texts:
I have two layers of which one represents the catastres and another one represents the areas of the town that are flooded (represented as risk levels 0-3).
As these two maps are combined the following picture is created:

Initially, I had manually put a risk level for each catastre, however, this does not accurately represent the level of risk and is fairly tedious to do later on when the same ask shall be repeated for other sites.
Is there a way to assign within the Attribute Table for the layer of catastres a risk level based on the significance of flooding within its boundaries (i.e. if 90% of the total area of catastre is flooded, then the risk level assigned is 3 if 60%-89% of the total area of catastre is flooded then risk level assigned is 2, if 1-59% of the catastre is flooded then risk level is 1, etc.)?
For the "Catastres" I have all of the XY coordinates and the area within the attribute table and for the flood area, I also have all of the XY coordinates and areas. I have so far tried the select by location/attributes/union commands.


texts: Why is the 'Shape' field not removed from list using del built in function?

texts:
I am preparing a table from a polygon feature class in order to write a CSV file. Therefore I want to remove certain fields from the table, as they are not needed in the final CSV product.

I first tried using this method, which did not remove the 'Shape' field from the list. The other two fields were removed successfully though.

import arcpy

workspace = r"X:\TEST\testDEMABOECK.gdb"
version = u"Test"

arcpy.env.workspace = workspace
arcpy.env.scratchWorkspace = workspace
arcpy.env.overwriteOutput = True

outDEMABOCK = """{}\\Testriver_DEMABOECKcalc_{}""".format(workspace, version)

# Table handling
arcpy.MakeTableView_management(outDEMABOCK, "tempTable")

fields = [field.name for field in arcpy.ListFields("tempTable")]
for index, field in enumerate(fields):
    if field == "Shape" or field == "Shape_Length" or field == "OBJECTID":
        del fields[index]

print fields

##[u'Shape', u'typeID', u'Shape_Area', u'hvAWB', u'hvPCA', u'hvRWB', u'hvTIZ', u'kfAWB', u'kfPCA', u'kfRWB', u'kfTIZ', u'typeName', u'Holzkubatur_m3_km2', u'Holzkubatur_m3']

I then found this post on GSE, which guided me in the right direction. The following solution did remove the 'Shape' field.

import arcpy

workspace = r"X:\TEST\testDEMABOECK.gdb"
version = u"Test"

arcpy.env.workspace = workspace
arcpy.env.scratchWorkspace = workspace
arcpy.env.overwriteOutput = True

outDEMABOCK = """{}\\Testriver_DEMABOECKcalc_{}""".format(workspace, version)

# Table handling
arcpy.MakeTableView_management(outDEMABOCK, "tempTable")

notNeeded = ["Shape", "OBJECTID", "Shape_Length"]
fields = [field.name for field in arcpy.ListFields("tempTable") if field.name not in notNeeded]

print fields

##[u'typeID', u'Shape_Area', u'hvAWB', u'hvPCA', u'hvRWB', u'hvTIZ', u'kfAWB', u'kfPCA', u'kfRWB', u'kfTIZ', u'typeName', u'Holzkubatur_m3_km2', u'Holzkubatur_m3']

Why does the second method work but the first does not?

The answer in above link does not go into detail.


texts: just started learning how to use carto using the tutorial HERE. My sidebar isnt shown anywhere on my dashboard. How do i find this so that i can continue with the tutorial.


texts: Add an incremential number to each feature in a FeatureCollection in GEE

texts:
Bit stuck at the moment on this. I need to add an incremental number (1:total length) to each feature in a FeatureCollection in Google Earth Engine.
So consider for instance the GAUL dataset as example. How would I add each of these newids to the dataset (one unique id per feature) ?
dataset = ee.FeatureCollection("FAO/GAUL/2015/level0")
newid = ee.List( list(range(1,dataset.size().getInfo() )) )

I can map a function to add a field, but this in itself needs to be mapped over the newid list I imagine?
def addField(feature, id):
  return feature.set({'sum': id})
dataset = dataset.map(addField, id)

Happy for any hints in javascript or python


texts: How to join two tables and convert joined table to a vector layer containing points in QGIS?

texts: I have one table that contains 450 locations and a table that has 10'000 rows containing data and no spatial information. I have a column that allows me to join them. The issue is that I want to have the joinig to take place by having my data table as main table. Therefore the solution of using the data table and converting it to a shape data and joining it with my data layer is not an option since it creates a file with only 450 rows and which obviously was not the intended result. What would be the solution to this problem.


texts: How to decide what type of GIS to use for my study project?

texts:
I'm a student and currently taking a self directed project course.

In our assignment, we were given a bunch of shapefiles and the goal is to make a tool, which would display all the data based on the parcel identifier and do some basic queries (i.e. which parcels are designated as having a commercial land use). The data would also be periodically updated to accommodate changes (ex. a parcel being re-zoned with a different land use).

One other constraint is that one of our "clients" has no previous experience with GIS while the other is quite advanced.

At first, I thought of creating a database in Access, but this lacks a spatial component to it. I've also considered mashups.

What are some other ways to approach this problem?

Thanks for your help!


texts: Change number of decimal digits for features in ArcGIS 10?

texts: I am editing vertices in polygons and points in ArcMap 10, and realised that they only hold 3 decimal digits for the X, Y coordinates, but I would like at least 6 decimal digits. Even if I type in more digits, it gets rounded up to 3. How do I change this? Thanks.


texts: how to put marker on particular lat,long in openlayers?

texts:
I am unable to put marker on specific lat,long here what is i am trying..

<script src="http://cdnjs.cloudflare.com/ajax/libs/openlayers/2.11/OpenLayers.js"></script>

<script>
  function init() {
    map = new OpenLayers.Map("basicMap");
    var mapnik         = new OpenLayers.Layer.OSM();
    var fromProjection = new OpenLayers.Projection("EPSG:4326");   // Transform from WGS 1984
    var toProjection   = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
    var position       = new OpenLayers.LonLat(77.5656523,22.545454).transform( fromProjection, toProjection);
    var zoom           = 3;

    map.addLayer(mapnik);
    map.setCenter(position, zoom );

    var markers = new OpenLayers.Layer.Markers( "Markers" );
    map.addLayer(markers);

    var lonLat = new OpenLayers.LonLat( 77.1279688 ,51.5043436 );

        var size = new OpenLayers.Size(30,30);
        var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
        var icon = new OpenLayers.Icon('../../assets_icon/sm_icon/lorry1.png', size, offset);
    var marker = new OpenLayers.Marker(lonLat,icon);
        markers.addMarker(marker);

     marker.events.register("click", marker, function(e){
     popup = new OpenLayers.Popup.FramedCloud("",
                           marker.lonlat,
                           new OpenLayers.Size(200, 200),
                           "here lies your information",
                           null, true);

      map.addPopup(popup);
    });

      }
</script>

Edit

what is here i am missing?


texts: How can I obtain the unit of a projection SRID?

texts:
Given a projection SRID, is there a way I can obtain the coordinates unit string (meter, degree, ...) ?

In PostGIS for example, it looks like it is present in the srtext column of spatial_ref_sys. Should I parse that block of text or is there a shortcut somewhere ?

Is there something in libproj directly ?

Thanks !


texts: Get min-max values of a raster and populate two parameters with the values in tool validation script

texts:
I am customizing the script tool behaviour of a custom script and would like to get the min-max values from a raster self.params[0] and populate the next two parameters, self.params[1] and self.params[2], with these values. Here is what I have so far but of course, it doesn't work.

  def updateParameters(self):
    """Modify the values and properties of parameters before internal
    validation is performed.  This method is called whenever a parmater
    has been changed."""

    if self.params[0].altered and self.params[0].value:
        paramInRaster = arcpy.Raster(self.params[0])
        minVal = paramInRaster.minimum
        maxVal = paramInRaster.maximum
        self.params[1].value = minVal
        self.params[2].value = maxVal
    return


texts: Managing a database with GIS: How can I fill a database with attributes?

texts:
I have a database in Google Earth from plots of land all over a city, I have information in different folders of the server. I want to analyze its financial feasibility and connect it with the server if possible. So, I want to extract (or input information in the GIS). I need to retrieve key attributes that for the analysis of every plot that is (land use, slope, average housing price in 3.5 and 4. 5 km radius, and other conditions). I was thinking of filling the necessary information as an attribute in a shapefile using QGIS the extracted to an Excel spreadsheet. However, I am not sure how to do so.

How would you build such a database?


texts: Opening .tab files associated with .lbl files in ENVI

texts: I need to open .tab files containing location information of chandrayaan-1 HYSI dataset. It contains four ASCII columns: longitude, latitude, pixel and scanline data. I need to open the .tab file as raster containing two bands- longitude and latitude for creating GLT file for georeferencing the HYSI dataset. How do I achieve this?


texts: Generate tiles with EPSG:4326 projection using Mapnik

texts:
I'm trying to generate tiles from a PostgreSQL database that contain OpenStreetMap (OSM) data in EPSG 4326. I used the scripts generate_xml.py and generate_tyles.py provided by mapnik-stylesheets.

The final result is not correct, the overlapping of the layers is wrong.
The client code is JavaScript and uses the OpenLayers library.

var danube = new OpenLayers.Layer.XYZ(
 "OSM",
 "http://localhost/osm/${z}/${x}/${y}.png",
 {sphericalMercator: false,
   numZoomLevels:11,
   buffer: 0,
   isBaseLayer: true,
   projection:"EPSG:4326"
);

I think that the client code is correct but the generation tiles with Mapnik is not correct. Indeed, the tiles generated have an overlaps and are not shown correctly.


texts: How to add a parameter to the ArcGIS WebAppBuilder Search widget?

texts:
ArcGIS WebAppBuilder (developer edition) comes with a built-in Search widget which uses the default ArcGIS world geocoder. I want to restrict the type of suggestions which are returned.

The Search widget has some configuration options, eg the ability restrict the search country (&searchCountry) and the number of results returned (&maxSuggestions). These parameters are appended to the search query, eg:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=windsor&maxSuggestions=6&countryCode=AU

How can I edit the Search widget to allow additional parameters to be included, eg &category=city? This will require a new parameter on the HTML page:

... and for the query to have additional parameters appended:

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest?f=json&text=windsor&maxSuggestions=6&countryCode=AU&category=city

The above URL returns the correct results but I can't see where in the Search Widget JS/HTML I should be making the change to add this parameter.


texts:
I am using ArcGis Java SDK for creating a map in my JavaFX application. I have a requirement to plot up to 500,000 graphics on graphics layer. When I do 100,000 graphics its performance is really bad. It takes 10-15 seconds to render the Base map and Graphics layer. I cannot use any online map because this application is running on a machine that has not internet connection.

    jMap = new JMap();
    ArcGISLocalTiledLayer tiledLayer = new ArcGISLocalTiledLayer(“Texas_UL3D_Test.tpk");
    GraphicsLayer graphicsLayer = new GraphicsLayer();

    jMap.getLayers().add(tiledLayer);
    jMap.getLayers().add(graphicsLayer);
    jMap.addMouseListener(new MouseClickListener());

    final HitTestOverlay overlay = new HitTestOverlay(graphicsLayer);

    overlay.addHitTestListener(new

    jMap.addMapOverlay(overlay);
    jMap.addMapOverlay(new MouseMoveOverlay());

    Map<String,Object> attributes = new HashMap<String, Object>();

    jMap.addMapEventListener(new MapEventListenerAdapter() {
        @Override
        public void mapReady(MapEvent event) {
           SpatialReference mapSR = event.getMap().getSpatialReference();
           for(Data data : getAllData()){
              attributes.clear();
              Point point = GeometryEngine.project(data.getLongitude (),data.getLatitude (), mapSR);
              attributes.put("number", data.getNum());
              attributes.put("name", data.getName());
              Graphic pointGraphic = new Graphic(point, getSimpleMarkerSymbol(data.getStatus()),attributes);
              graphicsLayer.addGraphic(pointGraphic);
           }
        }
    });

    chartSwingNode.setContent(jMap);

Please help me to improve its performance. Tell me what I am doing wrong.

A map with 200k+ graphics


texts: Partial extents for ArcGIS android geodatabase creation

texts:
I know how to create and download a geodatabase copy of a FeatureServer from arcgis rest services. I also know how to pass LayerQuery to the geodatabase task to filter layer objects and features.

Here is my question, in the class GenerateGeodatabaseParameters where I define my selected layers, query parameters and extent, how can I have multiple partial extents for my geodatabase? i.e. two separate polygons. Is that even possible?


texts: Performing ST_Within method in an SQL statement returns false although it shouldn't

texts:
I have a POSTGIS database with a table "space" that has two columns "id" and "geometry".

I also have a PHP script that accesses the database and returns data. My program is running on mobile devices and delivers the id and a location. I now try to figure out if the table "space" does have an entry with the given id and if so, if the user is within the boundaries of the geometry in "geometry".

This is my code:

$id = $_POST['id'];
$lon = $_POST['lon'];
$lat = $_POST['lat'];

$statementCheck = $pdo->prepare("SELECT * FROM space WHERE id= :id
    AND ST_Within(ST_MakePoint($long, $lat), geometry)");
$statementCheck->bindParam(':id', $id, PDO::PARAM_STR);
$statementCheck->execute();

My problem is: $statementCheck->execute() returns false. However, I'm sure that there is a matching dataset in the table. Am I using ST_Within in a wrong way? The tutorials I looked at suggest that this is the way to do it. I'm a bit suspecting the ",geometry" part of ST_MakePoint to be not accurate.

edit: Fixed typing error.


texts: Line Offset Tool in QGIS 3 not working between different layers

texts:
In QGIS2 it was possible to use the lineoffset tool between two different layers. You could for examle use a polygon from a different layer to generate an offset line in your linelayer.

In QGIS3 this does not work anymore. Is this a known issue or is there a solution to select features from different layers to get some offset lines from them interactively?