texts: problem displaying inline features with geoserver sld

texts:
I am trying to display a simple inline feature on top of other features with geoserver. I need the top feature to be defined through sld.
The sld does'nt give me any error but also does not display the inline feature. What could be wrong in my sld or request?

Here is the sld:

<sld:StyledLayerDescriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation="http://www.opengis.net/sld
                                               http://giswebservices.massgis.state.ma.us/geoserver/schemas/sld/StyledLayerDescriptor.xsd"
                           xmlns:gml="http://www.opengis.net/gml"
                           xmlns:sld="http://www.opengis.net/sld" version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>myWor:polygons</sld:Name>
    <UserStyle xmlns="http://www.opengis.net/sld">
      <FeatureTypeStyle>
        <Rule>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#000000</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#FFFFFF</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </sld:NamedLayer>
  <sld:UserLayer>
    <sld:Name>Inline</sld:Name>
    <sld:InlineFeature>
      <sld:FeatureCollection>
        <sld:featureMember>
          <polygonProperty>
            <sld:InlineFeature>
              <sld:FeatureCollection>
                <sld:featureMember>
                  <polygonProperty>
                    <gml:Polygon>
                      <gml:outerBoundaryIs>
                        <gml:LinearRing>
                          <gml:coordinates>-100,50 -90,60 -100,60 -100,50</gml:coordinates>
                        </gml:LinearRing>
                      </gml:outerBoundaryIs>
                    </gml:Polygon>
                  </polygonProperty>
                </sld:featureMember>
              </sld:FeatureCollection>
            </sld:InlineFeature>
          </polygonProperty>
        </sld:featureMember>
      </sld:FeatureCollection>
    </sld:InlineFeature>
    <sld:LayerFeatureConstraints>
      <sld:FeatureTypeConstraint/>
    </sld:LayerFeatureConstraints>
    <sld:UserStyle>
      <sld:Name>test style</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Rule>
          <sld:PolygonSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#FF0000</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
            </Stroke>
          </sld:PolygonSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:UserLayer>
</sld:StyledLayerDescriptor>

and here is the request (the bounding box parameter changes as I am displaying the data as tiles on google maps):

http://localhost:8080/geoserver/wms?&service=WMS&version=1.1.1&request=GetMap&layers=myWor:polygons&styles=inline&format=image/png&srs=EPSG:4326&TRANSPARENT=TRUE&bbox=-150,40,-40,90&width=500&height=500

As a result I see the polygons:

but not the inline feature that should be a polygon on top of other polygons.
Any ideas why?


texts: Problem with Scale Dependent Rendering after Upgrade to QGIS 2.18.6

texts:
I upgraded from QGIS 2.8.1 to 2.18.6 and all seems very nice.

One problem I have is with display.  Some, though not all, of my line and point layers won't display unless I zoom in.  All my polygon layers display at all scales.

The affected layers do not have Scale Dependent Visibility enabled for the layer.  So I'm not sure why this behavior is occurring.

I'm having to zoom way in to see them -- so much so that it is not practical.

UPDATE: I've narrowed down the problem, but haven't found a solution. It's one of the layers.  When I turn on labeling for that layer, all features in that layer suddenly disappear, and most (but not all) of my other vector layers also disappear.  If I disable display of the offending layer, display of all other layers is restored.  This issue does not occur with 2.8.1, but occurs consistently in 2.18.6.


texts: Combining (merging) neighbour points to one centred point in PostGIS (reducing density)?

texts:
I'm new to spatial algorithms and PostGIS functionality. Currently I have a Pg 10 + Postgis 2.4 database with table of more than 400 000 records (points with additional properties), with Node.JS tile server that generates and serves tiles for Mapbox GL JS plugin using PostGIS ST_ASMvt function.  An d everything seems ok (generates very fast, caching without problems, etc), but there is one problem.

The problem is very big tiles (more than 2 mb) with big amount of features, so Mapbox GL JS renders it veeery sloooowly and eat a lot of memory (sometime my app is chrashing even on my laptop with 16 gb RAM). I can't just reduce the number of features by SQL LIMIT (just believe me, there are some business problems with the data in this case and on the map it looks very ugly).

And I think that I need to cluster some points that have a big density. So I want to merge the neighbors (and show as one point) at a high zooms and I think it will help with the memory and rendering speed (because of lesser number of features and tile size). But I don't know and cant find how to do this.


texts: Seeking free elevation data for Thailand/Bangkok?

texts:
I am in the process of writing my thesis on flood hazard preparedness and forecasting in South East Asia, specifically Thailand. My analysis requires a medium resolution (even better, high resolution) digital elevation model for Bangkok and vicinity areas.

Where can I find such data?

My internet search so far returns not DEM data but only finished maps from different organizations.


texts: How to use QT QGis custom widget in a plugin?

texts: I am writing a new plugin for QGIS 2.18. I can't find what are the libraries to import in my main code to access widgets such as QgsSpinBox or QgsFileWidget.


texts: Is it possible to merge attributes from lines which are on top of each other?

texts:
I was able to merge the different kinds of roads (verharding lijn) with the normal roadmap (Wegen 1.0).

The attributes were copied to all the records, but there are empty attributes where the kind of road should be given.

Is there a way to combine these two lines? Or even just copy the cooresponding attributes from verharding lijn to Wegen 1.0?


texts: Transferring Mosaic Datasets to ArcGIS Online?

texts: I have a number of mosaic datasets that I have created that I would like to upload to my ArcGIS online map.  How would I go about doing this?  I read somewhere to create a tile cache from the mosaic, then export it as a tile package, then use the "share package" tool to transfer it online.  Will this work?  I'm fairly new to GIS. (And if it makes a difference, these mosaics are all very large; around 300 MB a piece).


texts: Appropriate distance metric for spatial clustering of geographic coordinates

texts:
I have a set of locations in geographic coordinates, and I would like to group the points using hierarchical clustering followed by tree-cutting at various "heights" in order to calculate group-wise means of variables at recorded at each location.

Hierarchical clustering of the distance matrix of geographic coordinates, I presume, may be a misleading way to form groups because latitude and longitude are not equally spaced.

I can then imagine two ways forward:

Using the great circle distance for the distance metric.
Converting the geographic coordinates to an equally-scaled projection and then finding the Euclidean distance.

Apart from option two being more complicated to perform, are these approaches equivalent?
And what exactly is the meaning of the tree cutting height in these cases?


texts: Symbolizing two categories with different colors and graduated colors

texts:
Beginner user. I'm trying to symbolize a layer using different colors, then also use graduated colors in ArcGIS Desktop.

I have two fields for point lightning data. One field is whether the lightning was cloud-to-ground (G) or cloud-to-cloud (C). The other field is the time it struck. I want cloud or ground to be different colors, then use graduated colors to demonstrate the time it struck. I have a lot of layers and I want to avoid turning them all into two different layers if I can.


texts: What are standard scales, or zoom levels, for map applications?

texts:
I am working on an ArcEngine program that is restricted to a set of scales. It currently has:

1:187.5
1:375
1:750
1:1500
1:3000
1:6000
1:12000
1:24000
1:50000
1:100000

I don't think there's anything wrong with my scales, but I thought it would be interesting to know if there are any "standard" sets of scales used in web mapping or any other mapping applications.


texts:
I don't think the QGIS standalone browser is working right on my computer. The only tab I can view is Param.  The Metadata, preview and attributes tab are all grayed out.   When I select a .shp for instance, nothing happens.  I can't do anything with it.

Also the Param tab doesnt just display spatial data, but every piece of data.

The browser within QGIS seems to function fine though.

Anyone know what the deal is here?

http://imgur.com/xoeSpZC

So FRUSTRATING!

EDIT:  Okay it appears the browser only works inside Quantum GIS Desktop.  The standalone browser does absolutely nothing like I described.


texts: Can ArcGIS accept SQL field names with spaces?

texts:
I'm working on an integration project that is providing data from our billing system to ArcGIS. Field names can include spaces which are acceptable in SQL Server if enclosed in brackets e.g. [Street Name].

Our GIS administrator tells me that ArcGIS can't handle spaces in field names. I need to rename all fields to use an underscore or remove spaces. Is this correct?  Are there any viable workarounds?

E.g. Create a view on each table and provide an alias.

Can ArcGIS use a query rather than attach to a table directly and substitute names on the fly?

E.g. "Select [Street name] as StreetName from Table1"


texts: Is there any tool or somehow to make a OpenStreetMap editor which can manage multi layer in it?

texts:
I need to build a web application that could draw, edit, import, export,.. map using OSM data. In that, I could add layers and manage like tree form. The layer can be toggled on/off on the map to edit.
ex: - building
      + school
      + hospital
      + house
    -way
      +subway
      +highway

I tried some editor like iD but it not like what I want.
Does anybody know any tool or any solution to create something like this?


texts:
To host a map application in real world, developed using GeoServer, we need a server with Tomcat/JSP rather than Apache, right? Correct me if I am wrong since my background is as GIS not development. Is there any options to host GeoServer in Apache Server or any similar applications like GeoServer that can connect with an Apache server. Because to maintain a good Apache Server is economical compared to Tomcat.

Update:

In GeoServer, as localhost, if we login and check Server Status, Memory Usage shows 376 MB. Therefore, if we plan to hire a host plan in JSP/Tomcat, the heap size offered should be greater than 376 MB, isn't it?, which will escalate the server plan cost. Need help on this aspect.


texts: I have been snapping points to lines using distance. In a couple of cases a point has gone to the wrong line, where there is more than two lines near each other. (see photo). How do I move the point to match with the correct line? In this case the line in the bottom of the attached picture.


texts: What does the "bisector angle of vertex for original geometry" mean in the Extract Vertices tool?

texts:
I need to calculate the number of notches in my polygons.
Therefore I need to know the angles of the vertices in a set polygons.
I managed to extract a value for the angle by the Extract Vertices tool but cannot make sense of the values I am given. The description of the value is given as "the bisector angle of vertex for original geometry". I tried to search what does this term mean, but to no avail.
Any help is welcome.


texts:
I am trying to measure and show angle using semicircle library. It would measure angle between two vertices being drawn with PM Leaflet library.

Measuring angles is good, however, drawn semicircle line and the angle lines are not overlapping. I noticed they are overlapping perfectly near 0,0 coordinates but if I try to apply this action near poles, as you suppose, distortion is great.

My code for capturing angle and creating circle.

function captureMove(evt, p1, p2){
  let firstAngle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]) * 180 / Math.PI - 90;
  let secondAngle = Math.atan2(evt.latlng.lat - p1[0], evt.latlng.lng - p1[1]) * 180 / Math.PI - 90;
  firstAngle < 0? firstAngle +=360:''
  secondAngle < 0? secondAngle +=360:''
  rightClick? createCircle(p1, secondAngle, firstAngle): createCircle(p1, firstAngle, secondAngle);
}

Creating circle:

   function createCircle(p1, ang1, ang2){
  let noOfLayers = temLayer.getLayers();
  if(noOfLayers.length > 1){
    temLayer.removeLayer(noOfLayers[1]);
  }
  ang1 < ang2?ang1+=360:''
  var circle = L.semiCircle(p1, {
      radius: 1000,
        startAngle: 360 - ang1,
        stopAngle: 360 - ang2,
        color: 'rgba(255,0,0,0.5)',
    });
  temLayer.addLayer(circle);
};

What could cause this? I realize it is projection distortion. But how to solve this?


texts: How to access arcgis cache directly using leaflet like openlayers?

texts:
I want to access arcgis server cache dircetly by only using leaflet,I wrote some code,but it work badly,could you anyone give me any hints?
my code:
getTileUrl: function (tilePoint) {

    var zoom = this._map.getZoom();

    var map = this._map;
    var crs = map.options.crs;

    var tileSize = this.options.tileSize;

    var nwPoint = tilePoint.multiplyBy(tileSize);
    var sePoint = nwPoint.add(new L.Point(tileSize, tileSize));
    var midX = (nwPoint.x + sePoint.x) / 2;
    var midY = (nwPoint.y + sePoint.y) / 2;
    var p = new L.Point(midX, midY);

    var tilep = crs.project(map.unproject(p, zoom));

    var z = zoom, x = tilep.x, y = tilep.y, url;

    url = this._url;
    var z1;
    if (z < 10)
    {
        z1 = 'L0' + z + '/';
    }
    else {
        z1 = 'L' + z + '/';
    }

    var row = Math.floor(Math.abs((this.options.tileOrigin.y - y) / (this.options.tileSize * this.options.res[z])));
    //console.info(row);
    var col = Math.floor(Math.abs((x - this.options.tileOrigin.x) / (this.options.tileSize * this.options.res[z])));
    //console.info(col);
    url = this._url + z1 + 'R' + this.zeroPad(row, 8, 16) + '/C' + this.zeroPad(col,8,16) + '.' + this.options.format;
    return url;
}

It's inherited from TileLayer,and I just change this function.


texts: Choosing tool to create raster with probability of occurence on each cell using ArcGIS Desktop?

texts:
I have two different datasets: 1) seal occurence (point data)
                               2) fishing boat tracks (line data)

First, I need to create two density maps, i.e. one for each dataset. For the seal map, I want each cell on my output raster to be assigned a value 0-1 according to the probability of occurence of seals in this cell. I tried Kernel Density but it didn't give me probabilities. Any idea of what I should do?? For the fishing effort map, it is exactly the same question.

Second, as soon as I manage to create my probability map for seal data, I will need to test for the overlap between fishing effort and probability of seal occurence. To do this, I need each cell of my output raster to be given a value based on the following equation:

P.cell=[(seal_probability).cell]*[(fishing_effort).cell]/Σ[(seal_probability).cell]*[(fishing_effort).cell]

with the values in the denominator being the sum of all the cells accross my study area,i.e. all cells of the raster.


texts: How to avoid "Handle bad layers" message when using QGIS Flowmapper plugin?

texts:
In QGIS, if I close a project and try to open it a few days later I often get a message that says "Handle bad layers". This is very frustrating because when I open the project various layers will have been deleted. This has happened to me while using the QGIS flowmapper plugin in particular.

What does this message mean? And how do I avoid this in the future?


texts: List layers in directory .Net ArcObjects or plain .Net  -- C# preferably

texts: Any code samples to list arcgis layer files from a directory so they can be looped over?


texts: I am currently studying for my exam in advanced photovoltaics. There is a question in a previous exam that states the following: Consider the day duration to be 10.8 hours, the tilt angle to be 30 degrees, and the declination angle to be 5.20 degrees. Calculate the latitude of this place. My approach was as follows: since I have the day duration, I have first calculated the hour angle at sunset = pi/12 * day duartion/2 = pi/12 * 10.8/2 = 9/20 pi radians, then I have used the hour angle at sunset formula as cos^-1 [-tan(declination angle)tan(latitude-tilt angle )] --> 9/20pi = os^-1 [-tan(13/40*pi)tan(latitude-1/6pi )], so now this is one equation in one unknown ( latitude ) and therefore solving for this unknown to find that the latitude is -29.7 degrees meaning that the location is approximately at latitude 30 degrees in the southern hemisphere. Is that right?


texts: QGIS 2.18.2 DB Manager on Mac OS no longer supports SpatiaLite

texts:
I recently updated QGIS from 2.18.1 to 2.18.2 on a Mac OS using the KyngChaos installer.

After the update, the DB Manager no longer recognizes the SpatiaLite extension on sqlite databases. The below image shows the installed libraries in QGIS.

Geometry layers appear fine in the QGIS Browser Panel. I can add these layers to the Map Canvas without problems. When I open the same database in DB Manager, I don't see the SpatiaLite, GEOS, or PROJ libraries in the "General Info" description for the database. If I try to view a spatial layer's table, I get the following error, "no such function: GeometryType."


texts: Run ST_DWithin on a subquery result from a different table

texts:
I have two tables "Customers", and "Providers" in my PostgreSQL DB. They both have a 'geom' column. Now, customer Table has a column called e.g. "profession".
I want to get the COUNT of providers from "Providers" table within 1000m from all the customers in the "Customers" table, where e.g. "profession" = "GIS Developer"
Even better, I'd like to have a function called e.g. _getCustomersStats(profession)
So I can call it like this: SELECT * FROM public._getCustomersStats('GIS Developer')
and get this result:

customer_count
providers_within_1000m

30000
400000

I've tried this query bellow. I haven't gotten to creating the function yet because this query is not working for me:

with
    cust as (
    select
        *
    from
        Customers as c
    where
        c.profession = 'GIS Developer'
    ),
select
    count(*)
from
    cust, Providers as p
where
    ST_DWithin (cust.geom, p.geom, 1000)


texts: Convert ESRI Integer ASCII Grid to something useful

texts:
How could I convert a file(s) which is "DIGITAL Map data stored in ESRI ARCInfo Integer ASCII Grid format" into something the rest of us can use? i.e import into QGIS.
The main file has no extension and is 70 MB, the accompanying files are a *.dbf and a *.prj.

It does appear to be of the format described here;
http://en.wikipedia.org/wiki/Esri_grid
but how do I convert it?


texts: Build Raster Attribute Table from .tif with pixel type of float or double?

texts:
I have a raster with the extension .tif. It's a subset of 87x87 pixel with values from some 6,66 to -4,27. If I right click on it there is no Attribute Table available. However, I can change the Symbology to Unique, Streched, Classified or Discrete Color and also classify manually, everything just fine. However, I need this attribute table, as I want to calculate the statistics of the values (not only the simple like mean and min, i got those, but a bit more advanced).
The ArcGIS help site ('Build Raster Attribute Table (Data Management)') mentions, that: 'It is not possible to build a raster attribute table for a raster dataset that has a pixel type of floating point or double precision.'
My values, however, ARE 32bit floating point. Does any of you have a clue what I can do?


texts:
My goal is to write an Android application where I could select a couple of points in the map and calculate shortest path between them based on my algorithms.

I'm absolutely new to OSM and since googling doesn't give that much info as with Google Maps API for Android (which I can't use in this case due to lack of data that I can get), I have few questions:

What would be the best way for beginner to start with OSM - is there some all-uniting Android API that (everyone) starts with?
Is there some kind of official API documentation that I should follow?
How are routes' coordinates stored and how can I retrieve them?
Are there any really good tutorials that I should follow to start with developing my Android app?

--

I know how stackexchange pages work but, seriously, googling didn't give me that much information, so here could be something like a links-how-to-start-with-OSM-for-Android list page with short explanation.


texts: Google Earth Engine - Filter for FeatureCollection WCMC/WDPA

texts:
I am working with FeatureCollection('WCMC/WDPA/current/polygons') and ImageCollection('LANDSAT/LC08/C01/T1_ANNUAL_EVI').  I would like to add a filter to  the WCMC/WDPA data to display only Parks Canada protected areas.  I have tried the following code lines with no success.

.filterMetadata('country', 'equals', 'Canada')
.filterMetadata('MANG_AUTH', 'equals', Parks Canada);

The following two scripts load successfully.

var dataset = ee.FeatureCollection('WCMC/WDPA/current/polygons')
var visParams = {
  palette: ['2ed033', '5aff05', '67b9ff', '5844ff', '0a7618', '2c05ff'],
  min: 0.0,
  max: 1550000.0,
  opacity: 0.8,
};
var image = ee.Image().float().paint(dataset, 'REP_AREA');
Map.setCenter(41.104, -17.724, 6);
Map.addLayer(image, visParams, 'WCMC/WDPA/current/polygons');
Map.addLayer(dataset, null, 'for Inspector', false);
var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_ANNUAL_EVI')
                  .filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
  min: 0.0,
  max: 1.0,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');


texts: How to re-render only a single layer on a mapcanvas?

texts:
In my application I have a mapcanvas that contains several layers.
some of layers need to be updated or rendered again because data has been changed ( like the geometry or some attributes )

Is there another way to update only one layer in a mapcanvas ?

My previous search is setLayerSet
actually i use the setLayerSet but all of the layer are rendered again,

I am working in c++ / §QT 4.8.5 and qgis api c++ 2.8.2


texts: Deleting many duplicate points using ArcGIS Desktop?

texts:
I have a shapefile with more than 6 million points, most of which are identical. I used the built-in tool Delete Identical by using Shape property to do it, which takes almost 10 hours and only complete 20%.

The point shapefile only contains three fields, including ID, x-coordinate and y-coordinate. I want to delete the duplicate records from the existing shapefile based on the condition that the points have same x,y coordinates. I can also save the unique records to another shapefile, depending on which method is much faster.

I am using ArcGIS 10.3.1 Advanced License.


texts: How to create GeoTIFF from PNG raster and and pgw world file with GDAL

texts:
I've used GDAL tools for several other operations on GeoTIFFs.

There is lots of information on how to splice geotiffs into pgw world files and images, but I havent found ANY documentation on how to properly CREATE a geotif from an image and and a worldfile (plus CRS format info).

This can be done by loading a layer in QGIS and exporting it as GeoTIFF, but need to use the GDAL commandline directly for batch conversions.

I've found one somewhat related question, which use world files as input.
GDAL rotate DEM
But despite GDAL created the file without showing errors, the file was unreadeable.

gdal_translate -of GTiff -co profile=baseline -co tfw=yes geotiff.tif baseline.tif

This also lead to an unreadeable file.

gdal_translate -of GTiff -co COMPRESS=JPEG -co tfw=yes -a_srs EPSG:3857 geotiff.tif baseline.tif


texts: Getting US Highway exit geocodes using Google Maps API?

texts:
For our application, we need to get all the US interstate highway exits along with their Geocodes. Can you please explain how to get these using Google Maps API or Google Local search or otherwise? So far I have no clue as to how to proceed.

I am looking for a free or a paid solution that is around $1000. I know there are people who provide geocodes. But they are out of our budget.

Several people are suggesting TIGER data with ArcGIS. I know nothing of them.


texts:
I try to perform some zonal statistics on a shape- and rasterfile and write the output to a completely new shapefile!

import sys
# where is the module
sys.path.append("/Applications/QGIS.app/Contents/Resources/python/")
sys.path.append('/Applications/QGIS.app/Contents/Resources/python/plugins')

import gdal
from qgis.analysis import *
from qgis.core import *
from PyQt4.QtCore import *

# initialize application
qpp = QgsApplication([], True)
QgsApplication.setPrefixPath(r"/Applications/QGIS.app/Contents/PlugIns", True)
QgsApplication.initQgis()

# rasterfile
filename = "/.../200001.asc"

vLayer = QgsVectorLayer("/.../my.shp", "plz", "ogr")
print vLayer.isValid()
> true

# zonal statistics
zonalStats = QgsZonalStatistics(vLayer, filename, 'pre-', 1)
zonalStats.calculateStatistics(None)
print zonalStats
> <qgis._analysis.QgsZonalStatistics object at 0x10cdf9e90>

# write shp
QgsVectorFileWriter.writeAsVectorFormat(zonalStats, "/.../zonal.shp", "utf-8", None, "ESRI Shapefile")

That returns.

  TypeError: arguments did not match any overloaded call:

  QgsVectorFileWriter.writeAsVectorFormat(QgsVectorLayer, QString, QString, QgsCoordinateReferenceSystem, QString driverName="ESRI Shapefile", bool onlySelected=False, QString errorMessage=None, QStringList datasourceOptions=QStringList(), QStringList layerOptions=QStringList(), bool skipAttributeCreation=False, QString newFilename=None, QgsVectorFileWriter.SymbologyExport symbologyExport=QgsVectorFileWriter.NoSymbology, float symbologyScale=1, QgsRectangle filterExtent=None): argument 1 has unexpected type 'QgsZonalStatistics'
    QgsVectorFileWriter.writeAsVectorFormat(QgsVectorLayer, QString, QString, QgsCoordinateTransform, QString driverName="ESRI Shapefile", bool onlySelected=False, QString errorMessage=None, QStringList datasourceOptions=QStringList(), QStringList layerOptions=QStringList(), bool skipAttributeCreation=False, QString newFilename=None, QgsVectorFileWriter.SymbologyExport symbologyExport=QgsVectorFileWriter.NoSymbology, float symbologyScale=1, QgsRectangle filterExtent=None):

  argument 1 has unexpected type 'QgsZonalStatistics'

I assume that QgsVectorFileWriter.writeAsVectorFormat needs something different than an object of type 'QgsZonalStatistics'. But how would I write my shp then?

I also tried

QgsVectorFileWriter.writeAsVectorFormat(QString(zonalStats), "/.../zonal.shp", "utf-8", None, "ESRI Shapefile")

which returned

  NameError: name 'QString' is not defined


texts: Showing labels of feature on the edge of screen

texts: My QGIS only shows labels on the center area. How to show labels of feature on the edge?


texts: Adding and removing WFS layer using Leaflet control?

texts:
I need add and quit a layer WFS vía Leaflet Control, So far I can add the WFS layer to the map, but how do I add it and remove it using the leaflet control?

This is my code.

var owsrootUrl ='http://geo.gporellana.gob.ec/geoinfo/gadpo/wfs';

var defaultParameters = {

          service: 'WFS',
          version: '2.0.0',
          request: 'GetFeature',
    typeName: 'gadpo:clima_estacion',
    outputFormat: 'application/json',
    format_options:'callback:getJson',
    SrsName:'EPSG:4326'
};

var parametres = L.Util.extend(defaultParameters);

var URL = owsrootUrl + L.Util.getParamString(parametres);
var WFSLayer =null;

var ajax = $.ajax({

    url:URL,
    dataType:'json',
    jsonpCallback:'getJson',
    success: function(response){
       WFSLayer = L.geoJson(response,{
            style:function(feature){
                return {
                    stroke:true,
                    fillColor:'FFFFFF',
                    fillOpacity:0
                };
            },
            onEachFeature: function (feature, layer){
                popupOptions = {maxWidth: 200};
                layer.bindPopup("Estación Meteorológica " + feature.properties.nam, popupOptions);
            }
        });//.addTo(mapa);
    }

});


texts: Calculating new shapefile areas after clipping using ArcGIS for Desktop?

texts:
I'm working with the WWF ecoregions, which use the GCS_WGS_1984 geographic coordinate system. I have clipped the ecoregions with a species range (consisting of two polygons), but the new attribute table doesn't tell me the new 'clipped' ecoregion areas.

From reading around it seems I need a projected coordinate system to calculate these new areas. However the attribute table of the ecoregions contain area (km2) as well as shape area. Would these have been calculated using a projected coordinate system? If so, is there a way of finding out which one they used?

I am using ArcGIS 10.1 for Desktop.


texts: Using Pygrass Functions in Jupyter gives XML Error

texts:
I have been trying to use pygrass from grass78 with Python 3.7 inside a Jupyter notebook and have run into an issue where I can import grass modules, but cannot call any pygrass functions, e.g, r.in_gdal.

I first used this wiki to install grass78 (debian stretch section):
https://grasswiki.osgeo.org/wiki/Compile_and_Install#GRASS_7_on_Debian_Stretch

And then this wiki: https://grasswiki.osgeo.org/wiki/GRASS_GIS_Jupyter_notebooks to set up my environment. I am trying to use pygrass within a jupyter notebook within a docker container and so I configured all the "session" environmental variables with my Dockerfile.

When I open a notebook to check my environmental variables I run the following:

print(f"GISBASE is: {os.environ['GISBASE']}")
print(f"MYGISDBASE is: {os.environ['MYGISBASE']}")
print(f"LOCATION is: {os.environ['MYLOC']}")
print(f"MAPSET is: {os.environ['MYMAPSET']}")
print(f"LD_LIBRARY_PATH is: {os.environ['LD_LIBRARY_PATH']}")
print(f"PYTHONPATH is: {os.environ['PYTHONPATH']}")
print(f"PATH is: {os.environ['PATH']}")

and see the following:

GISBASE is: /usr/local/grass78/
MYGISDBASE is: /root/jupyterhub-workspace/grassdata
LOCATION is: Pacific
MAPSET is: PERMANENT
LD_LIBRARY_PATH is: /usr/local/grass78/lib:/usr/local/grass78/lib
PYTHONPATH is: /usr/local/grass78/etc/python:/usr/local/grass78/etc/python
PATH is: /root/.local/bin:/opt/conda/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/grass78/bin:/usr/local/grass78/scripts:/root/.grass7/addons/scripts:/root/.grass7/addons/bin

Per this example (landsat 7 section): https://grasswiki.osgeo.org/wiki/Python/pygrass, I run the following:

from grass import script as g
from grass.script import setup as gsetup

import os
gisbase = os.environ['GISBASE']
dbase = os.environ['MYGISBASE']
location = os.environ['MYLOC']
mapset = os.environ['MYMAPSET']

gsetup.init(gisbase,dbase,location,mapset)

This code raises no errors and writes a temp config file that looks like this to my tmp:

I proceed to import pygrass packages:

from grass.pygrass.modules.shortcuts import raster as r
from grass.pygrass.modules.shortcuts import imagery as i
from grass.pygrass.modules.shortcuts import display as d
from grass.pygrass.modules import Module

which import with no apparent problems.

However, when I then call:

r.in_gdal(input='ned_NED_13.tif',output='test',flags="e",overwrite=True)

Meaning to take a tif in my home directory and read it into a raster map called 'test', I get this error:

In an effort to debug the error, I ran this:

Module('r.in.gdal')

with the same result.

When I then ran:

from grass import script
script.run_command('r.in.gdal')

I got a different error, but am unsure how to access the error message:

Does anyone have know why I see this error behavior?


texts:
I am using QGIS 3.0.3 to make a heatmap using processing toolbox, kernel density estimation.

The input I am using: I have generated centroids from polygons using Vector --> geometry --> centroids tool in QGIS. I have saved the centroids in a separate shapefile. I use these files as an input, but it does not seem to work and I am receiving the following error message:

Traceback (most recent call last):
File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\processing\algs\qgis\Heatmap.py", line 213, in processAlgorithm
self.tr('Could not create destination layer'))
_core.QgsProcessingException: Could not create destination layer

Execution failed after 0.06 seconds

not sure what to do.


texts:
I've been working on converting GPX files to GEOJSON and using them for analysis, so I make use of the QGIS plugin "GPS TOOLS". Thus far every time I attempt to download the files, the program crashes.

I've come to use GPS Babel as a workaround, but it would be nice to use this plugin as well...


texts: Transforming ocean color data to GeoTiff temperature raster and load in QGIS

texts:
I'm doing a project and I need to process the obtained SST data from NASA's Ocean color web (as shown below) for obtaining corresponding temperature raster (GeoTiff format). I'm trying to connect sea surface temperature to observations of marine mammals (min and mix temp for each species).

After downloading SST data, I processed it with SeaDas NASA software for transforming in GeoTiff temperature raster, however, no temperature data are displayed in QGIS.
I download the SST data through the "SMI HDF" option on the Level 3 SST through AQUA MODIS. The opened on SeaDAS NASA software and exported as GeoTiff but I think I maybe missed something? Because there is no data for the temperature when I put the exported raster it in Qgis

Can someone tell me if I'm doing something wrong or missing a step?


texts: Cost of hosting an OSM tile server with similar performance to Google Maps API

texts:
I am considering switching from Google Maps API to hosting my own OSM tile server.

Right now my site gets about 2,000 map hits a day, serving about 20-30 users at a time.  With Google Maps API, I would have to pay about $250 a month, and the cost could skyrocket if I grow fast.

If I were to host my own tile server, and to match the loading speed/performance of Google Maps API, how many CPU's and GB's of RAM would I need?  I will be most likely be using a Droplet on DigitalOcean to host it.

Apologies beforehand for the relatively broad question.


texts: Extracting a Point from MuItipoint and use it for a ST_DWithin query

texts:
I have a MultiPoint geometry column which has only one point (DB is a live server which cannot be changed now).

I need to find all points within a certain distance from a fixed point I provide to the query.

I tried to extract a point from the MultiPoint and use that as data for the ST_DWithin query but I still get a "Operation on mixed SRID geometries" error.

My query is as below:

SELECT o.id, ST_AsText(o.geom)
FROM table AS o
LEFT JOIN (
    SELECT id, ST_GeometryN(geom, 1) AS pt
    FROM table
) AS p
ON o.id = p.id
WHERE ST_DWithin(p.pt, ST_MakePoint(-112.779861,52.193760)::geography, 1000);


texts:
This might be a little bit of a beginner question but I just can't find the answer to my problem.
I have a .gpx file with numerous gps location data. I want to edit the code directly (not with a program that writes changes for me). However when I make the changes in - for example notepad or wordpad - it is not possible to save the file as .gpx that can be recognised by software that require coded gpx data. Is there a way to edit .gpx file directly without losing its .gpx encoding?


texts: I need a .csv file about the coordinates of all the Islands in Aegean Sea. Do you have any idea how I can find them?


texts: How to connect an oracle 10g database to QGIS? (TNS:Could not resolve the connect identifier specified)

texts:
Trying to connect an oracle 10g database to QGIS. I'm getting the error below:

ORA - 12154: TNS:Could not resolve the connect identifier specified

Anybody ever seen this error, or could provide some guidance?


texts: R sf Polygon subtract 1000 from x coordinates

texts:
My aim is to subtract a value of 1000 from all x coordinates of an R sf object. How can I achieve this?

When running the following code the value 1000 is subtracted from all coordinates (x and y values):

library(sf)

# Create Polygon: https://cran.r-project.org/web/packages/sf/vignettes/sf1.html
p1 <- rbind(c(1000,1000), c(1000,2000), c(2000,2000), c(1000,1000))
pol <-st_polygon(list(p1))
pol_geom = st_sf(st_sfc(pol, crs = 4326))
plot(pol_geom)

# Trying to subtract 1000 from all x coordinates
t <- st_geometry(pol_geom)
class(t)
lnd_geom <- t-1000
lnd_attrib <- pol_geom %>% st_set_geometry(NULL)
class(lnd_attrib)
pol_geom_new = st_sf(lnd_attrib, geometry = lnd_geom)
st_bbox(pol_geom)
st_bbox(pol_geom_new)


texts: Override infowindow Zoom To function or fire second event using ArcGIS JavaScript API?

texts:
The Popup of ArcGIS JavaScript API has a 'Zoom To' link on it that zooms you 4 levels closer to the linked feature.

I'd like to fire another event after the default zoom to function executes.

Here is the link in the HTML.

    Zoom to

I'm able to add a function to the Zoom To click with jQuery like this:

$('.action.zoomTo').click(function() {alert('Clicked!');});

But the the function above occurs before the default function of 'Zoom To'.  I wouldn't mind their click function executing, so long as it fires after mine does.

Any ideas?


texts: Why jsonp is disabled by default in GeoServer?

texts:
JSONP     EXCEPTIONS=text/javascript  Return a JsonP in the form: paddingOutput(...jsonp...). See WMS vendor parameters to change the callback name. Note that this format is disabled by default.

http://docs.geoserver.org/latest/en/user/services/wms/reference.html

Is there any security, performance or vulnability issues with jsonp enabled?


texts:
The Sentinal-1 dataset's metadata contain the following values:

range_spacing, azimuth_spacing, incidence_near, incidence_far.

What are corresponding names for these values in the RISAT Band_Meta.txt file? It does not have range and azimuth spacings and contains only one incidence angle.
Which point in the image has this incidence angle?
For my work, I need the incidence angle at every pixel in the image, how do I get it in case of RISAT (for Sentinel, I could do the math using near and far incidence angles and get it but can't do it here)?


texts: Buffering line with flat cap style using GeoPandas?

texts:
I'm interested in buffering a linestring geometry using a flat cap style rather than the default round cap style using GeoPandas. I see shapely, which geopandas is based off, has the option to do that:
object.buffer(distance, resolution=16, cap_style=2, join_style=1, mitre_limit=1.0)
However, when I try to integrate the cap style into my geopandas script
import geopandas as gp

shp = r'X:\temp\line_shapefile.shp'
outshp =r'X:\temp\buffered_line_shapefile.shp'

df = gp.GeoDataFrame.from_file(shp)
buffer = df.buffer(100, cap_style=2)

buffer.to_file(outshp)

it throws an error
Traceback (most recent call last):

  File "<ipython-input-12-9660d1a63146>", line 7, in <module>
    buffer = df.buffer(100, cap_style=2)

TypeError: buffer() got an unexpected keyword argument 'cap_style'

What is the correct implimentation of the flat cap style buffer in GeoPandas?


texts:
I am not regularly working in raster analysis.

I have a 30M DEM and I would like to create a 10 DEM out of that.

Is it possible to do this using QGIS? and How?

EDIT:
(I understand that a sub question can be added here itself.)
When I created the high resolution DEM, QGIS shows 2128 as the highest elevation value and ArcGIS Map shows 255 while the exact highest elevation value in the input DEM was 3260.

QGIS metadata shows:
STATISTICS_HISTOMAX=3260

But the      tag is missing in the aux.xml file along with the img file.
How can I show the exact highest elevation when viewed in the Table of Contents in ArcGIS Map(for the .img DEM created in Qgis)?


texts: EVI calculation from UAV multispectral survey

texts:
I want to calculate EVI index from UAV multispectral survey. For satellite imagery it is pretty straightforward (after reading multiple posts on GIS.SE) but not sure how to approach this problem, when imagery is collected from approx. 120 meters and atmospheric correction is not required in such extent.

Can somebody give me a tip how to build the equation in QGIS raster calculator to get proper EVI values?

What vaules should I assign for the "G", "C1", "C2" and "L" coefficients?

EVI = G X ((NIR - RED)/ (NIR + (C1 x RED)-(C2 x BLUE) + L))


texts: Moving and zooming map-layer while editing in QGIS?

texts:
I want to create lines with the help of "CAD-like improved line capture", make a point, pretend an angle or distance want to put the second point. To this end, I have to zoom out on the map, select a different part of the map and there zoom in again. Here, however, I lost the tool and the firt point/vertex ist lost.

Is there a way to prevent this?


texts: Adding differnet resolution raster layers using ArcGIS Desktop

texts:
I am trying to build a vulnerability index, although I have different resolution raster layers, e.g.: I have a 9km resolution climate change projection on pcp, euclidean distance of roads based on a 30m dem and other polygon layers that I have converted to raster based on my 30m dem.
Can I add these raster layers even though they are different resolution in order to build a vulnerability index?
I am using ArcGIS Desktop.


texts: How make .qgs files open in QGIS automatically on a Mac?

texts:
When saving a project my copy of QGIS used to assign file extension .qgis automatically.  Now it assigns .qgs automatically, which means that I can't reopen it.   All my old projects have also been given new extensions .qgs.

Does anyone know what's wrong and how can I fix it?


texts:
I use a opengeo standard installation of geoserver 2.5 and after adding the roles and users to access a specific store/layer, it so happens that if i'm editing the features as the normal user (has admin permissions on the store), when saving the edit, I get a error 403.

If I do the same, but with the admin user, the changes get saved.

Did I forget to do something in the service/users/roles config of the user?


texts: Using NASA Above landcover imagery in place with ArcGIS

texts:
Landsat-derived Annual Dominant Land Cover Across ABoVE Core Domain is composite tiled classified imagery dataset covering the years 1984-2014. The format is elegant and clever but hard to use. Each tile file is a 31-band GeoTIFF, with each band providing one year of data for the period (band_1 = 1984, ...band_31 = 2014) and classified into 15 values (1-15 in integer).

Neither ArcGIS or Qgis can use the data very well out of the box as they only allow colour maps and/or attributes for single channel 8 bit rasters. We could explode the bands into distinct files, but for my area of interest that will yield 175*31=5,425 files. A management headache to say the least, and probably file-system performance limit as well not to mention the increase in storage needs.

My intuition says both Arc and Qgis (via gdal) have the necessary features to be able to effectively use these imagery in place via raster mosaic-dataset with function chains (arc) and virtual raster tables vrt with pixel functions (gdal, and arc to lesser degree). I have so far though not managed to figure out the necessary magic.
The end goal is to enable people to load a given year from the data source and have it displayed in the standard colour map. Ideally it also yield the corresponding code when interrogated in ArcMap/Pro or Qgis. It should also be straightforward to use an arbitraty year as input to a geoprocessing tool. All with the least amount of fuss and hairpulling. ;-)
I would prefer a single solution that can serve both ArcGIS and Qgis but as requested I am splitting this into a separate question for each platform. This is the ArcGIS posting. The qgis posting is here.
For ArcGIS the simplest process for a single tile I've devised so far is below. Unfortunately it doesn't work for raster mosaic datasets.

Use Catalog to explore to the rasters, expand to see the bands

Add a band to a map. Band_5 would be 1989.
Change Symbology to "Unique Values"

Refer to a table  for the cell (pixel) value classifications and/or
Import canned colour map from a layer file

I'm going to self-answer with the best I've come up with so far for mosaic solutions, but they're just partial steps along the way and I'm not happy with them. Please feel free to improve or better.


texts: Point to Polygon with Fixed Spatial Attributes

texts: I have a point dataset with 3 useful columns. Those are width, height and direction (degrees from 1 to 360). I would like to create rectangles using the width and height, and with the specific direction (orientation), either using ArcGIS or R code. Any ideas?


texts: How to copy same values to another field in attribute table in QGIS using field calculator?

texts:
I am trying to copy values from Parsel_ID to Parsel_NO using an equation (look at pictures) in field calculator but it is not working.

What is the problem and how can I success this task?


texts:
Similar to this question: Generating map tiles with QGIS 3.6?, how is it possible to create MBTiles from a raster ? (I operate QGIS 3.4 LRT)

I have tried Save As.... and selecting format: MBTILES, however the resulting file seems very small and generate an error when reimported in QGIS

I also have tried the plugin: Tiles XYZ. However I have always a 32kB result file which is empty when reimported in QGIS and after analysis seems  to contain only one tile

For reference, here are the parameters passed to plugin Tiles XYZ:*

Démarrage de l'algorithme 'Generate XYZ tiles (MBTiles)'…
Param: { 'DPI' : 96, 'EXTENT' : '131000,6000000,6764542,7965990 [EPSG:2154]', 'METATILESIZE' : 4, 'OUTPUT_FILE' : '/tmp/processing_7ayyyy/xxxx/OUTPUT_FILE.mbtiles', 'QUALITY' : 75, 'TILE_FORMAT' : 0, 'TRANSPARENT' : True, 'ZOOM_MAX' : 12, 'ZOOM_MIN' : 6 }


texts: Reset canvas match print composer QGIS 3

texts:
Is there a way to reset the map canvas to match the layers, or layers and styling from a "locked" print composer window?
The lock layers, and lock layer styling buttons in QGIS Print Composer are great for retaining several different map layouts so you can go back and reproduce the layouts when something changes.  When I want or need to change something about the layout (e.g. add labels or add/remove a layer), however, it seems like I have to basically start from scratch to reset the map canvas to the desired set up. Is there a way to reset the layers to match the saved set up from the print composer?


texts: Running PyQGIS script inside QGIS console via Plugin?

texts:
I have some calculation and processing done on vector data. I have written code in pyqgis( and executing inside Console).I need to create a plugin (for my use only) which don't have any input button for loading vector and stuffs. It just have a button of "Process".

Is it possible for my plugin to access QGIS, open python console and run my script?

Don't write any "heavy" stuff I am new to QGIS Plugin and doing it for the first time.


texts: Downloading Garmin etrex Legend data into ArcGIS Desktop?

texts:
I seek a free solution to transfer waypoints from my GPS device to my PC, and into ArcGIS 9.3.

These are my devices: Garmin etrex Legend (it's the glittery blue one, fairly old) and ArcGIS 9.3. I'd like to upload the waypoints into ArcGIS 9.3 but the computer doesn't even recognize the device. The Garmin device software is up to date, and neither Garmin BaseCamp or GPSBabel could locate the device. I have a feeling it's the connector cable, but I'm not entirely familiar with this type of cable (not USB or mini-USB). It plugs into the back of my desktop and the contact point of the plug is large and shaped like a trapezoid with very rounded edges. There are two rows of pins in the "trapezoid", with five on the bottom and four on the top. Actually the pins are in the computer port and the plug is female. The GPS side connection seems to be Garmin's proprietary four pin connector.

So maybe the cable is busted?

Neither the GPS device or my PC give any indication that they are communicating, even though both devices are on.

I saw that Garmin has a Trip and Waypoint Manager, but I'd be really ideal if there is a free solution.


texts: Error when using NumPyArrayToFeatureClass in ArcPy

texts:
I am trying to write out a structured numpy array to a feature class using ArcPy, but this error message is returned:

File "<ipython-input-104-556b13ea80bd>", line 1, in
arcpy.da.NumPyArrayToFeatureClass(a,'b',['SHAPE@XY'],spatRef)

Even reading a feature class into a numpy array and then try to export as a feature class generates the same error. For example, if I have a feature class ("fc") that I import into a numpy array in python, I can't export it back as a feature class.
import arcpy
import arcpy.da as da

a = da.FeatureClassToNumPyArray("fc", ["SHAPE@XY"]) ## get feature class as structured numpy array
spatRef = arcpy.Describe("fc").spatialReference
arcpy.da.NumPyArrayToFeatureClass(a,'b',['SHAPE@XY'],spatRef)

generates the same error message. Any hints on why this doesn't work?


texts: Control visibility of ArcGIS Server service by capability

texts:
I've got a service published on ArcGIS Server 10.3 that has feature access enabled along with the (always-enabled) MapServer. Is it possible to control the visibility of a service  such that the MapServer service doesn't show in ArcCatalog or ArcMap but the Feature Access service does? I see two services right now.

Tried disabling all available operations (Map, Query, Data) for the MapServer service to no avail.


texts: Calculating slope/gradient from longitude and latitude

texts:
I've recently got some field erosion data. The only geographic data I have is the (lon, lat) (in degrees).

I need to plot the erosion against the slope, however, I do not have the slope yet.

Is it possible to calculate the slope from (lon, lat) coordinates?
If so, how?


texts:
This might be one of those slap your forehead so simple questions.

In ArcMap, how can I use wildcards to aid with map symbology? For the example below, I have tried adding values such as "Field *" and "Field %" but have not had any luck. This would be convenient with tables of 4000+ records with different ending comments.

Field Verify

Field Verify - Unclogged

Field Verify - Too Much Traffic

Field Verify - Under Fence

Field Verify - Buried

Field Verify - Under Asphalt

Edit:
I am scratching around with this code, except I would like it to first group the results and then insert, instead of replacing, the group into the existing symbology. I use the field name, and then repeat the field name in the query, so that tField = FID and tQuery = FID > 500

import arcpy

tLayer = arcpy.GetParameterAsText(0)
tField = arcpy.GetParameterAsText(1)
tQuery = arcpy.GetParameterAsText(2)

mxd = arcpy.mapping.MapDocument("current")
lyr = arcpy.mapping.ListLayers(mxd, tLayer)[0]
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", tQuery)
fList = []
rows = arcpy.da.SearchCursor(lyr, [tField])
for row in rows:
  fList.append(row[0])

if lyr.symbologyType == "UNIQUE_VALUES":
  lyr.symbology.classValues = fList
  lyr.symbology.showOtherValues = False

arcpy.RefreshActiveView()
arcpy.RefreshTOC()
del mxdde here


texts: How to put the two regions and countries data on OpenStreetMap into postgresql?

texts:
I'm developing a WebGIS in Linux development platform that cannot use internet and need to deal with maps and positioning.

I have used nominatim on OpenStreetMap to implement it. I use postgresql and postgis as my database according to the installation steps of OSM website. Now I have established the server, which contain one country data. I use the following statement to import the first country data:

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/country-latest.osm.pbf --all

I try to use the following statement to import the second country data:

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/anothercountry-latest.osm.pbf --all

It shows "the nominatim database already exists".

su test
download/Nominatim-2.5.1/utils/setup.php --osm-file download/country-latest.osm.pbf anothercountry-latest.osm.pbf --all

It shows "The file or directory could not be found".

So how do I import the second country data?


texts: Spatial database data representation vs. spatial programistic libraries representation

texts:
Can anyone tell me what is the difference between spatial database data representation and spatial programistic libraries representation?

It is not clear to me. I have tried to google it and I can not figure it out


texts: Why are ArcGIS Services Showing Wrong Layer Database Schema?

texts:
I have never seen this before.   Why do two different layers in an ArcGIS Service show different the database schema of the other?

We have an interesting situation with an ArcGIS Service. We have three different environments. There are two tables as part of a map service that show the schema/fields of the other table when the service is published. They have the same table name, but are on different Oracle database schemas (different ArcSDE table owners).

Oracle 11.2.0.1
ArcGIS Enterprise 10.5
ArcSDE 10.2.1 Versioned tables, with some relationship classes defined.
Federated with ArcGIS Portal 10.5.
The table schemas/fields are reflected correctly in the .mxd used to publish the service. The map service layer numbers are identical in both environments.

For example:

Environment #1 Service has SCHEMA111.MyTable and SCHEMA222.MyTable layers in it. The database tables have different fields defined on them. In development when the service is published it shows the same table schema/fields defined, even though the service shows the correct layer name (different table) in the REST page. In this environment the REST page shows SCHEMA111.MyTable and it correctly reflects the table fields. The service shows SCHEMA222.MyTable correctly in the REST page, however it reflects the fields in SCHEMA111.MyTable.

Environment #2 The exact same behavior occurs, however it is totally reversed! SCHEMA222.MyTable shows correctly in the REST page with the correct fields defined on the table. SCHEMA111.MyTable shows correctly in the REST page but the table has the fields (layers and numbers) from SCHEMA222.MyTable.

To reiterate:

The table names (MyTable above) are the same but in different Oracle database schemas (different ArcSDE table owners). ArcSDE and Oracle do not object to this, but is ArcGIS Server perhaps protesting?

The .mxds are correct and show the correct fields for each layer, but the fields are listed incorrectly on the service layer when it is published, even though it says it is the correct name in the REST page.


texts: Shared story map link requiring sign in?

texts:
I finished a story map with my ArcGIS Online account and linked it on Facebook and was told by someone that they need to sign in.

Why's that?


texts: Directional Spatial Join with Python - Arcpy

texts:
Using Python, I want to join one point feature (centroid node) to the closest 4 links (polylines), but spreading the search in the 4 directions around my point, so that I have:

1 centroid-link connector North-East,
1 centroid-link connector North-West,
1 centroid-link connector South-West,
1 centroid-link connector South-East.

I am now using the following statement to join the centroid node point with the closest link:

arcpy.MakeFeatureLayer_management(connectors_out, "connector_layer", "[CONNECTOR] = 1")
arcpy.SpatialJoin_analysis(centroid_point, "connector_layer", conn_link, "JOIN_ONE_TO_MANY", "KEEP_COMMON", "", "CLOSEST", max_Dist, "DistOut")


texts: Selecting DEM that best determines shore line using ArcGIS Desktop?

texts:
I want to extract the shore line (Z=0) from DEM files. the earth explorer provides two DEM sources (ASTER & SRTM).

In the following figure if the blue line represents the shore line as digitized from the topographic map, and both the other red and green lines are the shore lines as extracted from the two DEM sources.

Is there a tool in ArcGIS allows me to determine which of the red and green polylines is closer to the blue one.


texts: What causes error: Spatial reference of input image and samples don't match

texts:
I checked that the CRS is the same. I want to train the classifier in OTB to recognize "non-vegetation" and "vegetation" on an orthomosaic. I created a polygon layer with the two classes, and did 30 sample polygons of each. However I keep getting the error "Spatial reference of input image and samples don't match ". I am using QGIS 3.16.0 and the OTB 7.2.0 plug-in.
Does anyone know what might cause this error?


texts: Whats wrong with my code? Any reference missing?

texts:
I have been trying to add the navigation tool that will simply zoom in and zoom out. Push left and right using the click of the mouse.

I'm using in the Silverlight, Visual Studio 2010.

The XAML file contains the following:

<esri:Navigation Margin="5" HorizontalAlignment="Right" VerticalAlignment="Bottom"
 Map="{Binding ElementName=MyMap}">
 </esri:Navigation>

The C# file contains the following:

private void MyMap(object sender, RoutedEventArgs e)
    {
        MyMap.Focus();
    }

I have added the reference dll file : ESRI.ArcGIS.Client.Toolkit

Though the navigator is visible on the map. But unable to function. Please assist the same.


texts:
I am new to Sharpmap and GIS. Going through the sample code and building simple programs for better understanding. I have a water bodies layer. I want to display only a particular river. I used CustomTheme. How to show label for only this river.

To display a river (named Ganga), I have written following code.

SharpMap.Data.Providers.ShapeFile shapeFileProvider = new SharpMap.Data.Providers.ShapeFile(@"C:\water.shp", false);
SharpMap.Layers.VectorLayer waterLayer = new SharpMap.Layers.VectorLayer("Water", shapeFileProvider);

SharpMap.Rendering.Thematics.CustomTheme waterTheme = new  SharpMap.Rendering.Thematics.CustomTheme(GetWaterStyle);
waterLayer.Theme = waterTheme;
mapBox1.Map.Layers.Add(waterLayer);

The GetWaterStyle method:

private SharpMap.Styles.VectorStyle GetWaterStyle(SharpMap.Data.FeatureDataRow row)
{
    SharpMap.Styles.VectorStyle style = new SharpMap.Styles.VectorStyle();
    if (row["NAME"].ToString().Equals("Ganga"))
    {
        style.Fill = Brushes.Aqua;
        return style;
    }
    else
        return null;
}

Now I want to show a label "Ganga" (the river name) as well. How to approach?

Please help.

Thanks and regards,
Abhi


texts: Publish rasters in PostGIS into ArcGIS Server

texts:
Background
I have a lot of, I mean a lot of rasters (GeoTiffs, around 10000) stored in a PostgreGIS database. I have developed a website and I want to allow users to extract a raster based on its storage date and display it on a base map. The following image is expressing an example of what I wan to do.

I have used ArcGIS for Server 10.2, PostgreSQL 9.2, Windows 7 Ultimate, OpenLayers, and back-end is written in ASP.net MVC.

Should I automatically publish each raster as a map service once user extracts his/her required raster?


texts: What are the areas, relating to database or server, that should be viewed while making map based webapplication?

texts:
This question is relating to GIS web application that are based on relational database. I have database that is not indexed with spatial column and I use geoserver to display these data as layers. But for a single layer that is displayed zooming in and out takes time(Intranet or localhost). Are there anything that can be done so that the application can respond faster?
I have used:

1.Geoserver
2.SQl-SERVER 2008
3.Openlayers and geoExt
4.No of rows nearly 3000 only for each layers or less (200)


texts:
I have scripted a process to read a CSV file into a file geodatabase. Then, I want to read this imported file and work on it by adding new fields and calculating values. However, while using the arcpy.ListTables() on the geodatabase does not list the table.

I am just confused what is wrong.

Any help !!

Here is my script

outLocation = dbLoc+'\\'+ out_name +'.gdb'

# Make list of all tables in workspace
tables = arcpy.ListTables("GDB*")

print tables
try:

    for tb in tables:
    # Execute TableToGeodatabase
        print "Importing "+tb+ " to gdb: " + outLocation
        arcpy.TableToGeodatabase_conversion(tables, outLocation)

env.workspace = os.path.dirname(os.path.dirname(__file__))+'\\'+ out_name +'.gdb'
arcpy.RefreshCatalog(env.workspace)

inTables = arcpy.ListTables()


texts: Calculate coordinates with better precision in ArcGIS for Desktop?

texts:
I'm using the geometry calculator to get the geographic coordinates of a point shapefile.
However when I run it, it calculates the coordinates with 4 decimal points, regardless I've chosen double an increase the precision on the field definition..

I need the coordinates with at least 8 decimal points.

Can someone offer advice?


texts: I want to create an interactive map that includes sound snippets.  Can I do that in CartoDB?  If not, any recommendations on how I can make that happen?


texts: How to make a vector layer with Hebrew caption in Qgis?

texts:
I am working in Qgis and need to make layers with Hebrew caption.
When I make a new layer and write a word in Hebrew, in this case on a point vector layer that I made, it looks just fine.
However, when I save the layer the Hebrew word is replaced with question marks in the Attribute table and in the caption on the map.
  I tried to change the Unicode control character into right-to-left, but it did not solve the problem.

Can anyone help me with this issue?


texts: Multidimensional File to allow for pixel values across time series

texts:
I have a composite of SAR (28 images in a time series) data and I am trying to get the values of each pixel for the whole time series. I am looking at the coefficient of variation and trying to display pixel values as the time series progresses. I was able to get the coefficient of variation from the time series but it only shows me a static value. I was reading that possibly using multidimensional files would allow me to slice the data and drill down the pixels across the time series.

Can anyone give me any guidance?


texts: How do I copy all feature attributes to a feature in a new layer?

texts:
I'm trying to create a new layer in QGIS based on an existing layer. The new features should have all the attributes of the corresponding features in the original layer. I've been trying to use outFeat.setAttributeMap(inFeat.attributeMap() ) similar to what Victor Olaya is doing at http://qgissextante.blogspot.de/2012/11/spliting-vector-layer.html, but all the attributes come out as NULL.

Could you tell me where the error is in my code?

def test(outputFilename):
 layer = qgis.utils.iface.activeLayer()
 provider = layer.dataProvider()
 fields = provider.fields()
 writer = QgsVectorFileWriter(outputFilename, "CP1250", fields, provider.geometryType(), provider.crs(), "ESRI Shapefile")
 inFeat = QgsFeature()
 outFeat = QgsFeature()
 inGeom = QgsGeometry()
 while provider.nextFeature(inFeat):
  point = inFeat.geometry().asPoint()
  inGeom = inFeat.geometry()
  outFeat.setGeometry(inFeat.geometry() )
  outFeat.setAttributeMap(inFeat.attributeMap() )
  writer.addFeature( outFeat )
 del writer
 newlayer = QgsVectorLayer(outputFilename, "Output", "ogr")
 QgsMapLayerRegistry.instance().addMapLayer(newlayer)


texts: How to calculate the Scattering Matrix for a Sentinel-1 image

texts:
How can we calculate the elements of the scattering matrix (Spq with p and q being the transmit/receive polarizations), for a Sentinel-1 image?

Does the image have to be in a Single-Look Complex (SLC) format (contains complex values), in order to calculate the scattering matrix?


texts: How to convert image of map into vector format?

texts:
What is the best way of converting a gif of a map into a vector format, such as a shapefile?

The only relevant parts that I am interested in are the outline of the island so I realize some manual work will be necessary where it is shaded orange; is there a way to handle the rest?

Regarding copyright, it's from the 1980s and it's being used for academic research.


texts: Reading next row of *.txt column inside ArcPy for loop for batch process?

texts:
I'm not sure how to approach this problem with python, but in plain english, I'd like to rename rasters with the names given in the *.txt file (see screenshot) and concatenate the basename given by the text file with the original file extension. For example I would like snowdepthN0001.tif to be renamed to 12-Jul_02.tif

So far to check my progress, I've only been able to print single letters or characters from the text file per row rather than the all the characters within each row.

Anyone see what I'm missing?

import os
import arcpy
from arcpy import env

RASTER_DIR = r"C:\VMshared\small_example_valley8\SDpartINTRaster"
env.workspace = RASTER_DIR

date_file = open("timetest.txt", "r")

for raster in arcpy.ListRasters():
    fileName,fileExtension = os.path.splitext(raster)

    for row in date_file.read():
        print row
        fileNameParts = row
        fileNameParts = fileName.split('_')
        compactFileName = row + fileExtension
        arcpy.Rename_management(raster,compactFileName)

date_file.close()

Here's what the raster names look like (there are 90 of them).


texts: Clearing out 'Choose a locator:' drop-down

texts:
We are using ArcGIS Desktop 10.7.1 with concurrent licensing. One of the basic tools within ArcGIS Desktop is Find (Binocular icon).  Within this tool, I can search for an address using either the World Geocoding Service or my own locator.

How can I clear the drop-down of all the old locators that we do not have or use anymore?

Basically we are looking for a clean slate without resorting to an uninstall/reinstall methodology.


texts: How can I use Geoserver REST-API for s3 Geotiff plugin

texts: I have created an s3 GeoTIFF bucket to show raster data via GeoServer, now I'm looking to create a front end so that user can upload GeoTIFF, I am able to do the task halfway ( i.e. uploading tiff to s3 and creating s3Geotiff store using the rest API), how can I now create layer via rest API?


texts: Google BigQuery error: "Invalid polygon: edge crosses edge"

texts:
I am trying to upload the FCC's Study Area Boundaries into Google BigQuery for analysis with other data. I used QGIS to fix the geometries and convert the shapefile to a newline delimited geojson. Shapely and QGIS say that all the polygons in the geojson are valid. However, when I attempt to make a BigQuery table from the geojson, BigQuery has the following error:

Could not convert JSON value to geography: Invalid polygon loop: Edge 52 crosses edge 54; in loop 15 Field: geometry; Value: {"type": "MultiPolygon", "coordinates":  [[[[-71.084213, 45.305475], [-71.084695, 45.305694],  ...

I found the coordinates for edge 52 and edge 54 in loop 15, and this is what they look like in QGIS: If I remove the coordinate that sticks out, the error changes to be about another set of points that do the same thing.
How can I find all the errors of this type, and, ideally, fix them without manually removing each extraneous coordinate?


texts: Can anyone explain me the TSP pgRouting function?

texts:
I have no problems using Dijkstra or A* functions, but when I try to run TSP, I really don't know where to start.

What I'm, trying is to get the 'best route' to link four points (typical TSP problem), but I do not know how to implement this.
According the documentation:

SELECT seq, id1, id2, round(cost::numeric, 2) AS cost
FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);

My questions are:

What means "cost::numeric" and specially "::"? I have seen it before, but still don't know what it is.
Should I have another table with the points with x and y fields? Because if tsp refers to a "vertex table" that I supose will be the point table, where is the edge table (e.g streets) that I queried with Dijkstra?
And what means that 5 and 6?

Sorry if this a strange question, but I'm trying to run this function but I can't do it, and I don't find any documentation but the official docs, (that I don't understand).


texts: Files are being rewritten to created variables in ModelBuilder?

texts:
I am trying to build a model that clips a bunch of my rasters to a specific polygon shape, and I need all my files to be labelled in a specific way. In order to label them, I am trying to use the create a variable tool to splice out the parts of the files paths I need and then use them to label the file.

It works fine without the spliced variables, for example when the Extract by Mask output is: %Name%_clipped, it is totally fine.

But when I try and add the Calculated Values as parameters to the name of the Extract by mask the model just iterates through the one variable set, rewriting over the file every time. It no longer iterates through the files in the geodatabase.

The Calculated Values are strings and the inputs look like: "%Name%"[0:5]

Any suggestions to get it to iterate though all the rasters in my geodatabase and name the files based on the input rasters?


texts:
levelplot with static index works fine but not in a for loop. What's wrong with my code?

Static index:

png(paste("1998",outlist[[1]],".png",sep=""))
levelplot(RAD1998.all[[1:4]])
dev.off()

png(paste("1998",outlist[[5]],".png",sep=""))
levelplot(RAD1998.all[[5:8]])
dev.off()

png(paste("1998",outlist[[9]],".png",sep=""))
levelplot(RAD1998.all[[9:12]])
dev.off()

For loop:

for(i in seq(from=1, to=length(list.ras), by=4)) {
    png(paste("1998_",outlist[[i]],".png",sep=""))
    levelplot(RAD1998.all[[i:i+3]])
    dev.off()
}


texts: Which is my Oldest File Geodatabase backup?

texts:
I have made several backups over the years of our Enterprise Database. Sometimes I want to see some historical aspect of the data. I just realized that what I had been thinking was the oldest backup may or may not be the oldest because the file folder that stores the data (with the .gdb extension) updates simply from opening it in ArcMap (e.g. SDE_DEFAULT_BKUP.gdb was the oldest in the folder until today when I opened it to look at one of the feature classes).

How can I actually know which of these file geodatabases in my backups folder is the oldest?


texts: Is there a performance hit from using a Feature Dataset?

texts:
I vaguely remember being taught not to use a Feature Dataset to make things "look neat" in the database, and that the Feature Dataset should only be used when there was some sort of spatial relationship between the component feature classes.

The help file lists "organize thematically related feature classes" as a valid reason for using a feature dataset.

Is it a bad idea to use a feature dataset to group layers in the geodatabase, when the only purpose is to help navigation in ArcCatalog? Is there a performance hit from storing feature classes in a feature dataset?


texts: Getting attributes from features in list of another table using expressions in QGIS

texts:
The goal seems simple, the explanation not, but I try to:

On the one hand, I have a table with several objects ("objects_layer"). On the other hand is a table with a list-field ("list_layer").

I wan't to get the attributes ("prop1", "prop2", "prop3") from all objects in the objects_layer which are written in the "tellmeabout-field" in "list_layer".
I need it as expression or virtual field/layer.

Example:

The result I expect returns for example as new virtual field in list_layer like this:

Assume, someone is creating a new entry in "list_layer", and he want's to know the props of A and B as text, so he choose A and B from a list and the expression or virt. field is doing the rest:


texts:
I am getting data (GetMap) from a very slow WMS service. As I need to render the tiles very fast on devices, I was thinking to run a nightly batch on my server which grabs all the tiles and save them locally, in order to supply them faster during the day with LeafletJs.

Now it comes the question: is an installation of a full GeoServer the only option for this?


texts: Determine current address location in android mobile app

texts:
In my Android App I need to figure out what address i.e city, state, country my Android phone is in.

So for that, first I determine latitude, longitude via GPS. The phone gives this.

Now, from lat, long I need to determine the address as follows (probably called reverse geocoding):
http://maps.google.com/maps/api/geocode/json?latlng="+ latLng

This works and gives me the address with city, state, country etc. All fine.
Does this break any Google licensing requirements since I am not using any maps and I only need the location address?

If so, how else can I determine the address where an Android phone is.


texts:
I am currently using the following queries to return all features that intersect a large and complex polygon. I initially tried to use a single ST_Intersect query but because the number of features it is searching through is over 400 million this took a significant amount of time (+24hrs).

So I now start by using a bounding box query to drop the number of features that the second query (the ST_Intersects one) uses.

However, I think this is extremely verbose way of doing this, but I cannot figure out a better or quicker way.

Can anyone think of a more efficient way?

thanks

PS Extra Information

Windows 2008 Server 64-bit
Postgis 2.0 64-bit
PostGIS is configuration settings are tweaked using the wiki advice.
All geometries have GiST indexes.

CREATE TABLE temp_lines AS SELECT lines.* FROM lines,counties WHERE lines.wkb_geometry && counties.geom AND counties.name = 'County';
COMMIT;
CREATE INDEX temp_lines_idx ON temp_lines USING GIST(wkb_geometry);
COMMIT;
CREATE TABLE new_lines AS SELECT temp_lines.* FROM temp_lines, counties WHERE      ST_Intersects(counties.geom, temp_lines.wkb_geometry) AND counties.name = 'County';
COMMIT;
DROP TABLE IF EXISTS temp_lines;

CREATE INDEX lines_idx ON new_lines USING GIST (wkb_geometry);
COMMIT;

EDIT

After Paul's comment I went back and re-tried some of my earlier queries.

This first one took well over 24hrs

CREATE TABLE new_lines AS SELECT * FROM lines WHERE ST_Intersects((SELECT geom FROM counties WHERE name = 'County'), lines.wkb_geometry);

Then I found the following post http://revenant.ca/www/postgis/workshop/indexing.html

and I changed my query to this

CREATE TABLE new_lines AS SELECT lines.* FROM lines, counties WHERE ST_Intersects(counties.geom, lines.wkb_geometry) AND counties.name = 'County';

This took a matter of hours.

Not sure why there is such a difference as I thought my first query was the most efficient?


texts: How to add geospatial info to an existing PDF?

texts:
I work with a small non-profit mountain bike trail advocacy organizationand as a result have created a number of PDF-based maps. These are all Mercator projection, built off of OpenStreetMap data, and work great as print maps. For example: Map 1, Map 2

I'd like to georeference these so they can be viewed with something like Avenza PDF Maps on trail users' phones. Unfortunately, something like Avenza MAPublisher is beyond what we can afford.

How can I georeference my existing maps using free/open source/lower cost tools?


texts: How to convert GDB data to shapefiles without ArcGIS?

texts:
We've got some data (supposedly it's a simple collection of points--or at least that is all we need to extract) from a 3rd party in a GDB folder (I don't know how to tell what version) but we don't have an ESRI Arc* product. We are not primarily a GIS company, and our tools basically support only shapefiles. How can we convert the GDB to shapefiles?

Note: I tried following the instructions to get GDB support in QGIS (after uninstalling QGIS and re-installing via osgeo4w-setup) but it didn't work; QGIS still says "Xyz.GDB is not a valid or recognized data source".


texts: Difficulty to display WMS and Googlemaps layers using Geoext and ext

texts:
i have the following code on my html file:

        // World Geodetic System 1984 projection
    var WGS84 = new OpenLayers.Projection("EPSG:4326");

    // WGS84 Google Mercator projection
    var WGS84_google_mercator = new OpenLayers.Projection("EPSG:900913");

    // create a map panel with some layers that we will show in our layer tree
    // below.
    layers = [];

    layers.push(new OpenLayers.Layer.Google("Google Maps", {
        numZoomLevels: 20
                    , 'sphericalMercator' : true
            }
    ));

    layers.push(new OpenLayers.Layer.WMS(
    "National Parks", "http://localhost:8080/geoserver/wms", {
        srs: 'EPSG:4326',
        layers: 'National_Parks',
        format: 'image/png',
        buffer:0
    }, {
        'isBaseLayer': false
    }
    ));

    map = new OpenLayers.Map({
        allOverlays: false  // If it is true then both the wms and the map layers will be included under the "Overlays" folder

    });

    mapPanel = new GeoExt.MapPanel({
        region: "center",
        center: new OpenLayers.Bounds(-16.08,49.06,6.76,58.74).transform(WGS84, map.getProjectionObject()),
        zoom: 2,
        map: map
    });

    map.addLayers(layers);

As the code is at the moment i can see the googlemaps layer at full extent (although i wanted it zoomed in at these boundaries -16.08,49.06,6.76,58.74) but i can not see the national parks wms layer.

What i did was to add 'displayOutsideMaxExtent':true next to 'isBaseLayer': false  on the wms properties. When i did that i could see tha wms layer on all zoom levels but i couldnt see googlemaps at all. when i was zooming in and out the googlemaps layer was appearing instantly and then it was going off.

Does anyone have any idea where the problem might be?

I am using Geoserver, Openlayers, GeoExt and ext.

Thanks


texts: Renaming layer in a TOC using a tool within Python Toolbox

texts:
I created a simple tool that renames layers in the TOC using a for loop. As a tool within my normal toolbox it works fine. Now I´m trying to work more and more with the Python Toolbox and want to migrate the script there. It has these two parameters:

def __init__(self):
    """Define the tool (tool name is the name of the class)."""
    self.label = "Rename layers in TOC"

def getParameterInfo(self):
    """Define parameter definitions"""
    param0 = arcpy.Parameter(
        name="in_string",
        displayName="String to be replaced",
        datatype="GPString",
        parameterType="Required",
        direction="Input")

    param1 = arcpy.Parameter(
        name="out_string",
        displayName="will be replaced by",
        datatype="GPString",
        parameterType="Required",
        direction="Input")

    params = [param0,
              param1,
              param2]
    return params
...
def execute(self, parameters, messages):
    """The source code of the tool."""
    in_string = parameters[0].valueAsText
    out_string = parameters[1].valueAsText

    mxd = arcpy.mapping.MapDocument("CURRENT")
    layers = arcpy.mapping.ListLayers(mxd)
    for layer in layers:
        if in_string in layer.name:
            layer.name = layer.name.replace(in_string, out_string)

It goes through layer names in TOC and if in_string is found, it will be replaced by out_string. My problem is that if it founds a layer that matches the criteria, ArcMap probably renames it but immediately after that it removes the layer from the TOC.

As I was searching through the documentation and similar questions and answers here I found out that it treats that layer as a temporary one (that´s why it gets deleted from TOC) and a derived output must be set. That´s the point where I´m getting lost.

If I create a new parameter:

param2 = arcpy.Parameter(
    name="somelayer",
    displayName="somelayer",
    datatype="GPFeatureLayer",
    parameterType="Derived",
    direction="Output")

param2.parameterDependencies = [????]
param2.schema.clone = True

... I don´t think there is a suitable parameter for parameterDependecies because param0 and param1 are both strings. I need somehow to set the derived parameter to the layer that is being currently evaluated (for layer in layers...), is it possible to set the layer as derived while looping?

Where should I put a derived parameter? Or is there another way how I can make the layers in the TOC permament? Or could you give me some example (or maybe the solution) how to make it work? Neither the ArcGIS documentation nor another threads are quite clear for me.


texts:
I have problems while using the ZonalHistogram function in Python. It seems to give strange results, while, with the same code run in arcgis' python window everything works fine.
I am trying to study the snow cover per elevation ranges, thus including in the function a MODIS image (showing snow cover) as the input raster, and a reclissified DEM as the input value raster. I tried to modify the reclassification many times, but still not solving the problem... Moreover, inverting the input raster with the input value raster (meaning, inverting the function parameters), everything works fine, but it's a mess since I'm working on thousands of images and having the MODIS not always the same number of columns (while being the DEM always the same).
Hope someone could help me.
Here is my script, so that you can have a look at it in order to better understand my request:

import arcpy, os, sys, shutil

newpath= r'G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\Zonal_Histogram\\temporary'
if not os.path.exists (newpath):
    os.makedirs (newpath)

arcpy.env.workspace= 'G:\\Chile_2012\\MODIS10A2.V005\\Cobertura_nival\\Cuencas_Copia\\campione'
arcpy.env.overwriteOutput= True
from arcpy.sa import *

listRaster= arcpy.ListRasters ()
elev_ranges= 'G:\\Chile_2012\\MODIS10A2.V005\\DEM\\elev_ranges'
out_dir= 'G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\Zonal_Histogram\\'

try:
    for raster in listRaster:
        arcpy.CheckOutExtension ('Spatial')
        ZonalHistogram (raster, 'Value', elev_ranges, newpath+ '\\'+ raster)

    arcpy.ClearEnvironment ('workspace')
    arcpy.env.workspace= newpath
    listTable = arcpy.ListTables ()
    print listTable

    arcpy.Merge_management (listTable, out_dir+ 'Rio_Aconcagua_Merge.dbf')

    shutil.rmtree (newpath)

except:
    print arcpy.GetMessages ()

I would add that my idea would be to work with layers (by means of functions that could transform rasters in layers) since the table returned in arcgis has a "LABEL" field (coming from the classification in symbology) which is the thing I would like to include in the final table and which is not included while working out of arcgis (in pywin), in order to know on what I am working on.


texts: How to calculate distance to polygon edge to compute building setbacks?

texts:
I'm trying to calculate building setbacks using building footprint data. A building setback is the distance between a building and the edge of the lot line. (You can distinguish this further—garage setback and structure setback, but I won't complicate things.) The image below (red lines) shows the distance I am trying to get for one of the blocks as an example.

I have no idea how to start this. I think I need to turn the footprint and parcel polygons into polylines and break at vertices? I want to use the street center-line (green) as a sort of magnet so that the distance is calculated to the front of the lot instead of the back or side. I can ignore corner lots for the time being.

BTW, the parcels are also dissolved so it is just block structure (pic below). That means I just need to find the shortest distance between the footprint polygon and the edge of the block polygon.

If anyone has any clue, please let me know! This is for a class project. (And I'm using ArcGIS and QGIS.)


texts: OpenLayers: Constrain view zoom temporarily after having it set up with resolution array

texts:
I've got a map in OpenLayers with 12 possible zoom levels given by a resolution array as defined in view:
var map = new Map({
//...
view: new View({
      resolutions: [8, 4, 2, 1, 0.5, 0.25, 0.125, 0.0625, 0.03125, 0.015625, 0.0078125, 0.00390625],
      zoom: 2,
      constrainResolution: true
    }),
});

The maximum zoom seems to be given implicitly by the resolutions array and is set to 12.
In my use case, users should be able to select detail or overview layers for which I want to constrain the zoom temporarily:
  map.getView().setMaxZoom(7);

I would expect the zoom now to stop at zoom level 7 (i. e. restrict the zoom to resolutions of
[8, 4, 2, 1, 0.5, 0.25, 0.125, 0.0625]).
Unfortunately, it doesn't work for me as intended. Visually, zoom will stop at zoom level 7 but internally, on zoom interactions, zoom is being incremented until the original maximum zoom 12 is reached. Not only is this notable by calling map.getView().getZoom() in these stages, but also by user interaction. When “invisibly” having zoomed out to zoom level 12 (the original max zoom), users have to undo 5 zoom interactions (e. g. mouse wheel) before again reaching the state where zooming out results in a visible change.
Is there any way to achieve the behavior I am aiming for?


texts: Specify a column name of Raster to be read in R

texts: I am trying to read a tif in R. This tif has 4 columns in its attribute table as you can see in the image. However I am only interested in column 4 (WF) to plot and work in R. My problem is that when I call the raster in R, automatically it plots and works on the Value column (according to values of the scale bar). The dbf of this raster is also attached here. Do you know how can I do to specify the column WF I want to work in?


texts:
I'm trying to import a CSV file with geolocated attributes, but the format is not recognized:

Is there a way to automatically recognized it?
EDIT: I think what I need is a batch converter to replace (for example) 9.8N /42.8W by 9.8 / -42.8. I'm looking for that tool.
IDT 2: here is the csv sample https://gofile.io/d/8QsYwb


texts: QGIS remove useless vertex to simplify polygon

texts:
I received a shapefile which is the result of a combination of several polygon. I want to clean and simplify it as there are many useless vertex as you can see on the picture. This is only one feature so there is no need for all the lines in the middle. Just one simple polygon would be just fine.
I tried the function "simplify" but it doesn't change anything. Merge and dissolve functions won't do the trick neither. So I'm not sure how to proceed.


texts:
Linux Mint 17.2
Just came to fire up QGIS after a couple of days doing other stuff and the launcher is not on my panel and the program is not listed in the Applications menu.

Presumably something I have done has removed it, but there is still a directory .qgis2 in my user directory. I've looked in various places and can't see any QGIS-related stuff.

I had been (having trouble with) installing LAMP and related stuff, which I uninstalled & installed XAMPP. The only system change I can think of is the LAMP uninstall removed QGIS? This is the command I used:

for pkg in dpkg -l *apache* *mysql* phpmyadmin | grep ^ii | awk '{ print $2 }'; do sudo apt-get -y purge --auto-remove $pkg; done;

Any ideas? Any log that I can see what might have happened?


texts: Is there a way to make a straight line in ArcEngine 10 (Polyline but with ONLY start and end)

texts:
So I want to allow the user to create a connection between 2 polygons on my map. So it doesn't make sense to allow them to draw polyline with multi points.

My question is, is there a way I can do something like below BUT ONLY with 1 start and 1 end point?

private IPolyline DrawLine(IActiveView activeView, int x, int y)
{
    IPolyline line = null;
    IRubberBand rubberBand = new RubberLineClass();
    ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();

    if (activeView != null)
        line = rubberBand.TrackNew(activeView.ScreenDisplay, (ISymbol)simpleLineSymbol) as IPolyline;

    return line;
}

Problem is i don't want the user to have to double click at the last point, it could be confusing for user, i want them to click - create start point, click - create end point.

Thanks,
Kevin


texts:
I'm new in qgis and I need some help.

I'm trying to export a specific layer with defined some points using different symbols.

The exported kml file will discard the symbol type layout.

This is the resulting vision of the kml file:

Anyway if I will use ony a simple symbol will the symbol layout will not exported by qgis.


texts: Batch importing raster TIFFs into PostgreSQL using Python

texts:
I have a fairly simple script where I aim to insert roughly 30 raster TIFFs into a PostgreSQL database.

To manually import one TIFF at a time I run this command

raster2pgsql.exe -s 2263 -d -C -I -M -l 2,4,8,16 \\rasterpath\_001.tif -F -t 100x100 dem_001 | psql -d raster_test -U postgres -p 5434

This works great

Now to the Python script

folder=r'rasterpath'
for x in os.listdir(folder):
    if x.endswith('.tif'):
        fname='dem_'+x[-7:][:3]
        pg= "raster2pgsql.exe -s 2263 -d -C -I -M -l 2,4,8,16 {0} -F -t 100x100 {1} | psql -d raster_test -U postgres -p 5434 ".format(os.path.join(folder,x),fname)
        print(pg)
        subprocess.run(pg)

I get this error

ERROR: Unable to read raster file: dem_001
ERROR: Unable to read raster file: dem_002
...

But if I run the printed output from the Python script manually into the CMD it succesfully runs.

Kind of confused on what is going wrong here.

Using Python 3.7


texts: How do I inspect, then force a geotiff to be in the format of the Natural Earth 2 map?

texts:
We are using the Natural Earth 2 map as a test file, and it's worked swimmingly. Unfortunately, our archaeologist has given us a satellite image (not distributable) in the form of a geotiff that does not seem renderable by the application (after appropriate reprojection).

How do we, using grass or command line osgeo tools, inspect the various file settings of our Natural Earth 2 map and then impose those settings onto the geotiff we have. Unfortunately, our team is rather newbish when it comes to sophisticated geotiff manipulation, so specific steps are encouraged.


texts: How to move a value from field1 to field2 using Field Calculator?

texts: I would like to move value in field1 to field2. Purpose is to after that delete the column 'field1' to get a better column naming standard /Jan


texts: Can GRASS read Spatialite geometry fields?

texts:
I've looked at the question: How to import SpatiaLite data into GRASS? already. The links there talk about two separate tasks: Passing SQL to a Spatialite DB from GRASS and connecting to Spatialite from GRASS. That is fine, but the point of Spatialite is to generate geometry metadata. So to get specific, let me explain what I am aiming to achieve.

I create an SQLite database containing crime statistics with State Plane California Zone II (ft) projected coordinates (X_Coord and Y_Coord). All of that is done in R. I then run an SQL script that initializes the Spatialite script and adds geometry columns to the crime table, populates them, and then imports a couple of shapefiles.

Now, my table still has the original X_Coord and Y_Coord fields, but it also has a SHAPE field that contains the geometry. I can import the data into GRASS because I have the coordinates, but it cannot recognize, as far as I can tell, the Point geometry contained in SHAPE. If I'm going through all of this to store geometry in Spatialite, it seems redundant (and time consuming) to then recreate geometry in GRASS.

My aim is to use this database and have GRASS quickly extract the geometry and create a v.kernel raster for a density surface. It would also be nice to define the GRASS bbox based off the geometry stored in Spatialite (because it's easy to get that information from SHAPE instead of X_Coord and Y_Coord with Spatialite functions). But if GRASS currently cannot interface Spatialite geometry, there's an obvious disconnect.

Is this just a feature GRASS is currently lacking or am I missing where on the web this is documented? I've spent the past couple of weeks looking into this and find the only solution is to redundantly create the geometry in GRASS based off X_Coord and Y_Coord, making the SHAPE field superfluous to this part of my analysis. (It's still useful for directly pulling into QGIS.)


texts: Calling geopackage in a loop, "database is locked" error

texts:
I try to loop through a folder containing multiple geodatabases (12). After performing some calculation I try to save the results in a new shapefile located in another folder, but the code generates only three shapefiles. I also get following message during the creation:

[...]
it__
  File "fiona/_shim.pyx", line 73, in fiona._shim.gdal_open_vector
    self.session.start(self, **kwargs)
  File "fiona/ogrext.pyx", line 467, in fiona.ogrext.Session.start
  File "fiona/_shim.pyx", line 73, in fiona._shim.gdal_open_vector
fiona.errors.DriverError: database is locked
  File "fiona/_shim.pyx", line 73, in fiona._shim.gdal_open_vector
  File "fiona/ogrext.pyx", line 467, in fiona.ogrext.Session.start
fiona.errors.DriverError: database is locked
fiona.errors.DriverError: database is locked
  File "fiona/_shim.pyx", line 73, in fiona._shim.gdal_open_vector
fiona.errors.DriverError: database is locked

Here I have some code:

for file in glob.glob('[mypath]\\*[0-9].gpkg' ):

    layer = gpd.read_file(str(file), layer = os.path.splitext(os.path.basename(file))[0])

#[...doing something...]

if __name__ == '__main__':

    layer.to_file(f'[mypath]\\{os.path.splitext(os.path.basename(file))[0]}.shp', driver = "ESRI Shapefile")

Like the message indicates is there some problem with the database connection. Should I close the connection after every run in the loop? And how do I do it?

I'm using Windows 10 and Python 3.7.


texts: Creating sub-polygons based on underlying basemap?

texts:
I'm looking at ranging patterns where animals go in and out of nature reserves into residential areas.  In addition to home range polygons, I've generated polygons made from applying 25m and 50m buffers to individual points and dissolving those points into a single polygon shapefile.

To my knowledge there aren't freely available quality maps of my areas of interest that specify broad landscape types categorically (suburban, urban, primary forest, reserve, secondary forest etc) so I've been working off of basemaps thus far.

I realize one option is to create these layers myself by digitizing over the basemap.  Alternately, I could create a feature class and freehand draw polygons over the reserve areas that overlap with the home range or buffered points.  One problem I'm encountering with this is that the freehand tool seems to automatically 'draw' where ever the cursor goes, rather than waiting for a definitive click - this is preventing me from zooming in and out and shifting window view as I would like to make an accurate rendering.

Are there any ways of drawing a polygon over an existing polygon without the cursor automatically 'drawing'?

I'm using ArcMap 10.2.2

I think my best bet would be to create the polygons islandwide so that I could just use the intersect tool going forward to determine the % of the range that falls into each category.


texts: I hid the QGIS Menu bar, how can I bring it back?

texts:
I was trying to save customization templates in QGIS 2.4 and have managed to hide the MENU bar. Now I cannot access Settings->Customization to switch it on again.

I even un-installed and deleted the .qgis2/ folder from my user but it always loads without the menu bar now.

Please suggest a way to get the MENU bar back please.


texts: Shape ID is lost after converting a shapefile into a raster in QGIS

texts:
Instead of a landclass having the value 1 (my previous shapefile ID), the raster classes have the below values after shapefile conversion.
The above input values and gdal command was used
gdal_rasterize -l HanselSquare -a id -tr 100.0 100.0 -te 4130900.0 2799300.0 4230800.0 2899100.0 -ot Int32 -of GTiff

How do I keep the shapefile ID after conversion?


texts: Whenever I specify my area of interest and set my coordinates and choose Sentinel-2 it gives me error of  Error [50]: Internet error:HTTP Error 401: Unauthorized. How do I solve this problem hence I created ers, scihub, and earthdata.nasa 2 days ago?


texts: calculating total area of multiple polygons in qgis

texts:
I wish to know the total area of all polygons within a shapefile layer.
So far I have added a new column to the attribute table that shows me the individual area of the polygons.I tried to copy the column out of attribute table to do it in calc, but that did not work. How can i calculate the total area of all polygons ?


texts: Spatial Join - One Join Feature to Multiple Target Features

texts: I want to join a set of target features (polygons) to a set of join features (points).  The polygons can, and do, overlap.  I want the join features to be counted (joined) to as many target features as they intersect.  For example, in the picture below the green feature should get a join count of 4, the red feature should get a join count of 5 and the orange feature should get a join count of 3.  What selections are necessary to script this?


texts: Why the table fields imported from a .csv file have a length of zero?

texts: I've imported a .csv file (with relative .csvt) in QGIS 2.8.4 adding a delimited text layer... the table was correctly been imported but the table fields have a length of zero... the fields types instead have been correctly read from the .csvt, which obviously specifies also the fields lengths.