texts:
My 1 Service have only 1 layer with year wise archive data. Like it have same geometries at different year along with some addon in another year.

I want to use this Dynamic layer for representing the geoms on map yearwise with different symbols [Polyline] when user choose year. I m using MVVM Light, Silverlight. I do what ever but not able to change the rendering of Layer.

I crate ArcGISDynamicMapServiceLayer when User click on check box and create the layer. Then add to LayersCollection. once it initialize then I add Rendere. But still no hope. Can any one help me?

 public void ProjectLayer(ref HpmsMapLayerModel lyr, ref HpmsBaseEsriMapViewModel baseVm,bool isDynamic)
    {
        currentProjection = null;
        currentProjection = lyr;
        BaseVm = baseVm;
        ArcGISDynamicMapServiceLayer mapLayer = new ArcGISDynamicMapServiceLayer();

        mapLayer.Url = lyr.Url;
        mapLayer.ID = lyr.Id;
        mapLayer.DisableClientCaching = true;
        LayerInfo linf = new LayerInfo();
        linf.ID = 0;
        linf.SubLayerIds = new int[]{0};
        linf.DefaultVisibility = false;

      DynamicLayerInfoCollection  dyLyInfColx= mapLayer.CreateDynamicLayerInfosFromLayerInfos();
         dyLyInfColx = new DynamicLayerInfoCollection();

          BaseMapVM.Layers.Add(mapLayer);
        mapLayer.Initialized+=mapLayer_Initialized;
        GetFeatures("HPMSYEAR='" + 2013 + "'", lyr, baseVm);

    }

    private void mapLayer_Initialized(object sender, EventArgs e)
    {
        var rlyr = sender as ArcGISDynamicMapServiceLayer;
        var lyr = BaseMapVM.Layers.Where(L => L.ID == rlyr.ID).FirstOrDefault() as ArcGISDynamicMapServiceLayer;
        lyr.Layers[0].DefaultVisibility = false;
        DynamicLayerInfo layer1 = new DynamicLayerInfo();
        layer1.ID = 0;
        LayerMapSource lms =  new LayerMapSource();
        lms.MapLayerID = 4;
        layer1.Source = lms;
        DynamicLayerInfoCollection dyLyInfColx = lyr.CreateDynamicLayerInfosFromLayerInfos();
        dyLyInfColx.Add(layer1);

        lyr.DynamicLayerInfos = dyLyInfColx;

        LayerDefinition ldef = new LayerDefinition();
        ldef.LayerID = 0;
        string whereClse = "HPMSYEAR='" +2013+"'";
        ldef.Definition = whereClse;
        ObservableCollection<LayerDefinition> layerDrfins = new ObservableCollection<LayerDefinition>();
        layerDrfins.Add(ldef);
        lyr.LayerDefinitions = layerDrfins;

        LayerDrawingOptions ldrOpns = new LayerDrawingOptions();
        ldrOpns.LayerID = 0;
        UniqueValueRenderer myUniqueValueRenderer = new UniqueValueRenderer();
        myUniqueValueRenderer.Field = "HPMSYEAR";
        UniqueValueInfo myUniqueValueInfo1 = new UniqueValueInfo();
        myUniqueValueInfo1.Value = 2013;
        //SimpleFillSymbol mySimpleFillSymbol1 =
        //    new SimpleFillSymbol();
        SimpleLineSymbol smp = new SimpleLineSymbol();
        smp.Color = BrushConstants.Green; // BrushConstants.DefaultBrushes[colorIndex];
        smp.Width = 5;
        myUniqueValueInfo1.Symbol = smp;
        myUniqueValueRenderer.Infos.Add(myUniqueValueInfo1);
        ldrOpns.Renderer = myUniqueValueRenderer;

        LayerDrawingOptionsCollection ldoc = new LayerDrawingOptionsCollection();
        ldoc.Add(ldrOpns);
        lyr.LayerDrawingOptions = ldoc;
        ArcGISDynamicMapServiceLayer rLyr = null;
        rLyr = BaseMapVM.Layers.Where(L => L.ID == lyr.ID).FirstOrDefault() as ArcGISDynamicMapServiceLayer;
        if (rLyr != null)
        {
           // BaseMapVM.Layers.Remove(rLyr);
           // BaseMapVM.Layers.Add(lyr);
            lyr.Refresh();
        }

        var b = e;
    }

When User Click on Check Box HpmsMapLayerModel class contains the URL, Name, Id etc information and I HpmsBaseEsriMapViewModel contains the Map Object etc.

What I m doing wrong. I m not able to figure out. All the time layer get loaded with full data. Along with predefined rendere which is of Pink Color.


texts: Inputting multiple featureclasses into Merge tool using ModelBuilder?

texts:
So I have 490 point fc's in a single directory with uniform spatial features, field names/datatypes. I'm trying to figure out how to consecutively input the first seven fc's into the merge tool, create a new merged fc, and then iterate the model until 70 new merged fc's are created.

I know how to iterate single fc's as input into a tool, but not multiple features per x number of iterations.

I have some code below that uses list, an array, and a count system that does what i need for another GP operation. How can I translate this into modelbuilder's variables/methods? I am using modelbuilder because I was having trouble mapping fields for merge in python

try:
    # Create list of rasters
    rasters = arcpy.ListRasters("*", "tif")
    rastersCount = len(rasters)

    counter = 0
    weekNum = 1

    while counter < rastersCount:
        #collect 7 consecutive rasters
        weekRasters = []
        for i in range(counter,(counter+7)):
        weekRasters.append(rasters[i])

        # Execute CellStatistics (one can use list of rasters directly here)
        outCellStatistics = CellStatistics(weekRasters, "SUM", "NODATA")
        # Save the output
        outRasterName = "week_"+ str(weekNum)
        outCellStatistics.save("D:/dailyrainfall/nueces_dailyrainfall_rasterized/" + outRasterName )

        counter += 7
        weekNum += 1
except:
    # If an error occurred while running a tool, then print the messages.
    print arcpy.GetMessages()

Using ArcGIS 10 (ArcInfo) SP4 with all extensions


texts: How to convert Geodatabase to open standards to process it further?

texts:
I have a ESRI file in geodatabase format (v9.3). I intend to use this in a non-commercial application. I think I will have to convert it into a open standard since I am confused if ArcGIS online would need a paid subscription even for a non-commercial 'production' application. (Please let me know if i am wrong about their developer license)

So I am here basically looking for a solution to convert the gdb file/directory to another open format and do below operation: I need to use the gdb data (available data is polygon map overlays) to derive connecting lines from mid point of one polygon to the other polygon. (there would be a huge number of sets of two polygons like this). The end dataset would be a single table having below columns

set_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon

Could anyone tell me what open source technologies I should be looking at to convert and do above operations?


texts:
I have a raster file (PNG) georeferenced with PGW world file. The file was created in British National Grid EPSG 27700.
The recipient requires the file in WGS84 EPSG 4326, and has no re-projection facilities.
I thought I could easily reproject the file in QGIS - by changing both the project CRS and layer CRS to EPSG 4326, and re-exporting.
I've had a look at this post on how to export a TIFF with .tfw from QGIS, and have done this successfully. (And I know that world files can easily swap formats between PNG/TIFF (pgw/tfw) by amending the file extension, so I can translate this from tfw to pgw with no issues.)
However - when I interrogate the resulting world file, the co-ordinates still appear to be EPSG 27700 format co-ordinates. The recipient needs the file to show these in EPSG 4326.
Do I need to translate these manually in text edit? Is there an easy way to re-project world files between co-ordinate systems?


texts: How to check the value of a single pixel in QGIS?

texts:
I was wondering how to check the value of a pixel at a mouse click in QGIS (as of 2.4).

In ArcGIS, the Identify tool does the job for both rasters and vectors. However, in QGIS, the Identify tool seems to be greyed out when only one raster layer is loaded.


texts: Linear spatial regression of Sentinel-2 products?

texts:
I would like to run a spatial regression to refine the spatial resolution of Sentinel-2 20 m bands by using the 10 m 8A band.  So the idea is to have Bands at 20 m as dependent variables and band 8 A as the explanatory variable. I believe I should not use reducers as follow in the code because it is an image and not an image collection.
Any tips on how to do that?

//Mascara do Cerrado
var polygon = ee.FeatureCollection('ft:1T3PyuGkCwptQjf5MZ5POd1iJJ330kUZU-avcjpT-');

var bands_MSI = ['B2', 'B3', 'B4', 'B8', 'B5', 'B6', 'B7', 'B8A', 'B11', 'B12'];

//Mascara de nuvens
var col_noclouds = function(image){
  var quality = image.select('QA60');
  var cloud01 = quality.eq(1);//Densas
  var cloud02 = quality.eq(2);// Cirrus
  var mask = cloud01.or(cloud02).not();
  return image.updateMask(mask);};

var base_collection = ee.ImageCollection('COPERNICUS/S2')
.filter(ee.Filter.lt('CLOUD_COVERAGE_ASSESSMENT', 5))
.filterBounds(polygon)
.filterDate('2017-01-01', '2017-12-31')
.map(col_noclouds)
.select(bands_MSI)
.median()
.select('B8','B12');

// Compute robust linear regression coefficients.
var robustLinearRegression = base_collection.reduce(
  ee.Reducer.robustLinearRegression({
    numX: 1,
    numY: 1
}));

// The results are array images that must be flattened for display.
// These lists label the information along each axis of the arrays.
var bandNames = [['B8'], // 0-axis variation.
                 ['B12']]; // 1-axis variation.

var rlrImage = robustLinearRegression.select(['coefficients']).arrayFlatten(bandNames);

// Display the OLS results.
Map.setCenter(-100.11, 40.38, 5);
Map.addLayer(rlrImage.select('B12'),
  {min: 0, max: 3000}, 'OLS');


texts: Using GPFeatureRecordSetLayer in Python Toolbox for ArcMap?

texts:
I have written a Python Toolbox for ArcMap, that allows a user to consume a Template Feature Layer to run through a series of processes.

The user defines an Area of Interest (AOI) in the Tool and then a bunch of Geoprocessing Tools run for this AOI.

I have tested the Tool in ArcMap 10.4 and 10.6 and it works as expected.
I asked a user to run it in 10.2 and he produced a result.

I have however managed to get access to two Desktops running 10.2 and the AOI is not displayed correctly.

The Tool is meant to look like this:

When I open the tool in 10.2, in place of the "Tool:: Select your Area of Interest" there is a path to an "in_memory" workspace...of which I have none in my script at all:

Has the way in which the "GPFeatureRecordSetLayer" data type changed between ArcMap 10.2 and 10.4?

I think we should ignore the one time it worked on a 10.2 machine, as I was not there to witness the exact steps taken by the user, and the tool may have run correctly, without the AOI being created - it may have run using information already stored in the AOI Template file.

My code to create this tool is below:

**def getParameterInfo(self):
        '''parameter definitions for GUI'''
        params = None
        param0 = arcpy.Parameter(
        displayName = "AOI",
        name = "Choose you Area of Interest",
        datatype = "GPFeatureRecordSetLayer",
        parameterType = "Required",
        direction = "Input")

        param0.value = r"C:\Data\AOI.lyr"

        param1 = arcpy.Parameter(
        displayName = "Project Name",
        name = "Please provide a project for this search",
        datatype = "GPString",
        parameterType = "Required",
        direction = "Input")

        param1.value = "Input Text"

        param2 = arcpy.Parameter(
        displayName = "Project Identifier",
        name = "Please provide an unique identifer for this search - Text Only",
        datatype = "GPString",
        parameterType = "Required",
        direction = "Input")

        param2.value = "Input Text"

        params = [param0 , param1, param2]
        return params**


texts:
When creating a PostGIS table (e.g. 'lakes') in the DB Manger a primary key ('lakes_pkey'), a index ('sidx_lakes_geom) and a sequence ('lakes_gid_seq') are also created.

But when renaming the table (e.g. 'lakes_2015'), the constraint, the index and the sequence don't get new names.

So it's not possible to create a new table named 'lakes' after renaming the original table 'lakes'.

Error: Relation „sidx_lakes_geom“ already exists

Is this a bug? (https://hub.qgis.org/issues/13823)


texts: Choosing database for storing spatial data?

texts:
A couple of days ago I installed the demo of spatialware 4.9 from MapInfo into my SQL Server 2005 install and loaded all the larger dataset into it. I was quite impressed with the performance vs the old file based approach but it got me thinking what other options are out there and what are the pros and cons with them.

A con I would have to say with spatialware is the fact that it is $5000 p/a and only MapInfo can read the objects from it.  Which at the moment is fine because MapInfo is all we use.

I'm wondering what other people have gone with and what their experiences are.


texts: Using ArcGIS Online feature service attribute table dynamically in Excel

texts:
I've been trying to find a solution for a while now that will allow me to view a feature service in Excel without having to export. I'm aware of the ESRI Office add-in, however, this is only to upload/update data, and not to import data.
This will save me lots of time every month summarizing data from exports. I'd like to have it auto-fill into a template.


texts: What is the problem with the merge shapefiles tool in QGIS?

texts:
I'm having trouble merging shapefiles in QGIS. I'm using plugin ftools 0.6.1 and I get this:

Any workarounds someone may know of?


texts: ArcGIS Conditional operation in Raster Calculator

texts:
I have two raster datasets called "Raster1" and "Raster2". Raster1 is slightly larger than Raster2 in extent (in Top, Left, Right and Bottom). This means Raster2 is fully contained by Raster1.

I would like to use Raster Calculator in ArcGIS Desktop 10.5.1 to build an expression to create a new raster that meets all of the following criteria:

has the same extent of Raster1 (larger extent);
where Raster2 exists, pixel values are from Raster2;
where Raster2 does not exist but Raster1 exits, pixel values are NoData.

How can I go about specifying the expression in the Raster Calculator window to achieve this?


texts: shapely polygon leaves traces of other poly geometries after unary_union

texts:
I am trying to dissolve poly from a shapefile with unary_union and at times I am left with a poly that looks like this:

You can see the lingering line geometries left inside of the poly.  I have been able to drill down to the xy coords of the exterior and build a new polygon from that. This has removed the chatter that is shown in the interior of the poly, but using the exterior coords leaves me with a problem detailed in the image below that is a zoom from the red box above:

There are a couple of lines like this that remain in the exterior ring, is there a way that I can remove them?


texts: Access WMTS from a GeoTIFF Layer in GeoServer

texts:
I created a layer in GeoServer from a GeoTIFF-source.
I can access this layer via WMS through the following URLs:

mapproxy:

http://10.77.70.19:8080/geoserver/germany/wms?SERVICE=WMS&

I have enabled GeoWebCache for that layer.

I want to create a WMTS layer through mapproxy by combining this layer with another WMTS layer. Combining WMS and WMTS to create WMTS seems to not be possible.


texts:
I have a dynamic style in Geoserver, like below:

    <sld:ColorMap>
      <sld:ColorMapEntry color="#2c7bb6" quantity="${env('low',0)}" label="${env('low',0)}"/>
      <sld:ColorMapEntry color="#64a5cd" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 1 / 9}"/>
      <sld:ColorMapEntry color="#9dcfe4" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 2 / 9}"/>
      <sld:ColorMapEntry color="#c7e6db" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 3 / 9}"/>
      <sld:ColorMapEntry color="#edf7c9" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 4 / 9}"/>
      <sld:ColorMapEntry color="#ffedaa" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 5 / 9}"/>
      <sld:ColorMapEntry color="#fec980" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 6 / 9}"/>
      <sld:ColorMapEntry color="#f99e59" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 7 / 9}"/>
      <sld:ColorMapEntry color="#e85b3a" quantity="${env('low',0) + (env('high',0) - env('low',0)) * 8 / 9}"/>
      <sld:ColorMapEntry color="#d7191c" quantity="${env('high',0)}" label="${env('high',0)}"/>
    </sld:ColorMap>

An example request:

/geoserver/temper/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&LAYER=temper:A%C3%91O2017&WIDTH=30&HEIGHT=5&transparent=true&STYLE=estilo_fijo&env=low:11;high:13;&LEGEND_OPTIONS=fontSize:15;fontColor:0xFFFFFF0;fontStyle:bold;dpi:180;mx:0.2;my:0.2;dx:2;dy:2;absoluteMargins:True;

I was expecting labels to take the values provided with the enviroment variables passed in the GetLegendGraphics request, as it's working with the quantity parameter for GetMap requests.

The output image i'm getting:

It seems that whatever you pass in the label parameter is treated as string, and dynamic values are not working with the syntax used.

So it's possible and I'm using the wrong syntax? Or it's not possible to make the label dynamic?

Also, Geoserver says my style is not valid and get some errors during the validation, but the style is working:

  line 18: cvc-attribute.3: The value '${env('low',0) + (env('high',0) -
  env('low',0)) * 7 / 9}' of attribute 'quantity' on element
  'sld:ColorMapEntry' is not valid with respect to its type, 'double'.


texts: Problem with performances with Leaflet in an Ionic app => interactive metro map

texts:
I was hoping you could help me with something I am stuck with.
I am a newbie in the use of leaflet library on mobile and I encounter a problem with performances.

In fact, I try to build an app with an interactive metro map that might have 350 markers if not more. Because it is an image, not a map, my 350 markers are always displayed, no matter if it's zoomed in or zoomed out... and performances are impacted... It becomes VERY slow... :(

Does anyone have any clue to solve the issue?

Maybe a way to make markers appear only if they are in the area shown on the screen and disappear if they are out?


texts:
In Spanish and Catalan, we use numeric separators the other way round: We use a comma instead of the decimal point; and a point instead of a comma to mark the thousands.

English | Spanish
   10.5      10,5
2,228     2.228
1,150.2   1.150,2

What precautions have to be taken when transferring geographic data between programs configured in different languages?

Is there a way to force programs to emit all numeric values in English, and expect them in the same language?

Is there a way to do the same using Spanish as the standard?

Right now, I'm working with PostGIS and GeoServer, but I expect to use other programmes in the short term: mainly ArcGIS Server and Sitmun.


texts: Access geojson property of a layer in a featuregroup in Mapbox

texts:
I have a GEOJSON which I added to the featuregroup in my Mapbox map like this:

var featureCollection = {
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "properties": {
      "id": 1
    },
    "geometry": {
      "type": "Point",
      "coordinates": [0, 0]
    }
  },{
    "type": "Feature",
    "properties": {
      "id": 2
    },
    "geometry": {
      "type": "Point",
      "coordinates": [30, 30]
    }
  },{
    "type": "Feature",
    "properties": {
      "id": 3
    },
    "geometry": {
      "type": "Point",
      "coordinates": [-30, -30]
    }
  }]
};
var geojson = L.geoJson(featureCollection);
var featureGroup = L.featureGroup().addTo(map);
featureGroup.addLayer(geojson);

Now, I wish to access the id property of each layer while looping through the featuregroup, so that I can pass it as an argument to another function. In the case of a featurelayer, I can easily access it using something like this:

var featureLayer = L.mapbox.featureLayer(featureCollection).addTo(map);
featureLayer.eachLayer(function (layer) {
  layer.on('click', function (e) {
    console.log('Clicked feature ID: ' + e.target.feature.properties.id);
  });
});

But I want to be able to access it while looping inside a featuregroup, and also I want to be able to do it without a 'click' or any such event. For example, something like this:

featureGroup.eachLayer(function (layer) {
  var id = layer.feature.properties.id;
  testfunction(id);
});

I haven't been able to figure out how to do that. I've tried searching online, but because I'm new to this, I probably haven't been using the right keywords in my search.

Can someone please help me figure this out?


texts: Get coordinates from polygon outline with greatest distance

texts:
I'm looking into a task in ArcGIS 10.2 of which I need to discover the two points on a polygon outline where they would be at the greatest distance from each other.

I have looked at ET Geowizards center-line (then extract end nodes) but it doesn't work as the polygon being so narrow seems to confuse ET so the centerline doesn't reach the "tips".

See the image below, the orange dots indicate the points I need.  The polygons are always this shape, i.e. long, slim geomtries

I would need to do this for 500 or so polygons so I need something fairly quick.  I looked at using the near tool to loop through a point set for each polygon but it takes too long due to multiple calls of the GP tool.

My other thought is, using Python, use the geometery object to go through a point set for each polygon looping through all the possible pairings of vertices to find the pair that are the furthest distance.

Any thoughts?

I have full licenses of ET, ArcGIS Advanced and Spatial Analyst.  Also can do a Python or .NET solution.

Many thanks


texts: Error when calculate field using VBscript or Python (slice a field)

texts:
I have an expression in VBscript that works well for labeling:

Function FindLabel (field)
 if (INT(RIGHT(field, 2)) <> 1) then
   FindLabel = INT(MID(field, 8, 3)) &"-"& INT(RIGHT(field,2))
else
    FindLabel = INT(MID(field, 8, 3))
end if
End Function

This expression labels a text in this format: VCC065-00102 to: 1-2  or from VCC065-00501 to: 5 (using just the last 5 carachters, if the last one is > 1, it shows the number after a "-").

But, when I tried to use the same script for calculating a field, I've got a syntax error error:

Code block:
the same as above

Expression:

  FindLabel ([DATA])

Also, I tried to convert this script to Python:

Code Block:

def FindLabel (Field):
  Var1 = Field[-2:]
  Var2 = Field[8:-3]
  if (int(Var1)  <> 1 ):
    FindLabel = int(Var2) &"-"&  int(Var1)
  else:
    FindLabel = int(Var2)

Expression:

FindLabel (!DATA!)

But it returns an error:
The field is not nullable.
(I don't know why, but the expression is returning a null value)

Thanks!


texts:
I am new to Geoserver (version 2.4.3). I have configured SQL store and then tried to create a Layer over one of my views with the correct coordinate system, when I tried to preview the layer using openlayers -  I got this error in the logs.

Caused by: java.io.IOException
    at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:610)
    at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:563)
    at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:165)
    ... 108 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'FROM'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:775)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:611)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at org.geotools.jdbc.JDBCFeatureReader.<init>(JDBCFeatureReader.java:140)
    at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:580)
    ... 110 more
2013-12-29 12:49:52,626 INFO [geoserver.wms] -
Request: getServiceInfo
2013-12-29 12:49:52,632 ERROR [geotools.rendering] - Error querying layer
java.lang.Exception: Error transforming bbox
    at org.geotools.renderer.lite.StreamingRenderer.getStyleQuery(StreamingRenderer.java:1068)
    at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2009)
    at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:837)
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:481)
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:251)
    at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceM


texts: Why coordinates are saved like "0101000020110F00003CDBA337DCC351C06D37C1374D374840" in db?

texts:
On my DB, the data looks like this:

In the DAO I am executing a query:

public Object login(UserEntity user) {
        StringBuffer sb = new StringBuffer();
        sb.append("SELECT user FROM UserEntity user " + "WHERE email in (:email) ");

        Query q = em.createQuery(sb.toString());

        q.setParameter("email", user.getEmail());

        UserEntity userFound = new UserEntity();

        try {
             userFound = (UserEntity) q.getSingleResult();
        }catch(NoResultException nre){
        }
        return userFound;

    }

But if I try to do inspect over (UserEntity) q.getSingleResult() I have an exception (translated from Spanish):

org.postgresql.util.PSQLException: ERROR: the operator does not exist: character varying = bigint
  Hint: Either operator match with the name and the argument´s type.
Could be necessary add explicit type convertions

It seems that the reason is that geo data are stored as "0101000020110F00003CDBA337DCC351C06D37C1374D374840" instead of "POINT(238271.194740 5070436.677042)".

Is that normal or there are any method to avoid this?


texts: How to install gdal postgresql driver in Ubuntu

texts:
I want to use Python to load PostGIS table by ogr. But after I try ogr.open in python (it works if loading a shapefile), I can only get null value.

Now I have tried GDAL debug, the output shows like this:
GDAL: In GDALDestroy - unloading GDAL shared library. and I have found that the problem is lack of postgresql driver. So how should I install it in ubuntu?


texts: Get points in point file to write into new field the census tract each is in (from another shapefile)

texts: I have points that represent day care centers which have address and lat-long. I am using lat-long to display. Now I need to sort, count, etc. these points in conjunction with new census data. To be able to match, I need to get the census tract written into a new field for each point.


texts:
I want to request a WFS feature but my mapfile returns WMS, I have tried to change the mapfile but it still returns the WMS. I am using MapServer 7.3 and OpenLayers 4. Below is my mapfile

...
WEB
    TEMPLATE "/data/mapFile/template.html"
    IMAGEPATH "/data/mapFile/output/"
    IMAGEURL "/data/mapFile/output/"

    METADATA
        'wfs_title'             'Provincial Boundaries'
        'wfs_onlineresource'    'http://*****/cgi-bin/mapserv?map=/data/mapFile/South.map'
        'wfs_srs'               'EPSG:4326'
        "wfs_abstract"          "Provincial boundaries"
        'wfs_enable_request'    '*'
    END
END

PROJECTION
    'init=epsg:4326'
END

LAYER
    NAME    'south'
    METADATA
        "wfs_title"             "Provincial Boundaries"
        "wfs_srs"               "EPSG:4326"
        "gml_include_items"     "all"
        "wfs_request_method"    "GET"
        "gml_featureid"         "ID"
        "wfs_enable_request"    "*"
    END
    CONNECTIONTYPE WFS
    TYPE    POLYGON
    STATUS  ON
    DATA    '/Data/Webmapping/National/Provinces.shp'
    TRANSPARENCY 100
    PROJECTION
        'init=epsg:4326'
    END
    CLASS
        NAME    'Privincial Boundaries'
        STYLE
            WIDTH 0.55
            OUTLINECOLOR 0 0 0
        END
    END
END
....

And below is my layer

africa = new ol.layer.Tile({
  visible : true,
  source: new ol.source.TileWMS({
      url: 'http://*****/cgi-bin/mapserv?map=/data/mapFile/South.map',
      params: {
          'LAYERS': 'south',
          'TRANSPARENT': true
      }
  })
});


texts: QGIS2Threejs seems to be hung up in building a flat plane

texts:
I have installed QGIS 3.12.0 and Qgis2Threejs on a Windows 10 machine.  When I start up Qgis2Threejs exporter I get a message at the bottom of the exporter screen == Building Flat Plane...

The progress bar is about 1/4 complete.

The screen stays this way until I abort QGIS.

After I installed 3.12 I installed 2.x.  Qgis2Threejs appears not to have this problem.


texts:
I'm sorry for the newbie question, but I'm picking up QGIS after a few months' absence, and I feel like everything is confusing again. I have imported some kml tracks, and put them into a GeoPackage layer of line topology. A few of the tracks have breaks in them (when the GPS didn't have a signal) and I want to merge those tracks into one.
I turned on snapping, drew a new straight line to connect the two I want to merge, and then selected the three lines and selected the "Merge Selected Features" menu item. This succeeds perfectly, but then I get this very annoying error:

Could not commit changes to layer Temp Lines
Errors: ERROR: 1 feature(s) not added - geometry type is not compatible with the current layer.

With some browsing here, I think that the lines were merged to a polyline, but that information doesn't help me. How do I merge lines and have the resulting shape be a line?
@bable asked me some questions, which I think I am supposed to answer here inline (sorry if this is breach of posting etiquette):
When does the error occur? When I try to save the layer.
Is your layer single- or multipart? It is of type "geometrytype=LineString" which I assume is single-part.
Did you try to convert [the layer type]? No. It seemed like it would be a lot of time trying to figure out things. I look in the manual and it talks about "Polyline" features, and I remember that this is an option when I create a layer. But I can't figure out from the manual whether a "multipart line" layer is the same as a "polyline" layer, and I thought it would just be easier to keep it as a line layer if possible.
Did you try to copy the features and paste it as a new layer? Yes. When I had a layer for which the error message said two features could not be saved, I then created a new "line" layer and copied each feature over, one by one, saving after every paste, to identify which features were of the wrong type. I have not figured out how to tell the type of a feature, so I could by inspection tell which was the wrong type for the layer that it is in.
Line #1 comes in from the left and terminates at "A", line #2 spans "A" to "B", and line #3 extends from "B" beyond the bottom of the image. I "Merge Features" on these selected items.


texts: Convert vector point data (shp) to raster (tif) using QGIS

texts:
Overall Question: How can I get the rendered tif image to keep the modifications seen in the image produced by map canvas?

I am writing a standalone Python script. I have simplified my code below
for debugging purposes. Its purpose is to load a shapefile vector layer, in my case SOUNDG.shp, of the geometry type 'point', and then serve a tif image of the vector layer SOUNDG.
I have experimented with QgsMapCanvas thoroughly and can confirm that this specific vector layer is correctly displayed in the canvas; thus, paths to my file and the creation of a vector layer object are correct. Now, I am abandoning canvas entirely and am transitioning to solely relying on serving up a tif image through my script. I am keeping my modifications of the vector layer in my script as well (the depth values).
Canvas Image of SOUNDG point data
As you can see I have modified the vector layer corresponding to depth values.

Tif image
In contrast to canvas, when rendering to tif in my script, as seen below, my SOUNDG.tif image is a blank white image. There is nothing displayed. In addition, I receive no error messages.

I have tried rendering multiple layers of other geometries (lines and polygons) to tif and they are rendered with no issues at all. All layers are visible. My only issue lies with vector layers that have point geometries - they aren't visible when rendered to tif.
How can I fix this? (Using only script)
Here is my code based off of PyQgis' Cookbook:
# supply path to qgis install location
QgsApplication.setPrefixPath('/usr', True)
# create a reference to the QgsApplication, setting the
# second argument to False disables the GUI
app = QgsApplication([], True)
# load providers
app.initQgis()

# create image
img = QImage(QSize(800, 600), QImage.Format_ARGB32_Premultiplied)

# set image's background color
color = QColor(255, 255, 255)
img.fill(color.rgb())

# create painter
p = QPainter()
p.begin(img)
p.setRenderHint(QPainter.Antialiasing)
renderer = QgsMapRenderer()

# keep track of all layer IDs
mapLayers = []

# create vector layer object
layer = QgsVectorLayer('/ENC_ROOT/US6SP10M/shapefiles/SOUNDG.shp',\
                       'SOUNDG', 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(layer)
mapLayers.append(layer.id())
renderer.setLayerSet(mapLayers)

# set extent
rect = QgsRectangle(renderer.fullExtent())
rect.scale(1.1)
renderer.setExtent(rect)

# set output size
renderer.setOutputSize(img.size(), img.logicalDpiX())

# do the rendering
renderer.render(p)

p.end()

# save image'
img.save("/ENC_ROOT/US6SP10M/shapefiles/SOUNDG.tif", "tif")

app.exitQgis()

I noticed this occurs when also rendering to 'png', or rather, any method of rasterization.
UPDATE: I've begun to experiment with the gdal_rasterize route:
def rasterize(layer, source_dir, output_dir):
# this renders the point to tif correctly but no modifications are considered
call(['gdal_rasterize', '-a', 'DEPTH', '-ts', '800', '600', '-l', layer, source_dir, output_dir])

This method now gives me a .tif image that displays points in a black and white format. When I create modifications to the point layer, such as replacing the dots with ints representing water depths, is there a way such that those modifications would still hold in the rasterized .tif version?
Tif image using gdal_rasterize

I've spent numerous edits trying to make this a smooth read and very understandable. If you aren't up voting it then that is telling me that something isn't clear for you. Please make that clear so that I can edit the post as needed; this will hopefully bring me to someone who does have an answer.


texts: QGIS to Illustrator: file cannot be opened because there is not enough RAM

texts:
I am having trouble getting my files to transfer or export to a vector file. When I open the file in Adobe illustrator there is a lot of information missing. I have tried to "save selection as a vector..." I have all my layer selected. I tried selecting individual layers, all the layers at once, I selected the layers individually.

Next I tried to play with the CRS pull down menu. I used all the options and still get no results. I finally got what may be a file but when i open it in illustrator I get an error message that says "file cannot be opened because there is not enough RAM, I have 12 gigs of RAM, should not be a problem.

Am I missing something? A plug-in?


texts: Making copy of attribute within attribute table in ArcGIS for Desktop?

texts: Using ArcGIS 10.2.2 for Desktop, I simply want to create a copy of one of the columns in my attribute table. I created a new column by choosing 'add field' in the attribute table, however I can't copy and paste the entire column of data from one of my attributes into this new field. How can I do this?


texts: Group neighbouring features based on sum of attribute

texts:
Each polygon (building) contains "x" number of flats (eg "flat_num"=10 in one polygon/building).
I would like to group multiple polygons if:

the grouped polygons are neighbors

AND

sum of "flat_num"= 25 in the group of polygons.

If the conditions are filled, then the polygons of the same group should share the same "group_id".
If the conditions are not filled, then the "group_id" is NULL.

I tried to use the "Aggregate" function, with the expression: *sum("flat_num"=25")* but QGIS groups ALL the polygons together. I think I need to find the correct expression.
For the neighboring polygons condition, I use: https://spatialthoughts.com/2019/05/23/neighbor-polygons-aggregate-qgis/


texts:
I have a lot of points in the same layer. Many of these are coinciding.  I only want the points that coincide slected or the points that don't coincide (then I can just reverse the selection). This is because I want to identify clusters that are more than 1 at the same place. Working with ArcMap (Standard license).

And is there a way of specifying selection of ex 10> coinciding points? Like I want to only select points that are coinciding and are 10 or more?


texts: ArcGIS pro Runtime Error: Cannot open shape file through Python Add-In

texts:
I am facing runtime error while running this Python script as an extension to ArcGIS Pro version 2.522081

I also checked for minor errors and typos in the script, have gone through the documentation of ESRI, and tried debugging the script but still facing the same error. The main problem is this loop maybe because of cursor but I am not sure.

def get_unique_point(line_layer,start_of_drainages):
global start_of_drainages_fullpath
arcpy.CreateFeatureclass_management(workspace ,start_of_drainages,"Multipoint","","DISABLED","DISABLED",line_layer)
geometries = arcpy.CopyFeatures_management(line_layer,arcpy.Geometry())
#arcpy.AddMessage("-"*22)
startlist =[]
lastlist =[]
for geometry in geometries:
    startlist.append([round(geometry.firstPoint.X, 2),round(geometry.firstPoint.Y, 2)])
    lastlist.append([round(geometry.lastPoint.X, 2),round(geometry.lastPoint.Y, 2)])

unique_list=[]
for x in startlist:
    if x not in lastlist:
        unique_list.append(x)

for zz in unique_list:
    array = arcpy.Array(arcpy.Point(zz[0], zz[1]))
    Multipoint = arcpy.Multipoint(array)
    cursor = arcpy.da.InsertCursor(start_of_drainages_fullpath,["SHAPE@"])
    cursor.insertRow([Multipoint])
    del cursor

I am using the DEM raster file source from USGS and a drainage network feature as my input. I have attached my package. You can access the input data files from here.

How can I solve this issue?


texts: postgis: problems creating flow direction polyline; not all needed connections are drawn

texts:
I am using post-gis to create a polyline that describes the flow direction of water in a landscape/catchment, to use in a hydrological model.
To do that I start with a regular grid (as polygon) and connect the centre of each cell to the centre each of the 8 cells around it, using ST_Intersect. (afterwards I delete the irrelevant lines, based on the elevation of the grid).
When I do this, most connections are made as I want, except that only half of the diagonal connections are made:

In the figure the green squares is my grid, and the white lines are the output polyline

here is a code sample I use:

INSERT INTO test_olaf.olafmain(id,id_in,id_out,ngf_in,ngf_out,the_geom,geom_in,geom_out SELECT DISTINCT ON (ST_Intersection(parcel_a.the_geom,parcel_b.the_geom) CAST(CAST(parcel_a.id as TEXT)||CAST(parcel_b.id as TEXT) as INTEGER),
nextval('olaf_s2s_id'),
parcel_a.id,
parcel_b.id,
parcel_a.elevation,
parcel_b.elevation,
ST_MakeLine(ST_centroid(parcel_a.the_geom),ST_centroid(parcel_b.the_geom)),
parcel_a.the_geom,
parcel_b.the_geom

FROM test_olaf.grid as parcel_a, test_olaf.grid as parcel_b -- test_olaf.grid is my grid (based on a DEM, converted into a polygon)
WHERE ST_Intersects(parcel_a.the_geom,parcel_b.the_geom)

)
;

Does anyone know how I can connect my cell-centre to all the cells around it, or why the ST_intersect function does not work for all the cells?

thanks!
Annette


texts: QGIS Plugin: Creating a Plugin based on two scripts: where one script is dependent on another

texts: I have recently exported a model to a python script that is actually dependant on another Python Script I have converted from a previous model. Because the First Script/model F1 gets repeated three times (for all three vector types) and writing it three times is a hassle so I had to separate my completed model into two. But because of that I have a bit of trouble to convert these two scripts combined into 1 plug-in. Every tutorial I found spoke so far that of only one model to one script to one plug-in. But never have I found something like of where I convert two scripts, where the second script is dependant on the first script.


texts: How to get QGIS to make 3D mesh (triangles or quads) from points with 3D coordinates?


texts: How do I overrideMimeType in OpenaLyers.Request.Get

texts:
I can't find any info on this. When performing a GET request with the following format, I can't figure out how to add the request for "overrideMimeType("application/xml")":

request = OpenLayers.Request.GET({
url: "http://aaaaaaaa.com",
async: true,
callback: request_handler,
});

An OpenLayers request like this creates the request object and sends it all in this single code. I know if I weren't using the OpenLayers API, I would do something like:

request.overrideMimeType("application/xml");

But I can't get this to work using using my format.

Any ideas?


texts: search for road data using coordinates.?

texts:
I have the path data labeled tabel_roads, I want to find the nearest road using coordinates. this is the script I have, but it does not work.

                            select id from tabel_roads ORDER BY geom <-> st_makepoint(-6.1688009873927925,106.8256151676178) LIMIT 1


texts: Calculating percentage of property perimeter affected by flooding (excluding internal walls) using ArcGIS Desktop

texts:
I am trying to determine the percentage of a polygon perimeter that is intersected by another.

In short, I am carrying out some flooding analysis in ArcGIS 10 and am trying to determine properties that

are directly affected by the flood mapping and
the percentage of a property's perimeter that is affected excluding any internal walls.

I'm using Ordnance survey master map data for building polygons.

How can I achieve this?


texts: Inline variable substitution to end at a certain character

texts:
I am working in ArcGIS ModelBuilder.
For one of my models I would like to use an iterator (Iterate Feature Classes) but am having difficulties with the Wildcard.
Here is an example of some of the data files:
LC_1990_final,
LC_1990_final_NoWater,
LC_2000_final,
LC_2000_final_NoWater,
**Other additional years with the same naming convention

I have a series of models that incorporate this naming convention so I would rater not change all my models.
I am looking to only iterate over the LC_1990_final and LC_200_final and not the LC_1990_final_NoWater and LC_2000_NoWater.
I know I could do *_NoWater if I was looking to further process the NoWater files. However, I am looking to process just the other set of files.
Is there another symbol similar to * that would do a hard stop and allow the iterator only to select LC_1990_final and LC_2000_final?


texts: Loading vector only for specific zoom using OpenLayers?

texts:
I have a map with 4-5 vectors. At the beginning, the loading of the web application is very very slow, but was fine before I've added a new one vector, which is used only for little zooms.

Is it possible to launch the loading of a vector only when the specific zoom is reached?

I'm currently using OpenLayers 2.2, and as a beginner in OpenLayers, the only way I found to load a vector was like this:

var olmap = new ol.Map({
    layers: [
        new ol.layer.Tile({
            source: new ol.source.OSM({
                url: 'php/map/getOsm.php?z={z}&x={x}&y={y}'
            })
        }), vector, vector_country, vector_countryName, vector_term, vector_port, vector_ramp
    ],
    renderer: ol.RendererHint.CANVAS,
    overlays: [overlay],
    controls: ol.control.defaults().extend([
        new ol.control.FullScreen(), new app.CustomExport()
    ]),
    view: mapView
});

That was quite easy :

olmap.addLayer(nameofthelayer);


texts: Loop inside polygon shapefile to clip another shapefile using PyQGIS

texts:
I'm a beginner in PyQGIS and need help to figure out how to automate a process in QGIS.
I want to write a script that enables me to loop inside a polygon shapefile (shown in brown) and use extent of each polygon to clip another shapefile (shown in yellowish).
Below is what I figured out so far:
    loc_brown= 'D:/Python_Calcs/SHP_PR/brown.shp'
    loc_yellow = 'D:/Python_Calcs/SHP_PR/yellow.shp'

    layer_brown = QgsVectorLayer(loc_brown,'','ogr')
    layer_yellow = QgsVectorLayer(loc_yellow,'','ogr')

            for feat in layer_brown.getFeatures():
                    attrs = feat.attributes()
                    print(attrs[0])
                    clip = processing.run("native:clip",'INPUT':layer_yellow,'OVERLAY':????,'OUTPUT':"D:/Python_Calcs/tmp/"+"clip_"+str(attrs[0])+".shp"})


texts: Buffering river but it came out as circle

texts:
I'm buffering a river using QGIS 3. I am using 30 meters for my buffer. My problem is the buffers came out as a circle, not following the lines.

This is what happens during my buffer


texts: How to make a good table or view for QGIS in PostGIS?

texts:
I have a PostGIS db from OpenStreetMap (osm2pgsql) with my custom table. There are two problems with it:

When I list tables, the columns from my table are scanned for geometry type, and it takes several minutes. OSM tables are read instantly. I don't see anything special in those tables with pg_dump. How do I set the metadata to avoid this scanning?
(solved) QGIS tries to load all the points from that table, and there are 15M of them. Filter settings are available only after the layer is created. How can I filter points before reading them?~~

edit question 2 is solved: after tables are scanned, Set Filter button works fine.


texts: How to set hidden attribute in QGIS Lyon?

texts:
I want to set my attribute as hidden in QGIS.

I have tried Layer Properties -> Fields -> text edit -> Select Hidden. It is just information.

  In hidden attribute will be invisible - the user is not able to see
  it's contents

How to set hidden attribute?


texts: How to determine the date of the Bing imagery for an area?

texts:
Is it possible to determine how current the Bing imagery for a certain area is? I've checked the community blog and searched through the monthly updates, but I could not find my study area.

I found posts where they mentioned updating the imagery for the whole country, but with no specifics (is it really the entire country? Or just most of it?). In the credits in Layout View in ArcMap 10.1, I noticed that while Microsoft Corporation is 2012, the other credits are 2010. Does this indicate that the imagery is from that year?


texts:
I am trying to use arcpy to buffer a file geodatabase feature class and want to set the buffer_distance to the maximum value of a field in a separate dBase table.

My code is:

in_features = "projectArea"
out_feature_class = "bufferedProjectArea"
buffer_distance = (SELECT MAX("Distance") FROM "distanceTable")
line_side = "FULL"
line_end_type = "ROUND"
dissolve_option = "ALL"

arcpy.Buffer_analysis(in_features, out_feature_class, buffer_distance, line_side, line_end_type, dissolve_option)

My distanceTable is a dbase table (.dbf) looks like this:

OBJECTID    Type     Distance
1          Raccoons  2100
2          Squirrels 0
12         Cities    4200

I am trying to buffer by the maximum value in the distance field of my distanceTable. In this case it is cities, but I want to make the code robust so that when I change the values, the buffer distance is still pointing to the max value. I am receiving generic "syntax error" and am looking for assistance for the proper SQL code to replace for:

buffer_distance = (SELECT MAX("Distance") FROM "distanceTable")


texts: How to detect gaps in a MultiPolygon table with PostGIS?

texts: I have a mapping of land use. In it, I need to run a topology query to detect gaps between the polygons. Is there a PostGIS function to do this?


texts: How to sum all 'Luas_sawah' attributes in accordance with the 'Kabupaten' attributes?


texts:
I have a map with a set of roads obtained from Open Street Maps which I have filtered.  It leaves some portions of roads not connected to to the main network of roads, which can cause problems when using some tools like Shortest Path.
My question is if there is a way to separate a set of roads into networks that are interconnected and know how many separated networks are in a map. For example if there are roads that connect points A, B, C, and D in any way, but none of these point are connected to E and F, but E and F are connected, then there are two separate road networks, one that includes A,B,C and D, and one network with E and F.
EDIT: Found a plugin called Disconnected Islands that was able to separate the different disconnected networks in a graph.


texts:
Can a Google calendar go on a Google map?

Is there a GeoRSS that can be consumed?


texts: Struggling to find a shiny workaround to flush data from $finished while using EditMod in the mapEdit package

texts:
This is a crosspost from the mapedit issues github page here. I am attempting to build a shiny app that allows a user to plot a subset of data after selecting polygons using the mapedit package. While I am able to successfully plot the data using mapedit, I am unable to flush the $finished data after the selected mapedit polygons are deleted.

This produces two errors that I have yet to determine a workaround for, 1) if the plot collapses as seen in the gif below an error the argument is of length zero, and 2) if the plot does not collapse, the last selected $finished data remains with no ability to clear the data from the plot.

Is there anything that can be done to solve these issues?

Below is a reproducible example from r-spatial blog mapedit - updates in 0.2.0. In my shiny app I am using the mapedit package to subset a different time series using object ids and plot a timeseries in plotly. I believe the underlying issue can be solved using the reproducible example below.

library(sf)
# make the coordinates a numeric matrix
qk_mx <- data.matrix(quakes[,2:1])
# convert the coordinates to a multipoint feature
qk_mp <- st_multipoint(qk_mx)
# convert the multipoint feature to sf
qk_sf <- st_sf(st_cast(st_sfc(qk_mp), "POINT"), quakes, crs=4326)

# run select demo for the quake data
#  we will need the qk_sf
#  to test
# plot(qk_sf)

library(mapedit)
library(mapview)
library(shiny)

ui <- fluidPage(
  fluidRow(
    # edit module ui
    column(6, editModUI("editor")),
    column(
      6,
      h3("Boxplot of Depth"),
      plotOutput("selectstat")
    )
  )
)
server <- function(input, output, session) {
  # edit module returns sf
  edits <- callModule(editMod, "editor", mapview(qk_sf)@map)

  output$selectstat <- renderPlot({
    req(edits()$finished)
    qk_intersect <- st_intersection(edits()$finished, qk_sf)
    req(nrow(qk_intersect) > 0)
    boxplot(
      list(
        all = as.numeric(qk_sf$depth),
        selected = as.numeric(qk_intersect$depth)
      ),
      xlab = "depth"
    )
  })
}
shinyApp(ui, server)

Although I have posted this, along with others in the mapedit github issues page and r-spatial, I figured it would be worthwhile to see if there is a solution that doesn't require a package fix.


texts: How can I determine the location of a visitor to my website?

texts: If I want to provide a website with location appropriate content, what ways can I use to find the visitor's rough location using their IP or header information?


texts: Using Calculator in QGIS Graphical Modeler

texts:
Since QGIS graphical modeler calculator did not lead to an answer, I'll try my luck here again. I created a simple model in QGIS 2.18.16 that shall calculate a distance based on the extent of a raster and a given number of divisions, set by the user as a parameter. Basically it shall resemble the Fishnet-tool from ArcGIS. The model looks like this:

The description in the calculator tells me the following:

According to this, I set up my formula like:

(e - d) / b    # this should give me the segment length
(g - f) / a    # this should give me the segment height

The Log from the model run then gives me the following error message:

Parameters:
    FORMULA =(g-f)/a,
    NUMBER0 =2,
    NUMBER1 =3125884.941,
    NUMBER2 =3135324.941,
    NUMBER3 =None, NUMBER4 =None, NUMBER5 =None, NUMBER6 =None, NUMBER7 =None, NUMBER8 =None, NUMBER9 =None
Failed
Error executing algorithm Calculator Wrong formula: (None-None)/2

Unfortunately, the Documentation is empty. Can anyone tell me how to set up the variables correctly?


texts: iterate through all features and CalculateField with function

texts:
So I have a gdb, and the feature class I'm working on has a field that is formatted in html for ArcGISOnline. This is great if I'm only viewing the data online. What I'm trying to do is copy that attribute data to a new field and then convert the data from html. There is a great tool that does this well, html2text.

My question is: How do I go about getting the tool to play nice with arcpy?

Here's where I am right now and it's not converting the value for me

import html2text, arcpy
from arcpy import env
arcpy.env.workspace = "C:/Workspace/Data_National/RGOV/temp/20170330_RGOV.gdb/"
Rgdb = "C:/Workspace/Data_National/RGOV/temp/20170330_RGOV.gdb"
FFA = Rgdb + "/RSites/Facapp"

arcpy.AddField_management(FFA, "FFA", "TEXT", "", "", "8000")
with arcpy.da.SearchCursor(FFA, "FACILITYDESCRIPTION") as cursor:
    for htmlformat, in cursor:
        Expression = html2text.html2text(htmlformat)
        arcpy.CalculateField_management(FFA, "FFA", html2text.html2text('!FACILITYDESCRIPTION!'), "PYTHON_9.3", Expression)

Any pointers on where I'm going wrong?
I also tried throwing a

arcpy.CalculateField_management(FFA, "FFA", html2text.html2text('!FACILITYDESCRIPTION!'), "PYTHON_9.3")

but it didn't work...

When I used the CalculateField tool, the script runs through with no errors, but keeps the html formatting.

When I try it with the SearchCursor section of the script I get an error of "data = data.replace("/' + 'script)", "(/ignore)")


texts:
I am currently developing an application that requires to display raster images over a period of time (I'm looking how Hurrican Sandy progressed). While investigating, people have suggested that I could use a WCS service and view it on a viewer. We are currently using Google Maps API.

My question is, how can I publish these rasters in a WCS service (or relevant format) that can allow a viewer to loop through all images. Is there a standard practice everyone follows to accomplish this?

I have knowledge using ArcGIS 9.3 Desktop/Server, ArcGIS Flex Viewer, and QGIS.

I appreciate any information regarding this topic or tutorials (haven't found any good ones yet). The images are geotiffs.


texts: Using ArcPy to set Processing Extent to “Default”

texts:
I have an ArcPy routine that will often fail if the processing extents are not set to "Default" but I can't find any documentation on how that is done. I've tried the obvious arcpy.env.extent = "DEFAULT" but it doesn't seem to change anything. Also tried arcpy.env.extent="MAXOF".
While on the topic of processing extents, will setting the processing extent on the menu of an arcpy routine also set the extents accessed under Geoprocessing>Environment>etc?


texts: Is the QGIS "Random selection within subset" selecting spatially random or randomly from the attribute table?

texts:
I am trying to figure out exactly what is being randomly selected. I have a layer of road segments and I would like it to select a road segment at random within a neighborhood (the subset). This would be equivalent to selecting a random row in the attribute table within each neighborhood.

This seems to work but I feel (I know it is hard to actually judge if something is random) like it is selecting more segments in less dense areas. This got me wondering if it is actually doing something closer to generating random points within each neighborhood and selecting the nearest segment to each.

So is it randomly selecting a row in the attribute table, randomly selecting points in space, or something else?


texts: How to use pgRouting together with Django?

texts:
I am using pgRouting together with QGIS. Now I want to convert everything into a web-solution. I decided to use Django for that. Creating the data-model and receiving geographical data from the database and showing the data in a leaflet map works perfect, but I can't get any information from the database, when I use my SQL-Query:

SELECT * FROM pgr_drivingdistance('SELECT id, source, target, traveltime_min as cost
FROM routing_dataset'::text, 1, 100000::double precision, false, false) di (seq, id1, id2, cost)
JOIN routing_dataset rd ON di.id2 = rd.id;

This Query works perfect using pgAdmin or QGIS. Using this in django with a "raw SQL Query" https://docs.djangoproject.com/en/1.10/topics/db/sql/ does not work. I do not get an error, just nothing.

Is it possible, that "pgr_drivingdistance" is not usable within the django environment?


texts: Converting GeoPDFs to GeoTiffs using GDAL on a MAC

texts:
I was able to successfully install GDAL onto my Mac and it responds correctly to the test command. However, when I type in a command to translate a geopdf to a geotiff it spits out a failure. I have looked high and low for the answer (I am slightly tech savvy but not overly exceptional) without either being able to find it or even understand some of the solutions. Below I am posting some of the commands I use along with the failure read out, hopefully someone can explain to me what I am doing wrong and what I can do to fix it.

Test Command I use: gdalinfo --version

Response: GDAL 2.1.2, released 2016/10/24

Translation Command I use:  ogr2ogr -f "pdf" MD_Accident_20161108_TM_geo.pdf MD_Accident_20161108_TM_geo.tiff

Response: FAILURE:
Unable to open datasource `MD_Accident_20161108_TM_geo.tiff' with the following drivers.
  -> PCIDSK
  -> netCDF
  -> JP2OpenJPEG
  -> JPEG2000
  -> ESRI Shapefile
  -> MapInfo File
  -> UK .NTF
  -> OGR_SDTS
  -> S57
  -> DGN
  -> OGR_VRT
  -> REC
  -> Memory
  -> BNA
  -> CSV
  -> NAS
  -> GML
  -> GPX
  -> LIBKML
  -> KML
  -> GeoJSON
  -> Interlis 1
  -> Interlis 2
  -> OGR_GMT
  -> GPKG
  -> SQLite
  -> OGR_DODS
  -> ODBC
  -> WAsP
  -> MSSQLSpatial
  -> OGR_OGDI
  -> PostgreSQL
  -> OpenFileGDB
  -> XPlane
  -> DXF
  -> Geoconcept
  -> GeoRSS
  -> GPSTrackMaker
  -> VFK
  -> PGDUMP
  -> OSM
  -> GPSBabel
  -> SUA
  -> OpenAir
  -> OGR_PDS
  -> WFS
  -> SOSI
  -> HTF
  -> AeronavFAA
  -> EDIGEO
  -> GFT
  -> SVG
  -> CouchDB
  -> Cloudant
  -> Idrisi
  -> ARCGEN
  -> SEGUKOOA
  -> SEGY
  -> XLS
  -> ODS
  -> XLSX
  -> ElasticSearch
  -> Carto
  -> AmigoCloud
  -> SXF
  -> Selafin
  -> JML
  -> PLSCENES
  -> CSW
  -> VDV
  -> TIGER
  -> AVCBin
  -> AVCE00
  -> HTTP


texts: Spatial Index for lat/lng on JSONB column

texts:
I have a table with thousands of records with a JSONB column that has a location (geometry) as a point. I am able to select points within a bounding box using this query.

 SELECT
    url,
    ST_AsText(ST_GeomFromGeoJSON(keywords ->> 'lat_lng'::text))
FROM
    photos
WHERE
    ST_GeomFromGeoJSON(keywords ->> 'lat_lng'::text) && ST_MakeEnvelope(-74.494259, 39.486874, -74.774259 , 39.786874, 4326);

Example of keywords column on my table:

{"lat_lng": {"type": "Point", "coordinates": ["-74.218001", "40.107786"]}, "name": "test_name"}

I know that I can add a spatial index to speed up my queries like so, but the problem is that i dont have a lat_lng column, I have a JSONB column with geometry points. (this is just an example on how to add spatial index)

CREATE INDEX places_lat_lng_idx ON places USING gist(lat_lng);

So I did added this as an index instead:

CREATE INDEX photos_lat_lng_idx ON photos USING GIST(ST_GeomFromGeoJSON(keywords ->> 'lat_lng'::text));

I was able to create that without error and run explain on my query which doesn't do a sequential scan anymore and noticably faster.
On 10k rows I am getting this without the index on the JSONB column :

And with the index on the JSONB, I get this:

My question is, Am I right to assume that applying the index on the JSONB column worked?

Table definition:

CREATE TABLE "public"."photos" (
    "id" int4 NOT NULL DEFAULT nextval('photos_id_seq'::regclass),
    "url" varchar,
    "created_at" int4,
    "deleted_at" int4,
    "keywords" jsonb,
    PRIMARY KEY ("id")
);

Postgres version:  11.7

Postgis version: 2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1


texts:
I have a script too that works fine, but the progressor is not counting up at all (staying at "0%") when I run my tool, even though I can confirm it is working - I can see the products of the script being output.

How do I get it to count up to show progress?

fc= str(arcpy.GetParameterAsText(1))

cursor = arcpy.SearchCursor(fc)

count = int(arcpy.GetCount_management(fc).getOutput(0))

# Set the progressor
arcpy.SetProgressor("step", "doing stuff...", 0 , count, 1)

for row in cursor:
    try:
        do stuff with fc
    except:
        print arcpy.GetMessages()


texts: Count values greater than 0 in SpatialPolygonsDataframe R

texts: I have a SpatialPolygonsDataframe with > 100 layers and I would like to get a single layer showing the total count of where the values of all the layers are greater than 0. I have tried converting to a rasterstack but still cannot find a method that will summarise all the layers by count. Any suggestions?


texts: How might one optimise geospatial operations on complex polygons, especially plots in R?

texts:
Question:

I'm attempting to run some simple plots on some shapefiles with a high number of complex polygons. These aren't massive files - for the example below, the shapefile is 70mb (15872 obs), but plots, buffers, etc. are running extremely slowly, e.g. over an hour in some cases for a single relatively simple plot. Can anyone recommend some ways to optimise these operations? I cannot simplify the geometry of the polygons, as I need to ensure accuracy, but this seems to render R unworkable as a platform for reproducible geospatial research.

Sample data:

Download data as ESRI Shapefile from page at: https://gateway.snh.gov.uk/natural-spaces/dataset.jsp?dsid=SSSI

Reproducible example:

(install libraries and data ahead of execution)

require(RCurl) # used for fetching reproducible datasets
require(sf) # new simplefeature data class, supercedes sp in many ways
# using GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3
require(sp) # needed for proj4string, deprecated by sf()
require(rgdal) # version version: 1.3-6
require(rgeos) # used for buffering below
require(devtools)
require(ggplot)

# Download data as ESRI Shapefile from page at: https://gateway.snh.gov.uk/natural-spaces/dataset.jsp?dsid=SSSI

unzip("SSSI_SCOTLAND_ESRI.zip")
sssi_sf <- st_read("SSSI_SCOTLAND.shp")
sssi_sp <- readOGR("./", "SSSI_SCOTLAND")

# First test out plots using spatialfeatures and spdf with core R

system.time(
plot(sssi_sf)
  )

system.time(
plot(sssi_sp)
  )

# Then test out plots using spatialfeatures and spdf with ggplot2

system.time(
  ggplot() +
    geom_sf(data = sssi_sf)
)

system.time(
  ggplot() +
    geom_polygon(data = sssi_sp)
)

A few notes:

I've updated R and packages as of this morning, so am working with the latest versions (of pre-compiled binaries) of relevant libraries.

Also worth noting is that I've seen indications elsewhere that slow plots might be related to XQuartz limitations, but I've tested and confirmed that plots are terribly slow (> 1hr for plot(sssi_sf) below for example) on both MacOS and Windows (running in virtualbox).


texts: No image exported from GEE ImageCollection to Cloud Storage

texts:
I am attempting to export an ImageCollection from Google Earth Engine to Cloud Storage using python API.
I work in Atom text editor using Hydrogen, which relies on Jupyter. My workstation runs Ubuntu 20.04.
The code below does not return any error, but the 212 images in collection are not exported either. Nonetheless, I can copy/remove objects (e.g. a_test_file) manually to/from the bucket using gsutil. This confirms that I have WRITE permission to the bucket (actually I have OWNER permission).
I have tried to go through the native export tool of Earth Engine and those provided by geetools. None of the them led to the expected outcome.
Is there any specific setting/configuration necessary to export from GEE to Cloud Storage which I should take care of beforehand? I have checked the documentation extensively, but I may have missed something, of course. Any suggestion is welcome.
import ee
import geetools

# ee.Authenticate()
ee.Initialize()

aoi_coo = [[44.1475, -0.8456],
           [44.73383, 4.08383],
           [44.62833, 4.56666],
           [43.88367, 5.16483],
           [42.96, 2.53],
           [43.6397, -0.435]]

aoi = ee.Geometry.Polygon(coords=aoi_coo).buffer(100)

collection = ee.ImageCollection("COPERNICUS/S1_GRD")\
            .filterDate('2018-01-01', '2019-01-01')\
            .filterBounds(aoi)

vv_desc = collection.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))\
    .filter(ee.Filter.eq('instrumentMode', 'IW'))\
    .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))

vv_desc.size().getInfo()

# Export parameters
out_bucket = 'my_bucket'
name_pattern = 'system:id'
scale = 10

# Test copy/remove object to/from bucket using gsutil tools
!touch a_test_file
!gsutil cp a_test_file gs://my_bucket
!gsutil ls -l gs://my_bucket/
!gsutil rm gs://my_bucket/a_test_file
### ALL GOOD!

### Native ee approach
imagesList = vv_desc.toList(vv_desc.size())
for i in range(0, imagesList.size().getInfo()):
    image= ee.Image(imagesList.get(i))
    #Process the export for you image into the bucket in GCS
    task = ee.batch.Export.image.toCloudStorage(**{
        'image':image,
        'region':aoi_coo,
        'description':'Sent1 image',
        'fileNamePrefix':image.get(name_pattern).getInfo() + '.tif',
        'scale':scale,
        'bucket':out_bucket,
        'fileFormat':'GeoTIFF'})
    task.start()

!gsutil ls gs://my_bucket/

### geetools approach
tasks = geetools.batch.imagecollection.toCloudStorage(
            collection=vv_desc,
            bucket=out_bucket,
            region=aoi,
            namePattern=name_pattern,
            scale=scale,
            dataType='float',
            verbose=True
            )

!gsutil ls gs://my_bucket/


texts: I was working on a polygon that I split using the Split features tool. I'd like to put it back into one piece, is there a way to do so?


texts: clipped raster but attribute table not updated?

texts:
I have a nightlights raster file of India, and I clipped it using the block shapefile for India. After the clipping, the clipped raster files have the attribute of the original raster file. I want the updated attribute tables for the files but I can't figure out the problem. I am attaching a screenshot of the model.

P.S. When I was joining the clip to the green oval using an arrow, a pop-up box appeared where I clicked 'output extent', so that i can check the 'Use input features for clipping geometry' box.


texts: Should gdal2 installation include CLI commands gdal_calc.py and gdal_merge?

texts:
I have gdal2 (v2.4) installed on my mac using homebrew.  When I try to run either gdal_calc.py or gdal_merge from the command line I get the error

-bash: gdal_merge: command not found

or
-bash: gdal_calc.py: command not found

Going to my the bin where homebrew installed gdal2 I can see that indeed neither gdal_calc.py nor gdal_merge is there.  These seem to be fairly fundamental commands, however, and other common commands such as gdal_translate are present.

Should gdal_merge and gdal_calc.py have been present in that folder?  If not, where should they be or how do I install them?


texts: Get geographic coordinate system for its projected coordinate system in ArcObjects.NET

texts:
I have geometry in PCS, that must be convert to GCS, while PCS is projection of GCS.

How can I get ISpatialReference for PCS's parent using ArcObjects.NET?


texts: Extracting data from HTML field in table using ArcGIS Desktop?

texts:
I'm operating ArcGIS.

I need to make a calculated field.  The value of the field is a sub-string of one of the other fields.  My problem is that the other field (PopUpInfo) is an HTML string:

An example of the field is below:

Attributes

 STATEFP	 04

 COUNTYFP	 013

 TRACTCE	 061045

 AFFGEOID	 1400000US04013061045

 GEOID	 04013061045

 NAME	 610.45

 LSAD	 CT

 ALAND	 41022523

 AWATER	 102732

I tried using left(), mid(), Instr(), and I'm not getting any text out. What I need is the 10 digit code called GEOID;  in this example: 04013061045

The original layer was converted by the ArcToolbox from a KML.  Here's the original KML: https://1drv.ms/u/s!AkwOsxuyxzoVmgvHu2RdkixTu18M

How do I address this?


texts: Making arrow from polygon centroid to point using QGIS

texts:
I would like to present in QGIS a graphical information I have in two vector layers, an arrow. One layer has catchemnt areas as polygons and the other has the outlet points. The catchment areas layer has the ID of the outlet points in its Atribute Tables. The question is how to present an arrow rom the centroid to the point.

The background of the question is the SWMM model. In the picture below the yellow area points to node J3 and I want to draw that line.

In my case I have a subcatchment layer ('CatchmentAreas') with an attribute table like this:

fid Name    RainGage    Outlet
1   Sub_01  Rainfall    43
2   Sub_02  Rainfall    38
3   Sub_03  Rainfall    73

and a outlet layer ('Junctions') like this:

id  DESC    INV_ELEV
43  desc1   3.96
73  desc2   3.77
38  desc3   3.75

Outlet matches id


texts: Is there a way to split a shapefile into 10ha blocks?

texts: I'm relatively new to QGIS and I'm trying to work out how to split a shapefile I have created into 10ha blocks in QGIS. The shapefile is a blob shape and not a rectangle/square so it can't just be a grid. The area is approximately 250ha in total.


texts: GP Service analyser gives error 00068: broken project data source

texts:
I'm trying to publish a GP result to both my live and dev servers.

I ran the tool, clicked on the result and published to the live server without a problem. Then I clicked on the same result and tried to publish to the dev server, but the analyser complains about a broken project data source. The path it gives in the error message (C:\Users\jpm\AppData\Local\ESRI\Desktop10.3\Staging\arcgis on xxxx_live_6080 (admin)\0\v101\xxxx.sde) contains the address of the live server, so it's not surprising that it does not exist, as the Staging folder was cleared out after the tool successfully published.

Are we supposed to run the tool again to publish it to a different server?


texts: Converting 3d images in meters to feet when exported to dxf

texts: In QGIS 2.10, I am using the raster calculator to convert a metric elevated raster to feet and then create 2 foot contours (no problem). But when I dxf it out and put it in CAD, I can get the contours to elevate correctly but the x,y is still in metric.  Any suggestions?


texts: PostGIS: unable to import GeoJSON data (selected attributes) to PostgreSQL database using ogr2ogr

texts:
I downloaded sample OSM data of my area of interest via Overpass-turbo as my_map.geojson. I am trying to import this geojson file to my PostgreSQL 10 (Windows 8 x64 machine) database using ogr2ogr (QGIS OSGeo CMD tool). The following command imports entire my_map.geojson without errors.

ogr2ogr -f PostgreSQL PG:"host=localhost user=my_user dbname=my_db password=my_pw" -lco GEOMETRY_NAME=the_geom -lco FID=gid -nln my_tbl path_to_my_map.geojson

However, when I try to import selected attributes using following command:

ogr2ogr -f PostgreSQL PG:"host=localhost user=my_user dbname=my_db password=my_pw" -select 'name,highway,oneway,surface' -lco GEOMETRY_NAME=the_geom -lco FID=gid -nln my_tbl path_to_my_map.geojson

I get the error:

ERROR 1: Field ''name' not found in source layer.
ERROR 1: Terminating translation prematurely after failed
translation of layer map (use -skipfailures to skip errors)

Any idea why -select flag of ogr2ogr throws error?

Update:

The output of:

ogrinfo -al -so path_to_my_map.geojson

is,

Layer name: my_map
Geometry: Unknown (any)
Feature Count: 28
..
..
id: String (0.0)
@id: String (0.0)
highway: String (0.0)
name: String (0.0)
surface: String (0.0)


texts: Importing linetypes from AutoCAD to ArcMap?

texts:
I am creating a map that has property lines, streams, sanitary sewer, railroads etc.

I would like to apply lineytpes that are similar to those of AutoCAD, if that is possible?


texts:
I have configured MapProxy to reveal a wms service and tms service. Problem is, the tms don't show anything. (WMS works excellent)

Opening the demopage I cannot se any layers (as one can do in for example ORKa.MV)

I have preseeded the cache at C:\Pythonenv\mapproxy\cache\topo_color\sjobo_ruta\0\0\0.png and the file is there and looks good but when trying to access the seeded tile through http://127.0.0.1:8081/tms/1.0.0/topo_color/sjobo_ruta/0/0/0.png gives me a 404 error.

What am I missing?

globals:
  srs:
    axis_order_ne: ['EPSG:3008']
  cache:
    base_dir: C:\\Pythonenv\\mapproxy\\cache
    lock_dir: C:\\Pythonenv\\mapproxy\\cache\\locks
    tile_lock_dir: C:\\Pythonenv\\mapproxy\\cache\\tile_locks
    meta_size: [2, 2]
    meta_buffer: 80

services:
  demo:
  tms:
    use_grid_names: true
    origin: 'nw'
  wms:
    srs: ['EPSG:3008']
    versions: ['1.1.1', '1.3.0']
    image_formats: ['image/png']

sources:
  lm_wms1:
    type: wms
    req:
      url: http://user:password@maps.lantmateriet.se/topowebb/wms/v1?
      layers: topowebbkartan
    coverage:
      bbox: [149981, 6152974, 181706, 6184699]
      srs: 'EPSG:3008'

layers:
  - name: topowebbkartan
    title: Lantmateriet Topowebb - www.lm.se
    sources: [lm_wms1]

caches:
  topo_color:
    grids: [sjobo_ruta]
    sources: [lm_wms1]
    cache:
      type: file
      directory_layout: tms
      use_grid_names: true

grids:
  sjobo_ruta:
    srs: EPSG:3008
    bbox: [149981, 6152974, 181706, 6184699]
    bbox_srs: EPSG:3008
    origin: nw
    tile_size: [1024, 1024]
    res: [
        64.0000000000,
        32.0000000000,
        16.0000000000,
         8.0000000000,
         4.0000000000,
         2.0000000000,
         1.0000000000,
         0.5000000000,
         0.2500000000,
         0.1250000000,
   ]

I use MapProxy 1.12.0 with Python 3 and GDAL on Windows Server 2012


texts: GeoServer caching request not aligned to grid(s)

texts:
For starters, just to point out I have really gone through all posts here on this issue and none of the solutions are working for me.

I have a lot of GeoServer layers which I am serving in EPSG:3765 without a problem to my app. However, when I turn on caching using GeoServer integrated GWC, the trouble begins. I created a new gridset as in the image:

The pixel sizes I calculated by dividing the coordinate difference (e.g. X2-X1 or Y2-Y1, the result is the same) of tile bounds(from the http request params) at respective zoom levels with 256 and calculated the result on pow(-1). Maybe this is where I went wrong but adding normal zoom levels without any change hasn't done it for me either.
All my layer extents are set to SRID extent, my request is set to tile width and height 256. I think I am doing something wrong with defining pixel size /scale but for the life of me, I can't get it right. I also tried changing CRS extent to the one defined on SRS official page, hasn't made any difference. My projection and view are defined like this:

proj4.defs('EPSG:3765', "+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");

var htrs = ol.proj.get('EPSG:3765');

var view = new ol.View({center: [467500, 5101500],
projection: htrs,
minZoom: 7,
maxZoom: 20,
zoom: 12 });

All of my layers, have a 'TILED':true parameter. The error I am getting is

geowebcache-cache-result "MISS"
geowebcache-miss-reason "request does not align to grid(s) 'grid_3765'"

I am a newbie at Geoserver, GWC and JavaScript and have no idea anymore what I could be doing wrong. Any solutions?


texts:
I've downloaded sample proxy.cgi file from here. I've placed it in Apache's cgi-bin directory. However, whenever I try to access it, it throws the error Can't find string terminator '"' anywhere before EOF at C:/dev_/dev_php/sws/xampp/cgi-bin/proxy.cgi line 80.\r. I'm using MS Windows and I've updated the first line of the CGI file to reflect my settings, i.e., to #!"C:\dev_\dev_php\sws\xampp\perl\bin\perl.exe".

All the cgi files in the same directory execute fine. Is it that I'm using an outdated proxy file? I'm using Apache 2.2.21.


texts:
I have got a memory issue due to the use of the zonal statistics command into a loop.

It seems that after using the ZS command QGIS stores some information in the RAM (cache memory?). It is not really an issue if you use it once but when it comes for a loop the memory capacity is quickly saturated and QGIS crashes.

Does anyone know where this information is kept and how I can get rid of it?

I already tried the command gc.enable() without any results.


texts: QGIS plugin 'sextante' not loading after upgrading to Mac OS X 10.8

texts: Any known issue with sexante and Mac OS X 10.8? After updating from 10.7 and even after reinstalling GDAL sexante is still not working...


texts: How to translate coordinates on the earth

texts: I am trying to translate coordinates. I have a set of coordinates for city A which I need to map to city B, given a point P1 in city A maps to P2 in city B. How do I do this? This problem would be similar to a translation transformation but in this case, it's on a sphere and not on a plane.


texts: How to move a feature along a certain angle and distance?

texts:
In my case I would like to copy and move a polygon from one location to the next using 2 parameters; angle and distance.  I know i can do this programmatically, just wondering if there is an out-of-the-box tool for this.

I am using ArcGIS 10.3.1 Standard with Spatial Analyst and 3D Analyst


texts: Store results including style in vector format for QGIS, ArcGIS

texts:
As I am wrapping up my project, I would like to make my results available for download. There are however many flavors to choose from and I was wondering what format is best.

My criteria include:

Compatible with QGIS, ArcGIS and GDAL
No limitations on length of column names
Include a large number of columns (appr. 300)

Nice to have features:
1. Add styling to the file

Exporting to GeoPackage will check most criteria but I am lost on what to do with styling information. The best I can think of is exporting the GeoPackage and include ArcGIS and QGIS project files with relative paths and styling information. Any better ideas?


texts: Safest way to copy an attribute from one las file to another?

texts:
I have two modified las files, which came from the same original las file. One of the files (file A) was produced using normalize_height() and the other (file B) was produced using normalize_intensity(). So the two las files come from the same parent las file, only they have normalized heights and normalized intensities respectively. I would like to copy the normalized intensity values from file B to file A. Is there a way to this with add_attribute()
while ensuring that each point get's the correct normalized intensity value? Should both files first be sorted or something like that?
UPDATE:
It seems that normalize_height() removes a few points from file A, making a match without filtering file B impossible...
add_lasattribute(norm_las, rc_las@data$Intensity, "CorrectedIntensity", "intensity values as a result of range correction")
#> Error in `[[<-.data.frame`(`*tmp*`, name, value = c(13L, 13L, 161L, 150L,  :
  replacement has 28380609 rows, data has 28380265
npoints(norm_las)
#>[1] 28380265
npoints(rc_las)
#>[1] 28380609


texts: Implementing GeoExplorer login functionality in a OpenGeo Suite App

texts:
I’m trying to implement the same type of login functionality that is available in GeoExplorer. I gather from the answer to this question that there are at least a few files needed. On the client side I’ve added the following lines
, which seems to work OK (the login window is displayed when clicking on the login button).

The error I get when clicking on the button to sumbit the user/password is the following (running the app using debug with client side SDK):

"NetworkError: 404 Not Found - http://localhost:9080/login/"

So obviously I’m missing some code/configuration. From the thread I linked to, it says auth.js is needed for the server side, but I’m not sure how to set it up properly. I'm using version 3.1 of the suite.

What am I missing in order for the login to work?


texts: Forgot to enable hierarchical updates on my Nominatim database. How can I fix stale data?

texts: I have been running a Nominatim server for a few months. The server is updated with Osmosis. Over time, I have seen my data slowly get out of date. I believe the reason is that I forgot to enable hierarchical updates, causing certain places to miss out on updates. Is there some way to fix this, say by telling Osmosis to reprocess all updates for the last two months, or do I need to completely reimport the database?


texts: Calculating Similarity between Two Clusters in QGIS?

texts:
I am new to GIS and I have a question to ask about how to calculate the similarity between two rasters in QGIS.

I have generated two interpolations of plant water status in the exact same field for 2 years. Then I used KMeans classification to classify the images (Rasters) into two clusters.

The problem I am currently facing is how to determine the similarity between the two clustering maps from these 2 years (the whole field performed the same or not from year to year?).

I have been looking for the solution, but not yet find one applicable for me. I use QGIS, ArcMap and R.


texts:
I am pretty new to ArcGIS and would like to extract GPS coordinates of nodes as well as the length of all edges connecting those nodes from some ESRI layer files (http://www.nyc.gov/html/dcp/html/bytes/dwnlion.shtml).

Ideally, I would like to store all this in a csv file where each line would be:

GPS coordinates node A, GPS coordinates node B, length of edge connecting A and B.

provided the direction of traffic on the edge connecting A to B allows one to drive from A to B.  If the edge is a two-way street, we would also have a line in the csv file that would read:

GPS coordinates node B, GPS coordinates node A, length of edge connecting A and B.

In the layer files, there is information on street direction, nodes and segments but I have no idea how I could produce the csv file described above.


texts:
I am trying to convert my plain python script to script in ArcToolbox to share, where user can set input data (in this case, feature class). Unfortunately, Converting Python (ArcPy) script into tool or toolbox script? did not provide an answer for me, although I tried to follow it.

This is my working script which is working good when run from python window.

import arcpy
fcLst = [r"D:\GIS_Temp\Folder B\Water.shp"]
for fc in fcLst:
fieldList = [f.name for f in arcpy.ListFields(fc) if f.type == "String"]
if fieldList:
    with arcpy.da.UpdateCursor(fc, fieldList) as cursor:
        for row in cursor:
            for i in range (len(fieldList)):
                row[i] = row[i].replace("!","1")
                cursor.updateRow(row)

I want to make script in ArcToolbox, with this code, where user can select for which feature class he wants to edit data (in this case, "D:\GIS_Temp\Folder B\Water.shp")

In ArcToolbox I created new script, clicked "store relative paths names (instead absolute paths), and browse to my python code, which I tried to edit given the answer on post I linked.

This is the python script for toolbox (which is not working):

import arcpy
fcLst = arcpy.GetParameterAsText(0)
for fc in fcLst:
fieldList = [f.name for f in arcpy.ListFields(fc) if f.type == "String"]
if fieldList:
    with arcpy.da.UpdateCursor(fc, fieldList) as cursor:
        for row in cursor:
            for i in range (len(fieldList)):
                row[i] = row[i].replace("!","1")
                cursor.updateRow(row)

As you can see, I put arcpy.GetParameterAsText(0) into code, so the user can select own data to edit. But I get this error:

  Traceback (most recent call last):   File
  "C:\Users\Name\Desktop\Script.py", line 4, in
      fieldList = [f.name for f in arcpy.ListFields(fc) if f.type == "String"]   File "C:\Program
  Files\ArcGIS\Desktop10.1\arcpy\arcpy__init__.py", line 1075, in
  ListFields
      return gp.listFields(dataset, wild_card, field_type)   File "C:\Program
  Files\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing_base.py", line
  344, in listFields
      self._gp.ListFields(*gp_fixargs(args, True))) IOError: "D" does not exist Failed to execute (Script).

What am I missing? I have decent number of working codes in python, but I want to eventually convert them all to scripts in toolbox and share it with other users. What is the main process for converting the codes, and which parts of codes, given the example?

EDIT:
This is the tab i edited for the script for parameters:


texts: I'm working on a project where I am building a tool to use. I have a large data set in a standalone table that has data for multiple years and multiple species. The first step in my tool is to make a way that the user just inputs what year and species they want and it will create a new table with just that information that I can then join to the spatial layer. I'm having trouble creating this first step. I have been reading around and I feel like it has to do with Python and the WHERE clause, but I'm not quite sure where to start.


texts: Integrating Spring hibernate-spatial and Solr

texts:
For a new project I'm looking for a more "mainstream" like server side web development technology stack. This question could also be asked in Stack Overflow, but as we also use GeoServer and the Java topology suite (JTS) it has a very strong GIS relevance in my opinion.
As I already mentioned we use JTS and GeoServer and therefore want to stay on the Java platform.
We use Hibernate as an O/R Mapping Framework because it also offers robust mapping of spatial data types over Hibernate-Spatial.
As a new feature we want to integrate Solr as search and indexing server. The Integration with the data that is read or written (by Hibernate-Spatial) should be as seamless as possible.
Spring offers the integration we would like to have, so we can trigger indexing after every database action.
Does that all also fit together if we want to use Hibernate-Spatial with Spring?
Are there any version dependencies?
Do you know better alternatives to integrate these technologies?
Do you have experiences and know good tutorials?


texts: With carto editor I could add feature but now in carto builder I don't know how to do it. Where is the button "Add feature"?


texts: How to post an existing shapefile datastore using cURL?

texts:
I read geoserver doc, and already Uploaded a shapefile to geoserver using cURL. But I can't change layer name by REST. So I think that there is another way to post a layer.
If I can post an existing shapefile datastore, this problem will be solved.

and is it possible change layer name(not title) by cURL?

This is my command line:

F:\\new\\curl-7.22.0\\src\\DLL-Release\\curl.exe -v -u admin:geoserver -XPUT -H "Content-type:text/xml" -d "file:///data/shapefiles/states.shp" http://********:8081/geoserver/rest/workspaces/myworkspace/datastores/16-43/external.shp


texts: Performing raster calculation in ArcGIS Desktop?

texts:
I have a raster layer with values between 0 and 10.

My second layer consists of 0's and 1's.

What I need is my first layer, but with 0's or NoData values where my second layer has 1's?


texts:
I'm trying to extract one single contour line at given elevation from a DEM. Taking into account that I want only one contour and not all contours with the given elevation, is there a way to do it in QGIS?
What I really want it is a tool similar to the contour drawing in ArcView. Just one click on DEM or GRID into the main view e the contour is drawn. I'd like to reproduce something like that.


texts: Cannot add attachments through Attributes window of ArcMap?

texts:
I am trying to add *.png files to shapefiles in ArcMap like this:

Enable attachments through ArcToolbox
Open the Editor Toolbar and select "start editing"
In Attributes window, click the paperclip icon next to "Attachments" and add the .png file
You can view the image with HTML popup

I have been adding attachments like that until now. I cannot get the paperclip icon to show up in the Attributes window and I get an error message when enabling the attachments that reads "Attachments already enabled for this database". I have tried disabling attachments and re-enabling them, but I get the same error message and there is still no paperclip icon.

Any idea what is going wrong here?


texts: Create features from a table without spatial location?

texts:
I have a building footprints layer with the name and other data about the building. I have a table which details "work requests" such as maintenance requests from users of these buildings. The work request data details the TYPE of request (electrical, mechanical etc) and the date and building name. I am trying to associate these work requests to matching buildings accordingly so that i may display each request as a dot on top of the building. The purpose is to create a time lapse video of all the different work requests that occur throughout the year. I do not want to manually create each feature (over 1000) and place on top of each building. I want something that can be updated year after year.

I've looked into make a query table..and also relationship classes.


texts: How do I produce a time series of the NDVI with Landsat composites with Google Earth Engine?

texts:
I am trying to obtain a yearly time series of the NDVI values for a series of locations, specifically 82 random squared polygons. As I need the best temporal resolution possible, dating back to the 80s at least, I've chosen to work with Landsat data, specifically Landsat missions 5-8.
I have seen that there are already calculated NDVI Landsat products available and "ready to use" in the GEE catalogue (see https://developers.google.com/earthengine/datasets/catalog/LANDSAT_LT05_C01_T1_8DAY_NDVI) for these specific missions, but I can't figure out how to extract the specific NDVI values for my AOIs. I've loaded the AOIs in GEE and I'm able to visualize the NDVI values, but I need a table with the pixel values (preferably csvCSV) to work with. Does anybody know how can I do this? Also, does anybody knowsknow how to loop the code for the individual AOI?


texts:
I have an old table that contains bounding boxes of lat long coordinates in a "box" type.
How do I convert them to PostGIS geometry ?

I tried using ST_Transform(ST_SetSRID(se.bound_box::box2d::geometry, 4326), 4326) but it says I can't cast box to box2d or to geometry.

Any help much appreciated


texts: When might the objectid field hold a negative value

texts:
I am working on a historical code base and it has a filter query that includes  this condition:
[OBJECTID] >-1

The context surrounding the query doesn't explain why it would want to filter out negative IDs.

What are the circumstances under which an feature this field will hold a negative value?


texts: How can I calculate flow length in QGiS/GRASS?

texts:
I have these rasters:

DEM
Flow Direction
Flow Accumulation

I would like to calculate the flow distance of every pixel to the outlet of a basin.

In Arc-GIS, I can use the flow length. But I don't have access to a license right now. Any other open source way to do it?


texts: OSM import fails due to non-matching PostgreSQL version

texts:
I am trying to follow the installation of Nominatim, based on http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Ubuntu.2FDebian. The command

./utils/setup.php —osm-file <pbf-file> —all —osm2pgsql-cache 18000 2>&1 | tee setup.log

returns an error: 'PostgreSQL version is not correct. Expected 9.3 found 9.4'.

How do I get this line to work with version 9.4 instead of 9.3? I checked my version of PostgreSQL and it is 9.4.3. Looking into setup.php, I find the function returning the error

$sVersionString = $oDB->getOne('select version()';
reg_match('#PostgreSQL ([0-9]+){.]([0-9]+)[ˆ0-9]#', $sVersionString, $aMatches);
if (CONST_Postgresql_Version != $aMatches[1].'.'.$aMatches[2])
{
    echo "ERROR: PostgreSQL version is not correct. Expected ".CONST_Postgresql_Version." found ".$aMatches[1].'.'.$aMatches[2].'\n';
    exit;
}

My operating system is Debian Jessie and I am using UbuntuGIS repositories, just in case this has anything todo with the error.


texts: Merge two WKT Linestrings (almost parallel) into one

texts:
I don't have tools like ArcGIS. I have two LINESTRINGs

LINESTRING(121.5160996 25.0358556,121.5168148 25.0347768,121.5170452 25.0345573)
LINESTRING(121.517053 25.0345682,121.516851 25.0347814,121.5161259 25.0358884)

They are the same MRT route with different directions. Is there any algorithm or module that can merge them to one LINESTRING like the red one in picture?


texts: About distance between two coordinates streets?

texts:
Let's suppose there are two places coordinates (street places).
I know that straight direction between them I can calculate by formula.
Also we know that route between those coordinates can be different, depends roads where human or car can
drive through.
Is distance between two coordinates on the map(street view) always minimal distance comparing others paths? I think now, because straight the path can be uphill and from the mountain.
This is not consider by formula haversine.
I need calculate distance between two coordinates, where courier is now and where he should go.
Could I avoid paid Google Service to calculate distance between two coordinates in my business application? Or it is unreal?
What do famous applictions use for that?
Could I say that distance would be shortest between two coordinates using this formula in short distance (less 1000km)?

This formula uses radians and returns central angle in radians.
Then final formual is:

Is it enough to calculate shortest distance between two coordinates (less 1000 km between)?


texts: Dissolve not based on attribute in GeoPandas?

texts:
I would like to dissolve a shapefile regardless of attribute content using geopandas. The regular dissolve can be accomplished with something like this:

import geopandas
all = geopandas.read_file(r'Inputs\All.shp')
all = all.dissolve(by='topology')
all.to_file(driver = 'ESRI Shapefile', filename = r'Intermediate\All_dissolved.shp')

But the above is using the 'topology' field to aggregate. I have also noticed that the all.dissolve() function exits with an error, indicating that the by parameter is required.

How can I dissolve regardless of the attribute in GeoPandas?


texts: ArcGis' python library (arcpy) are imported so long

texts:
python -c import time; t1 = time.clock(); import arcpy; print('{0} seconds'.format(time.clock() - t1))
3.60283379862 seconds

It takes this long each time i launch my script or test.

Is there any way to make import faster? Probably somehow cache arcpy module in memory between launches?

OS - Windows 7.


texts: Creating bathymetry maps using sonar data in SAGA

texts:
I am a geologist, however somewhat of a newbie to GIS.
As a personal project, I am looking to create some bathymetric maps of some local fishing lakes.
I am looking to do this using free open source programs at zero cost, and have initially downloaded SAGA. I am aware that QGIS may be an alternative if that's better suited.
I have plenty of raw sonar data in lat/long/depth format which effectively gives me xyz.
What I would like to know is a can anyone provide me with a basic outline of how to import and transform this data into a 3d bathymetric map to show a contoured / shaded lake bed surface?


texts: getting started designing satellite projection raster

texts: How do I get started designing a map with a satellite projection like this:http://bl.ocks.org/joyrexus/6619251. So far using d3 I've created a map of North Africa w/ topojson and tiles from Mapbox but I don't know how to design a static satellite projected terrain raster layer of the areas and match it up with the vector layer. Is there


texts: Rasters loaded in Postgres/PostGIS using raster2pgsql contain blank lines

texts:
I recently set up an Ubuntu Server as a Postgres/PostGIS database server. In an effort to serve a collection of aerial photos to my colleagues, I loaded 608 GeoTiffs (non-overlapping 1km tiles each ~60mb) into a Postgres/PostGIS (Postgres version 9.3) using raster2pgsql. Six overview levels were selected using the -l switch to speed up rendering in QGIS. The following was used to load the rasters into the dbase:

raster2pgsql -s 26917 -I -C -M -l 2,4,8,16,32,64 *.tif -F -t 100x100 imagery.aerials | psql -d GISDB postgres

The process ran successfully without any errors. Using DB Manager in QGIS (version 2.8.1), the resulting raster dataset (imagery.aerials) loads. However, when zoomed out to the maximum extent (or anything beyond 1:30,000), white lines appear on the imagery. These are presumably NoData areas, but there are absolutely no gaps in the raster dataset. Furthermore, when zoomed in those lines do not appear. For example, see this image (1:38,000).

Here is the gdalinfo for one of the rasters (if that helps):

Can anyone explain what causes the appearance of these lines, and how to either remove them or prevent them from appearing?

Furthermore, is this a QGIS issue or a Postgres/Postgis issue?