texts: How do I remove Schema Locks from a File GeoDatabase in Java in ArcGis 9.3?

texts:
I have an application written in Java which uses ArcObjects 9.3. The application accesses a file GeoDatabase. The application produces output in the GeoDatabase that will be accessed by ArcMap. The problem is that ArcMap can't access the file GeoDatabase because my application still has locks on it. The only workaround I have is to close my application, which removes all the locks. But there's got to be a better way than that. Does anyone have a solution for freeing up these locks?

FileGDBWorkspaceFactory fileGDBWF;
fileGDBWF = new FileGDBWorkspaceFactory();
ws = new Workspace(fileGDBWF.openFromFile(workspacePath, 0));


texts:
I'm new to QGIS and I would like to convert SPOT(2-5) images from DN to TOA.
How do I go about doing this? I've an idea of how to do it for Landsat images however I'm not sure about SPOT.


texts: Arcmap Addin 10.3.1: Cancel/control loading of addins, based on a condition

texts:
I'm creating Add-in for arcmpa in C# , for 10.3.1. These add-in are to help with client workflows for the business needs.

I need to be able to control whether an add-in can load or not. (control of workflow)

I understand that you can on-demand load etc, but want to do something like:

if mxdFilename = blah OR configfile.fullname exists
 load
else
 ignore.

Or allow only certain mxd to 'know' the path location for the addin.


texts: How to find lowest value that is not null using Python in ArcGIS for Desktop?

texts:
I have four fields in my table, (A,B,C,D). The field type is double with some fields being NULL. I used min(A,B,C,D) to return the smallest value and it works well if there are no NULL value in any of the fields . What would be the easiest way to return the minimum value that is not NULL?

I think I found a very simple way: min(filter(None,[!A!,!B!,!C!,!D!]))


texts: Understanding star parameter for esda.G_local

texts:
I'm completing some hot-spot analysis currently and am wondering how to treat the star parameter in esda's G_Local function.
The star parameter as described in esda documentation determines

whether or not to include focal observation in sums (default: False)"

While this makes sense in principal - can someone explain to me the pros and cons of including the focal observation in the calculation?


texts: Multipatch footprint of Sun Shadow Volume in ArcScene (removal of below ground shadows)

texts:
I am new to using ArcScene and encountered a problem in my analysis. I want to calculate shadows in the city center of Utrecht on different times and days. Subsequently I want to transform these shades to polygons that represent the amount of shade on streetlevel. I am using the tools Sun Shadow Volume and Multipatch Footprint.

I extruded a layer with buildings (with heights in the attribute table) on a TIN with the baseheights of Utrecht, which is almost flat (image 1). Subsequently I ran the Sun Shadow Volume tool, which seems to work fine. However, the resulting shades cut through the baselayer (image 2). When I want to transform them to footprints, I get the footprints at the lowest point, instead of at baseheight level (image 3).

Does anybody know whether I can change the settings in Sun Shadow Volume tool somehow? Or in the Multipatch Footprint tool? Or did I already do something wrong with the extrusion?


texts: Land Parcel Numbering Automation in QGIS?

texts:
I have a parcel data for which I have to give parcel numbering with some suffix defining its landuse.

Is there way to do this in a automation rather than going to each plot and adding attribute manually?

I think in ARCGIS we can achieve that using the Parcel Fabric, but I have a basic License for which I can't use that.

Is there a way we can do this in QGIS or some other method, where we can do this numbering based on some criteria like clockwise and E-W direction?


texts: Cutting out polygon from other polygon / removing clip

texts:
I have a polygon that shows a lake. I have a second polygon that contains districts.

I want to cut out the lake so only get the bits of the districts that is on land. I tried clip, but I think I want an "anti-clip". What function can I use?

I used Difference, but it resulted in an error and I'm not sure it's the good function for this.


texts:
Does Mapbasic work with MapInfo Discover?

From what I've been able to figure out it does not.

I was really hoping to make some macro style things to help automate some of our process but it doesn't look like it is possible with Discover functions.


texts: Run gdal_calc with more than 26 input bands

texts:
I'm trying to average 30 greyscale netCDF files pixel-by-pixel using gdal_calc.py. However the script seems to require the input files to be enumerated with letters A-Z, so I'm four letters short.

The docs for gdal_calc lead me to believe I can instead supply a single raster file with all the bands and run an expression on that, but I haven't been able to find the correct syntax.

The closest I've come has been with this command ...

gdal_calc.py -A stacked.vrt --outfile=mean.nc --calc="mean(A, axis=0)"

... which produced a weird blocky-looking result unfortunately:

Has anyone done this before? Ideally I'm looking for a solution that would also work if it were more than 30 input files/bands.


texts: Determining local geodatabase release version with ArcPy?

texts:
Can anyone get the release version of a ESRI local geodatabase, using arcpy? I should be simple, and yet...

I use the "Describe" function on both personal and file geodatabases, and need to retrieve the workspace properties "release" or "currentRelease" - either would do: I want to pinpoint databases that need upgrading (this project is run in ArcGIS 10.0, I am looking for 9.x databases.)

I based the code below on the properties exposed in the ESRI help (here):

    import arcpy, os, sys

    data = r"C:\NEW_GDB.gdb"
    desc_gdb = arcpy.Describe(data)

    if hasattr(desc_gdb,"workspaceType"):
        print desc_gdb.workspaceType
        print desc_gdb.workspaceFactoryProgID
    else:
        print "no 'workspaceType' property"

    if hasattr(desc_gdb, "release"):
        print desc_gdb.release
    else:
        print "\nno 'release' property"

    if hasattr(desc_gdb, "currentRelease"):
        print desc_gdb.currentRelease
    else:
        print "no 'currentRelease' property"

And here is the result I get:

    >>>
    LocalDatabase
    esriDataSourcesGDB.FileGDBWorkspaceFactory.1

    no 'release' property
    no 'currentRelease' property
    >>>


texts: SelectLayerByAttribute not renwing before CopyFeatures

texts:
I'm using ArcMap 10.2 and want a python script to loop through a list to make new feature classes, using the list items as attribute values in a selection before copying the features to a new file.

The script makes the first feature class fine but then copies all of the features for the next two iterations of the loop.

import arcpy

arcpy.env.workspace = r"C:\RS_Data\SHP"
arcpy.env.overwriteOutput = True

amenities = ['school', 'hospital', 'place_of_worship']
points = r"C:\RS_Data\SHP\OSMpoints.shp"
arcpy.MakeFeatureLayer_management(points, "OSM_Lyr")

with arcpy.da.SearchCursor("OSM_Lyr","amenity") as cursor:
    for amenity in amenities:
        query3 = '"amenity" = ' + "'" + amenity + "'"
        arcpy.SelectLayerByAttribute_management("OSM_Lyr", "CLEAR_SELECTION")
        for row in cursor:
            if row[0] == amenity:
                arcpy.SelectLayerByAttribute_management("OSM_Lyr", "ADD_TO_SELECTION",query3)
        arcpy.CopyFeatures_management("OSM_Lyr", amenity)
        print query3

Here is the print statement I get for the query after each loop:

"amenity" = 'school'
"amenity" = 'hospital'
"amenity" = 'place_of_worship'

It seems the selection is working the first time but not for the next two iterations. If I take the CLEAR_SELECTION line out it makes three identical feature classes using the same attribute value. How can I get the loop to make a selection on the next value in the list and copy the features to a new file?


texts: How do I Check to See if a column is within latitiude/longitude coordinates?

texts:
I have two columns latitude and longitude. I am trying to create boundaries such that only points within the boundary is returned. For example i have this static lat/long (40.6681, -73.9806).

There are latitude/longitude coordinates in my database which are not within that static coordinate, how do I only select those coordinates within 40.6681, -73.9806? Here is my query:

select houses from housing where borough = 'BROOKLYN' and latitude + longitude = st_within(40.6681, -73.9806);

The error message I see is:

Hint: No function matches the given name and argument types. You might need to add explicit type casts. Can someone guide me in the right direction?


texts: Seeking open source software for post-processing > Utility mapping?

texts:
I am using Mobile Mapper 10 with MobileMapper Field 4.7 Mapping software more mapping of underground,cables and pipes as well as various point features. The standard accuracy is 2m, I need compatible open source post-processing software, which will allow be to get 0.5m accuracy.

Will  "GeoKettle" work? (previously recommended for MobileMapper CX).

I can also use ESRI ArcPad 7, would this allow post-processing?

If not, is there some other software which can be recommended with ArcPad 7?


texts: Counting points inside polygons by attribute using ArcMap

texts:
I am working with ArcMap 10.8 and extensions.
I have a grid (polygons) and another shapefile of points. I need to generate a field in the grid that shows me how many points are inside each cell, but grouped by a criterion.
For example suppose that the grid are "football stadiums" and players are points. The points shape has a field called "team". If in a specific stadium there are 34 players from 3 different teams, in the count field of polygons shape we will have 3.
With spatial join tool I can only count the total points within the polygons, but I cannot count by attributes.


texts: KML/KMZ: Make one placemark appear in two folders?

texts:
I'm not actually sure this is quite the right way to approach this problem, so if I'm just off in the wrong direction, please help me figure out where I should be heading.

I have a collection of several hundred geolocated items, each of which is tagged with one or more attributes. I want to save the items as a KML/KMZ file such that it's trivial for a Google Earth user to show/hide the items based on their tags. Right now, I've just got a folder for each tag, and the items duplicated between folders, so there might be three copies of one item across three different folders.  This works great if the user only wants to look at one tag at a time -- just select that folder and deselect the others. However, of course, if you've got 2+ folders selected, you wind up with duplicates of the same item showing up on the map.

Is it possible to have a single placemark which is "symlinked" into more than one folder, such that if it's in two folders and both are enabled, only one copy of the placemark will actually appear on the map?

If not, is there some other useful mechanism within the KML/KMZ format that will give me the sort of functionality I'm looking for?


texts: How can I find an appropriate coordinate reference system?

texts:
I have a worldmap and need to present different countries (e.g. Japan and France) in different extracts in QGIS. Thus I need to find out the best way to decide for an appropriate CRS for the presentation of each country without too much effort. I am intending to then just use the "Project properties" to change the CRS, depending on the country that is currently presented.

How do you decide, which CRS is the most suitable?


texts: When I insert country borders from Natural Earth, they look broken when zoomed out. When I zoom in they look correct. Is there any way to correct this, particularly when creating a map in layout?


texts: Connecting QGIS 2.x to Firebird Database via ODBC?

texts:
I tried to connect a Firebird Database in QGIS 2.2 and 2.4 via ODBC to a database and get following error message:

  Unable to initialize ODBC connection to DSN for SYSDBA/masterkey@Akdees
  [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture
  mismatch between the Driver and Application

Funny, that it does work with QGIS 1.8! but fails with QGIS 2.2 and 2.4. Does anyone have an idea as to what the reason is and how to make it work again?


texts: Flipping Road-Lines based on direction of apparently parallel DrainageLines derived using DEM

texts:
I have 2 FeatureClasses one is road lines (Red coloured as shown in the attached image) with random digitized direction and another is drainage lines (Blue Lines) derived using Raster DEM with correct direction. Mostly, the DrainageLines fc has lines apparently parallel to all road lines and also lateral sub drainlines.

I need to correct the direction of road lines based on the direction of seemingly parallel lines in Drainageline FeatureClass. I may just need to flip road lines if their bearing is opposite to parallel DrainageLines only (but should not consider other than parallel lines) or based on some other logic. Its difficult to flip them manually as they are in thousands.
Is there a method or any tools/procedure to perform this job on ArcGIS Desktop?


texts:
I'm using the Atlas functionality in QGIS 1.9 to create a set of maps. So far, so good. But I want to be able to create a smaller map in the margin that acts as a map index.

I've seen a blog post by Underdark which indicates that the Invert Overview may be the option that helps with this. I haven't been able to find any more information about this toggle and how to use it.

Can someone point me in the right direction, please?


texts: Cutting polygons into smaller (more regular shape) chunks

texts:
I came up with a polygon shapefile like what you see here. There are some small polygons which exactly match what I want, though I want to cut(split) those bigger ones into smaller pieces.

So far I have tried many combination of different commands. I converted this to polyline and again to polygon, and from these 2 shapefiles, I ran cut with polyline, multipart to single part, extend the line, minimum boundary around it polyline and convert to polygon again or merge, intersect, dissolve, eliminate, ...etc. (I didn't write them in order)

I am afraid what I want is not possible at all. But anyone got any idea how to do this?

Even roughly on some larger polygons.
P.S: I have full Arc GIS licence.


texts: Arcpy addin editable textbox on tool bar

texts:
I would like to add an editable toolbox on an arcpy addin toolbar.  This would be used to change values of a threshold but I don't think this is currently available. (What I would really like is a slider!)

My current work around is to use a combobox which does 80% of what I want it to do except display an initial value and update the displayed value when altered programatically. As can be seen in my code I have a + and - button that can change the value stored in the combo box items variable.

import arcpy
import pythonaddins
import os

class decreaseBottom(object):
    """Implementation for alterRange.btn1 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        firstBreak.items[0] -= 1
        if firstBreak.items[0] < 0:
            firstBreak.items[0] = 0
        firstBreak.refresh()

class decreaseTop(object):
    """Implementation for alterRange.btn3 (Button)"""
    def __init__(self):
        self.enabled = True
        self.checked = False
    def onClick(self):
        firstBreak.items[0] += 1
        if firstBreak.items[0] > 100:
            firstBreak.items[0] = 100
        firstBreak.refresh()

class firstBreak(object):
    """Implementation for alterRange.firstBreak (ComboBox)"""
    def __init__(self):
        self.items = [30]
        self.editable = True
        self.enabled = True
        self.dropdownWidth = 'WWWWWW'
        self.width = 'WWWWWW'
    def onSelChange(self, selection):
        pass
    def onEditChange(self, text):
        pass
    def onFocus(self, focused):
        pass
    def onEnter(self):
        pass
    def refresh(self):
        pass

Is there a variable in the __init__ of the combo box that can do this?


texts: Moving raster to different mapset GRASS GIS

texts:
I have a raster DEM that I created in one mapset but I would like to copy it to another mapset for another purpose.

Is this possible within GRASS or can I just copy some files over in the filesystem to the FloodModels mapset folder on my hard drive?


texts: How to force polygons to the bottom, without compromizing drawing speed?

texts: I have a large polygon dataset and no time to rebuild it to regoranize the Object IDs. Many polygons are drawing above others, blocking their symbol (for example on one side of the polygon). I tried using the 'advanced' symbol level drawing however this resulted in the polygons drawing at a glacial pace. For my clients & users, this is not cool. Is there any way to force the polygons I don't want up front to the bottom, without compromizing drawing speed?


texts: Zooming to coordinates upon start up using Potree?

texts:
I am using the latest version of Potree (the version last updated 27/08/2018).  I have converted my source LAZ data into Potree compatible LAZ tiles (using PotreeConverter.exe).  I have huge amounts of data (by this I mean possibly a few TBs worth of LAZ data).  This is for the road network of the country I reside in.

How do I programatically zoom to a given set of coordinates (XYZ) in the point cloud upon initial load?

My point cloud is potentially hundreds of miles wide, therefore I need to zoom to given coordinates e.g. XYZ coordinates 409200.000, 209200.000, 150.000.

I have tried the following.  It zooms, not to the desired location/coordinates:

Potree.loadPointCloud("pointclouds/OsgbColour/cloud.js", "OsgbColour", e => {
        let pointcloud = e.pointcloud;
        let material = pointcloud.material;
        viewer.scene.addPointCloud(pointcloud);
        material.pointColorType = Potree.PointColorType.RGB; // any Potree.PointColorType.XXXX
        material.size = 1;
        material.pointSizeType = Potree.PointSizeType.ATTENUATED;
        material.shape = Potree.PointShape.CIRCLE;
        viewer.fitToScreen();

        viewer.scene.view.position.set(409200.000, 290200.000, 150.000);
        viewer.scene.view.lookAt(4092000.000, 290200.000, 150.000);
        var myactivecamera = viewer.scene.getActiveCamera();
        myactivecamera.position.set(4092000.000, 290200.000, 150.000);
        myactivecamera.zoom += 3.0;
    });


texts: problem in pgRouting with data from google earth

texts:
Hello i am new in forum an in Postgesql,postgis and pgRouting.
I try to make a pgrouting for my city roads.

I use googlemaps to make a lines with coordinates of the roads and export the results in kml file.
example <MultiGeometry><LineString><coordinates>22.950164627408352,40.592917358186945 22.950657309819846,40.592514769916995</coordinates></LineString></MultiGeometry>

but i have problem with the insert in postgresql
The queries for table and make the geometry for roads.

 CREATE TABLE roads(
    "id" integer PRIMARY KEY,
        "Name" text NOT NULL,
    "Lenght (m)" numeric CHECK("Lenght (m)" > 0)
);

SELECT AddGeometryColumn('','roads','the_geom','4326','MULTILINESTRING',2);

After i use an insert like this but i have problem with MULTILINESTRING

    INSERT INTO roads VALUES(1,'Kwnn/nou Kanarh',1000,ST_SetSRID(ST_GeomFromKML('<MultiGeometry><LineString><coordinates>
26.683023,37.7939654,0.0 26.6839457,37.7941011,0.0 26.6857266,37.7944063,0.0 26.687851,37.7948472,0.0 26.69034,37.7955084,0.0 26.6947603,37.7972888,0.0 26.6975284,37.7980687,0.0 26.6992879,37.7984926,0.0 26.701498,37.7993573,0.0 26.7026782,37.79989990000001,0.0 26.703794,37.8000355,0.0 26.7052317,37.8002729,0.0 26.7067122,37.8006375,0.0 26.7095018,37.8014089,0.0
</coordinates></LineString></MultiGeometry>'),4326));

Update After the inserts i create topology and other step from the
http://workshop.pgrouting.org/chapters/topology.html for make a pgRouting for the insert data but when i run the pgr_dijkstra the query is

SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra('
            SELECT id AS id,
                     source::integer,
                     target::integer,
                     length::double precision AS cost
                     FROM roads',
            30, 60, false, false);

Give me this error ERROR:  Target vertex was not found.
I dont find the reason


texts:
I installed PostgreSQL 12 using Windows Installer. After the installation, there´s no option to install postgis extension. I tried to add postgis support in a database using CREATING EXTENSION and I got an error message about postgis.control missing file.

How can I proceed to use PostGIS features in PostgreSQL 12?


texts:
I'm not finding Georeferencer on QGIS3. In version QGIS2 it was found under Raster > Georeferencer > Georeferencer (the only option available).

Forgot to say I'm on a Mac using the http://www.kyngchaos.com/software/qgis version. This led to @sys49152 showing that Georeferencer is present on at least one other system.

I've, of course, looked at all the options under the Raster menu and nothing reads like Georeferencer not looks like the light hash icon shown in the plugins.

I don't know how to contact the great person creating the macOS installer.

This is close enough to being a duplicate, that I'll plan on marking it so. This post was macOS, but turns out the issue is probably on other platforms. There seems to be a bug the Plugin Manager for displaying and checking/unchecking.

It's a bit confusing that you can't "uninstall" Georeferencer which I think I took to mean that it was installed and operational. I think there is a semantic/logic issue here. Does install mean that you've downloaded the plugin in or that it's installed, that is, ready for use? That on top of the display bug.


texts: How can I display "related" data in a polygon label?

texts:
I have the classic situation with ownership parcels where a single polygon has numerous owners.  I have related the parcel shapefile with an owner table in my database but for the life of me I can't figure out how to build a label template that displays the fields from the related records (as i would have done with a join).

Ideally the label would display the parcel data stacked on the ownership info.  The only solution I can think of at the moment is to insert a .pdf with the multiple owners related to the parcel ID but that isn't very elegant.

Any idea how do to this (ArcMap Desktop 10x).

Thanks


texts: How to display graphics in IOS when connected remotely with Linux server?

texts:
I am trying to work using GRASS GIS for my data remotely from Mac. Here is what I have done:

XQuartz was installed and run;
Terminal was run. I typed: ssh -Y root@IPaddress
Then I typed: grass64 (to be able to use grass commands in terminal)
Afterwards got a question about directory to chose and the information:

WARNING: It appears that the X Windows system is not active.
A graphical based user interface is not supported.
Switching to text based interface mode.

I am struggling with enabling window to display rasters that I have. I tried to type -X despite -Y, as well running GRASS before, but nothing works.. My GRASS version is 7.8.
Any ideas?


texts: How to convert boundaries in image to polygons in QGIS

texts:
I have an image from a cities districts and their boundaries and I need them as polygons in QGIS.

I tried "Raster -> Conversion -> Polygonize (Raster to vector)" as described here, but that vectorised every single pixel.


texts: Geometry vs geography for line-to-polygon intersection

texts:
I have two WGS84 NAD83 shapefiles, one polygonal, the other containing lines:

Geometry: Polygon
Feature Count: 1294
Extent: (-79.761059, 44.991143) - (-57.105486, 62.582865)
Layer SRS WKT:
GEOGCS["GCS_North_American_1983",
    DATUM["North_American_Datum_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]]

Geometry: Line String
Feature Count: 427227
Extent: (-79.882212, 44.929534) - (-55.834430, 62.427856)
Layer SRS WKT:
GEOGCS["GCS_North_American_1983",
    DATUM["North_American_Datum_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]]

which I export to PostGIS 2 using the -G flag, to obtain geographies:

$ shp2pgsql -G -I -s 4326 polygons | psql ...
$ shp2pgsql -G -I -s 4326 lines | psql ...

However when I perform a query to obtain their intersection:

select * from polygons p, lines l
where p.geog && l.geog
and st_intersects(p.geog, l.geog)

it runs for a very, very long time, and doesn't yield the same results as the one performed over the equivalent tables, but with geometries instead (i.e. shp2pgsql without the -G flag), which runs very rapidly. According to the docs, st_intersects should play well with both types, so why this difference?


texts: Is ArcMap's Mosaic Dataset primarily for display or can its component rasters still be meaningfully analyzed?

texts: Mosaic blends the areas of overlap between component images and adjusts the images to a common brightness.  Does anyone know if the final multi-band mosaicked image is still considered data, ready to be analyzed, or is it more like pansharpening or smoothing -- a cosmetic fix that removes some of the data quality?


texts: Is it possible to set a tooltip for a layer?

texts:
When hovering your mouse over a layer, a tooltip appears showing the layer's source. E.g. for a virtual layer:

Is it possible to change this tooltip either through an existing option or PyQGIS?

I noticed the QgsDataItem class has a setToolTip() method, can something similar be used?


texts: Getting raster value area per polygon with many values in QGIS

texts: I was trying to get the area of each pixel values over each polygon in a shapefile. My raster file has so many values (more than 1 thousand pixel values). I usually do this by executing 'Zonal Histogram' tool in QGIS. The tool will return the same vector file/shp but with additional columns that define number of pixel in each polygon for each pixel values. If I have thousands of pixel values in my raster file, it means it will return a shapefile with thousands of columns, which lead me to error as shapefile/dbf file has limitation in term of max number of columns. Any suggestion how to resolve with this issue?


texts: Random Dips/Pits in Elevation surface in ArcGlobe 10.2

texts:
I have an elevation raster which I load into ArcGlobe as an elevation source and appears to have large pits and dips in it when I place floating features such as roads and imagery.

The odd thing is that the phenomenon does not show up in ArcScene and if I import the raster into a FGDB the pits disappear.

It's seriously looking like Apple Maps and any help would be nice.


texts: Downloading OpenStreetMap data for one state of USA?

texts:
I'm following this tutorial

It has following instrucions to download the data:

1)  Planet download:

wget -c http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf

2) This for Great britain:

wget -c http://download.geofabrik.de/europe/great-britain-latest.osm.pbf

Both works, but I don't find how to download USA data, I have tried this:

wget -c http://download.geofabrik.de/north-america/usa/california-latest.osm.pbf

I'm working on a remote server, hence I can't use the browser to do download the file.

But I get 404 error:

 ERROR 404: Not Found.


texts: Can a new point automatically be populated with data from the containing polygon

texts:
I need some help to create a script.

Imagine that I'm using 3 shapes: 1 point and 2 polygons. When I create a new point I want it to assume some attributes of the polygons in which that point is inserted.

Any idea?


texts: Using WMS external SLD with OpenLayers application

texts:
I want to use external SLD file in my OpenLayers application. So I created WMS layer like this:

     var ly= new OpenLayers.Layer.WMS("mylyer",
        serverurl,
        {
           layers: "PGS:geopoint",
           transparent:true,
           style:"",
           sld: "http://localhost/app/style/point.xml"
        },
        {
           isBaseLayer: false,
           buffer:0
        });

This is not working. This is returning null images. If I send request from browser (not openlayers) it returns error:

      java.net.ConnectException: Connection refused
Connection refused


texts:
I've just got access to ArcGIS 10 through my university, and it seems to be far nicer than ArcGIS 9.3. I'm trying to find out what exactly has changed, but the ESRI pages on 'What's new in ArcGIS' seem very vague and marketing-oriented.

So, what have you noticed that's different in ArcGIS 10 (preferably useful too)? If possible I'd like to particularly focus on things that maybe aren't obvious, but are very useful and really improve your GIS workflow.


texts: Manually modifying ArcGIS Server Geoprocessing Parameters Data Type?

texts: In ArcGIS 10.5, when I publish a Python Toolbox result as service, the parameters such as GPRasterDataLayer become GPString if these parameters are unfilled when running the toolbox on Desktop. This causes errors when using these GPString parameters as they are supposed to be GPRasterDataLayer. Is there any way to go to the server arcgisserver\directories or any folder and modify the data types?


texts: Query MYSQL database inside a python plugin

texts:
I am new to QGIS python development and I have a requirement to query the database and depending on the result do some processing in QGIS.

I found how to create a connection to mysql db on python cook book, but I was unable to execute a user defined query using a python plugin. I did search but am couldn't find any good article about that. Can anyone please help to find out how to execute user defined query inside a python plugin?


texts: Closing InfoTemplate Programmatically in ArcGIS API for JavaScript?

texts:
I am trying to hide a layer on the map like

      var point = new esri.geometry.Point(-106.61, 35.1107);
      point = esri.geometry.geographicToWebMercator(point);
      var symbol = new esri.symbol.PictureMarkerSymbol("https://cdn1.iconfinder.com/data/icons/Map-Markers-Icons-Demo-PNG/128/Map-Marker-Marker-Outside-Chartreuse.png", 32, 32);
      pointInfoTemplate = new InfoTemplate();
      pointInfoTemplate.setTitle("Project Details");
      pointInfoTemplate.setContent('
Some Att Here
 ');
      var graphic = new esri.Graphic(point, symbol).setInfoTemplate(pointInfoTemplate);
      layer1 = new esri.layers.GraphicsLayer();
      layer1.add(graphic);
      map.addLayer(layer1);

$("#hide").on("click", function(){
    layer1.hide();
});

which works fine but the InfoTemplate() remains in the map (in case of it being opened)


texts: Statistically comparing two spatially congruent continuous rasters?

texts:
First: Rasters are the same spatial resolution & extent and contain the same kind of information. Each pixel contains a probability value from 0-1.

Sounds simple to compare. Conventional wisdom might point to a neighborhood analysis of some size (along with a sensitivity analysis of Nhood size). I could always use a pearson linear correlation, a reflective correlation, a spearman rank correlation, etc. However, none of these analyses will quite give me what I want. Since these two rasters contain extremely similar values for most locations (pixels) what I'm really interested in knowing:

How do they differ in relation to isotropy?

I suspect there are small directional differences in the values of these two rasters. To be more direct, there are two possible comparisons to consider; (1) values, and (2) position. Most of the analyses listed above provide information about values and not position.

Is there a way to compare 2 semivariograms?


texts:
From the documentation is an example of a "crypt1" password.
As an example, the password geoserver is encrypted to crypt1:KWhO7jrTz/Gi0oTQRKsVeCmWIZY5VZaD
We are using this level of security at our organization.  What we currently do is change the password to our datastores using the GeoServer interface.
What we would like to do is not use the GUI feature to update our datastore passwords, but instead enter the encrypted passwords directly into the datastore files.
We have the masterpw available to us in plain text.
What we are looking for is a procedure to take a plain text password "datastorepassword" and run a procedure to generate the encrypted password for the datastore and manually enter it in the datastore.xml.  We do not want to use the GeoServer GUI.

Receive new password in plaintext
Run a procedure to encrypt the password to the desired format:
crypt1:KWhO7jrTz/Gi0oTQRKsVeCmWIZY5VZaD
Manually change the datastore.xml entry.

How can I do this?


texts:
How do I remove overlapping polygons in QGIS 3?

I've tried v.clean (bpol, rmdupl and rmarea using right tolerances) and when I check the topology after doing that it says there is no overlapping but I can still see overlapping polygons. As a result I would like something like that last picture.


texts: Changing width and height attribute with ArcGIS Javascript API?

texts:
We've got a client side drawing application working with the Arcgis Javascript API, works pretty well with most of the standard components so far. This is our first Arcgis application and we really like the API. Now I've got a request from our client that he wants to be able to change the width and length of a graphic from an infowindow/attribute.
If already played around and looked at first getting the extend of the graphic and then use getWidth and getHeight, but it seems this gives with the bounding box and not the graphic. Another option I was thinking of is calculating the line lengths of each side and then edit the points, but it feel like this might be an overcomplex solution.
It is fine if this is only possible with a polygon drawn with the rectangle drawing tool, however it should be possible to rotate this element. So what I want to achieve is a bit something like the screenshot underneath.

(source: kabelfoon.nl)
Do you have any opinions what the best way to tackle this with the Arcgis API


texts: Creating catchment from point using DTM raster in QGIS?

texts:
I need to find a better way to delineate a catchment from a given point on a watercourse using a DTM - currently I am either using FEH, or if the catchment is too small using contours to draw manually.

Ideally - can I pick a point on a DTM and produce a catchment based upon all cells draining to that point.

I have tried using watershed analysis to no avail.

Can someone could walk me through the steps to create a catchment from the DTM?


texts: Can QGIS render and show DTM (Digital Terrain Model)?

texts:
I wonder if qgis can properly render a DTM (triangle) layer (as shown in image1) and become like a moveable (orbit-able) map to export to web browser?

If this is possible, where should I start from?

Currently the output of DTM layer looks so 2D and flat.. Did I import it with a wrong way?


texts:
I have recently created a web map that uses the legend snippet from the ESRI JavaScript API website.
https://developers.arcgis.com/en/jav...et_legend.html

It works great for the most part, but has one issue, there are duplicate entries in the legend. The rest services that I am using are all symbolized properly without duplicates. The method I'm using to add the services to the map is through a feature layer.

This is the exact code in my .js file.

dojo.connect(myMap, 'onLayersAddResult', function (results) {
    var layerInfo = dojo.map(results, function (layer, index) {
        return { layer: layer.layer, title: layer.layer.name };
    });

    if (layerInfo.length > 0) {
        var legendDijit = new esri.dijit.Legend({
            map: myMap,
            layerInfos: layerInfo},
            "legendDiv");
            legendDijit.startup();
        }
    });

//Layers are added to map
myMap.addLayers([featureLayer1, DMSL_StudyArea]);

Any information would help.

Thanks


texts: Percentage of multistring or geometry lying inside polygon

texts:
I was able to find all the lines lying inside each polygon using below query. But, now I want what percentage of total length of that road or multilinestring lies inside multipolygon.

  Query

select sla_code06,sla_name06,sum(trucks) as total_trucks,sum(
lung_deaths+heart_deaths+respiratory_deaths+copd_deaths) as total_deaths from patients_geom,"vicRoads_Data
" where ST_Intersects("vicRoads_Data".geom,patients_geom.geom) group by sla_code06,sla_name06;

Tables
lung_cancer=# \d patients_geom;
                      Table "public.patients_geom"
               Column       |          Type          | Modifiers
        --------------------+------------------------+-----------
         lung_deaths        | real                   |
         heart_deaths       | real                   |
         respiratory_deaths | real                   |
         copd_deaths        | real                   |
         area_code          | integer                |
         area_name          | character(250)         |
         gid                | integer                |
         state_code         | character varying(1)   |
         sla_code06         | character varying(9)   |
         sla_name06         | character varying(50)  |
         sla_5digit         | character varying(5)   |
         geom               | geometry(MultiPolygon) |

        lung_cancer=# \d "vicRoads_Data";
                                              Table "public.vicRoads_Data"
           Column   |           Type            |                           Modifiers
        ------------+---------------------------+---------------------------------------------------------------
         gid        | integer                   | not null default nextval('"vicRoads_Data_gid_seq"'::regclass)
         allveh_amp | character varying(254)    |
         label      | character varying(254)    |
         allveh_pmp | character varying(254)    |
         road       | character varying(254)    |
         trucks     | integer                   |
         allvehs    | integer                   |
         __gid      | integer                   |
         directio_1 | character varying(254)    |
         hf_1       | integer                   |
         year       | integer                   |
         per_trucks | character varying(254)    |
         geom       | geometry(MultiLineString) |
        Indexes:
            "vicRoads_Data_pkey" PRIMARY KEY, btree (gid)
            "vicRoads_Data_geom_idx" gist (geom)


texts: QGis 3.4 Categorized Symbology: Overlapping objects

texts:
I have a point layer with categorized symbology

One object is a big point and one is a smaller one.

How do I change which one is displayed in front of the other one?


texts: Getting latitude and longitude of polyline on map?

texts:
I have a code, that allows me to construct a polyline on the map, which I edited from here . The thing I want is to take the coordinates of the points clicked. I came up with

function myClickHandler(event) {
  alert("User clicked at " +
    event.screenPoint.x + ", " + event.screenPoint.y +
    " on the screen. The map coordinate at this point is " +
    event.mapPoint.x + ", " + event.mapPoint.y
  );
}

from here, but was not able to use both techniques in one code. Is there a way for coordinates of the chosen polyline points to be seen?


texts: CartoDB table join error: Column reference is ambiguous

texts:
I've got a CartoDB question that seems dumb b/c the layer is correctly rendering. Anyway, I have two layers, named

sampling_points
sample_point

I'm trying to inner join the sample_point data to the sampling_points. Basically to render all sampling_points that have their id (suid) in the sample_point table.

Here's my code.

     SELECT sampling_points.the_geom_webmercator, sampling_points.suid, sample_point.suid
     FROM sampling_points, sample_point
     WHERE sampling_points.suid = sample_point.suid


texts: how to restore subdataset window (Do Not Ask Again) checked by mistake

texts:
I checked "Do Not Ask Again" check box by mistake.Choosing this option automatically loads the first subdataset for any HDF without opening the subdataset selection. so how to fix this problem? I need to choose one of the subdataset in a modis image.

i m using arcmap 10.3


texts: Features repeated on select in a no-wrapped vector layer ol3

texts:
I have a map created with gdal2tiles on OL3. I added a Vector layer, and some features, but when I select a feature, this is repeated horizontally, even when the vector layer is non-wrapped.

Some screenshots


texts: Well Known Binary GeometryCollection for GeoPackage doesn't show in QGIS

texts:
I wanted to test QGIS/GeoPackage with the Well Known Binary for: WKBGeometryCollection(WKBMultipoint(WKBPoint, WKBpoint))

I was guided by the document "OGC 06-103r4" for Geopackage and generated the following BLOB:

4750000000000f11000000000700000001000000000400000002000000000141515cbb6b198b4c4156a84c9a39b482000000000141515cd46b198b4c4156a8659a39b482

This doesn't show in QGIS. When I leave out WKBGeometryCollection, it works perfect:

4750000000000f11000000000400000002000000000141515cbb6b198b4c4156a84c9a39b482000000000141515cd46b198b4c4156a8659a39b482


texts:
OpenLayers Plugin is installed correctly but when I add a layer I get following message. (CRS is on Pseudo Mercator) Can anyone help me out?

An error has occurred while executing Python code:

  Traceback (most recent call last):   File
  "C:\Users\s58sj/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py",
  line 109, in draw
      self.render(rendererContext)   File "C:\Users\s58sj/.qgis2/python/plugins\openlayers_plugin\openlayers_layer.py",
  line 158, in render
      for res in self.resolutions(): TypeError: 'NoneType' object is not iterable

  Python version:
  2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

  QGIS version:
  2.0.1-Dufour Dufour, ebebdf3

  Python path:
  ['C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins\processing',
  'C:/PROGRA~2/QGISDU~1/apps/qgis/./python',
  'C:\Users\s58sj/.qgis2/python',
  'C:\Users\s58sj/.qgis2/python/plugins',
  'C:/PROGRA~2/QGISDU~1/apps/qgis/./python/plugins',
  'C:\PROGRA~2\QGISDU~1\bin\python27.zip',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\DLLs',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\plat-win',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\lib-tk',
  'C:\PROGRA~2\QGISDU~1\bin',
  'C:\PROGRA~2\QGISDU~1\apps\Python27',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages\PIL',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages\win32',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages\win32\lib',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages\Pythonwin',
  'C:\PROGRA~2\QGISDU~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode',
  'C:\PROGRA~2\QGISDU~1\apps\qgis\python\plugins\fTools\tools']


texts:
Does anyone know where I can get a reasonably accurate road network of Uruguay?

I have only managed to locate a very sparse one, and those roads are often a mile out of position. TAB or SHP file would be good.


texts: Text appearing as symbols after opening Map Package from ArcMap

texts:
I am using ArcMap 10.6.1.

Text in my map packages does not export/open correctly.  I have no problem creating  or sharing the map, but when someone else opens the map package the text appears as symbols.  This happens with different fonts.

Any help?


texts: Using landmarks in routing directions for ArcGIS Network Analyst?

texts:
I was wondering if there is a way to use a set of landmarks (in a point class or something) that will be included in the directions output for a Network Analyst route. So if there is a point (or building polygon for that matter) at a corner, the text would read "Turn right at 7-11, on to _____". I found this thread: http://forums.arcgis.com/threads/35424-Displaying-point-features-as-landmarks-on-Network-Analysis-route-direction-maps , but I don't necessarily want to attribute my route paths with building information, which is what I gathered this was doing. I'm using ArcGIS 10. Any suggestions?

Thanks,

eric


texts:
I'm attempting to make a seamless raster from US Topo Maps for a large portion of the Western US. I have succeeded in converting the GeoPDFs from The National Map into GeoTIFF format using gdal_translate, but when I attempt to process them further I receive a warning related to the rotation of the rasters.

#R 3.5.0 x86_64-w64-mingw32

library(raster) #version 2.6-7

iraster <- raster(i)

Warning message:
In .rasterFromGDAL(x, band = band, objecttype, ...) :

 This file has a rotation
 Support for such files is limited and results of data processing might be wrong.
 Proceed with caution & consider using the "rectify" function

When I attempt to rectify the rasters, per the suggestion of the warning from the raster function, I am unable do so because I receive the following error:

iraster.rectified <- rectify(x = iraster)

Error in validityMethod(object) : invalid extent: ymin >= ymax

I noticed that the res.y attribute of the raster is negative, so I'm wondering if that could have something to do with my issue.

Here is the geotransformation info from iraster:

iraster@rotation@geotrans
         ll.x         res.x     oblique.x          <NA>     oblique.y          res.y
 3.762988e+05  1.015902e+00  1.396716e-02  4.097299e+06  1.396716e-02  -1.015902e+00


texts:
I have created a view in MSSQL Server 2012 that does a spatial join as below:

SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 100)) AS PID, DS.Dip_No, PB.SP_GEOMETRY
FROM dbo.Dipsites AS DS INNER JOIN
  dbo.Parcel_Base AS PB ON PB.SP_GEOMETRY.STContains(DS.SP_GEOMETRY) = 1

I can view the resulting data in SQL Mgmt Studio but I cannot see it in QGIS v3.4. Is it possible to open a view in QGIS? Or am I missing something in my SQL that is required for this to happen?

@DPSSpatial, @Mapperz, @JHG
I have added the following SQL now:

    SELECT DS.MI_PRINX AS OBJECTID, DS.Dip_No, PB.Pcl_num, geometry::STGeomFromText(PB.SP_GEOMETRY.STAsText(), 28356) AS GEOMETRY
FROM dbo.Dipsites AS DS INNER JOIN dbo.Parcel_Base AS PB ON PB.SP_GEOMETRY.STIntersects(DS.SP_GEOMETRY.STBuffer(200)) = 1

I have pulled a unique ID field and called it OBJECTID. I have made sure the GEOMETRY field is actually geometry. But this still won't come through to QGIS.

Any other suggestions I may be missing?


texts: I am very new in programming and I want to ask how can I make a scatterplot of two rasters in R and also get their correlation?


texts:
I was wondering if it was possible to link Google Earth files (KML, KMZ) to a QGIS project. The main idea would be that if you'd add a point with coordinates in Google Earth, this point would be added to your QGis project or vice versa.

Can this be done?


texts: Loading not advertised layers into opengeo SDK app

texts:
I`ve made several apps using OpenGeo suite SDK but so far never needed to keep layers from being exposed in the capabilities. Now I´ll like to "hide" some of them but still being able to load them. I taught that the solution was to set the layers as not advertised but if I do that the app will not load those layers!!
As far as I understand I should be able to call a layer that is not advertised!!
Using geoexplorer and saving the map I can do the same with no problems….  Any idea what may be wrong?


texts: Using Chaiken Method parameters for smoothing polygon vectors in QGIS

texts:
I've been trying to smooth a huge polygon, that is result of a segmentation export. I'd like to know what's the best parameters to use Chaiken Method to get smooth curved boundaries on QGIS 2.14.

I already tried v.generalize

The best result I got so far is this:

And what I really need is something like this:

I made this red line on adobe illustrator as example.
So, how can I get this result on QGIS 2.14?


texts: How to extract elevation information from contour lines?

texts: I'm working with OS windows 7 and using ArcGIS 10.2 and I have a point shape, which I must extract elevation for every point in it but the only useful data is a contour line shape. Not sure if it's useful but I need your help once again to lead me on how do I extract the data I need from it.


texts: Modifying text with tags in If Then Else in VBScript Label Expressions

texts:
I am having a problem with formatting text in a label expression using VBscript.

Here is my label expression:

Function FindLabel ([Mean], [Count])
if ([Mean] < 1) then
    FindLabel =   [Count] & vbCrLf & vbCrLf & "< 1" & vbCrLf & " "
Else
    FindLabel =   "<FNT size='3'>" & [Count] & vbCrLf & vbCrLf& "</FNT>" & "<BOL>" &
Round([Mean],1) & "</BOL>" & vbCrLf & " "
end if
End Function

It results with this: the label on the left is what I want.

I understand that the cells on the right are formatted as they are because of the < formatting tags> but if I edit the label expression to have the tags on both sides of the Else statement like this:

Function FindLabel ([Mean], [Count])
if ([Mean] < 1) then
    FindLabel =   "<FNT size='3'>" & [Count] & vbCrLf & vbCrLf& "</FNT>" & "<BOL>" & "< 1" & "</BOL>" & vbCrLf & " "
Else
    FindLabel =   "<FNT size='3'>" & [Count] & vbCrLf & vbCrLf& "</FNT>" & "<BOL>" & Round([Mean],1) & "</BOL>" & vbCrLf & " "
end if
End Function

It results with this:

Is there some way around putting tags on either side of the Else statement?


texts:
Is there a WFS library that will work with typescript or angular 4
I would like the access a WFS server without showing a Map on the page so I dont think openlayers will work for me.


texts: QSpatiaLite Plugin: LINESTRINGZ(x y z, ...) supported?

texts:
I get an error when trying to import this query as a spatial table in QGIS:

select geomFromText('LINESTRING Z(13.091464 47.061328 2597, 13.092059 47.061287 2580)') as geometry

  'The result can't be loaded in QGIS..'

However, the results-panel of the QSpatiaLite Plugin shows a column with a valid 'GeomObject'

Does anybody know what's the problem here?


texts: Calculating number of rows for seperate objects (shapefiles) at once in QGIS

texts:
I have around 750 seperate shapefiles of species distribution data.
For each species i want to calculate the number of atlas squares it occures in. Doing this for each object seperately seems a tedious job and i think there might be a faster way of doing this.

An example of the distribution map:

So, Herniaria occurs in three atlas squares (or circles in this case). Hydrochaeris in 19 and Holcus in a whole lot. I have around 750 of these maps and i dont want to select each of these seperate, and go to the attribute table to calculate the number of rows (which is the number of atlas squares). I am trying for a while now, but cant find a way to do this for all the maps at once.

In the best scenario, the end product would be a list/CSV/XLS/TXT file with one column for the species and one column for the abundance (i.e. the number of atlas squares).

I hope this is possible.


texts:
I've tried to geocode with MMQGIS Plugin a CSV file with addresses (converted from an Excel file) and I get an error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xf1 in position 0: invalid  continuation byte

I've tried to save the CSV file with option UTF-8 but didn't found an option like it:

How can I handle this?


texts: python's .replace doesn't work in QGIS' python editor

texts:
I am trying to compare some files to a datalist. The datalist's names are all in english letters, while the datafiles have the scandinavian "æ" "ø" "å" letters.

an example:
the file "Kystnære_måger.shp" and the datalist name "kystnaere_maager" are compared using

filename_UK = ('Kystnære_måger'.lower().replace("ø", "oe")
.replace("æ", "ae").replace("å", "aa").replace(".shp", ""))
dataname = "kystnaere_maager"

print (dataname == filename_UK)

In Pyscripter, using a default Python 3, the value returned is True. If the above statement is run in the python EDITOR window (not the python console) in Qgis 3.2, the returned value is False

can anyone give any explanation for this, or some way to circumvent it? I need to use the editor, as the python console in qgis doesnt handle many lines of code very well.

to be precise, the actual output from the qgis python editor is:
     exec(open('C:/Users/JonJon/AppData/Local/Temp/tmpnzhq2w9i.py'.encode('utf-8')).read())
False


texts:
I am using QGIS for GIS maps, and data visualization. There are very few symbols available for marker, line and polygons. I want to create my own symbols, that i can later import into QGIS and then use it.

I know that QGIS support XML format for symbols, so any symbol with that XML can be imported into QGIS.

How can i create my own symbol in any software and then export that into QGIS supported format?

There is a way of doing the same thing is ArcMap i.e.. create symbol in FONTOGRAPHER and then export it into ArcGIS Support .style file using Enterprise Architect, i need to do the same for QGIS.


texts: Can preset name be used in QGIS expression?

texts:
Does anyone know if it is possible to use a Preset name in the expression builder in the Print Layout?

I was hoping to use the present name as the Map Title in a text box, but can't find a variable in the expression builder that might be able to call it in.


texts: Stacking labels in ArcMap without Maplex?

texts:
I do not see any obvious setting for stacking labels in ArcMap (ArcView license).

Am I missing something or do i have to write a complex expression to stack my labels?


texts: Convert tiff file with multiple bands into a single csv file

texts:
I have a GeoTIFF file which contains 13 bands and I want to create one .csv file using gdal_translate, but by default gdal generate one CSV with 1 bands data

I want this kind of CSV:

 lat     longi  band1 band2 band3 band4
 2.565   45.545  45    65    34    34

I want to know if it is possible using gdal.

gdal_translate -of XYZ -b 4 -b 8 subset_S2A_OPER_MTD_SAFL1C_PDMC_20161017T172323_R019_V20161016T050802_20161016T051302_resampled_b4_b8_reprojected.tif subset_S2A_OPER_MTD_SAFL1C_PDMC_20161017T172323_R019_V20161016T050802_20161016T051302_resampled_b4_b8_reprojected.csv

Here only one band is selected ......


texts:
Recently, I started having problems with my C# projects running ArcGIS10.1 geoprocessing tools. My tools point to custom scripts in project toolboxes. The code in question has run without issue in the past.

However, something in my environment has changed and even the simplest code throws errors. Please see sample below. The code fails on gp.Execute(). I've triple checked, labels, names, paths, parameters etc.

I've tried every thing I can think of to track down this problem including re-installing Arc. I'm dead in the water if I can't solve this nasty problem.

Thanks in Advance

    private void runTool()
    {
        try
        {

            Geoprocessor gp = new Geoprocessor();
            gp.AddToolbox(@"C:\0_Test\Test.tbx");

            IVariantArray parameters = new VarArrayClass();
            parameters.Add(@"MyStringArg");

            // Execute the tool.
            gp.Execute("test", parameters, null);

        }
        catch (Exception ex)
        {
            System.Windows.Forms.MessageBox.Show(ex.Message, "TestGP Error", System.Windows.Forms.MessageBoxButtons.OK);
            return;
        }
    }


texts: Read Elevation from 1/3 Arc-Second NED .tif or .img

texts:
I'm trying to read multiple elevations from a USGS 1/3 arc-second IMG / GeoTIFF file.

A sample of the files is available here (5 MB):
http://tdds3.cr.usgs.gov/Ortho9/ned/ned_13/img/n43w108.zip

I can query the .img file and get the elevation using GDAL:
gdallocationinfo -wgs84 imgn60w145_13.img -144.267361111152354 59.9981944444444082

This returns:
Report:
  Location: (7918P,25L)
  Band 1:
    Value: 1.2593731880188

Because a GeoTIFF can be read quite a bit faster than an IMG file (in my benchmarks) I convert the IMG to a WGS84 GeoTIFF:
gdal_translate -a_srs WGS84 -of GTiff imgn60w145_13.img imgn60w145_13.tif

gdallocationinfo only supports querying one point at a time.  I need to get the elevation every 10 meters between 2 points (along a straight path), so I'm trying to read the file directly, with the following PHP code (but the approach is the same in C or Python):

$STRIPOFFSETS = 230; // 0xe6
$LEN_OFFSET = 4;

$DATA_VOID = 0x8000;    // data void ( = signed int -32768)
$LEN_DATA = 4; // the number of bytes containing each item of elevation data // ( = BitsPerSample tag value / 8)

$fp = fopen("imgn60w145_13.tif", 'rb');
if ($fp === false) {
    echo "Could not open the file\n";
}

// first data offset
fseek($fp, $STRIPOFFSETS);

// find the location of the required data row in the StripOffsets data
$dataOffset = $STRIPOFFSETS + ($row * $LEN_OFFSET);
fseek($fp, $dataOffset);
$dataBytes = fread($fp, $LEN_OFFSET);
$data = unpack('VdataOffset', $dataBytes);
echo print_r($data, true);

// this is the offset of the 1st column in the required data row
$firstColOffset = $data['dataOffset'];

// now work out the required column offset relative to the 1st column
$requiredColOffset = $col * $LEN_DATA;

// combine the two and read the elevation data at that address
fseek($fp, $firstColOffset + $requiredColOffset);
$dataBytes = fread($fp, $LEN_DATA);
echo "1: " . $firstColOffset . " + " . $requiredColOffset . "\n";
echo "2: " . $LEN_DATA . "\n";
echo "3: " . $dataBytes . "\n";
$data = unpack('velevation', $dataBytes);

$elevation = $data['elevation'];
if ($elevation == $DATA_VOID) {
    $elevation = 0;
}
echo $elevation . "\n";

I don't know that I have the right values for $STRIPOFFSETS, $LEN_OFFSET, or $LEN_DATA.  The code above is a limited snippet from SRTMGeoTIFFReader (http://www.osola.org.uk/elevations/index.htm), which I'm not able to get to work either.

I'd really prefer to be able to do this using a direct approach similar to the above (no external libraries, etc), but I can live with a Python / GDAL approach as well.

Thanks!


texts: Transit webapp development (journey planner)

texts:
I am going to develop a journey planner (like Google transit), i was just wondering that if there any opensource API available that can help me, or i have to do every thing on my own.
And where can i find some help to get started.
kindly help me out .
Thanks.


texts: How to add any WMS layer on Google Earth Plugin in my web application?

texts:
I have a GIS application which allows user to draw features on Google Earth plugin included on my web application.

Now i want to give an option of adding any wms layer on the google earth plugin if needed.

I searched on the internet for answers but the only solution was through Image Overlay option which is not available on google earth plugin.


texts: What percentage of polygon x is in raster pixel y, efficiently

texts:
I feel this is a competition worthy problem, due to its size.

I would like to weight a set of raster pixels to the attributes of a set of polygons. To do this I need to know the proportion of each polygon in each raster pixel.

I'd also like to keep IDs of both the pixel and the polygon on the final output.

Sometimes the polygons are larger than the pixels, sometimes smaller. Pixels with a value of 0 can be excluded.

The polygons I am working with are Statistical Area Level 1 (SA1) ASGS Ed 2011 and they can be found at the bottom of this page:

http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.001July%202011?OpenDocument

The raster I am working with is here:

http://www.abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.0072011?OpenDocument

I believe these are GDA94, the polygons are epsg:4283, the raster is epsg:3577

As you'll notice these are both large, which is why efficiency is important.

Any open source solution (R, QGIS etc.) would be best, although if there is an efficient solution in ArcGIS or MapInfo it would be interesting to know of it.


texts: Qgis Least Cost Path with certain threshold

texts:
I have DEM data on which I have performed Slope Analysis and extracted contours from it as well. After slope analysis the contours with slope greater than 450 have been transformed into polygons (considered as obstacles). Now I would like to create two points on this map and want to find a path that will avoid these obstacles (contours having slope value greater than 450).

How can I create two points?
How can I find the path drawing between these two points, that will avoid the obstacles?

I am working in QGIS.


texts: Add an expression to calculate an attribute in the print composer with PyQGIS

texts:
In the print composer, it's possible to add an expression in the window "select attributes", in order to display an attribute that wasn't calculated in the attribute table of a layer, see an example below :

I would like to display 2 attributes containing area values, in hectares (unit of 'sup' and 'supepnd') and in acres, without if possible calculating new fields.
I am using the following expression : format_number(field*2.47105,2)
Is it also possible using PyQGIS?
For now, I tried to copy the expression in the list of fields to display, but it's not working :
pdf_table = QgsLayoutItemAttributeTable.create(layout)
pdf_table.setVectorLayer(pdf)
pdf_fields = ['champ','sup','supepnd',format_number('sup'*2.47105,2),format_number('supepnd'*2.47105,2)]
pdf_table.setDisplayedFields(pdf_fields, True)

I thought maybe I should clone the columns, calculate the 2 new fields and set the content of the attribute table, but I don't understand how to call the columns values. I get "AttributeError: 'QgsLayoutTableColumn' object has no attribute 'setContents'".
pdf = project.mapLayersByName('plan_de_ferme')[0]
champ_field = pdf.fields().indexFromName('champ')
sup_field = pdf.fields().indexFromName('sup')
supepend_field = pdf.fields().indexFromName('supepnd')
features = pdf.getFeatures()
champ = []
sup = []
supepend = []
nsup = []
nsupepend = []
length = 0
for feat in features :
    attr0 = feat.attributes()[champ_field]
    attr1 = feat.attributes()[sup_field]
    attr2 = feat.attributes()[supepend_field]
    champ.append((str(attr0)))
    sup.append(round(float(attr1),2))
    supepend.append(round(float(attr2),2))
    nsup.append(round(float(attr1*2.47105),2))
    nsupepend.append(round(float(attr2*2.47105),2))
    length += 1
tab = []

for i in range(length):
    tab.append([str(champ[i]), str(sup[i]), str(supepend[i]), str(nsup[i]), str(nsupepend[i])])

cols = pdf_table.columns()
new_cols = [col.clone() for col in cols]
for i, cloned_col in enumerate(new_cols):
    cloned_col.setContents(tab[i])
pdf_table.setColumns(new_cols)
#refresh layout
layout.refresh()

I also thought of adding the last two columns of the text table created previously next to my attribute table, but I am making an atlas and need the table to show only features visible on the map (changing for each page), and like a text table is not linked to a layer I don't think it will work.


texts: Apply affine transformation to multiple layers

texts:
I have many shapefiles representing the layers of a map (roads, buildings, etc). In total, I have hundred of layers, and I want to scale all of them by the same factor. I know I can use the affine transformation plugin to do that, but I was looking for an automatic way to do all 100+ layers to avoid having to do it manually every time.

Is there any such thing?


texts: Programmatically removing Annotation items crashes QGIS 3.10

texts:
I'm writing a plugin (based on Plugin Builder 3 "tool button with dialog") to allow complex annotation in QGIS 3.10.5, and whilst I can add annotations OK, as soon as there's more than one, I can't remove them without crashing QGIS.
Annotation is added by
# Do something useful here - delete the line containing pass and
# substitute with your code.
marker = QgsMarkerSymbol.createSimple({"size":"0.1","color":"blue"})
layer = self.iface.activeLayer()
for feature in layer.selectedFeatures():
    attrs = feature.attributes()
    geom = feature.geometry()
    point = geom.asPoint()
    easting = point.x()
    northing = point.y()
    html = "

{int(attrs[1])}	{attrs[2]}
"
    html += "
{int(attrs[5])} cas	{int(attrs[6])} veh
"
    html += "

"
    htmlData = eval("f'"+html+"'")   # substitutes the layer attributes into the html text string

    content = QTextDocument()
    content.setHtml(htmlData)

    annot = QgsTextAnnotation()
    annot.setFrameSizeMm(QSizeF(25, 12))
    annot.setMapLayer(layer)
    annot.setFrameOffsetFromReferencePointMm(QPoint(15, 15))
    annot.setMapPositionCrs(QgsCoordinateReferenceSystem(layer.crs()))
    annot.setMapPosition(QgsPointXY(easting, northing))
    annot.setMarkerSymbol(marker)
    annot.setDocument(content)
    QgsProject.instance().annotationManager().addAnnotation(annot)

That creates the annotation items OK

To remove the annotation, I'm doing...
def clear_annotations(self):
    annotations = QgsProject.instance().annotationManager().annotations()
    for annot in annotations:
        QgsProject.instance().annotationManager().removeAnnotation(annot)
    #
    # or, by swapping what's commented out...
    #
    #QgsProject.instance().annotationManager().clear()

I've tried deleting them both individually, and by clearing all annotation, and whilst it works OK if I've only created a single annotation item, QGIS crashes as soon as there are more than one. Adding QMessageBoxes leads me to believe that the crash is on the second call to the annotationManager.
Using the python console instead doesn't help, and if I try to remove the annotations manually using the toolbar Annotation tool, I can delete the first annotation item, but I get "Access violation - no RTTI data!" as soon as I click on the next, and have to kill QGIS.
Has anyone any idea what I'm doing wrong?
ThomasG77 has provided the correct answer


texts: DEM polygonize (raster to vector) doesn't work for contour lines less than 1 meter apart? (QGIS)

texts: I tried to make polygon from DEM (geotiff) in QGIS. My requirement is that elevation value was every 0.5m of polygon. If I use the function  polygonize (raster to vector)  , polygon is created but only 1 meter elevation value. It's possible created this polygon with 0.5m elevation value please?


texts: Display selected feature next to winform window

texts:
I'm trying to achieve a scenario like below image
when a row selected in Grid, the selected row's feature should be visible next to winform window

But in my case, I'm stuck with a selected feature is back of grid form, the code so far I worked

private void zm2Feat(IFeature pFeat, IMap pMap)
        {
            IActiveView pActVw = (IActiveView)pMap; IEnvelope pEnv = null;
            try
            {
                //zoom to feat
                IPoint pPnt = (IGeometry)pFeat.ShapeCopy as IPoint;
                HIlightFeatures(pFeat.ShapeCopy, pMap);
                IPoint pnewPnt = new PointClass(); pnewPnt.X = pPnt.X + 50; pnewPnt.Y = pPnt.Y;
                ITopologicalOperator pTopoOp = (ITopologicalOperator)pnewPnt;
                IGeometry newGeom = pTopoOp.Buffer(50);
                pEnv = newGeom.Envelope;  pActVw.Extent = pEnv;
               clsGeneralFunctions.pMap.MapScale = 1000;
                pActVw.Refresh();
            }
            catch (Exception)
            {
                throw;
            }
        }

How can I move selected feature next to winform window?


texts:
I have a function that i want to call when you start pinchzoom on the map. This function turns off all vector layers to improve performance while panning zooming.

I got another function that is called with "moveend"  which turns  the vector layers back on after zoom pan finishes. I have both these functions already written.

I registered "movestart" and "zoomproxy" hack to trigger the layers to be turned off as soon as user starts panning or zooming. Everything works except on a mobile device where pinch zoom does not turn off the vector layers. it does not seem to call my function.

I know there is a pinch handler that could possibly be added onto a control and attached to the map. Could you please provide some details on how to do do this and in turn call my function to turn off layers at the start of pinch zoom.

The following worked for me.

map.events.register("touchstart", map, function({hideLayersBeforePanOrZoom();});

I need to solve one more problem related to this however.
PinchEnd.
I want to be able to use a event listener for PinchEnd and call a function to display a dialog box indicating "Processing.Please wait". The function is ready and working. I tried to add the following code below but it does not work completely. Its an event handler rather than an event listener.

I want my function to fire but the system should continue the normal PinchEnd event handling. Looks like my function fires but it does not return the control back and finish whatever it is supposed to do for the PinchDone event. Can you please suggest how to register this as an event listener rather than an event handler. This is the last issue I need to resolve in order to complete my prototype for a demo. Any help would be much appreciated. Thanking You

map.addControl( new OpenLayers.Control.PinchZoom({pinchDone: function(  evt, pinchData  ){showProcessingIndicator();}}));


texts: Getting boundary coordinates from given lat,long and radius

texts:
I have:

lat-long : (41.8719 , 12.5674 )

Radius: 50 meters

I want all the boundary coordinates from that given point.

I would like some scala code for this.


texts: Binding angularjs inside leaflet path message

texts:
I am trying to bind angular attributes inside to angular leaflet directive's path message.But I couldn't do it.my code is below. As you see, it doesn't apear my $scope value.

 $scope.pth = {
        p1: {
            color: '#0ff',
            weight: 8,
            latlngs: [
                { lat: 48.83, lng: 2.37 },
                { lat: 41.91, lng: 12.48 }
            ],  message:"hello worldv  {{a}}",
            getMessageScope: function () { return $scope; },
        }
    }
    $scope.a="{{2+3}}";

you can click here to look at my code.


texts: How to supply user and password to download USGS data with wget?

texts:
I think that http://e4ftl01.cr.usgs.gov/ has recently applied a login and pass authentication to retrieve data.
my script was working before, but now it comes with an error
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.

I have login and pass, so how and where do I put it in the script?

#!/bin/sh

  for YEAR in  2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 ;
  do
     wget -r -l1 -p -nd -e robots=off -A "*h17v03*","*h18v03*" -R .jpg -R .xml http://e4ftl01.cr.usgs.gov/MOLA/MYD13Q1.005/$YEAR.07.03

wget -r -l1 -p -nd -e robots=off -A "*h17v03*","*h18v03*" -R .jpg -R .xml http://e4ftl01.cr.usgs.gov/MOLA/MYD13Q1.005/$YEAR.07.04
done

#!/bin/sh


texts: Geoserver WFS Layer in OL3 tilted and mirrored

texts:
I am using Geoserver (2.4.2) to display a WFS-Layer in Ol3 (3.13.0). I successfully used this example from a fellow user to get things going. Here is my modified code. I am sorry for not providing a fiddle since my Geoserver ist not accessible from the outside.

<!doctype html>

    <meta charset="utf-8">
    <link rel="stylesheet" href="./ol.css" />

The result is a tilted and mirrored WFS layer ontop a WMS layer that is displayed ok. See pic

I checked both layers in QGIS to make sure both layers are actually OK and not tilted in any way. When I change the $.ajax GET-Parameter outputFormat to 'application/json' and inside the function loadFeatures format = new ol.format.GeoJSON() everything looks as it is supposed to. See pic

So I wonder if this is an error with my code, Openlayers or Geoserver error?


texts: Bad positions of items in saved template

texts:
I work with QGIS 3.8

I saved project with print layout which looks good even if I open it again.

Also I saved template of it - but when I create a new layout and open that saved template - it is all wrong.
Am I missing something? Page size is the same as in the saved project.

Is there any option to fix this?
Or is it possible to save that print layout like a file to copy/paste for another coworkers/computers?


texts:
Running getGetFeatureInfoUrl() against a TileWms source returns:
Either no layer was queryable, or no layers were specified using QUERY_LAYERS

My URL is:

  https://geoserver.xxx.com/geoserver/yyy/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&format=image%2Fpng&version=1.1.1&layers=yyy%3Aboundaryline&tiled=true&INFO_FORMAT=application%2Fjson&I=219&J=208&WIDTH=256&HEIGHT=256&CRS=EPSG%3A3857&STYLES=&BBOX=-508764.86026613414%2C6966165.009797823%2C-469629.1017841239%2C7005300.768279833

GeoServer docs say:
If application/vnd.ogc.gml is supported the request should be successful.
All of the layers in question have GML as an available output format in the layer preview options in GeoServer.

OpenLayers docs say:
If QUERY_LAYERS is not provided then the layers specified in the LAYERS parameter will be used.
LAYERS params is set on all these layers upon configuration.


texts: Buffering polygons depending on raster values

texts:
I have many polygons representing mountain lakes. I need information about the slope of surrounding mountainsides in order to estimate the chance of avalanches or rockfalls into the lakes. (Btw: I'm relatively new to Python but need to do this for thousands of lakes so I think I will have to use ArcPy.)

My plan is to create a buffer around every lake for which I then can extract the slope values from my raster. But I only need those parts of a buffer that lay above the surface elevation of the lake (and can therefore be the origin of something falling into the lake).

My workflow would be to create the buffer, extract the values from the slope raster and set every pixel to NA where the value in the underlying DEM falls under the surface height of the lake.

Is this a valid plan or is there some ArcPy-package that could help me?
EDIT: It would also be possible to work with R.


texts: Downloading Sentinel 3 data using Python

texts:
I need yo download Sentinel 3 data with Sentinelsat python api but all I get after downloading is a bunch of .nc files and a xml file. But I was expecting the OLCI sensor data products. Here is the code I am using.
# connect to the API
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
#import geopandas
api = SentinelAPI('XX', 'XX', 'https://scihub.copernicus.eu/dhus')
# download single scene by known product id

#api.download(<product_id>)
# search by polygon, time, and SciHub query keywords
#footprint=POLYGON ((172.004255361271 66.3536004879411,172.495083017778
66.3596341182359,172.453099135439 66.1348280545081,172.085061564384 66.1162434151038,172.004255361271
66.3536004879411))
footprint = 'MULTIPOLYGON(((172.0043 66.3536,172.4951 66.3596,172.4531 66.1348,172.0851
66.1162,172.0043 66.3536)))'#geojson_to_wkt(read_geojson(r'C:\Users\v-mmfarhad\sample.geojson'))
products = api.query(footprint,
date=('20160129', date(2016, 5, 10)),
platformname='Sentinel-2',
cloudcoverpercentage=(0, 30))

# download all results from the search
api.download_all(products)

Apart from that is there any other python api to download Sentinel 3 data?


texts: Zonal stats of multiple rasters in Python

texts:
I have a python script to get the zonal stats for one raster. Trying to use the same for multiple rasters.
I have seen so many answers on similar post but somehow none seems to be working on mine.

Here is my code for the single raster stats.

import pandas as pd
import numpy as np
import geopandas as gpd
import rasterio as rio
from rasterio.plot import show
from rasterio.mask import mask
import matplotlib.pyplot as plt
import shapely

band1 = rio.open("C:/Users/mahanp/Desktop/BRZ-tmin/tmin/rep/f072_rep.tif.tif")
districts = gpd.read_file("C:/Users/mahanp/Desktop/BRZ-tmin/tmin/rep/test.shp")
#districts = districts[["id", "Name",]]
districts.head()

band1.height
band1.width

fig, ax = plt.subplots(1, figsize=(12, 10))
show(band1, ax=ax)
plt.show()

fig, ax = plt.subplots(figsize=(12, 10))
show(band1, ax=ax)
districts.plot(ax=ax, color="black", alpha=.90)
plt.show()

def derive_stats(geom, data=band1, **mask_kw):
    masked, mask_transform = mask(dataset=data, shapes=(geom,),
                                  crop=True, all_touched=True, filled=True)
    return masked

districts['max'] = districts.geometry.apply(derive_stats).apply(np.max)
districts['min'] = districts.geometry.apply(derive_stats).apply(np.max)
districts.head()

Code for multiple raster

import pandas as pd
import numpy as np
import geopandas as gpd
import rasterio as rio
from rasterio.plot import show
from rasterio.mask import mask
import matplotlib.pyplot as plt
import shapely
import os
import glob

inraster_path = 'C:\\Users\\MahanP\\Desktop\\BRZ-tmin\\tmin\\rep'
districts = gpd.read_file("C:/Users/mahanp/Desktop/BRZ-tmin/tmin/rep/test.shp")
districts.head()

# Make a search criteria to select the raster files
search_criteria = "*.tif"
inraster = os.path.join(inraster_path, search_criteria)
print(inraster)

# glob function can be used to list files from a directory with specific criteria
zonal_fps = glob.glob(inraster)

# Files that were found:
print(zonal_fps)

# Iterate over raster files and add them to source -list in 'read mode'
for fp in zonal_fps:
    band1 = rio.open(fp)
    band1.height
    band1.width

    districts1 = districts
    districts1.head()

    fig, ax = plt.subplots(1, figsize=(12, 10))
    show(band1, ax=ax)
    plt.show()

    fig, ax = plt.subplots(figsize=(12, 10))
    show(band1, ax=ax)
    districts1.plot(ax=ax, color="black", alpha=.90)
    plt.show()

    def derive_stats(geom, data, **mask_kw):
     masked, mask_transform = mask(dataset=data, shapes=(geom,),
                                  crop=True, all_touched=True, filled=True)
     return masked

    districts1['max'] = districts1.geometry.apply(derive_stats, args=(band1, )).apply(np.max)
    districts1.head()

The code just plots the vector file on the raster and nothing happens.

What am I doing wrong?


texts:
I am trying programmatically to download a number of Proba-V NDVI images in tiff format from the VITO website (http://www.vito-eodata.be/PDF/portal/Application.html#Home). Final objective is to prepare an input file with all the urls and then download them. I wrote this code, where I set my own username and password but it does not work (response code is 500, but it is not a server problem)

import requests
username = myUserName
psw = myPassword
url = r"http://www.vito-eodata.be/PDF/datapool/Free_Data/PROBA-V_100m/S5_TOC_NDVI_100_m/2016/9/1/PV_S5_TOC_NDVI-20160901_100M_V001/PROBAV_S5_TOC_X00Y00_20160901_100M_NDVI_V001_NDVI.tif"
resp = requests.get(url, auth(username, psw))

I suspect that this has to do with the headers of my request.

Any suggestion?


texts: Making DEM raster file using centroid point shapefile in QGIS?

texts:
I had a DEM file at first. Then I converted it to centroid points vector to add some data to it. So, I ended up with a vector with millions of points. Now I added my data and I want to use "elevation" attribute to again make a raster out of my points.

My elevation attributes column range is from 0.0000 to 22.3200 but waterer method I have so far tried gave me a raster layer with an irrelevant range e.g.. 8.500 to 10.500.


texts: I have a list of coordinates that make up a route - how can I easily render this shape on a map?

texts:
Additional info - I don't need this to be on a map - I just need the shape of the route.  Is there anything that can return that shape easily?

The list of coordinates are in an XML document and I'd like to be able to update that XML when I'm heading to a new location.

Edit 1:
Thanks for the comment! here's the structure below:

<shape>
               <element>42.18462</element>
               <element>-88.63731</element>
               <element>42.18557</element>
               <element>-88.64003</element>
               <element>42.18853</element>
               <element>-88.64849</element>
               <element>42.19017</element>
               <element>-88.65314</element>
               <element>42.19106</element>
               <element>-88.65573</element>
</shape>

Any thoughts?

Edit 2: One more option -- I can get this as WKID coordinates as well:

<Shape>41.8857613,-87.6230011 41.8857689,-87.6222992 41.8851204,-87.6222916 41.8844986,-87.6222687 41.8844604,-87.6239014 41.8844604,-87.6244278 41.8844604,-87.6251984 41.8844604,-87.6253281 41.8844604,-87.6262283 41.8844604,-87.6264114 41.884491,-87.6279068 41.8844719,-87.6294632 41.8844795,-87.6309204 41.8844719,-87.6316833 </shape>


texts: Get the name of the layer when I click on it with openlayers 3

texts:
I have a question, I need to make more than one GetFeatureInfo (obtaining information under the layer that you click), and for this I need the name of the layer I click on it to get the information.

Anyone know how to get the name of this layer?

This is my getFeatureInfo code:

map.on('click', function(evt) {
          var pixel = map.getEventPixel(evt.originalEvent);

          var url = WMS2.getSource().getGetFeatureInfoUrl(
              evt.coordinate, viewResolution, 'EPSG:3857',
              {'INFO_FORMAT': 'application/json',
               'propertyName': 'referencia'});

          if (url) {
            var parser = new ol.format.GeoJSON();
             $.ajax({url: url,

                    dataType: 'json',
                    success:function(response) {

              var result = parser.readFeatures(response);

              if (result.length) {
                var info2 = [];
                for (var i = 0, ii = result.length; i < ii; ++i) {
                  info2.push(result[i].get('referencia'));
                }
                document.getElementById("Getfeatureinfo").value = info2;

              } else {
                document.getElementById("Getfeatureinfo").value = info2;

              }
            }});


texts: Disabling ContrastEnhancement in GeoServer?

texts:
I am using Geoserver to upload and display GTiff images in OpenLayers. The images are unsigned 16 bit grayscale at about 300MB size and are processed to to give better performance using the methods here.

When viewing the images in OpenLayers it changes darkness when zooming in/out and from what I understand this is coming from the ContrastEnhancement property in the style script (SLD).

This is not necessary with the images I have and are only lowering the performance.

Is it possible to disable this altogether?

Changing from Normalize to Histogram in SLD makes it better, but now black values for some reason will be treated as no-value and become transparent when zooming in.

I am fairly new with GeoServer.


texts: How to get part of a linestring that is less than 300 meters apart from another linestring?

texts:
I've two linestrings Line1,Line2. I'm trying to get the part of Line1 that is 300m apart from line2.

line1 = "LINESTRING(72.863221 18.782499,72.863736 18.770147,72.882275 18.756169,72.881417 18.750805,72.878842 18.736987,72.874379 18.709512,72.860989 18.679593,72.864422 18.653897)"
line2 = "LINESTRING(72.883133 18.780793,72.882103 18.760314,72.862534 18.716422,72.860474 18.683577)"

I used the ST_DWithin function but it returns the whole linestring if the distance is lesser than 300 meters. Here's my query:

road2 = "ST_GeographyFromText('SRID=4326;%s')"%line1
road4 = "ST_GeographyFromText('SRID=4326;%s')"%line2
cur.execute("SELECT ST_AsText(road1) from %s as road1,%s as road2
            where ST_DWithin(road1,road2,500)"%(road2,road4))
res = cur.fetchall()
print res

Can anyone tell me what I'm doing wrong ?


texts: How to resolve missing Python module (importlib) for GRASS/Sextante?

texts:
I have installed the nightly build of QGIS 1.9 from Larry's Dakota Cartography site, and have downloaded the latest Frameworks from William's Kyng Chaos site.

However, I am unable to install the Sextante plugin, and therefore cannot access the GRASS plugin for QGIS.  The Sextante plugin is "Invalid" and requires a missing Python module (importlib).

Any suggestions on how I can resolve this issue?  I know I have not provided all of the information that I probably need to provide, so if additional information is needed, please ask, and I will do my best to provide it.  Many thanks.

QGIS 1.9 GRASS/Sextante Plugin Error, OSX 10.6.8


texts: Improve performance of a PostGIS st_dwithin query

texts:
I am doing a local statistic, similar to the the one described in an earlier question / answer:

SELECT a.tree_id, a.species, avg(b.age) as age_avg, count(*) as samples, a.geom
FROM trees a LEFT JOIN trees b
ON ST_DWithin(a.geom, b.geom, 100) AND a.species = b.species
WHERE a.age IS NULL
GROUP BY a.tree_id, a.species, a.geom;

This finds all trees of the same species in a radius of 100 meters. This works quite nicely for small datasets with few missing data points (WHERE a.age IS NULL).

However, when I run the query for a larger dataset with more missing data, it gets very slow (i.e. several hours / days). In this case 6000 of of a total of 200000 points have no value (a.age).

Do you see a way to increase the speed of the query? Maybe an alternative function to st_dwithin is helpful?

UPDATE - EXPLAIN ANALYZE says:

  HashAggregate  (cost=2721694211.11..2721694280.52 rows=6941 width=26) (actual time=12571.761..12571.774 rows=8 loops=1)

  Group Key: a.id, a.age, a.species

  ->  Nested Loop Left Join  (cost=0.00..2721694141.70 rows=6941 width=26) (actual time=655.504..12570.495 rows=167 loops=1)
          Join Filter: ((a.geom && st_expand(b.geom, 300::double precision)) AND (b.geom && st_expand(a.geom, 300::double precision)) AND _st_dwithin(a.geom, b.geom, 300::double precision))
          Rows Removed by Join Filter: 11210316

  ->  Seq Scan on trees a  (cost=0.00..251349.76 rows=6941 width=54) (actual time=213.037..1006.055 rows=8 loops=1)
                Filter: ((age IS NULL))
                Rows Removed by Filter: 1401302

  ->  Materialize  (cost=0.00..254946.52 rows=1438701 width=36) (actual time=0.004..326.335 rows=1401310 loops=8)

  ->  Seq Scan on trees b  (cost=0.00..247753.01 rows=1438701 width=36) (actual time=0.011..1490.796 rows=1401310 loops=1)

  Planning time: 0.186 ms
  Execution time: 12597.034 ms


texts: ArcGIS python toolbox: GPFeatureLayer parameter "loses" symbology type

texts:
I'm pretty new at ArcGIS python toolboxes. Here is one problem I've been fighting with for a while.

I want to create an output layer (GPFeatureLayer) with a specific symbology (GRADUATED_COLORS) and then modify the parameters of the symbology to "light up" features with a given value in a specific field.

First I create a layer in ArcGIS, selected a datasource (shapefile), applied the GRADUATED_COLORS symbology, and save it as layer file.

In my toolbox, within the def getParameterInfo(self): method, I define the output parameter as:

out_layer = arcpy.Parameter(displayName="Output layer showing the results",
                            name="out_layer",
                            datatype="GPFeatureLayer",
                            parameterType="Required",
                            direction="Output")
GV_LYR = os.path.join(os.path.dirname(__file__), "graduated_colors_point.lyr")
out_layer.symbology = GV_LYR

Later on, within the def execute(self, parameters, messages): method,

I first create the out_layer using arcpy.management.MakeFeatureLayer(in_layer, out_layer) (where out_layer = parameters[2].valueAsText and in_layer = parameters[0].valueAsText),
then I extract the output layer object using out_layer_obj = parameters[2].value

Following this step, I would like to modify the parameters of the symbology (valueField, classBreakValues, classBreakLabels) to fit my needs but when I check for the symbology type (out_layer_obj.symbologyType) I get OTHER instead of GRADUATED_COLORS. At the same time, within the ArcGIS map, a new layer is created with GRADUATED_COLORS symbology, and relative parameters, copied from the graduated_colors_point.lyr.

I've also tried a different approach when I created a plain out_layer without specifying the type of symbology in the parameter definition and then use the following:

GV_LYR = os.path.join(os.path.dirname(__file__), "graduated_colors_point.lyr")
sym_layer_obj = arcpy.mapping.Layer(GV_LYR)
arcpy.management.ApplySymbologyFromLayer(out_layer, sym_layer_obj)
out_layer_obj = arcpy.mapping.Layer(out_layer)

In which case it seems to work properly only on my computer while, anybody else who tried it (on same and different version of ArcGIS) gets the following error: ERROR 000968: The symbol layer does not match the input layer when running the ApplySymbologyFromLayer function.

Any suggestion or comment?

ADDENDUM

In the process of trying to figure out what's happening while the toolbox executes, I've noticed the following. While the out_layer parameter is defined as described above, there is also an in_layer parameter that is defined as follows:

in_layer = arcpy.Parameter(displayName="Layer containing selected SqueeSAR data",
                           name="in_layer",
                           datatype="GPFeatureLayer",
                           parameterType="Required",
                           direction="Input")

When, right at the beginning of the def execute(self, parameters, messages): method, I look at the object types of the parameters values:

in_layer = parameters[0].value
arcpy.AddMessage("Input layer: {0}".format(type(in_layer)))

out_layer = parameters[2].value
arcpy.AddMessage("Output layer: {0}".format(type(out_layer)))

I would expect for both of them to register as geoprocessing Layer object but this is true only for in_layer whereas out_layer is registered as geoprocessing value object. (My     updateParameters(self, parameters): and updateMessages(self, parameters): methods are empty).


texts:
Somebody else in our CartoDB organisation has created a map.

I need to use the Static Maps API to get a .jpg image from the map, as described here.  I'll be storing the .jpg locally and serving it up to a customer via our own API.

I've tried various values for the :token parameter, but none seems to work:

map name (slightly complicated because it contains a space, which I've substituted with both + and %20)
our API key (we use CartoDB.js elsewhere in our organisation)
the GUID in the three samples I see when on https://<ouraccount>.cartodb.com/dashboard/maps I click "publish" on the map.

This leads me to construct a URL like:

https://<ouraccount>/api/v1/map/static/center/<token>/14/-41.2588729/174.8958929/200/200.jpg

But when I try to visit the URL in my browser, I get the message:

{"errors":["Invalid or nonexistent map configuration token '<token value>'"]}

How do I find the layergroupid?


texts: Creating inner ring of polygon using buffered geometry in JTS?

texts:
I am still a beginner to GIS.

I have a polygon and I want to draw a large border inside the that polygon (see fig A and B below).

With the library I am using, I have to do this with a polygon with "holes" (inner rings).

I use JTS to buffer the polygon with a negative value, which works most of the time.

The issue is that is some situations, the buffered geometry is self intersecting (fig C, red circles) and the rendering library does not like it (not one bit).

How can I go from fig. C to fig. D with JTS ?

The code is really simple (insetDeg is a negative value) :

  Geometry innerPoly = polygon.buffer(insetDeg);

I then add my innerPoly as an inner ring for the renderer

This is not a code related question, and to me it is more about geometry manipulation know-how.

"Do an intersection of the polygon with itself" is the tip I was looking for.


texts:
I have a set of points which are bus stops in a network separately. I also have a layer of road network. These bus stop points and the nodes of the network perfectly match so there is no need for alignment.

I want to perform the following tasks:

Filter only the bus network out of the entire road network: For this I want to connect all the points through the network layer
Create a separate attribute naming each bus route in that bus network.


texts: Comparing viewshed surface using ArcGIS for Desktop?

texts:
I have a couple of viewshed layers produced from specific points on the digital elevation model. Once I got the results, I was thinking about how should I compare them to see which point has bigger viewshed.

How do I measure the visible surface from the viewshed?

I am using ArcGIS for Desktop.


texts: How to convert non Web-Mercator coordinates to the tile Y, X, Z coordinates?

texts:
I just found that leafletjs and openlayers have two different conventions to convert coordinates from EPSG:4326 (WGS 84) to tile names ({Z}/{X}/{Y}).

Thus I would like to have more information about the origin and usages of such two standards, and I would also know if there is a generalized way to implement the conversions from any projection (using only proj4 data) to tiles names.

I added the following preliminary snippet to mod_tile, so that it can serve EPSG:4326 (WGS 84) tiles:

} else if (strcmp(srs, "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") == 0) {
    syslog(LOG_DEBUG, "Using wgs84 projection settings");
    prj = (struct projectionconfig *)malloc(sizeof(struct projectionconfig));
    prj->bound_x0 = -180;
    prj->bound_x1 =  180;
    prj->bound_y0 = -90;
    prj->bound_y1 =  90;
    prj->aspect_x = 2;
    prj->aspect_y = 1;

To display a tiled map I use:

Leafletjs

L.tileLayer('.../base/{z}/{x}/{y}.png');`

Openlayers

('.../base/{z}/{x}/{y}.png').replace('{z}', (tileCoord[0] - 1).toString())
                            .replace('{x}', tileCoord[1].toString())
                            .replace('{y}', (-tileCoord[2] - 1).toString());

The results with the two libraries is exactly the same, if I adapt the zoom level.

EDIT: My target is to provide a generalized patch for mod_tile (and ev. other services), but from the answer below, I think I need to provide extra parameters in a configuration file of mod_tile (e.g. renderd.conf) to generate the correct tile with the expected name.


texts: Quick Map Services not appearing in web dropdown menu

texts: I have installed the QMS plug-in but it is no longer displaying in the web drop-down menu. It was displayed earlier, but since it has disappeared. I have also attempted to re-install it.


texts:
I want to smooth polygons which share a common boundary. How can I smooth them
so that the shared boundaries stay shared?

I'm using Arcgis 10.3


texts: GRASS 7.2.1 Installation in Windows 10 StartUp Problem

texts:
I have attempted to use the GRASS plugin v.clean in QGIS 2.18.15 to sort out a messy polygon layer.
When I tried to run the algorithm. An error message popped up;

I attempted to open the existing GRASS software I had on my computer. This window pops up.

How do you install this software?


texts: OpenLayers/proj4js and the EPSG:27700 (UK) Projection

texts:
I'm trying to use OpenLayers to transform projections, which in turn uses the http://proj4js.org/ library.

  var ll = new OpenLayers.Projection('EPSG:4326');
  var a = new OpenLayers.LonLat(3,53).transform(ll,new OpenLayers.Projection('EPSG:900913'));
  var b = new OpenLayers.LonLat(3,53).transform(ll,new OpenLayers.Projection('EPSG:27700'));

a will have transformed fine, b will not.

Is it possible to get support for EPSG:27700?

http://osgeo-org.1803224.n2.nabble.com/Reprojecting-Google-td1827338.html suggests adding in a extra class, but that's 2 years old so I'm hopeing it's improved since then.


texts: Allow multiple users to share personal geodatabases safely?

texts: We're using ArcGIS 9.3 but for reasons beyond the scope of this question we have to stick with personal geodatabases (MS Access .mdb's) and multiple users. How can we set this up so only a limited few have write access and still allow the bulk of the users to use it?


texts: How to get GeoNetwork to search through PostGIS fields via GeoServer WMS

texts:
I can't seem to get GeoNetwork to search through my PostGIS fields via GeoServer WMS.

According to the GeoNetwork Documentation:

  it should loop over datasets served by
  the service and produce also metadata
  for each datasets

I have a simple test table with simple features in PostGIS for testing:

| id | date_creation | date_publication | Author | location                |
+----+---------------+------------------+--------+-------------------------+
| 27 |  12/24/2006   |    12/29/2006    |  MDA   | POINT(133.8855 -5.6701) |
| 24 |  02/11/1952   |    05/10/1952    |  NRO   | POINT(22.8855 -44.6701) |
| 12 |  05/12/1996   |    12/24/1956    |  CCP   | POINT(33.8855 -34.6701) |
| 99 |  12/24/2008   |    12/24/1956    |  MDA   | POINT(44.8855 -44.6701) |

I've added the PostGIS store in GeoServer and published the Layer.
I've added the "http://localhost:8080/geoserver/wms" service in a harvesing entry.

When i run the harvester i get 2 entries in GeoNetwork. But the only way i can find the entries is if i search for the GeoServer published "Layer Name". I will not get any results if i search for an author like "MDA" in my table.

Am i missing something? Is there a setting or config for exposing the fields i want to share via metadata on GeoServer or something of the sort? Is this even possible?


texts: Spherical law of cosine what does the 'a' represent?

texts:
I want to use the spherical law of cosine formula,
 θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ),  to calculate distances between coordinates, but, I cannot for the life of me remember what the 'a' stands for.

Can some please help me out?


texts: Using Field Calculator to append attribute

texts: I have a field containing the file names for photos. I need to add the folder location to the beginning of each file name. Anyone know the code for doing this in Field Calculator?